| 1 |
// PR c++/94066 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
|
| 4 |
union U; |
| 5 |
constexpr int foo(U *up); |
| 6 |
|
| 7 |
union U { |
| 8 |
int a = foo(this); int y; |
| 9 |
}; |
| 10 |
|
| 11 |
constexpr int foo(U *up) { |
| 12 |
up->y = 11; // { dg-error "'U::a' to 'U::y'" } |
| 13 |
return {42}; |
| 14 |
} |
| 15 |
|
| 16 |
extern constexpr U u = {}; |