Lines Matching full:this

5 void f(this); // expected-error{{variable has incomplete type 'void'}} \
6 // expected-error{{invalid use of 'this' outside of a non-static member function}}
8 void g(this auto); // expected-error{{an explicit object parameter cannot appear in a non-member function}}
10 auto l1 = [] (this auto) static {}; // expected-error{{an explicit object parameter cannot appear in a static lambda}}
11 auto l2 = [] (this auto) mutable {}; // expected-error{{a lambda with an explicit object parameter cannot be mutable}}
12 auto l3 = [](this auto...){}; // expected-error {{the explicit object parameter cannot be a function parameter pack}}
13 auto l4 = [](int, this auto){}; // expected-error {{an explicit object parameter can only appear as the first parameter of the lambda}}
16 static void f(this auto); // expected-error{{an explicit object parameter cannot appear in a static function}}
17 virtual void f(this S); // expected-error{{an explicit object parameter cannot appear in a virtual function}}
20 void *operator new(this unsigned long); // expected-error{{an explicit object parameter cannot appear in a static function}}
21 void operator delete(this void*); // expected-error{{an explicit object parameter cannot appear in a static function}}
23 void g(this auto) const; // expected-error{{explicit object member function cannot have 'const' qualifier}}
24 void h(this auto) &; // expected-error{{explicit object member function cannot have '&' qualifier}}
25 void i(this auto) &&; // expected-error{{explicit object member function cannot have '&&' qualifier}}
26 void j(this auto) volatile; // expected-error{{explicit object member function cannot have 'volatile' qualifier}}
27 void k(this auto) __restrict; // expected-error{{explicit object member function cannot have '__restrict' qualifier}}
28 void l(this auto) _Nonnull; // expected-error{{explicit object member function cannot have '' qualifie}}
31 void variadic(this auto...); // expected-error{{the explicit object parameter cannot be a function parameter pack}}
32 void not_first(int, this auto); // expected-error {{an explicit object parameter can only appear as the first parameter of the function}}
34 S(this auto); // expected-error {{an explicit object parameter cannot appear in a constructor}}
35 ~S(this S) {} // expected-error {{an explicit object parameter cannot appear in a destructor}} \
48 int f(this B&, int); // expected-warning {{hides overloaded virtual function}}
49 int f(this B&); // expected-error {{an explicit object parameter cannot appear in a virtual function}}
50 int g(this B&); // expected-warning {{hides overloaded virtual function}}
51 int h(this B&); // expected-error {{an explicit object parameter cannot appear in a virtual function}}
52 int h(this B&&); // expected-error {{an explicit object parameter cannot appear in a virtual function}}
53 int h(this const B&&); // expected-error {{an explicit object parameter cannot appear in a virtual function}}
54 int h(this A&); // expected-error {{an explicit object parameter cannot appear in a virtual function}}
55 int h(this int); // expected-error {{an explicit object parameter cannot appear in a virtual function}}
60 struct Test { void f(this const auto& = Test{}); };
62 auto L = [](this const auto& = Test{}){};
69 void f(this auto) {
70 this->fun(); // expected-error{{invalid use of 'this' in a function with an explicit object parameter}}
83 void bar(this auto) {
98 [i = 0](this Test) { }();
102 auto ok = [i = 0](this const Derived&) {};
103 auto ko = [i = 0](this const Test&) {};
114 auto alsoOk = [](this const Test &) {};
119 auto nothingIsOkay = [i = 0](this const Frobble &) {}; // expected-note {{candidate function not viable: requires 0 non-object arguments, but 1 was provided}}
128 void a(this Corresponding&); // expected-note 2{{here}}
131 void a(this Corresponding&, int);
132 void a(this Corresponding&, double);
134 void b(this const Corresponding&); // expected-note 2{{here}}
138 void c(this Corresponding&&); // expected-note {{here}}
141 void d(this Corresponding&);
142 void d(this Corresponding&&);
143 void d(this const Corresponding&);
144 void d(this const int&);
145 void d(this const int); // expected-note {{previous declaration is here}}
146 void d(this int); // expected-error {{class member cannot be redeclared}}
148 void e(this const Corresponding&&); // expected-note {{here}}
155 void a(this CorrespondingTpl&); // expected-note 2{{here}}
158 void a(this Corresponding&, int);
159 void a(this Corresponding&, double);
163 void b(this const CorrespondingTpl&); // expected-note 2{{here}}
167 void c(this CorrespondingTpl&&); // expected-note {{here}}
170 void d(this Corresponding&);
171 void d(this Corresponding&&);
172 void d(this const Corresponding&);
173 void d(this const int&);
174 void d(this const int); // expected-note {{previous declaration is here}}
175 void d(this int); // expected-error {{class member cannot be redeclared}}
176 void e(this const CorrespondingTpl&&); // expected-note {{here}}
186 (void)[=](this auto&&) { return i; }();
187 (void)[=](this const auto&) { return i; }();
188 (void)[i](this C) { return i; }(); // expected-error{{invalid explicit object parameter type 'C'}}
189 (void)[=](this C) { return i; }(); // expected-error{{invalid explicit object parameter type 'C'}}
190 (void)[](this C) { return 42; }();
191 auto l = [=](this auto&) {};
198 [i = 0](this auto &&){ i++; }();
199 [i = 0](this auto){ i++; }();
200 [i = 0](this const auto&){ i++; }(); // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
203 const auto l1 = [x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
204 const auto l2 = [=](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
206 const auto l3 = [&x](this auto&) {
207 const auto l3a = [x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
211 const auto l4 = [&x](this auto&) {
212 const auto l4a = [=](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
216 const auto l5 = [x](this auto&) {
217 const auto l5a = [x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
221 const auto l6 = [=](this auto&) {
222 const auto l6a = [=](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
226 const auto l7 = [x](this auto&) {
227 const auto l7a = [=](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
231 const auto l8 = [=](this auto&) {
232 const auto l8a = [x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
236 const auto l9 = [&](this auto&) {
237 const auto l9a = [x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
241 const auto l10 = [&](this auto&) {
242 const auto l10a = [=](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
246 const auto l11 = [x](this auto&) {
247 const auto l11a = [&x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}} expected-note {{while substituting}}
251 const auto l12 = [x](this auto&) {
252 const auto l12a = [&](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}} expected-note {{while substituting}}
256 const auto l13 = [=](this auto&) {
257 const auto l13a = [&x](this auto&) { x = 42; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}} expected-note {{while substituting}}
264 return [*this] (this auto&&) {
266 [*this] () mutable { x = 42; } ();
267 [*this] (this auto&&) { x = 42; } ();
268 [*this] () { x = 42; } (); // expected-error {{read-only variable is not assignable}}
269 const auto l = [*this] (this auto&&) { x = 42; }; // expected-error {{read-only variable is not assignable}}
275 return [&] (this auto&&) {
277 const auto l = [*this] (this auto&&) { x = 42; }; // expected-error {{read-only variable is not assignable}}
307 const auto l1 = [&x](this auto&) { x = 42; };
308 const auto l2 = [&](this auto&) { x = 42; };
314 const auto l15 = [=](this auto&&) [[clang::annotate_type("foo")]] [[clang::annotate_type("bar")]] {
329 a(); // ok, (*this).a()
332 void f(this const Over_Call_Func_Example&); // expected-note {{here}}
334 f(); // ok: (*this).f()
335 f(*this); // expected-error{{too many non-object arguments to function call}}
336 this->f(); // ok
345 void k(this int);
347 void m(this const Over_Call_Func_Example& c) {
353 void f(this int); // expected-note {{candidate function}}
354 void f(this float); // expected-note {{candidate function}}
359 void test(this const AmbiguousConversion &s) {
365 void s(this short);
367 void test(this const IntToShort &val) {
373 void s(this int);
375 void test(this const ShortToInt &val) {
382 void f(this auto &&, auto, auto); // expected-note {{requires 2 non-object arguments, but 0 were provided}}
383 void g(this auto &&, auto, auto); // expected-note {{requires 2 non-object arguments, but 3 were provided}}
384 void h(this auto &&, int, int i = 0); // expected-note {{requires at least 1 non-object argument, but 0 were provided}}
385 void i(this S&&, int); // expected-note 2{{declared here}}
409 void f(this auto &&) {}
410 void g(this s &&) {};
458 operator int(this auto&& self) {
462 Wrap* operator->(this auto&& self) {
466 int operator[](this auto&& self, int) {
470 int operator()(this auto&& self, int) {
474 int operator++(this auto&& self, int) {
478 int operator++(this auto&& self) {
482 int operator--(this auto&& self, int) {
486 int operator--(this auto&& self) {
490 int operator*(this auto&& self) {
494 bool operator==(this auto&& self, int) {
498 bool operator<=>(this auto&& self, int) {
502 bool operator<<(this auto&& self, int b) {
643 struct A { operator int(this auto&&); }; //expected-note {{candidate}}
647 struct B { operator X(this auto&&); };
653 operator T (this int); // expected-note {{candidate function not viable: no known conversion from 'C' to 'int' for object argument}}
666 operator fn_t * (this C const &);
678 S(this auto &self) {} // expected-error {{an explicit object parameter cannot appear in a constructor}}
679 virtual void f(this S self) {} // expected-error {{an explicit object parameter cannot appear in a virtual function}}
680 void g(this auto &self) const {} // expected-error {{explicit object member function cannot have 'const' qualifier}}
681 void h(this S self = S{}) {} // expected-error {{the explicit object parameter cannot have a default argument}}
682 void i(int i, this S self = S{}) {} // expected-error {{an explicit object parameter can only appear as the first parameter of the function}}
683 ~S(this S &&self); // expected-error {{an explicit object parameter cannot appear in a destructor}} \
686 static void j(this S s); // expected-error {{an explicit object parameter cannot appear in a static function}}
689 void nonmember(this S s); // expected-error {{an explicit object parameter cannot appear in a non-member function}}
710 Thing(this Self&& self, Args&& ... args) { } // expected-error {{an explicit object parameter cannot appear in a constructor}}
722 S& operator=(this Base& self, const S&) = default;
729 S2& operator=(this int&& self, const S2&);
730 S2& operator=(this int&& self, S2&&);
734 S2& S2::operator=(this int&& self, const S2&) = default;
737 S2& S2::operator=(this int&& self, S2&&) = default;
741 Move& operator=(this int&, Move&&) = default;
763 auto serialize(this auto&& self, auto&& archive) {
771 auto f(this auto self...) { }
784 return [*this](this auto&&) {
795 const auto g = [x = 10](this auto&& self) { x = 20; }; // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
807 [&cursor_guard](this auto self) {
817 [&list](this auto self) {
827 [&list](this auto self) {
837 [&list](this auto self) {
846 void operator+=(this auto &&, const char (&)[N]);
847 void operator+=(this auto &&, auto &&) = delete;
849 void f1(this A &, auto &);
850 void f1(this A &, auto &&) = delete;
852 void f2(this auto&);
853 void f2(this auto&&) = delete;
856 void f3(this A&, auto&&) = delete;
859 void f4(this A&, auto&);
862 void f5(this A&, auto&&) = delete;
865 void f6(this A&, auto&);
878 void operator-(this A&, auto&&) = delete;
881 void operator*(this A&, auto&);
906 void c(this const C&); // #first
923 (&C::c)(*this); // expected-error {{call to non-static member function without an object argument}}
934 int f(this A);
941 int (S::*x)(this int); // expected-error {{an explicit object parameter can only appear as the first parameter of a member function}}
942 int (*y)(this int); // expected-error {{an explicit object parameter can only appear as the first parameter of a member function}}
943 int (***z)(this int); // expected-error {{an explicit object parameter can only appear as the first parameter of a member function}}
945 int f(this S);
946 int ((g))(this S);
947 friend int h(this S); // expected-error {{an explicit object parameter cannot appear in a non-member function}}
948 int h(int x, int (*)(this S)); // expected-error {{an explicit object parameter can only appear as the first parameter of a member function}}
951 int f(this T);
954 friend int T::f(this T);
955 friend int N::A::f(this N::A);
956 friend int N::f(this N::A); // expected-error {{an explicit object parameter cannot appear in a non-member function}}
957 int friend func(this T); // expected-error {{an explicit object parameter cannot appear in a non-member function}}
960 using T = int (*)(this int); // expected-error {{an explicit object parameter can only appear as the first parameter of a member function}}
961 using U = int (S::*)(this int); // expected-error {{an explicit object parameter can only appear as the first parameter of a member function}}
962 int h(this int); // expected-error {{an explicit object parameter cannot appear in a non-member function}}
964 int S::f(this S) { return 1; }
969 void a::f(this auto) {} // expected-error {{an explicit object parameter cannot appear in a non-member function}}
976 void operator()(this X);
981 [x = X{}](this auto) {}();
985 std::move([x = X{}](this auto) {})();
989 void f(this auto &&self, int &&r_value_ref) {} // expected-note {{candidate function template not viable: expects an rvalue for 2nd argument}}
997 bool operator == (this const int&, const A&);
999 bool A::operator == (this const int&, const A&) = default;
1005 A& operator=(this A, const A&) = default;
1008 A& operator=(this int, const A&) = default;
1016 bool operator==(this A&, const A&) = default;
1018 bool operator==(this const A, const A&) = default;
1020 bool operator==(this A, A) = default;
1024 bool operator==(this B, B) = default;
1038 void operator()(this auto &&, auto &&);
1047 void operator()(this auto &&, const char (&)[N]);
1058 void operator[](this auto &&, auto &&);
1067 void operator[](this auto &&, const char (&)[N]);
1080 constexpr auto operator[](this T &&self, auto... i) // expected-note {{candidate template ignored: substitution failure [with T = Foo &, i:auto = <>]: member '_evaluate' used before its declaration}}
1087 constexpr auto _evaluate(this T &&self, auto... i) -> decltype((i + ...));
1098 void f(this const C1);
1103 void f(this const C2); // expected-note {{previous declaration is here}}
1104 void f(this volatile C2); // expected-error {{class member cannot be redeclared}} \
1109 void f(this volatile C3); // expected-note {{previous declaration is here}} \
1111 void f(this const C3); // expected-error {{class member cannot be redeclared}}
1115 void f(this const C4); // expected-note {{previous declaration is here}}
1116 void f(this const volatile C4); // expected-error {{class member cannot be redeclared}} \
1125 constexpr operator Wrap (this const S& self) {
1128 constexpr int operator <<(this Wrap self, int i) {