gcc/testsuite/g++.dg/cpp2a/no_unique_address14.C
raw| 1 | // PR c++/105622 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct empty { |
| 5 | empty() = default; |
| 6 | constexpr empty(int) { } |
| 7 | }; |
| 8 | |
| 9 | struct container { |
| 10 | empty __begin_ = {}; |
| 11 | [[no_unique_address]] empty __size_ = 0; |
| 12 | }; |
| 13 | |
| 14 | constexpr bool test() { |
| 15 | container s; |
| 16 | return true; |
| 17 | } |
| 18 | static_assert(test()); |
| 19 |