Lines Matching full:explicit

1 // RUN: %check_clang_tidy %s google-explicit-constructor %t
39 explicit A(void *x) {} in A()
40 explicit A(void *x, void *y) {} in A()
41 explicit operator bool() const { return true; } in operator bool()
45 explicit A(const A& a) {} in A()
46 …[@LINE-1]]:12: warning: copy constructor should not be declared explicit [google-explicit-construc…
50 …ngle-argument constructors must be marked explicit to avoid unintentional implicit conversions [go…
51 // CHECK-FIXES: {{^ }}explicit A(int x1);
54 …ble with a single argument must be marked explicit to avoid unintentional implicit conversions [go…
55 // CHECK-FIXES: {{^ }}explicit A(double x2, double y = 3.14) {}
60 // CHECK-FIXES: {{^ }}explicit A(T&&... args);
71 …: warning: 'operator bool' must be marked explicit to avoid unintentional implicit conversions [go…
72 // CHECK-FIXES: {{^ }}explicit operator bool() const { return true; }
75 …warning: 'operator double' must be marked explicit to avoid unintentional implicit conversions [go…
76 // CHECK-FIXES: {{^ }}explicit operator double() const;
78 explicit B(::std::initializer_list<double> list4) {} in B()
79 …2: warning: initializer-list constructor should not be declared explicit [google-explicit-construc…
82 explicit B(const ::std::initializer_list<char> &list5) {} in B()
86 explicit B(::std::initializer_list<char> &&list6) {} in B()
111 explicit C2(initializer_list<double> list4) {} in C2()
128 explicit D(T t) {} in D()
135 // CHECK-FIXES: {{^ }}explicit E(T *pt) {}
139 // CHECK-FIXES: {{^ }}explicit E(U *pu) {}
141 explicit E(T t) {} in E()
143 explicit E(U u) {} in E()
159 // CHECK-FIXES: {{^}} explicit operator bool() const;
162 // CHECK-FIXES: {{^}} explicit operator F<T>() const;
166 // CHECK-FIXES: {{^}} explicit operator F<U>*() const;