gcc/testsuite/g++.dg/cpp0x/constexpr-base7.C
raw| 1 | // PR c++/91933 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct NoMut1 { int a, b; }; |
| 5 | struct NoMut3 : NoMut1 { |
| 6 | constexpr NoMut3(int a, int b) : NoMut1{a, b} {} |
| 7 | }; |
| 8 | void mutable_subobjects() { |
| 9 | constexpr NoMut3 nm3 = {1, 2}; |
| 10 | struct A { |
| 11 | void f() { |
| 12 | static_assert(nm3.a == 1, ""); |
| 13 | } |
| 14 | }; |
| 15 | } |