gcc/testsuite/g++.dg/cpp0x/constexpr-93169.C
raw| 1 | // PR c++/93169 - Wrong-code with a non-constexpr constructor. |
| 2 | // { dg-do run { target c++11 } } |
| 3 | // { dg-options "-O2" } |
| 4 | |
| 5 | template <typename T> class B { |
| 6 | struct C { |
| 7 | T h; |
| 8 | constexpr C() {} |
| 9 | ~C() {} |
| 10 | } c; |
| 11 | }; |
| 12 | struct S { |
| 13 | int g; |
| 14 | S() { g = 2; } |
| 15 | }; |
| 16 | |
| 17 | int |
| 18 | main() |
| 19 | { |
| 20 | static const B<S> f; |
| 21 | } |