Skip to content

Conversation

@rniwa
Copy link
Contributor

@rniwa rniwa commented Mar 27, 2025

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Mar 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 27, 2025

@llvm/pr-subscribers-clang-static-analyzer-1

@llvm/pr-subscribers-clang

Author: Ryosuke Niwa (rniwa)

Changes

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

1 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp (+2-1)
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
index 291eb140d3202..a524593b0119b 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
@@ -231,7 +231,8 @@ class ForwardDeclChecker : public Checker<check::ASTDecl<TranslationUnitDecl>> {
     if (BR->getSourceManager().isInSystemHeader(E->getExprLoc()))
       return;
 
-    if (auto *Receiver = E->getInstanceReceiver()->IgnoreParenCasts()) {
+    if (auto *Receiver = E->getInstanceReceiver()) {
+      Receiver = Receiver->IgnoreParenCasts();
       if (isUnknownType(E->getReceiverType()))
         reportUnknownRecieverType(Receiver, DeclWithIssue);
     }

@rniwa rniwa merged commit 2e3c317 into llvm:main Mar 27, 2025
10 of 11 checks passed
@rniwa rniwa deleted the fix-forward-decl-checker-after-pr-132784 branch March 27, 2025 23:45
rniwa added a commit to rniwa/llvm-project that referenced this pull request Apr 22, 2025
rniwa added a commit to rniwa/llvm-project that referenced this pull request Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants