aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2024-04-19 15:41:50 -0700
committerVitaly Buka <vitalybuka@google.com>2024-04-19 15:41:50 -0700
commitfb6bcedb3de596c2ddf56fd0001e3a6624b62257 (patch)
tree32fa165efef87810ce2e68da89ad23cfc545d52a /clang/lib/Sema/SemaTemplate.cpp
parent31cb633e504579e57f6e01a4f8187089b87f1e2e (diff)
parentd9169ffaf7c01691644537d3443240748b107359 (diff)
downloadllvm-fb6bcedb3de596c2ddf56fd0001e3a6624b62257.zip
llvm-fb6bcedb3de596c2ddf56fd0001e3a6624b62257.tar.gz
llvm-fb6bcedb3de596c2ddf56fd0001e3a6624b62257.tar.bz2
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index d4976f9..4bda31b 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -2962,19 +2962,6 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
Context.getCanonicalTemplateArgument(
Context.getInjectedTemplateArg(NewParam));
}
- // Substitute new template parameters into requires-clause if present.
- Expr *RequiresClause =
- transformRequireClause(SemaRef, F, TemplateArgsForBuildingFPrime);
- // FIXME: implement the is_deducible constraint per C++
- // [over.match.class.deduct]p3.3:
- // ... and a constraint that is satisfied if and only if the arguments
- // of A are deducible (see below) from the return type.
- auto *FPrimeTemplateParamList = TemplateParameterList::Create(
- Context, AliasTemplate->getTemplateParameters()->getTemplateLoc(),
- AliasTemplate->getTemplateParameters()->getLAngleLoc(),
- FPrimeTemplateParams,
- AliasTemplate->getTemplateParameters()->getRAngleLoc(),
- /*RequiresClause=*/RequiresClause);
// To form a deduction guide f' from f, we leverage clang's instantiation
// mechanism, we construct a template argument list where the template
@@ -3020,6 +3007,20 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
F, TemplateArgListForBuildingFPrime, AliasTemplate->getLocation(),
Sema::CodeSynthesisContext::BuildingDeductionGuides)) {
auto *GG = cast<CXXDeductionGuideDecl>(FPrime);
+ // Substitute new template parameters into requires-clause if present.
+ Expr *RequiresClause =
+ transformRequireClause(SemaRef, F, TemplateArgsForBuildingFPrime);
+ // FIXME: implement the is_deducible constraint per C++
+ // [over.match.class.deduct]p3.3:
+ // ... and a constraint that is satisfied if and only if the arguments
+ // of A are deducible (see below) from the return type.
+ auto *FPrimeTemplateParamList = TemplateParameterList::Create(
+ Context, AliasTemplate->getTemplateParameters()->getTemplateLoc(),
+ AliasTemplate->getTemplateParameters()->getLAngleLoc(),
+ FPrimeTemplateParams,
+ AliasTemplate->getTemplateParameters()->getRAngleLoc(),
+ /*RequiresClause=*/RequiresClause);
+
buildDeductionGuide(SemaRef, AliasTemplate, FPrimeTemplateParamList,
GG->getCorrespondingConstructor(),
GG->getExplicitSpecifier(), GG->getTypeSourceInfo(),