|
@@ -21,6 +21,7 @@
|
|
#include <variant>
|
|
#include <variant>
|
|
|
|
|
|
#include "test_macros.h"
|
|
#include "test_macros.h"
|
|
|
|
+#include "test_workarounds.h"
|
|
|
|
|
|
struct NonT {
|
|
struct NonT {
|
|
NonT(int v) : value(v) {}
|
|
NonT(int v) : value(v) {}
|
|
@@ -137,14 +138,21 @@ constexpr bool test_constexpr_copy_ctor_extension_imp(
|
|
auto v2 = v;
|
|
auto v2 = v;
|
|
return v2.index() == v.index() &&
|
|
return v2.index() == v.index() &&
|
|
v2.index() == Idx &&
|
|
v2.index() == Idx &&
|
|
- std::get<Idx>(v2) == std::get<Idx>(v);
|
|
|
|
|
|
+ std::get<Idx>(v2) == std::get<Idx>(v);
|
|
}
|
|
}
|
|
|
|
|
|
void test_constexpr_copy_ctor_extension() {
|
|
void test_constexpr_copy_ctor_extension() {
|
|
-#ifdef _LIBCPP_VERSION
|
|
|
|
|
|
+#if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER)
|
|
using V = std::variant<long, void*, const int>;
|
|
using V = std::variant<long, void*, const int>;
|
|
- static_assert(std::is_trivially_copyable<V>::value, "");
|
|
|
|
|
|
+#ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
|
|
|
|
+ static_assert(std::is_trivially_destructible<V>::value, "");
|
|
static_assert(std::is_trivially_copy_constructible<V>::value, "");
|
|
static_assert(std::is_trivially_copy_constructible<V>::value, "");
|
|
|
|
+ static_assert(std::is_trivially_move_constructible<V>::value, "");
|
|
|
|
+ static_assert(!std::is_copy_assignable<V>::value, "");
|
|
|
|
+ static_assert(!std::is_move_assignable<V>::value, "");
|
|
|
|
+#else
|
|
|
|
+ static_assert(std::is_trivially_copyable<V>::value, "");
|
|
|
|
+#endif
|
|
static_assert(test_constexpr_copy_ctor_extension_imp<0>(V(42l)), "");
|
|
static_assert(test_constexpr_copy_ctor_extension_imp<0>(V(42l)), "");
|
|
static_assert(test_constexpr_copy_ctor_extension_imp<1>(V(nullptr)), "");
|
|
static_assert(test_constexpr_copy_ctor_extension_imp<1>(V(nullptr)), "");
|
|
static_assert(test_constexpr_copy_ctor_extension_imp<2>(V(101)), "");
|
|
static_assert(test_constexpr_copy_ctor_extension_imp<2>(V(101)), "");
|