gcc/testsuite/g++.dg/cpp2a/no_unique_address15.C
raw| 1 | // PR c++/112439 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | struct Empty {}; |
| 5 | |
| 6 | class Foo { |
| 7 | public: |
| 8 | constexpr Foo(int x, Empty y, int z) : a(x), b(y) |
| 9 | { |
| 10 | c = z; |
| 11 | } |
| 12 | |
| 13 | private: |
| 14 | int a{}; |
| 15 | [[no_unique_address]] Empty b{}; |
| 16 | [[no_unique_address]] int c{}; |
| 17 | }; |
| 18 | |
| 19 | constexpr Foo r{1, {}, 3}; |