[libcxx-commits] [libcxx] e781e03 - [libc++] Remove workaround for broken __is_trivially_copyable on old GCC

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 31 13:05:43 PDT 2021


Author: Louis Dionne
Date: 2021-08-31T16:05:29-04:00
New Revision: e781e03e40337fba4ed57fcfb257d1d4a5e00e2b

URL: https://github.com/llvm/llvm-project/commit/e781e03e40337fba4ed57fcfb257d1d4a5e00e2b
DIFF: https://github.com/llvm/llvm-project/commit/e781e03e40337fba4ed57fcfb257d1d4a5e00e2b.diff

LOG: [libc++] Remove workaround for broken __is_trivially_copyable on old GCC

All supported versions of GCC now do the right thing.

Differential Revision: https://reviews.llvm.org/D108997

Added: 
    

Modified: 
    libcxx/include/type_traits
    libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index b6e1c20bf397f..067cfcf10512e 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -3708,13 +3708,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_standard_layout_v
 // is_trivially_copyable;
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable
-#if __has_feature(is_trivially_copyable)
     : public integral_constant<bool, __is_trivially_copyable(_Tp)>
-#elif _GNUC_VER >= 501
-    : public integral_constant<bool, !is_volatile<_Tp>::value && __is_trivially_copyable(_Tp)>
-#else
-    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
-#endif
     {};
 
 #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)

diff  --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
index 38a6b17722c43..4f0d31a30fd47 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
@@ -10,10 +10,6 @@
 
 // is_trivially_copyable
 
-// GCC has not implemented Core 2094 which makes volatile
-// qualified types trivially copyable.
-// XFAIL: gcc
-
 #include <type_traits>
 #include <cassert>
 #include "test_macros.h"


        


More information about the libcxx-commits mailing list