bool Explicit, TypeSourceInfo *TInfo,
SourceLocation LocStart, SourceLocation Loc,
SourceLocation LocEnd) {
+ ArrayRef<ParmVarDecl *> Params =
+ TInfo->getTypeLoc().castAs<FunctionProtoTypeLoc>().getParams();
+
// Build the implicit deduction guide template.
auto *Guide = FunctionDecl::Create(SemaRef.Context, DC, LocStart, Loc,
DeductionGuideName, TInfo->getType(),
if (Explicit)
Guide->setExplicitSpecified();
Guide->setRangeEnd(LocEnd);
- Guide->setParams(
- TInfo->getTypeLoc().castAs<FunctionProtoTypeLoc>().getParams());
+ Guide->setParams(Params);
+
+ for (auto *Param : Params)
+ Param->setDeclContext(Guide);
auto *GuideTemplate = FunctionTemplateDecl::Create(
SemaRef.Context, DC, Loc, DeductionGuideName, TemplateParams, Guide);
typename ...B>
X(float) -> X<A, B...>; // ok
}
+
+namespace default_args_from_ctor {
+ template <class A> struct S { S(A = 0) {} };
+ S s(0);
+
+ template <class A> struct T { template<typename B> T(A = 0, B = 0) {} };
+ T t(0, 0);
+}