Debian Codegraph @

gcc/testsuite/g++.dg/lookup/operator-4.C

raw
1 // PR c++/51577
2 // { dg-do compile { target c++17 } }
3 // Like operator-3.C but for unary fold expressions.
4
5 template <class... Ts> void f (Ts... xs) {
6 (xs->*...); // { dg-error "no match" }
7 (...->*xs); // { dg-error "no match" }
8 (xs / ...); // { dg-error "no match" }
9 (... / xs); // { dg-error "no match" }
10 (xs * ...); // { dg-error "no match" }
11 (... * xs); // { dg-error "no match" }
12 (xs + ...); // { dg-error "no match" }
13 (... + xs); // { dg-error "no match" }
14 (xs - ...); // { dg-error "no match" }
15 (... - xs); // { dg-error "no match" }
16 (xs % ...); // { dg-error "no match" }
17 (... % xs); // { dg-error "no match" }
18 (xs & ...); // { dg-error "no match" }
19 (... & xs); // { dg-error "no match" }
20 (xs | ...); // { dg-error "no match" }
21 (... | xs); // { dg-error "no match" }
22 (xs ^ ...); // { dg-error "no match" }
23 (... ^ xs); // { dg-error "no match" }
24 (xs << ...); // { dg-error "no match" }
25 (... << xs); // { dg-error "no match" }
26 (xs >> ...); // { dg-error "no match" }
27 (... >> xs); // { dg-error "no match" }
28 (xs && ...); // { dg-error "no match" }
29 (... && xs); // { dg-error "no match" }
30 (xs || ...); // { dg-error "no match" }
31 (... || xs); // { dg-error "no match" }
32 (xs, ...);
33 (..., xs);
34
35 (xs == ...); // { dg-error "no match" }
36 (... == xs); // { dg-error "no match" }
37 (xs != ...); // { dg-error "no match" }
38 (... != xs); // { dg-error "no match" }
39 (xs < ...); // { dg-error "no match" }
40 (... < xs); // { dg-error "no match" }
41 (xs > ...); // { dg-error "no match" }
42 (... > xs); // { dg-error "no match" }
43 (xs <= ...); // { dg-error "no match" }
44 (... <= xs); // { dg-error "no match" }
45 (xs >= ...); // { dg-error "no match" }
46 (... >= xs); // { dg-error "no match" }
47
48 (xs += ...); // { dg-error "no match" }
49 (... += xs); // { dg-error "no match" }
50 (xs -= ...); // { dg-error "no match" }
51 (... -= xs); // { dg-error "no match" }
52 (xs *= ...); // { dg-error "no match" }
53 (... *= xs); // { dg-error "no match" }
54 (xs /= ...); // { dg-error "no match" }
55 (... /= xs); // { dg-error "no match" }
56 (xs %= ...); // { dg-error "no match" }
57 (... %= xs); // { dg-error "no match" }
58 (xs |= ...); // { dg-error "no match" }
59 (... |= xs); // { dg-error "no match" }
60 (xs ^= ...); // { dg-error "no match" }
61 (... ^= xs); // { dg-error "no match" }
62 (xs <<= ...); // { dg-error "no match" }
63 (... <<= xs); // { dg-error "no match" }
64 (xs >>= ...); // { dg-error "no match" }
65 (... >>= xs); // { dg-error "no match" }
66 }
67
68 namespace N { struct A { }; }
69
70 #include "operator-3-ops.h"
71
72 int main() {
73 f(N::A(), N::A());
74 }