[clang] [C23] Allow casting from a null pointer constant to nullptr_t (PR #133742)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 31 14:43:07 PDT 2025


================
@@ -93,6 +91,9 @@ void test() {
   (int *)null_val;    // ok
   (int *)nullptr;     // ok
   (nullptr_t)nullptr; // ok
+  (nullptr_t)0;       // ok
+  (nullptr_t)(void *)0; // ok
+  (nullptr_t)null_val;  // ok
----------------
Sirraide wrote:

What about `(nullptr_t)__null`

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


More information about the cfe-commits mailing list