[libcxx-commits] [libcxx] r360586 - Add a test for LWG#3204 and mark it as complete. Reviewed as https://reviews.llvm.org/D61829 Thanks to Zoe for the patch.

Marshall Clow via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 13 07:56:02 PDT 2019


Author: marshall
Date: Mon May 13 07:56:02 2019
New Revision: 360586

URL: http://llvm.org/viewvc/llvm-project?rev=360586&view=rev
Log:
Add a test for LWG#3204 and mark it as complete. Reviewed as https://reviews.llvm.org/D61829  Thanks to Zoe for the patch.

Added:
    libcxx/trunk/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp
Modified:
    libcxx/trunk/www/cxx2a_status.html

Added: libcxx/trunk/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp?rev=360586&view=auto
==============================================================================
--- libcxx/trunk/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp (added)
+++ libcxx/trunk/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp Mon May 13 07:56:02 2019
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// LWG issue 3024
+
+#include <variant>
+#include <type_traits>
+
+struct NotCopyConstructible
+{
+    NotCopyConstructible() = default;
+    NotCopyConstructible(NotCopyConstructible const&) = delete;
+};
+
+int main(int, char**)
+{
+    static_assert(!std::is_copy_constructible_v<NotCopyConstructible>);
+
+    std::variant<NotCopyConstructible> v;
+    std::variant<NotCopyConstructible> v1;
+    std::variant<NotCopyConstructible> v2(v); // expected-error {{call to implicitly-deleted copy constructor of 'std::variant<NotCopyConstructible>'}}
+    v1 = v; // expected-error {{object of type 'std::__1::variant<NotCopyConstructible>' cannot be assigned because its copy assignment operator is implicitly deleted}}
+}

Modified: libcxx/trunk/www/cxx2a_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx2a_status.html?rev=360586&r1=360585&r2=360586&view=diff
==============================================================================
--- libcxx/trunk/www/cxx2a_status.html (original)
+++ libcxx/trunk/www/cxx2a_status.html Mon May 13 07:56:02 2019
@@ -213,7 +213,7 @@
 	<tr><td><a href="https://wg21.link/LWG2993">2993</a></td><td>reference_wrapper<T> conversion from T&&</td><td>Albuquerque</td><td></td></tr>
 	<tr><td><a href="https://wg21.link/LWG2998">2998</a></td><td>Requirements on function objects passed to {forward_,}list-specific algorithms</td><td>Albuquerque</td><td><i>Nothing to do</i></td></tr>
 	<tr><td><a href="https://wg21.link/LWG3001">3001</a></td><td>weak_ptr::element_type needs remove_extent_t</td><td>Albuquerque</td><td></td></tr>
-	<tr><td><a href="https://wg21.link/LWG3024">3024</a></td><td>variant's copies must be deleted instead of disabled via SFINAE</td><td>Albuquerque</td><td></td></tr>
+	<tr><td><a href="https://wg21.link/LWG3024">3024</a></td><td>variant's copies must be deleted instead of disabled via SFINAE</td><td>Albuquerque</td><td>Complete</td></tr>
 
  	<tr><td></td><td></td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/LWG2164">2164</a></td><td>What are the semantics of <tt>vector.emplace(vector.begin(), vector.back())</tt>?</td><td>Jacksonville</td><td>Complete</td></tr>




More information about the libcxx-commits mailing list