// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s struct S { template friend void foo(auto){} template friend void foo2(){} }; template struct TemplS { template friend void foo3(auto){} template friend void foo4(){} }; void Inst() { TemplS(); } // expected-error@+2{{template parameter missing a default argument}} // expected-note@+1{{previous default template argument defined here}} template struct ClassTempl{}; struct HasFriendClassTempl { // expected-error@+1{{default template argument not permitted on a friend template}} template friend struct Friend; // expected-error@+3{{cannot define a type in a friend declaration}} // expected-error@+1{{default template argument not permitted on a friend template}} template friend struct Friend2{}; }; template struct HasFriendClassTempl2 { // expected-error@+3{{template parameter missing a default argument}} // expected-note@+2{{previous default template argument defined here}} // expected-note@#INST2{{in instantiation of template class}} template friend struct Friend; }; void Inst2() { HasFriendClassTempl2(); // #INST2 } // expected-error@+2{{template parameter missing a default argument}} // expected-note@+1{{previous default template argument defined here}} template static constexpr U VarTempl; // expected-error@+2{{template parameter missing a default argument}} // expected-note@+1{{previous default template argument defined here}} template using TypeAlias = U;