Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-friend12.C

raw
1 // PR c++/107853
2 // { dg-do compile { target c++20 } }
3
4 template<class T, class U>
5 concept C = __is_same(T, U);
6
7 template<class... Ts>
8 struct A {
9 template<class... Us>
10 requires (C<Ts, Us> && ...)
11 friend void f(A, A<Us...>) { }
12 };
13
14 int main() {
15 A<int> x;
16 f(x, x);
17 A<int, int> y;
18 f(y, y);
19 A<char> z;
20 f(x, z); // { dg-error "no match" }
21 }