Update issue status for LWG 2744
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -153,7 +153,7 @@ void test_copy_assign_throws()
|
||||
|
||||
assert(Tp::count == 1);
|
||||
assertEmpty<Tp>(lhs);
|
||||
assertContains<Tp>(rhs);
|
||||
assertContains<Tp>(rhs, 1);
|
||||
}
|
||||
{
|
||||
any lhs((small(2)));
|
||||
@@ -166,7 +166,7 @@ void test_copy_assign_throws()
|
||||
assert(small::count == 1);
|
||||
assert(Tp::count == 1);
|
||||
assertContains<small>(lhs, 2);
|
||||
assertContains<Tp>(rhs);
|
||||
assertContains<Tp>(rhs, 1);
|
||||
}
|
||||
{
|
||||
any lhs((large(2)));
|
||||
@@ -179,7 +179,7 @@ void test_copy_assign_throws()
|
||||
assert(large::count == 1);
|
||||
assert(Tp::count == 1);
|
||||
assertContains<large>(lhs, 2);
|
||||
assertContains<Tp>(rhs);
|
||||
assertContains<Tp>(rhs, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -172,15 +172,15 @@ void test_assign_throws() {
|
||||
// * std::in_place type.
|
||||
// * Non-copyable types
|
||||
void test_sfinae_constraints() {
|
||||
{
|
||||
{ // Only the constructors are required to SFINAE on in_place_t
|
||||
using Tag = std::in_place_type_t<int>;
|
||||
using RawTag = std::remove_reference_t<Tag>;
|
||||
static_assert(!std::is_assignable<std::any, RawTag&&>::value, "");
|
||||
static_assert(std::is_assignable<std::any, RawTag&&>::value, "");
|
||||
}
|
||||
{
|
||||
struct Dummy { Dummy() = delete; };
|
||||
using T = std::in_place_type_t<Dummy>;
|
||||
static_assert(!std::is_assignable<std::any, T>::value, "");
|
||||
static_assert(std::is_assignable<std::any, T>::value, "");
|
||||
}
|
||||
{
|
||||
// Test that the ValueType&& constructor SFINAE's away when the
|
||||
|
||||
@@ -108,17 +108,12 @@ void test_copy_move_value() {
|
||||
|
||||
// Test that any(ValueType&&) is *never* selected for a std::in_place type.
|
||||
void test_sfinae_constraints() {
|
||||
using Tag = std::in_place_type_t<int>;
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wignored-qualifiers"
|
||||
#endif
|
||||
static_assert(std::is_same<Tag, const Tag>::value, "");
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
using BadTag = std::in_place_type_t<int>;
|
||||
using OKTag = std::in_place_t;
|
||||
using OKDecay = std::decay_t<OKTag>;
|
||||
// Test that the tag type is properly handled in SFINAE
|
||||
Tag t = std::in_place;
|
||||
BadTag t = std::in_place;
|
||||
OKTag ot = std::in_place;
|
||||
{
|
||||
std::any a(t);
|
||||
assertContains<int>(a, 0);
|
||||
@@ -127,11 +122,24 @@ void test_sfinae_constraints() {
|
||||
std::any a(std::move(t));
|
||||
assertContains<int>(a, 0);
|
||||
}
|
||||
{
|
||||
std::any a(ot);
|
||||
assertContains<OKDecay>(a, ot);
|
||||
}
|
||||
{
|
||||
OKDecay d = ot;
|
||||
std::any a(d);
|
||||
assertContains<OKDecay>(a, ot);
|
||||
}
|
||||
{
|
||||
struct Dummy { Dummy() = delete; };
|
||||
using T = std::in_place_type_t<Dummy>;
|
||||
static_assert(!std::is_constructible<std::any, T>::value, "");
|
||||
}
|
||||
{
|
||||
using DecayTag = std::decay_t<BadTag>;
|
||||
static_assert(!std::is_constructible<std::any, DecayTag>::value, "");
|
||||
}
|
||||
{
|
||||
// Test that the ValueType&& constructor SFINAE's away when the
|
||||
// argument is non-copyable
|
||||
|
||||
@@ -53,7 +53,7 @@ int main()
|
||||
{
|
||||
any a(large(1));
|
||||
assert(large::count == 1);
|
||||
assertContains<large>(a);
|
||||
assertContains<large>(a, 1);
|
||||
|
||||
a.reset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user