diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2019-05-13 14:56:02 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2019-05-13 14:56:02 +0000 |
commit | 98c7c4fad25df52b8a4c7a6e1fa65824b84a813f (patch) | |
tree | 33686b32b2fe2768c2a1d1d6932eb939d4d35c00 | |
parent | 05dafb1c97de8f3dbb8a883f96c6ae452dcc6ef4 (diff) | |
download | bcm5719-llvm-98c7c4fad25df52b8a4c7a6e1fa65824b84a813f.tar.gz bcm5719-llvm-98c7c4fad25df52b8a4c7a6e1fa65824b84a813f.zip |
Add a test for LWG#3204 and mark it as complete. Reviewed as https://reviews.llvm.org/D61829 Thanks to Zoe for the patch.
llvm-svn: 360586
-rw-r--r-- | libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp | 33 | ||||
-rw-r--r-- | libcxx/www/cxx2a_status.html | 2 |
2 files changed, 34 insertions, 1 deletions
diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.fail.cpp new file mode 100644 index 00000000000..46e26e71384 --- /dev/null +++ b/libcxx/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}} +} diff --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html index ecdb6ae9113..9b06a4e4939 100644 --- a/libcxx/www/cxx2a_status.html +++ b/libcxx/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> |