Add more tests for LWG#2582. No code changes needed, just tests.

llvm-svn: 275211
This commit is contained in:
Marshall Clow 2016-07-12 20:15:46 +00:00
parent 5868e5dde9
commit 10e8bef1d4
26 changed files with 48 additions and 20 deletions

View File

@ -47,14 +47,15 @@ void test_array()
typedef char array[3];
typedef const char const_array[3];
typedef char incomplete_array[];
struct incomplete_type;
struct Incomplete;
int main()
{
test_array<array>();
test_array<const_array>();
test_array<incomplete_array>();
test_array<Incomplete[]>();
// LWG#2581
static_assert(!std::is_array<incomplete_type>::value, "");
// LWG#2582
static_assert(!std::is_array<Incomplete>::value, "");
}

View File

@ -53,7 +53,8 @@ struct incomplete_type;
int main()
{
test_class<Class>();
test_class<incomplete_type>();
// LWG#2581
// LWG#2582
static_assert( std::is_class<incomplete_type>::value, "");
}

View File

@ -51,6 +51,6 @@ int main()
{
test_enum<Enum>();
// LWG#2581
// LWG#2582
static_assert(!std::is_enum<incomplete_type>::value, "");
}

View File

@ -52,6 +52,6 @@ int main()
test_floating_point<double>();
test_floating_point<long double>();
// LWG#2581
// LWG#2582
static_assert(!std::is_floating_point<incomplete_type>::value, "");
}

View File

@ -88,6 +88,6 @@ int main()
TEST_REF_QUALIFIED( int (double, char, ...) );
#endif
// LWG#2581
// LWG#2582
static_assert(!std::is_function<incomplete_type>::value, "");
}

View File

@ -66,6 +66,6 @@ int main()
test_integral<__uint128_t>();
#endif
// LWG#2581
// LWG#2582
static_assert(!std::is_integral<incomplete_type>::value, "");
}

View File

@ -90,5 +90,5 @@ int main()
test_is_not_array<Empty>();
test_is_not_array<bit_zero>();
test_is_not_array<NotEmpty>();
test_is_not_array<incomplete_type>(); // LWG#2581
test_is_not_array<incomplete_type>(); // LWG#2582
}

View File

@ -41,6 +41,6 @@ int main()
test_lvalue_ref<int&>();
test_lvalue_ref<const int&>();
// LWG#2581
// LWG#2582
static_assert(!std::is_lvalue_reference<incomplete_type>::value, "");
}

View File

@ -136,6 +136,6 @@ int main()
test_member_function_pointer<void (Class::*)(int, char,...) const volatile &&>();
#endif
// LWG#2581
// LWG#2582
static_assert(!std::is_member_function_pointer<incomplete_type>::value, "");
}

View File

@ -76,6 +76,6 @@ int main()
test_member_function_pointer<void (Class::*)(int, ...) volatile>();
test_member_function_pointer<void (Class::*)(int, char, ...) volatile>();
// LWG#2581
// LWG#2582
static_assert(!std::is_member_function_pointer<incomplete_type>::value, "");
}

View File

@ -54,6 +54,6 @@ int main()
{
test_member_object_pointer<int Class::*>();
// LWG#2581
// LWG#2582
static_assert(!std::is_member_object_pointer<incomplete_type>::value, "");
}

View File

@ -51,7 +51,7 @@ int main()
{
test_nullptr<std::nullptr_t>();
// LWG#2581
// LWG#2582
static_assert(!std::is_null_pointer<incomplete_type>::value, "");
}
#else

View File

@ -54,6 +54,6 @@ int main()
test_pointer<const int*>();
test_pointer<void (*)(int)>();
// LWG#2581
// LWG#2582
static_assert(!std::is_pointer<incomplete_type>::value, "");
}

View File

@ -43,7 +43,7 @@ int main()
test_rvalue_ref<int&&>();
test_rvalue_ref<const int&&>();
// LWG#2581
// LWG#2582
static_assert(!std::is_rvalue_reference<incomplete_type>::value, "");
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}

View File

@ -56,6 +56,6 @@ int main()
{
test_union<Union>();
// LWG#2581
// LWG#2582
static_assert(!std::is_union<incomplete_type>::value, "");
}

View File

@ -50,6 +50,6 @@ int main()
{
test_void<void>();
// LWG#2581
// LWG#2582
static_assert(!std::is_void<incomplete_type>::value, "");
}

View File

@ -38,9 +38,12 @@ typedef char array[3];
typedef const char const_array[3];
typedef char incomplete_array[];
class incomplete_type;
int main()
{
test_array<array>();
test_array<const_array>();
test_array<incomplete_array>();
test_array<incomplete_type[]>();
}

