gcc/testsuite/g++.dg/cpp0x/constexpr-static10.C
raw| 1 | // PR c++/55944 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<class T> |
| 5 | struct Test |
| 6 | { |
| 7 | constexpr Test(T val) : value(val) {} |
| 8 | static void test() |
| 9 | { |
| 10 | static constexpr Test<int> x(42); // ICE |
| 11 | } |
| 12 | T value; |
| 13 | }; |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | static constexpr Test<int> x(42); // OK |
| 18 | Test<double>::test(); |
| 19 | } |