| 1 |
// PR c++/51675 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
union foo |
| 5 |
{ |
| 6 |
int x = 0; |
| 7 |
short y; |
| 8 |
|
| 9 |
constexpr foo() = default; |
| 10 |
}; |
| 11 |
|
| 12 |
union bar |
| 13 |
{ |
| 14 |
int x; |
| 15 |
short y; |
| 16 |
|
| 17 |
constexpr bar() = default; // { dg-error "constexpr" "" { target c++17_down } } |
| 18 |
}; |