c++: P0847R7 (deducing this) - initial functionality. [PR102609]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp23 / explicit-obj-ops-mem-call.C
blobecd6bdfd44c1a388f7e107268ecbb11a03ab1299
1 // P0847R7
2 // { dg-do compile { target c++23 } }
4 // uses of member only operators (call op)
6 // execution paths for subscript with 1 argument and 0 and 2+ arguments are different
7 // just to be safe, also test 0 and 2 argument cases here too
9 struct S {
10   void operator()(this S&) {}
11   void operator()(this S&, int) {}
12   void operator()(this S&, int, int) {}
13   template<typename... Args>
14   void operator()(this S&, Args... args) {}
17 void non_dep()
19   S s{};
20   s();
21   s(0);
22   s(0, 0);
23   s(0, 0, 0);
26 template<typename = void>
27 void dependent()
29   S s{};
30   s();
31   s(0);
32   s(0, 0);
33   s(0, 0, 0);
36 void call()
38   dependent();