gcc/testsuite/g++.dg/cpp2a/concepts-var-templ1b.C
raw| 1 | // PR c++/98486 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<class T, class U> concept C = __is_same(T, U); |
| 5 | |
| 6 | template<class T> |
| 7 | struct A { |
| 8 | template<C<T>> static int v; |
| 9 | }; |
| 10 | |
| 11 | template<> template<> int A<int>::v<int>; |
| 12 | template<> template<> int A<int>::v<char>; // { dg-error "match" } |
| 13 | |
| 14 | int x = A<int>::v<int>; |
| 15 | int y = A<int>::v<char>; // { dg-error "invalid" } |