aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp')
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp b/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
new file mode 100644
index 000000000000..e6f6c3efee5b
--- /dev/null
+++ b/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;
+}