llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: StefanPaulet

<details>
<summary>Changes</summary>

Resolves #<!-- -->213420.

The problem introduced in #<!-- -->211811 is that the search for the 
`LambdaScopeInfo` corresponding to the current lambda operator stops at the 
first scope info that is not a `CapturingScopeInfo`. 
This is relevant in `getCurLambda` (where I looked when implementing the PR), 
but not here.

---
Full diff: https://github.com/llvm/llvm-project/pull/217021.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaExpr.cpp (+1-2) 


``````````diff
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 0908841dca8bf..d06079a43e23a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -2122,8 +2122,7 @@ static Decl *getPredefinedExprDecl(Sema &S, DeclContext 
*DC) {
   auto tryAdjustLambdaContext = [&S, &LSI](DeclContext *&DC) {
     if (isLambdaCallOperator(DC)) {
       auto E = S.FunctionScopes.rend();
-      while (LSI != E && isa<CapturingScopeInfo>(*LSI) &&
-             !isa<LambdaScopeInfo>(*LSI))
+      while (LSI != E && !isa<LambdaScopeInfo>(*LSI))
         ++LSI;
       assert(LSI != E && "Should be in a lambda scope info");
       if (dyn_cast<LambdaScopeInfo>(*LSI)->BeforeCompoundStatement)

``````````

</details>


https://github.com/llvm/llvm-project/pull/217021
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to