gcc/testsuite/g++.dg/cpp2a/no_unique_address10.C
raw| 1 | // Make sure [[no_unique_address]] doesn't affect is_standard_layout. |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct E1 { }; struct E2 { }; |
| 5 | struct A |
| 6 | { |
| 7 | [[no_unique_address]] E1 e; |
| 8 | }; |
| 9 | |
| 10 | struct B: A |
| 11 | { |
| 12 | [[no_unique_address]] E2 e; |
| 13 | }; |
| 14 | |
| 15 | static_assert(__is_standard_layout (A), ""); |
| 16 | static_assert(!__is_standard_layout (B), ""); |