Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wsequence-point-4.C

raw
1 // PR c++/98126
2 // { dg-do compile }
3 // { dg-options "-Wsequence-point" }
4 // Make sure we don't hang when verify_tree processes a large expression.
5
6 struct T { bool operator==(const T &ot) const; };
7
8 #define CMP(M, N, L) t[100 * M + 10 * N + L] == ot.t[100 * M + 10 * N + L] &&
9
10 #define CMP1(M, N) \
11 CMP(M, N, 0) \
12 CMP(M, N, 1) \
13 CMP(M, N, 2) \
14 CMP(M, N, 3) \
15 CMP(M, N, 4) \
16 CMP(M, N, 5) \
17 CMP(M, N, 6) \
18 CMP(M, N, 7) \
19 CMP(M, N, 8) \
20 CMP(M, N, 9)
21
22 #define CMP2(M) \
23 CMP1(M, 0) \
24 CMP1(M, 1) \
25 CMP1(M, 2) \
26 CMP1(M, 3) \
27 CMP1(M, 4) \
28 CMP1(M, 5) \
29 CMP1(M, 6) \
30 CMP1(M, 7) \
31 CMP1(M, 8) \
32 CMP1(M, 9)
33
34 #define GENERATE_CMPS \
35 CMP2(0) \
36 CMP2(1) \
37 CMP2(2) \
38 CMP2(3) \
39 CMP2(4) \
40 CMP2(5) \
41 CMP2(6) \
42 CMP2(7) \
43 CMP2(8) \
44 CMP2(9)
45
46 struct C {
47 bool operator==(const C &ot) const {
48 return
49 GENERATE_CMPS
50 true;
51 }
52 T t[999];
53 };