case ActiveTemplateInstantiation::DefaultFunctionArgumentInstantiation: {
ParmVarDecl *Param = cast<ParmVarDecl>((Decl *)Active->Entity);
FunctionDecl *FD = cast<FunctionDecl>(Param->getDeclContext());
- TemplateDecl *Template = FD->getPrimaryTemplate();
std::string TemplateArgsStr
= TemplateSpecializationType::PrintTemplateArgumentList(
Context.PrintingPolicy);
Diags.Report(FullSourceLoc(Active->PointOfInstantiation, SourceMgr),
diag::note_default_function_arg_instantiation_here)
- << (Template->getNameAsString() + TemplateArgsStr)
+ << (FD->getNameAsString() + TemplateArgsStr)
<< Active->InstantiationRange;
break;
}
template<typename T> struct F {
F(T t = 10);
+ void f(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}}
};
struct FD : F<int> { };
FD fd;
}
+void g3(F<int> f, F<struct S> s) {
+ f.f();
+ s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}}
+}
+
template<typename T> struct G {
G(T) {}
};
void s(G<int> flags = 10) { }
+