comparison gcc/testsuite/g++.dg/cpp1y/pr94066-2.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++/94066
2 // { dg-do compile { target c++14 } }
3
4 struct A { long x; };
5
6 union U;
7 constexpr A foo(U *up);
8
9 union U {
10 U() = default;
11 A a = foo(this); int y;
12 };
13
14 constexpr A foo(U *up) {
15 up->y = 11; // { dg-error "'U::a' to 'U::y'" }
16 return {42};
17 }
18
19 extern constexpr U u = {};