Remove undefined behavior from tests; specifically, ensure that the value type of the allocators match the value type of the containers

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@254030 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-11-24 22:10:51 +00:00
parent 5e00a713ed
commit eefcf8206e
14 changed files with 59 additions and 49 deletions

View File

@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{