[libcxx] Reorganize tests since the application of P0602R4
Summary: P0602R4 makes the special member functions of optional and variant conditionally trivial based on the types in the optional/variant. We already implemented that, but the tests were organized as if this were a non-standard extension. This patch reorganizes the tests in a way that makes more sense since this is not an extension anymore. Reviewers: EricWF, mpark, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54772 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// optional<T>& operator=(const optional<T>& rhs);
|
||||
// optional<T>& operator=(const optional<T>& rhs); // constexpr in C++20
|
||||
|
||||
#include <optional>
|
||||
#include <type_traits>
|
||||
@@ -53,15 +53,19 @@ int main()
|
||||
{
|
||||
{
|
||||
using O = optional<int>;
|
||||
#if TEST_STD_VER > 17
|
||||
LIBCPP_STATIC_ASSERT(assign_empty(O{42}), "");
|
||||
LIBCPP_STATIC_ASSERT(assign_value(O{42}), "");
|
||||
#endif
|
||||
assert(assign_empty(O{42}));
|
||||
assert(assign_value(O{42}));
|
||||
}
|
||||
{
|
||||
using O = optional<TrivialTestTypes::TestType>;
|
||||
#if TEST_STD_VER > 17
|
||||
LIBCPP_STATIC_ASSERT(assign_empty(O{42}), "");
|
||||
LIBCPP_STATIC_ASSERT(assign_value(O{42}), "");
|
||||
#endif
|
||||
assert(assign_empty(O{42}));
|
||||
assert(assign_value(O{42}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user