Debian Codegraph @

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

raw
1 // { dg-do compile { target concepts } }
2
3 template <class T> concept True = true;
4
5 template <True U> struct B { int i = ++U::x; };
6 template <True U> void f() { ++U::x; }
7 template <class U> void g() requires True<U> { ++U::x; }
8
9 template <class V> class C
10 {
11 static int x;
12
13 template <True U> friend struct B;
14 template <True U> friend void f();
15 template <class U> friend void g() requires True<U>;
16 };
17
18 int main()
19 {
20 f<C<int>>();
21 g<C<int>>();
22 B<C<int>>();
23 }