[PATCH] D157757: [Headers] Replace __need_STDDEF_H_misc with specific __need_ macros

Nikolas Klauser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 11:14:35 PDT 2023


philnik added a comment.

I think these changes would allow us to drop the `stddef.h` compat header from libc++, which would be really nice.



================
Comment at: clang/lib/Headers/stddef.h:36-40
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) ||              \
+    (defined(__cplusplus) && defined(_MSC_EXTENSIONS) &&                       \
+     defined(_NATIVE_NULLPTR_SUPPORTED))
+#define __need_nullptr_t
+#endif
----------------



================
Comment at: clang/lib/Headers/stddef.h:118-125
+#ifdef __cplusplus
+namespace std {
+typedef decltype(nullptr) nullptr_t;
+}
+using ::std::nullptr_t;
+#else
 typedef typeof(nullptr) nullptr_t;
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157757/new/

https://reviews.llvm.org/D157757



More information about the cfe-commits mailing list