aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaConcept.cpp
diff options
context:
space:
mode:
authorYounan Zhang <zyn7109@gmail.com>2025-07-08 19:01:01 +0800
committerGitHub <noreply@github.com>2025-07-08 19:01:01 +0800
commite55b1949c50da1aadb416a833cce352ace7c2280 (patch)
treebc908d22ff9f87c28428cc7b7f9dd7d605e38ebb /clang/lib/Sema/SemaConcept.cpp
parente476f968bc8e438a0435d10934f148de570db8eb (diff)
downloadllvm-e55b1949c50da1aadb416a833cce352ace7c2280.zip
llvm-e55b1949c50da1aadb416a833cce352ace7c2280.tar.gz
llvm-e55b1949c50da1aadb416a833cce352ace7c2280.tar.bz2
[Clang] Fix template arguments collection for out-of-line declarations (#147463)
We were using the lexical DC as the starting point of template argument collection when comparing declarations. This caused an issue that template arguments from out-of-line declarations are ignored when substituting into the constraints, which in turn led to expression mismatching. Fixes https://github.com/llvm/llvm-project/issues/145521
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r--clang/lib/Sema/SemaConcept.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index be9737d..4a16412 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -898,7 +898,7 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction(
Sema &S, const Sema::TemplateCompareNewDeclInfo &DeclInfo,
const Expr *ConstrExpr) {
MultiLevelTemplateArgumentList MLTAL = S.getTemplateInstantiationArgs(
- DeclInfo.getDecl(), DeclInfo.getLexicalDeclContext(), /*Final=*/false,
+ DeclInfo.getDecl(), DeclInfo.getDeclContext(), /*Final=*/false,
/*Innermost=*/std::nullopt,
/*RelativeToPrimary=*/true,
/*Pattern=*/nullptr, /*ForConstraintInstantiation=*/true,