gcc/testsuite/g++.dg/cpp0x/constexpr-decltype5.C
raw| 1 | // PR c++/99130 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<class T> |
| 5 | struct A { |
| 6 | static constexpr int value = T::nonexistent; |
| 7 | }; |
| 8 | |
| 9 | using type = const int; |
| 10 | using type = decltype(A<int>::value); |
| 11 | |
| 12 | #if __cpp_variable_templates |
| 13 | struct B { |
| 14 | template<class T> |
| 15 | static constexpr int value = T::nonexistent; |
| 16 | }; |
| 17 | |
| 18 | template<class T> |
| 19 | constexpr int value = T::nonexistent; |
| 20 | |
| 21 | using type = decltype(B::value<int>); |
| 22 | using type = decltype(value<int>); |
| 23 | #endif |