aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaConcept.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2024-08-08 23:38:08 -0300
committerGitHub <noreply@github.com>2024-08-08 23:38:08 -0300
commit00139ae1bc0ae855ebe9c8991f480b382bbc4308 (patch)
treecb69a23da85dc0bbb080adc5416d8d5a0c7b3715 /clang/lib/Sema/SemaConcept.cpp
parent2ac2e9a5b6c97cbf267db1ef322ed21ebceb2aba (diff)
downloadllvm-00139ae1bc0ae855ebe9c8991f480b382bbc4308.zip
llvm-00139ae1bc0ae855ebe9c8991f480b382bbc4308.tar.gz
llvm-00139ae1bc0ae855ebe9c8991f480b382bbc4308.tar.bz2
Revert "[clang] Reland: Instantiate concepts with sugared template arguments (#101782)" (#102551)
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r--clang/lib/Sema/SemaConcept.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index d4c9d04..d1e62fb 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -414,8 +414,7 @@ DiagRecursiveConstraintEval(Sema &S, llvm::FoldingSetNodeID &ID,
E->Profile(ID, S.Context, /*Canonical=*/true);
for (const auto &List : MLTAL)
for (const auto &TemplateArg : List.Args)
- S.Context.getCanonicalTemplateArgument(TemplateArg)
- .Profile(ID, S.Context);
+ TemplateArg.Profile(ID, S.Context);
// Note that we have to do this with our own collection, because there are
// times where a constraint-expression check can cause us to need to evaluate
@@ -643,8 +642,8 @@ bool Sema::CheckConstraintSatisfaction(
// here.
llvm::SmallVector<TemplateArgument, 4> FlattenedArgs;
for (auto List : TemplateArgsLists)
- for (const TemplateArgument &Arg : List.Args)
- FlattenedArgs.emplace_back(Context.getCanonicalTemplateArgument(Arg));
+ FlattenedArgs.insert(FlattenedArgs.end(), List.Args.begin(),
+ List.Args.end());
llvm::FoldingSetNodeID ID;
ConstraintSatisfaction::Profile(ID, Context, Template, FlattenedArgs);
@@ -828,8 +827,6 @@ Sema::SetupConstraintCheckingTemplateArgumentsAndScope(
/*RelativeToPrimary=*/true,
/*Pattern=*/nullptr,
/*ForConstraintInstantiation=*/true);
- if (TemplateArgs)
- MLTAL.replaceInnermostTemplateArguments(FD, *TemplateArgs, /*Final=*/true);
if (SetupConstraintScope(FD, TemplateArgs, MLTAL, Scope))
return std::nullopt;
@@ -1483,7 +1480,7 @@ static bool substituteParameterMappings(Sema &S, NormalizedConstraint &N,
const ConceptSpecializationExpr *CSE) {
MultiLevelTemplateArgumentList MLTAL = S.getTemplateInstantiationArgs(
CSE->getNamedConcept(), CSE->getNamedConcept()->getLexicalDeclContext(),
- /*Final=*/true, CSE->getTemplateArguments(),
+ /*Final=*/false, CSE->getTemplateArguments(),
/*RelativeToPrimary=*/true,
/*Pattern=*/nullptr,
/*ForConstraintInstantiation=*/true);