aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-var-templ1b.C
blob: 37d7f0fc654e1dd17d6d68a5bb6667ce0271dc0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/98486
// { dg-do compile { target c++20 } }

template<class T, class U> concept C = __is_same(T, U);

template<class T>
struct A {
  template<C<T>> static int v;
};

template<> template<> int A<int>::v<int>;
template<> template<> int A<int>::v<char>; // { dg-error "match" }

int x = A<int>::v<int>;
int y = A<int>::v<char>; // { dg-error "invalid" }