[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

Endre Fülöp via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 28 05:20:55 PDT 2025


================
@@ -0,0 +1,166 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s
+
+// Test basic functionality of StoreToImmutable checker
+// This tests direct writes to immutable regions without function modeling
+
+// Direct write to a const global variable
+const int global_const = 42; // expected-note {{Memory region is in immutable space}}
----------------
gamesh411 wrote:

Added FIXME to the test files and the example as well.

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


More information about the cfe-commits mailing list