aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaConcept.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2024-08-04 19:00:54 -0300
committerGitHub <noreply@github.com>2024-08-04 19:00:54 -0300
commit9e9d98aaf503171e2cb229e89966ec1c0adf3804 (patch)
tree87048d9d947a7d6ff961e74820d5800f85a19127 /clang/lib/Sema/SemaConcept.cpp
parentd34191102ae84352b047498825ab9dd9c8777f98 (diff)
downloadllvm-9e9d98aaf503171e2cb229e89966ec1c0adf3804.zip
llvm-9e9d98aaf503171e2cb229e89966ec1c0adf3804.tar.gz
llvm-9e9d98aaf503171e2cb229e89966ec1c0adf3804.tar.bz2
[clang] concepts: perform parameter mapping substitution in correct context (#101745)
Prior to this patch, during constraint normalization we could forget from which declaration an atomic constraint was normalized from. Subsequently when performing parameter mapping substitution for that atomic constraint with an incorrect context, we couldn't correctly recognize which declarations are supposed to be visible. Fixes #60336
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r--clang/lib/Sema/SemaConcept.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 9e16b67..7d7a94e 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1457,8 +1457,8 @@ substituteParameterMappings(Sema &S, NormalizedConstraint &N,
: ArgsAsWritten->arguments().front().getSourceRange().getEnd();
Sema::InstantiatingTemplate Inst(
S, InstLocBegin,
- Sema::InstantiatingTemplate::ParameterMappingSubstitution{}, Concept,
- {InstLocBegin, InstLocEnd});
+ Sema::InstantiatingTemplate::ParameterMappingSubstitution{},
+ Atomic.ConstraintDecl, {InstLocBegin, InstLocEnd});
if (Inst.isInvalid())
return true;
if (S.SubstTemplateArguments(*Atomic.ParameterMapping, MLTAL, SubstArgs))
@@ -1632,7 +1632,7 @@ NormalizedConstraint::fromConstraintExpr(Sema &S, NamedDecl *D, const Expr *E) {
Kind, std::move(*Sub), FE->getPattern()}};
}
- return NormalizedConstraint{new (S.Context) AtomicConstraint(S, E)};
+ return NormalizedConstraint{new (S.Context) AtomicConstraint(E, D)};
}
bool FoldExpandedConstraint::AreCompatibleForSubsumption(