Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp1y/pr90996.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // PR c++/90996 | |
2 // { dg-do run { target c++14 } } | |
3 | |
4 struct S | |
5 { | |
6 int &&a = 2; | |
7 int b[1] {a}; | |
8 }; | |
9 | |
10 S c[2][2] {{{5}}}; | |
11 | |
12 struct T | |
13 { | |
14 S c[2][2] {{{7}}}; | |
15 }; | |
16 | |
17 T d {}; | |
18 | |
19 int | |
20 main() | |
21 { | |
22 if (++c[0][0].b[0] != 6 | |
23 || ++c[0][1].b[0] != 3 | |
24 || ++c[1][0].b[0] != 3 | |
25 || ++c[1][1].b[0] != 3) | |
26 __builtin_abort(); | |
27 | |
28 auto& e = d.c; | |
29 if (++e[0][0].b[0] != 8 | |
30 || ++e[0][1].b[0] != 3 | |
31 || ++e[1][0].b[0] != 3 | |
32 || ++e[1][1].b[0] != 3) | |
33 __builtin_abort(); | |
34 } |