aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2024-06-28 18:54:36 +0100
committerGitHub <noreply@github.com>2024-06-28 18:54:36 +0100
commitdac366111e5560c117a06330efee14a2052d3a46 (patch)
treea599d2d613373f9a42228510f49cfbdec92f4dbb /clang/lib/Sema
parentc6e264952e94a7705d902ebda4d1a77256ee9926 (diff)
downloadllvm-dac366111e5560c117a06330efee14a2052d3a46.zip
llvm-dac366111e5560c117a06330efee14a2052d3a46.tar.gz
llvm-dac366111e5560c117a06330efee14a2052d3a46.tar.bz2
[Sema] LambdaScopeForCallOperatorInstantiationRAII - fix typo in early out logic (#96888)
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).
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index e9476a0..ca9c7cb 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);