annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 // { dg-do compile { target c++14 } }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3 union U;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 constexpr int foo(U *up);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6 union U {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 int a = foo(this); int y;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8 };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 constexpr int foo(U *up) {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 up->a++;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12 return {42};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 extern constexpr U u = {}; // { dg-error "accessing uninitialized member" }