[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 21 06:11:36 PDT 2025


================
@@ -16,7 +16,8 @@
 #define _NULLPTR_T
 
 #ifdef __cplusplus
-#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
+#if __cplusplus >= 201103L ||                                                  \
+    (defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))
----------------
AaronBallman wrote:

>  yeah, I'm OK with it. I just wish we could go all the way.

+1, but it might be a challenge too. I'm not certain libc++ *should* provide `nullptr_t` in C++03 mode; that's taking an identifier from the user in that language mode and `nullptr` doesn't work in C++03 anyway: https://godbolt.org/z/96vMdbobe

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


More information about the cfe-commits mailing list