aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaExprMember.cpp
diff options
context:
space:
mode:
authorKrystian Stasiowski <sdkrystian@gmail.com>2024-08-06 12:40:44 -0400
committerGitHub <noreply@github.com>2024-08-06 12:40:44 -0400
commit55ea36002bd364518c20b3ce282640c920697bf7 (patch)
tree6568006f4e746aabdcb6a494c67ccc7fcee47240 /clang/lib/Sema/SemaExprMember.cpp
parentb7cd564fa3ecc2a9ed0fded98c24f68e2dad63ad (diff)
downloadllvm-55ea36002bd364518c20b3ce282640c920697bf7.zip
llvm-55ea36002bd364518c20b3ce282640c920697bf7.tar.gz
llvm-55ea36002bd364518c20b3ce282640c920697bf7.tar.bz2
[Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392)
A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a `UnresolvedLookupExpr` in order to defer the implicit transformation to a class member access expression until instantiation. Since `ASTContext::getDecltypeType` only creates a `DecltypeType` that has a `DependentDecltypeType` as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the `UnresolvedLookupExpr` as instantiation dependent in order to correctly build a `DecltypeType` using the expression as its operand with a `DependentDecltypeType` canonical type. Fixes #99873.
Diffstat (limited to 'clang/lib/Sema/SemaExprMember.cpp')
-rw-r--r--clang/lib/Sema/SemaExprMember.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp
index 2070f3b..f1ba26f 100644
--- a/clang/lib/Sema/SemaExprMember.cpp
+++ b/clang/lib/Sema/SemaExprMember.cpp
@@ -331,7 +331,8 @@ ExprResult Sema::BuildPossibleImplicitMemberExpr(
return UnresolvedLookupExpr::Create(
Context, R.getNamingClass(), SS.getWithLocInContext(Context),
TemplateKWLoc, R.getLookupNameInfo(), /*RequiresADL=*/false,
- TemplateArgs, R.begin(), R.end(), /*KnownDependent=*/true);
+ TemplateArgs, R.begin(), R.end(), /*KnownDependent=*/true,
+ /*KnownInstantiationDependent=*/true);
case IMA_Error_StaticOrExplicitContext:
case IMA_Error_Unrelated: