Skip to content

Commit b6877bc

Browse files
committed
Use getPatternFunctionDecl() over getTemplateInstantiationPattern()
The latter version doesn't find the very original template pattern for a transformed lambda, while getPatternFunctionDecl() finds what we want for constraint instantiation.
1 parent f523717 commit b6877bc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Sema/SemaLambda.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,8 +2433,7 @@ bool Sema::addInstantiatedCapturesToScope(
24332433
if (LambdaPattern->capture_size() && !LambdaClass->capture_size()) {
24342434
for (FunctionScopeInfo *Scope : llvm::reverse(FunctionScopes)) {
24352435
auto *LSI = dyn_cast<LambdaScopeInfo>(Scope);
2436-
if (!LSI ||
2437-
LSI->CallOperator->getTemplateInstantiationPattern() != PatternDecl)
2436+
if (!LSI || getPatternFunctionDecl(LSI->CallOperator) != PatternDecl)
24382437
continue;
24392438
InstantiatingScope = LSI;
24402439
break;

0 commit comments

Comments
 (0)