[libcxx-commits] [PATCH] D48292: use modern type trait implementations when available

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 24 16:51:29 PDT 2019


EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.
Herald added subscribers: libcxx-commits, miyuki, jfb, ldionne.

LGTM minus nits.



================
Comment at: include/type_traits:3683
+
+#elif __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
+
----------------
We don't support anything before GCC 4.9, so you can replace the GCC guard with `|| defined(_LIBCPP_COMPILER_GCC)`


================
Comment at: include/type_traits:3710
 
-#if 0
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
----------------
We should use variadics in C++03 when Clang is the compiler.  I would write this check as `#if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__)`


================
Comment at: include/type_traits:3718
 
-#else
+#elif __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
 
----------------
At this point I believe `#elif !defined(_LIBCPP_CXX03_LANG)` should work.


================
Comment at: test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp:120
+
+#if defined(__is_identifier)
+#if !__is_identifier(_Atomic)
----------------
You can use `TEST_HAS_BUILTIN_IDENTIFIER` defined by `test_macros.h` (https://github.com/llvm-mirror/libcxx/blob/master/test/support/test_macros.h#L58)


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D48292





More information about the libcxx-commits mailing list