[clang] [Analysis] Remove an unnecessary cast (NFC) (PR #146547)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 1 08:33:15 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-analysis

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

ME is already of ObjCMessageExpr *.


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


1 Files Affected:

- (modified) clang/lib/Analysis/CFG.cpp (+1-2) 


``````````diff
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index cf7595952be27..c23e3d057c525 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -898,8 +898,7 @@ class CFGBuilder {
       return;
     }
 
-    B->appendStmt(const_cast<ObjCMessageExpr *>(ME),
-                  cfg->getBumpVectorContext());
+    B->appendStmt(ME, cfg->getBumpVectorContext());
   }
 
   void appendTemporaryDtor(CFGBlock *B, CXXBindTemporaryExpr *E) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/146547


More information about the cfe-commits mailing list