[clang] [Clang] Be less strict about diagnosing null pointer dereference. (PR #149648)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 19 16:21:03 PDT 2025


================
@@ -153,3 +150,7 @@ struct PR35214_X {
 int PR35214_x;
 int PR35214_y = ((struct PR35214_X *)&PR35214_x)->arr[1]; // expected-error {{not a compile-time constant}}
 int *PR35214_z = &((struct PR35214_X *)&PR35214_x)->arr[1]; // ok, &PR35214_x + 2
+
+
+int * GH149500_p = &(*(int *)0x400);
+static const void *GH149500_q = &(*(const struct sysrq_key_op *)0);
----------------
shafik wrote:

Maybe a test w/ `NULL`?

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


More information about the cfe-commits mailing list