comparison gcc/testsuite/g++.dg/cpp1y/constexpr-union5.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
18:1830386684a0 19:2b5abeee2509
1 // { dg-do compile { target c++14 } }
2
3 union U;
4 constexpr int foo(U *up);
5
6 union U {
7 int a = foo(this); int y;
8 };
9
10 constexpr int foo(U *up) {
11 up->a++;
12 return {42};
13 }
14
15 extern constexpr U u = {}; // { dg-error "accessing uninitialized member" }