aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-friend12.C
blob: 9687be5931a16d46662944b8bf684d1cc395956d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// PR c++/107853
// { dg-do compile { target c++20 } }

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

template<class... Ts>
struct A {
  template<class... Us>
    requires (C<Ts, Us> && ...)
  friend void f(A, A<Us...>) { }
};

int main() {
  A<int> x;
  f(x, x);
  A<int, int> y;
  f(y, y);
  A<char> z;
  f(x, z); // { dg-error "no match" }
}