diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-17 15:34:17 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-03-17 15:34:17 +0000 |
| commit | 7ed7200811069c513465e0a7867ec0cb24bdb2dc (patch) | |
| tree | dde84250cccd5c49a24528acfbf4a41f206acfd2 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
| parent | 1ff3a73c1ece7a0a4b7a8457eb4d5c47334b1526 (diff) | |
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 1da0dfec3f23..467372c71496 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -6012,7 +6012,9 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, (ParentDependsOnArgs && (ParentDC->isFunctionOrMethod() || isa<OMPDeclareReductionDecl>(ParentDC) || isa<OMPDeclareMapperDecl>(ParentDC))) || - (isa<CXXRecordDecl>(D) && cast<CXXRecordDecl>(D)->isLambda())) { + (isa<CXXRecordDecl>(D) && cast<CXXRecordDecl>(D)->isLambda() && + cast<CXXRecordDecl>(D)->getTemplateDepth() > + TemplateArgs.getNumRetainedOuterLevels())) { // D is a local of some kind. Look into the map of local // declarations to their instantiations. if (CurrentInstantiationScope) { |
