}
}
}
+
+ // Check the template parameter list against the previous declaration. The
+ // goal here is to pick up default arguments added since the friend was
+ // declared; we know the template parameter lists match, since otherwise
+ // we would not have picked this template as the previous declaration.
+ if (TemplateParams && FunctionTemplate->getPreviousDecl()) {
+ SemaRef.CheckTemplateParameterList(
+ TemplateParams,
+ FunctionTemplate->getPreviousDecl()->getTemplateParameters(),
+ Function->isThisDeclarationADefinition()
+ ? Sema::TPC_FriendFunctionTemplateDefinition
+ : Sema::TPC_FriendFunctionTemplate);
+ }
}
if (Function->isLocalExternDecl() && !Function->getPreviousDecl())
} // end ns1
} // end ns PR26134
+
+namespace friends {
+ namespace ns {
+ template<typename> struct A {
+ template<typename> friend void f();
+ template<typename> friend struct X;
+ };
+ template<typename = int> void f(); // expected-warning 0-1{{extension}}
+ template<typename = int> struct X;
+ A<int> a;
+ }
+ namespace ns {
+ void g() { f(); }
+ X<int> *p;
+ }
+}