diff options
author | Krystian Stasiowski <sdkrystian@gmail.com> | 2024-08-06 12:40:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 12:40:44 -0400 |
commit | 55ea36002bd364518c20b3ce282640c920697bf7 (patch) | |
tree | 6568006f4e746aabdcb6a494c67ccc7fcee47240 /clang/lib/Sema/SemaOpenMP.cpp | |
parent | b7cd564fa3ecc2a9ed0fded98c24f68e2dad63ad (diff) | |
download | llvm-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/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 7d814e6b..b5978dd 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -17932,7 +17932,8 @@ buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, return UnresolvedLookupExpr::Create( SemaRef.Context, /*NamingClass=*/nullptr, ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, - /*ADL=*/true, ResSet.begin(), ResSet.end(), /*KnownDependent=*/false); + /*ADL=*/true, ResSet.begin(), ResSet.end(), /*KnownDependent=*/false, + /*KnownInstantiationDependent=*/false); } // Lookup inside the classes. // C++ [over.match.oper]p3: @@ -20798,7 +20799,8 @@ static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S, return UnresolvedLookupExpr::Create( SemaRef.Context, /*NamingClass=*/nullptr, MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId, - /*ADL=*/false, URS.begin(), URS.end(), /*KnownDependent=*/false); + /*ADL=*/false, URS.begin(), URS.end(), /*KnownDependent=*/false, + /*KnownInstantiationDependent=*/false); } SourceLocation Loc = MapperId.getLoc(); // [OpenMP 5.0], 2.19.7.3 declare mapper Directive, Restrictions |