[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 10 05:20:55 PDT 2025


================
@@ -265,7 +265,7 @@ namespace const_modify {
 
 namespace null {
   constexpr int test(int *p) {
-    return *p = 123; // expected-note {{assignment to dereferenced null pointer}}
+    return *p = 123; // expected-note {{read of dereferenced null pointer}}
----------------
AaronBallman wrote:

Is there a reason we can't say `assignment to` like we did before? I think that's more clear than `access to`.

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


More information about the cfe-commits mailing list