summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/associative/multimap
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-06-30 15:11:53 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-06-30 15:11:53 +0000
commit497677449be6f4a19b6b692dccab3b23e7cfd872 (patch)
treec194cf777fd0b44f992ab9b96d8406aa7f212ef5 /libcxx/test/std/containers/associative/multimap
parent2d1938be0d21f0e4c8b79db722b361969d90538a (diff)
downloadbcm5719-llvm-497677449be6f4a19b6b692dccab3b23e7cfd872.tar.gz
bcm5719-llvm-497677449be6f4a19b6b692dccab3b23e7cfd872.zip
Implement LWG#2436: 'Comparators for associative containers should always be CopyConstructible'
llvm-svn: 274235
Diffstat (limited to 'libcxx/test/std/containers/associative/multimap')
-rw-r--r--libcxx/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
new file mode 100644
index 00000000000..e6f6c3efee5
--- /dev/null
+++ b/libcxx/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <map>
+
+// Check that std::multimap fails to instantiate if the comparison predicate is
+// not copy-constructible. This is LWG issue 2436
+
+#include <map>
+
+template <class T>
+struct Comp {
+ bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
+
+ Comp () {}
+private:
+ Comp (const Comp &); // declared but not defined
+ };
+
+
+int main() {
+ std::multimap<int, int, Comp<int> > m;
+}
OpenPOWER on IntegriCloud