View File

@ -38,7 +38,10 @@ class Class
{
};
class incomplete_type;
int main()
{
test_class<Class>();
test_class<incomplete_type>();
}

View File

@ -45,6 +45,8 @@ void test_is_not_arithmetic()
#endif
}
class incomplete_type;
class Empty
{
};
@ -98,6 +100,7 @@ int main()
test_is_not_arithmetic<Enum>();
test_is_not_arithmetic<FunctionPtr>();
test_is_not_arithmetic<Empty>();
test_is_not_arithmetic<incomplete_type>();
test_is_not_arithmetic<bit_zero>();
test_is_not_arithmetic<NotEmpty>();
test_is_not_arithmetic<Abstract>();

View File

@ -45,6 +45,8 @@ void test_is_not_compound()
#endif
}
class incomplete_type;
class Empty
{
};
@ -81,6 +83,7 @@ int main()
test_is_compound<int&&>();
test_is_compound<Union>();
test_is_compound<Empty>();
test_is_compound<incomplete_type>();
test_is_compound<bit_zero>();
test_is_compound<int*>();
test_is_compound<const int*>();

View File

@ -45,6 +45,8 @@ void test_is_not_fundamental()
#endif
}
class incomplete_type;
class Empty
{
};
@ -103,6 +105,7 @@ int main()
test_is_not_fundamental<int&&>();
test_is_not_fundamental<Union>();
test_is_not_fundamental<Empty>();
test_is_not_fundamental<incomplete_type>();
test_is_not_fundamental<bit_zero>();
test_is_not_fundamental<int*>();
test_is_not_fundamental<const int*>();

View File

@ -45,6 +45,8 @@ void test_is_not_member_pointer()
#endif
}
class incomplete_type;
class Empty
{
};
@ -93,6 +95,7 @@ int main()
test_is_not_member_pointer<char[]>();
test_is_not_member_pointer<Union>();
test_is_not_member_pointer<Empty>();
test_is_not_member_pointer<incomplete_type>();
test_is_not_member_pointer<bit_zero>();
test_is_not_member_pointer<NotEmpty>();
test_is_not_member_pointer<Abstract>();

View File

@ -45,6 +45,8 @@ void test_is_not_object()
#endif
}
class incomplete_type;
class Empty
{
};
@ -86,7 +88,7 @@ int main()
test_is_object<int*>();
test_is_object<const int*>();
test_is_object<Enum>();
test_is_object<Empty>();
test_is_object<incomplete_type>();
test_is_object<bit_zero>();
test_is_object<NotEmpty>();
test_is_object<Abstract>();

View File

@ -45,6 +45,8 @@ void test_is_not_reference()
#endif
}
class incomplete_type;
class Empty
{
};
@ -87,6 +89,7 @@ int main()
test_is_not_reference<void *>();
test_is_not_reference<FunctionPtr>();
test_is_not_reference<Union>();
test_is_not_reference<incomplete_type>();
test_is_not_reference<Empty>();
test_is_not_reference<bit_zero>();
test_is_not_reference<int*>();

View File

@ -45,6 +45,8 @@ void test_is_not_scalar()
#endif
}
class incomplete_type;
class Empty
{
};
@ -104,6 +106,7 @@ int main()
test_is_not_scalar<char[]>();
test_is_not_scalar<Union>();
test_is_not_scalar<Empty>();
test_is_not_scalar<incomplete_type>();
test_is_not_scalar<bit_zero>();
test_is_not_scalar<NotEmpty>();
test_is_not_scalar<Abstract>();

View File

@ -254,7 +254,7 @@
<tr><td><a href="http://wg21.link/LWG2577">2577</a></td><td><tt>{shared,unique}_lock</tt> should use <tt>std::addressof</tt></td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2579">2579</a></td><td>Inconsistency wrt Allocators in <tt>basic_string</tt> assignment vs. <tt>basic_string::assign</tt></td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2581">2581</a></td><td>Specialization of <tt>&lt;type_traits&gt;</tt> variable templates should be prohibited</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2582">2582</a></td><td>&sect;[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traits</td><td>Jacksonville</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2582">2582</a></td><td>&sect;[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traits</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2583">2583</a></td><td>There is no way to supply an allocator for <tt>basic_string(str, pos)</tt></td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2585">2585</a></td><td><tt>forward_list::resize(size_type, const value_type&amp;)</tt> effects incorrect</td><td>Jacksonville</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2586">2586</a></td><td>Wrong value category used in <tt>scoped_allocator_adaptor::construct()</tt></td><td>Jacksonville</td><td></td></tr>