annotate gcc/testsuite/g++.dg/cpp1y/pr90996.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 // PR c++/90996
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2 // { dg-do run { target c++14 } }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 struct S
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6 int &&a = 2;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 int b[1] {a};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8 };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 S c[2][2] {{{5}}};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12 struct T
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 S c[2][2] {{{7}}};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17 T d {};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19 int
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 main()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
22 if (++c[0][0].b[0] != 6
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
23 || ++c[0][1].b[0] != 3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
24 || ++c[1][0].b[0] != 3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
25 || ++c[1][1].b[0] != 3)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
26 __builtin_abort();
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
27
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
28 auto& e = d.c;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
29 if (++e[0][0].b[0] != 8
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
30 || ++e[0][1].b[0] != 3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
31 || ++e[1][0].b[0] != 3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
32 || ++e[1][1].b[0] != 3)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
33 __builtin_abort();
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
34 }