summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-11-26 01:24:04 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-11-26 01:24:04 +0000
commit94f89aeec5eb6a720f734b84523451d92206c0bb (patch)
treefb38a79ecab4d5d03195d749bc89bc3420849ba7 /libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp
parentbcd150362aff56aafdecb5545b36a50c00c63cd5 (diff)
downloadbcm5719-llvm-94f89aeec5eb6a720f734b84523451d92206c0bb.tar.gz
bcm5719-llvm-94f89aeec5eb6a720f734b84523451d92206c0bb.zip
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.
llvm-svn: 254119
Diffstat (limited to 'libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp')
-rw-r--r--libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp b/libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp
new file mode 100644
index 00000000000..6905d934486
--- /dev/null
+++ b/libcxx/test/std/containers/associative/set/allocator_mismatch.fail.cpp
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+// The container's value type must be the same as the allocator's value type
+
+#include <set>
+
+int main()
+{
+ std::set<int, std::less<int>, std::allocator<long> > s;
+}
OpenPOWER on IntegriCloud