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

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 30 08:31:08 PDT 2025


Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fulop at sigmatechnology.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/150417 at github.com>


================
@@ -0,0 +1,32 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s
+
+// Global const variable
+const int global_const = 42;
----------------
steakhal wrote:

Agreed. I misinterpreted the context.

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


More information about the cfe-commits mailing list