[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 04:35:40 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:

Or is your suggestion that we move `stddef.h` to something more like:
```
#if defined(__cplusplus) && __cplusplus >= 201103L /* c++11 */
#include_next <stddef.h>
#else
/* The usual stddef.h header */
#endif
```
Either way, I think it's orthogonal to this fix because that's a pretty substantial change that requires a fair amount of investigation. Are you okay with landing the changes as-is and doing that exploration in a follow-up if someone gets the chance? (I'm going to be out of office for a while, so I'm not able to commit to that work myself.)

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


More information about the cfe-commits mailing list