Skip to content

Commit 0b59273

Browse files
committed
[clang] WIP: Implement CTAD for type alias template.
This is a preliminary, WIP and messy implementation. While it is still missing many pieces (see FIXMEs), it works for happy cases.
1 parent cc38cff commit 0b59273

7 files changed

+603
-16
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9280,6 +9280,14 @@ class Sema final {
92809280
const TemplateArgumentList &TemplateArgs,
92819281
sema::TemplateDeductionInfo &Info);
92829282

9283+
TemplateDeductionResult
9284+
DeduceTemplateArguments(TemplateParameterList *TemplateParams,
9285+
ArrayRef<TemplateArgument> Ps,
9286+
ArrayRef<TemplateArgument> As,
9287+
sema::TemplateDeductionInfo &Info,
9288+
SmallVectorImpl<DeducedTemplateArgument> &Deduced,
9289+
bool NumberOfArgumentsMustMatch);
9290+
92839291
TemplateDeductionResult SubstituteExplicitTemplateArguments(
92849292
FunctionTemplateDecl *FunctionTemplate,
92859293
TemplateArgumentListInfo &ExplicitTemplateArgs,
@@ -10432,9 +10440,11 @@ class Sema final {
1043210440
SourceLocation PointOfInstantiation, FunctionDecl *Decl,
1043310441
ArrayRef<TemplateArgument> TemplateArgs,
1043410442
ConstraintSatisfaction &Satisfaction);
10435-
FunctionDecl *InstantiateFunctionDeclaration(FunctionTemplateDecl *FTD,
10436-
const TemplateArgumentList *Args,
10437-
SourceLocation Loc);
10443+
FunctionDecl *InstantiateFunctionDeclaration(
10444+
FunctionTemplateDecl *FTD, const TemplateArgumentList *Args,
10445+
SourceLocation Loc,
10446+
CodeSynthesisContext::SynthesisKind CSC =
10447+
CodeSynthesisContext::ExplicitTemplateArgumentSubstitution);
1043810448
void InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
1043910449
FunctionDecl *Function,
1044010450
bool Recursive = false,

0 commit comments

Comments
 (0)