[PATCH] D27029: [libc++] [test] Unbreak variant::swap test for non-libc++ libraries

Casey Carter via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 22 17:35:43 PST 2016


CaseyCarter created this revision.
CaseyCarter added reviewers: EricWF, mclow.lists.
CaseyCarter added a subscriber: cfe-commits.

`LIBCPP_ONLY(foo;)` at namespace scope is bad, and it should feel bad.


https://reviews.llvm.org/D27029

Files:
  test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp


Index: test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
===================================================================
--- test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
+++ test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
@@ -577,10 +577,10 @@
   }
 }
 
-
+#ifdef _LIBCPP_VERSION
 // This is why variant should SFINAE member swap. :-)
-LIBCPP_ONLY(template class std::variant<int, NotSwappable>;)
-
+template class std::variant<int, NotSwappable>;
+#endif
 
 int main() {
   test_swap_valueless_by_exception();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27029.79008.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161123/663d4565/attachment.bin>


More information about the cfe-commits mailing list