[libcxx-commits] [PATCH] D61829: LWG issue 3024

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun May 12 09:57:42 PDT 2019


zoecarver updated this revision to Diff 199170.
zoecarver added a comment.

- fix name (oops)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61829/new/

https://reviews.llvm.org/D61829

Files:
  test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp
  www/cxx2a_status.html


Index: www/cxx2a_status.html
===================================================================
--- www/cxx2a_status.html
+++ www/cxx2a_status.html
@@ -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>
Index: test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp
===================================================================
--- /dev/null
+++ test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp
@@ -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}}
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61829.199170.patch
Type: text/x-patch
Size: 2677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190512/53622a23/attachment.bin>


More information about the libcxx-commits mailing list