[PATCH] D33021: [libcxx] [test] libc++ test changes for CWG 2094

Billy Robert O'Neal III via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 16:48:29 PDT 2017


BillyONeal created this revision.

Update is_trivially_copyable tests with CWG 2094

Clang 5.0 implements this here: https://github.com/llvm-mirror/clang/commit/87cd035326a39523eeb1b295ad36cff337141ef9
MSVC++ will implement it in the first toolset update for VS 2017.


https://reviews.llvm.org/D33021

Files:
  test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp


Index: test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
===================================================================
--- test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
+++ test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
@@ -17,18 +17,26 @@
 #include <cassert>
 #include "test_macros.h"
 
+#ifndef IMPLEMENTS_CWG_2094
+ #if (defined(__clang_major__) && __clang_major__ >= 5) || (defined(_MSC_VER) && _MSC_VER >= 1911)
+  #define IMPLEMENTS_CWG_2094 true
+ #else /* ^^^ Clang 5.0 or later, MSVC++ 19.11 or later ^^^ // vvv Others vvv */
+  #define IMPLEMENTS_CWG_2094 false
+ #endif /* defined(_MSC_VER) && _MSC_VER >= 1911 */
+#endif
+
 template <class T>
 void test_is_trivially_copyable()
 {
-    static_assert( std::is_trivially_copyable<T>::value, "");
-    static_assert( std::is_trivially_copyable<const T>::value, "");
-    static_assert(!std::is_trivially_copyable<volatile T>::value, "");
-    static_assert(!std::is_trivially_copyable<const volatile T>::value, "");
+    static_assert(std::is_trivially_copyable<T>::value, "");
+    static_assert(std::is_trivially_copyable<const T>::value, "");
+    static_assert(std::is_trivially_copyable<volatile T>::value == IMPLEMENTS_CWG_2094, "");
+    static_assert(std::is_trivially_copyable<const volatile T>::value == IMPLEMENTS_CWG_2094, "");
 #if TEST_STD_VER > 14
-    static_assert( std::is_trivially_copyable_v<T>, "");
-    static_assert( std::is_trivially_copyable_v<const T>, "");
-    static_assert(!std::is_trivially_copyable_v<volatile T>, "");
-    static_assert(!std::is_trivially_copyable_v<const volatile T>, "");
+    static_assert(std::is_trivially_copyable_v<T>, "");
+    static_assert(std::is_trivially_copyable_v<const T>, "");
+    static_assert(std::is_trivially_copyable_v<volatile T> == IMPLEMENTS_CWG_2094, "");
+    static_assert(std::is_trivially_copyable_v<const volatile T> == IMPLEMENTS_CWG_2094, "");
 #endif
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33021.98368.patch
Type: text/x-patch
Size: 2010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170509/453d7149/attachment.bin>


More information about the cfe-commits mailing list