gcc/testsuite/g++.dg/cpp1y/var-templ88.C
raw| 1 | // PR c++/123143 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | constexpr int x = 42; |
| 5 | struct S { static constexpr int x = 20; template <int N> static constexpr int a = N; }; |
| 6 | |
| 7 | template<typename> |
| 8 | void |
| 9 | f () |
| 10 | { |
| 11 | constexpr S s; |
| 12 | static_assert (s.template a<42> == 42, ""); |
| 13 | static_assert (s.S::template a<42> == 42, ""); |
| 14 | } |
| 15 | |
| 16 | void |
| 17 | g () |
| 18 | { |
| 19 | f<int>(); |
| 20 | } |