[libcxx-commits] [PATCH] D129056: [libc++] Prefer __has_builtin for detecting compiler-provided type_traits

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 3 18:30:02 PDT 2022


philnik created this revision.
philnik added reviewers: ldionne, Mordante, var-const.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Both clang and GCC support using `__has_builtin` for detecting compiler-provided type_traits. Use it instead of `__has_keyword` or `__has_feature` to remove special-casing for GCC-provided builtins


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129056

Files:
  libcxx/include/__type_traits/extent.h
  libcxx/include/__type_traits/has_virtual_destructor.h
  libcxx/include/__type_traits/is_array.h
  libcxx/include/__type_traits/is_assignable.h
  libcxx/include/__type_traits/is_compound.h
  libcxx/include/__type_traits/is_const.h
  libcxx/include/__type_traits/is_convertible.h
  libcxx/include/__type_traits/is_destructible.h
  libcxx/include/__type_traits/is_function.h
  libcxx/include/__type_traits/is_fundamental.h
  libcxx/include/__type_traits/is_integral.h
  libcxx/include/__type_traits/is_member_function_pointer.h
  libcxx/include/__type_traits/is_member_object_pointer.h
  libcxx/include/__type_traits/is_member_pointer.h
  libcxx/include/__type_traits/is_nothrow_assignable.h
  libcxx/include/__type_traits/is_nothrow_constructible.h
  libcxx/include/__type_traits/is_object.h
  libcxx/include/__type_traits/is_pod.h
  libcxx/include/__type_traits/is_pointer.h
  libcxx/include/__type_traits/is_reference.h
  libcxx/include/__type_traits/is_scalar.h
  libcxx/include/__type_traits/is_signed.h
  libcxx/include/__type_traits/is_standard_layout.h
  libcxx/include/__type_traits/is_trivial.h
  libcxx/include/__type_traits/is_trivially_destructible.h
  libcxx/include/__type_traits/is_unsigned.h
  libcxx/include/__type_traits/is_void.h
  libcxx/include/__type_traits/is_volatile.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129056.441995.patch
Type: text/x-patch
Size: 24122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220704/602c1551/attachment-0001.bin>


More information about the libcxx-commits mailing list