gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C
raw| 1 | // PR c++/47199 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-fno-elide-constructors" } |
| 4 | |
| 5 | template < int > struct S |
| 6 | { |
| 7 | constexpr S (int r):rr (r) |
| 8 | { |
| 9 | } |
| 10 | S (const S &) = default; |
| 11 | static constexpr S s () |
| 12 | { |
| 13 | return -1; |
| 14 | } |
| 15 | int rr; |
| 16 | }; |
| 17 | |
| 18 | static const int d = S < 0 >::s ().rr; |