[libcxx-commits] [PATCH] D98720: [libc++] Consistency in _LIBCPP_CLANG_VER tests in <type_traits>

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 16 09:43:16 PDT 2021


zoecarver accepted this revision as: zoecarver.
zoecarver added inline comments.


================
Comment at: libcxx/include/type_traits:1132
 
-// In clang 9 and lower, this builtin did not work for nullptr_t. Additionally, in C++03 mode,
-// nullptr isn't defined by the compiler so, this builtin won't work.
-#if __has_keyword(__is_fundamental) && _LIBCPP_CLANG_VER > 900 && !defined(_LIBCPP_CXX03_LANG)
+// Before Clang 10, __is_fundamental didn't work for nullptr_t.
+// In C++03 nullptr_t is library-provided but must still count as "fundamental."
----------------
Quuxplusone wrote:
> zoecarver wrote:
> > Nit: I think this means we won't take this path on Clang 9.0.1 anymore (which is maybe OK). 
> Yeah, I saw that and decided that it was OK, since any difference would be observed merely as a compile-speed pessimization on Clang 9.x compilers. I value consistency-of-syntax more than... that. :)
Fair enough. Especially given these paths won't have to exist much longer. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98720



More information about the libcxx-commits mailing list