comparison gcc/testsuite/g++.dg/cpp1y/pr79937-4.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 // PR c++/79937
2 // { dg-do run { target c++14 } }
3
4 struct X {
5 unsigned i;
6 unsigned n = i;
7 };
8
9 X
10 bar (X x)
11 {
12 return x;
13 }
14
15 struct Y
16 {
17 static Y bar (Y y) { return y; }
18 unsigned i;
19 unsigned n = bar (Y{2,i}).n;
20 };
21
22 int
23 main ()
24 {
25 X x { 1, bar (X{2}).n };
26 if (x.n != 2)
27 __builtin_abort ();
28
29 Y y { 1 };
30 if (y.n != 1)
31 __builtin_abort ();
32 }