35 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -verify %s2 3template<class T, class U>4concept C = true;5 6class non_temp {7 template<C<non_temp> T>8 friend void f();9 10 non_temp();11};12 13template<C<non_temp> T>14void f() {15 auto v = non_temp();16}17 18template<class A>19class temp {20 template<C<temp> T>21 friend void g(); // expected-error {{friend declaration with a constraint that depends on an enclosing template parameter must be a definition}}22 23 temp();24};25 26template<C<temp<int>> T>27void g() {28 auto v = temp<T>();29}30 31void h() {32 f<int>();33 g<int>();34}35