[libcxx] r303953 - Remove incorrect #ifdef guards around variant tests.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu May 25 18:27:08 PDT 2017


Author: ericwf
Date: Thu May 25 20:27:08 2017
New Revision: 303953

URL: http://llvm.org/viewvc/llvm-project?rev=303953&view=rev
Log:
Remove incorrect #ifdef guards around variant tests.

The tests were previously guarded by #if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER),
which is both incorrect (e.g. _LIBCPP_VERSION) and unneeded. Although the tests are
technically non-standard (yet) they are supported by both libc++ and MSVC's STL.

libstdc++ doesn't regularly use the test suite so I'm not concerned about guarding these
tests for them.

Modified:
    libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
    libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp

Modified: libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp?rev=303953&r1=303952&r2=303953&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp Thu May 25 20:27:08 2017
@@ -149,7 +149,7 @@ constexpr bool test_constexpr_copy_ctor_
 }
 
 void test_constexpr_copy_ctor_extension() {
-#if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER)
+  // NOTE: This test is for not yet standardized behavior.
   using V = std::variant<long, void*, const int>;
 #ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_destructible<V>::value, "");
@@ -163,7 +163,6 @@ void test_constexpr_copy_ctor_extension(
   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<2>(V(101)), "");
-#endif
 }
 
 int main() {

Modified: libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp?rev=303953&r1=303952&r2=303953&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp Thu May 25 20:27:08 2017
@@ -186,7 +186,7 @@ constexpr bool test_constexpr_ctor_exten
 }
 
 void test_constexpr_move_ctor_extension() {
-#if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER)
+  // NOTE: This test is for not yet standardized behavior.
   using V = std::variant<long, void*, const int>;
 #ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_destructible<V>::value, "");
@@ -201,7 +201,6 @@ void test_constexpr_move_ctor_extension(
   static_assert(test_constexpr_ctor_extension_imp<0>(V(42l)), "");
   static_assert(test_constexpr_ctor_extension_imp<1>(V(nullptr)), "");
   static_assert(test_constexpr_ctor_extension_imp<2>(V(101)), "");
-#endif
 }
 
 int main() {




More information about the cfe-commits mailing list