[libcxx-commits] [PATCH] D127226: [libc++] Simplify type_traits and use more builtins

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 10 02:38:18 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/include/__type_traits/is_arithmetic.h:23
 
+#if __has_keyword(__is_arithmetic)
+
----------------
ldionne wrote:
> On what compilers is this not supported?
In all cases GCC. Should I guard them with `#ifndef _LIBCPP_COMPILER_GCC`?


================
Comment at: libcxx/include/__type_traits/is_fundamental.h:23-25
 // 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."
+#if __has_keyword(__is_fundamental)
----------------
ldionne wrote:
> The comments are now stale. Also, can we simply assume that we have `__is_fundamental`?
Nope, GCC also doesn't support `__is_fundamental`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127226



More information about the libcxx-commits mailing list