llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Simon Pilgrim (RKSimon)

<details>
<summary>Changes</summary>

We should be checking for a failed dyn_cast on the ParentFD result - not the 
loop invariant FD root value.

Seems to have been introduced in #<!-- -->65193

Noticed by static analyser (I have no specific test case).

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


1 Files Affected:

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


``````````diff
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index e9476a0c93c5d..ca9c7cb9faadf 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -2391,7 +2391,7 @@ Sema::LambdaScopeForCallOperatorInstantiationRAII::
       Pattern =
           dyn_cast<FunctionDecl>(getLambdaAwareParentOfDeclContext(Pattern));
 
-      if (!FD || !Pattern)
+      if (!ParentFD || !Pattern)
         break;
 
       SemaRef.addInstantiatedParametersToScope(ParentFD, Pattern, Scope, 
MLTAL);

``````````

</details>


https://github.com/llvm/llvm-project/pull/96888
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to