Debian Codegraph @

gcc/testsuite/g++.dg/lookup/operator-3a.C

raw
1 // PR c++/51577
2 // { dg-do compile { target c++14 } }
3 // Like operator-3.C but also containing a partial instantiation step.
4
5 template <class...> auto f () {
6 return [] (auto x) {
7 +x; // { dg-error "no match" }
8 -x; // { dg-error "no match" }
9 *x; // { dg-error "no match" }
10 ~x; // { dg-error "no match" }
11 &x;
12 !x; // { dg-error "no match" }
13 ++x; // { dg-error "no match" }
14 --x; // { dg-error "no match" }
15 x++; // { dg-error "declared for postfix" }
16 x--; // { dg-error "declared for postfix" }
17
18 x->*x; // { dg-error "no match" }
19 x / x; // { dg-error "no match" }
20 x * x; // { dg-error "no match" }
21 x + x; // { dg-error "no match" }
22 x - x; // { dg-error "no match" }
23 x % x; // { dg-error "no match" }
24 x & x; // { dg-error "no match" }
25 x | x; // { dg-error "no match" }
26 x ^ x; // { dg-error "no match" }
27 x << x; // { dg-error "no match" }
28 x >> x; // { dg-error "no match" }
29 x && x; // { dg-error "no match" }
30 x || x; // { dg-error "no match" }
31 x, x;
32
33 x == x; // { dg-error "no match" }
34 x != x; // { dg-error "no match" }
35 x < x; // { dg-error "no match" }
36 x > x; // { dg-error "no match" }
37 x <= x; // { dg-error "no match" }
38 x >= x; // { dg-error "no match" }
39 #if __cplusplus > 201703L
40 x <=> x; // { dg-error "no match" "" { target c++20 } }
41 #endif
42
43 x += x; // { dg-error "no match" }
44 x -= x; // { dg-error "no match" }
45 x *= x; // { dg-error "no match" }
46 x /= x; // { dg-error "no match" }
47 x %= x; // { dg-error "no match" }
48 x |= x; // { dg-error "no match" }
49 x ^= x; // { dg-error "no match" }
50 x <<= x; // { dg-error "no match" }
51 x >>= x; // { dg-error "no match" }
52 };
53 }
54
55 namespace N { struct A { }; }
56
57 #include "operator-3-ops.h"
58
59 int main() {
60 f()(N::A());
61 }