Add static_assert to set/multiset/map/multimap/forward_list/deque that the allocator's value_type match the container's value_type. vector/unordered/list/string already do this. Add tests for all the containers to verify this.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@254119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
18
test/std/strings/basic.string/allocator_mismatch.fail.cpp
Normal file
18
test/std/strings/basic.string/allocator_mismatch.fail.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
// The container's value type must be the same as the allocator's value type
|
||||
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::basic_string<char, std::char_traits<char>, std::allocator<int> > s;
|
||||
}
|
Reference in New Issue
Block a user