summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-06-30 18:15:41 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-06-30 18:15:41 +0000
commitf8457a0735899ba71b7bb321cf88ff48b54c9d30 (patch)
treea1c8b315114dab918f4bb1f8a200aec9db9d475d /libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
parentd9f09858a45aaeb1e258e41b04d6f78c345fbd8d (diff)
downloadbcm5719-llvm-f8457a0735899ba71b7bb321cf88ff48b54c9d30.tar.gz
bcm5719-llvm-f8457a0735899ba71b7bb321cf88ff48b54c9d30.zip
Add tests for LWG#2299. While doing so, I noticed that the tests we have for the transparent comparators don't actually call them. Fix those tests, too. Now one of them is failing, due to a missing const in <map>. Add that (twice). Next step is to do the same for <unordered_map>
llvm-svn: 241091
Diffstat (limited to 'libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp')
-rw-r--r--libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
new file mode 100644
index 00000000000..18f2c7b71fd
--- /dev/null
+++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// class map
+
+// iterator lower_bound(const key_type& k);
+// const_iterator lower_bound(const key_type& k) const;
+//
+// The member function templates find, count, lower_bound, upper_bound, and
+// equal_range shall not participate in overload resolution unless the
+// qualified-id Compare::is_transparent is valid and denotes a type
+
+
+#include <map>
+#include <cassert>
+
+#include "is_transparent.h"
+
+#if _LIBCPP_STD_VER <= 11
+#error "This test requires is C++14 (or later)"
+#else
+
+int main()
+{
+ {
+ typedef std::map<int, double, transparent_less_not_a_type> M;
+
+ M().lower_bound(C2Int{5});
+ }
+}
+#endif
OpenPOWER on IntegriCloud