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
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: f8457a0735899ba71b7bb321cf88ff48b54c9d30
diff --git a/include/map b/include/map
index 14eb4eb..cdcf405 100644
--- a/include/map
+++ b/include/map
@@ -1117,7 +1117,7 @@
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
- count(const _K2& __k) {return __tree_.__count_unique(__k);}
+ count(const _K2& __k) const {return __tree_.__count_unique(__k);}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -1850,7 +1850,7 @@
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
- count(const _K2& __k) {return __tree_.__count_multi(__k);}
+ count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
diff --git a/test/std/containers/associative/map/map.ops/count.pass.cpp b/test/std/containers/associative/map/map.ops/count.pass.cpp
index 9668055..ae87ae8 100644
--- a/test/std/containers/associative/map/map.ops/count.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/count.pass.cpp
@@ -18,6 +18,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -133,6 +134,25 @@
assert(r == 1);
r = m.count(4);
assert(r == 0);
+
+ r = m.count(C2Int(5));
+ assert(r == 1);
+ r = m.count(C2Int(6));
+ assert(r == 1);
+ r = m.count(C2Int(7));
+ assert(r == 1);
+ r = m.count(C2Int(8));
+ assert(r == 1);
+ r = m.count(C2Int(9));
+ assert(r == 1);
+ r = m.count(C2Int(10));
+ assert(r == 1);
+ r = m.count(C2Int(11));
+ assert(r == 1);
+ r = m.count(C2Int(12));
+ assert(r == 1);
+ r = m.count(C2Int(4));
+ assert(r == 0);
}
{
diff --git a/test/std/containers/associative/map/map.ops/count0.pass.cpp b/test/std/containers/associative/map/map.ops/count0.pass.cpp
new file mode 100644
index 0000000..ce54936
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/count0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class map
+
+// iterator find(const key_type& k);
+// const_iterator find(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"
+
+int main()
+{
+ typedef std::map<int, double, transparent_less> M;
+
+ M().count(C2Int{5});
+}
diff --git a/test/std/containers/associative/map/map.ops/count1.fail.cpp b/test/std/containers/associative/map/map.ops/count1.fail.cpp
new file mode 100644
index 0000000..9c15059
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/count1.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 find(const key_type& k);
+// const_iterator find(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_no_type> M;
+
+ M().count(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/count2.fail.cpp b/test/std/containers/associative/map/map.ops/count2.fail.cpp
new file mode 100644
index 0000000..7aa1553
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/count2.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 find(const key_type& k);
+// const_iterator find(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_private> M;
+
+ M().count(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/count3.fail.cpp b/test/std/containers/associative/map/map.ops/count3.fail.cpp
new file mode 100644
index 0000000..7e7bb8f
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/count3.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 find(const key_type& k);
+// const_iterator find(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().count(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/equal_range.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range.pass.cpp
index dff751c..a71149a 100644
--- a/test/std/containers/associative/map/map.ops/equal_range.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range.pass.cpp
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -365,6 +366,58 @@
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
+
+ r = m.equal_range(C2Int(5));
+ assert(r.first == next(m.begin(), 0));
+ assert(r.second == next(m.begin(), 1));
+ r = m.equal_range(C2Int(7));
+ assert(r.first == next(m.begin(), 1));
+ assert(r.second == next(m.begin(), 2));
+ r = m.equal_range(C2Int(9));
+ assert(r.first == next(m.begin(), 2));
+ assert(r.second == next(m.begin(), 3));
+ r = m.equal_range(C2Int(11));
+ assert(r.first == next(m.begin(), 3));
+ assert(r.second == next(m.begin(), 4));
+ r = m.equal_range(C2Int(13));
+ assert(r.first == next(m.begin(), 4));
+ assert(r.second == next(m.begin(), 5));
+ r = m.equal_range(C2Int(15));
+ assert(r.first == next(m.begin(), 5));
+ assert(r.second == next(m.begin(), 6));
+ r = m.equal_range(C2Int(17));
+ assert(r.first == next(m.begin(), 6));
+ assert(r.second == next(m.begin(), 7));
+ r = m.equal_range(C2Int(19));
+ assert(r.first == next(m.begin(), 7));
+ assert(r.second == next(m.begin(), 8));
+ r = m.equal_range(C2Int(4));
+ assert(r.first == next(m.begin(), 0));
+ assert(r.second == next(m.begin(), 0));
+ r = m.equal_range(C2Int(6));
+ assert(r.first == next(m.begin(), 1));
+ assert(r.second == next(m.begin(), 1));
+ r = m.equal_range(C2Int(8));
+ assert(r.first == next(m.begin(), 2));
+ assert(r.second == next(m.begin(), 2));
+ r = m.equal_range(C2Int(10));
+ assert(r.first == next(m.begin(), 3));
+ assert(r.second == next(m.begin(), 3));
+ r = m.equal_range(C2Int(12));
+ assert(r.first == next(m.begin(), 4));
+ assert(r.second == next(m.begin(), 4));
+ r = m.equal_range(C2Int(14));
+ assert(r.first == next(m.begin(), 5));
+ assert(r.second == next(m.begin(), 5));
+ r = m.equal_range(C2Int(16));
+ assert(r.first == next(m.begin(), 6));
+ assert(r.second == next(m.begin(), 6));
+ r = m.equal_range(C2Int(18));
+ assert(r.first == next(m.begin(), 7));
+ assert(r.second == next(m.begin(), 7));
+ r = m.equal_range(C2Int(20));
+ assert(r.first == next(m.begin(), 8));
+ assert(r.second == next(m.begin(), 8));
}
{
typedef PrivateConstructor PC;
diff --git a/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp
new file mode 100644
index 0000000..c95c3df
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class map
+
+// iterator find(const key_type& k);
+// const_iterator find(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"
+
+int main()
+{
+ typedef std::map<int, double, transparent_less> M;
+
+ M().equal_range(C2Int{5});
+}
diff --git a/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
new file mode 100644
index 0000000..8f0da08
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/equal_range1.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 find(const key_type& k);
+// const_iterator find(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_no_type> M;
+
+ M().equal_range(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
new file mode 100644
index 0000000..e73122d
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/equal_range2.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 find(const key_type& k);
+// const_iterator find(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_private> M;
+
+ M().equal_range(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
new file mode 100644
index 0000000..bb72e9e
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/equal_range3.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 find(const key_type& k);
+// const_iterator find(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().equal_range(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/find.pass.cpp b/test/std/containers/associative/map/map.ops/find.pass.cpp
index a757844..17463b6 100644
--- a/test/std/containers/associative/map/map.ops/find.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/find.pass.cpp
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -200,6 +201,25 @@
assert(r == next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
+
+ r = m.find(C2Int(5));
+ assert(r == m.begin());
+ r = m.find(C2Int(6));
+ assert(r == next(m.begin()));
+ r = m.find(C2Int(7));
+ assert(r == next(m.begin(), 2));
+ r = m.find(C2Int(8));
+ assert(r == next(m.begin(), 3));
+ r = m.find(C2Int(9));
+ assert(r == next(m.begin(), 4));
+ r = m.find(C2Int(10));
+ assert(r == next(m.begin(), 5));
+ r = m.find(C2Int(11));
+ assert(r == next(m.begin(), 6));
+ r = m.find(C2Int(12));
+ assert(r == next(m.begin(), 7));
+ r = m.find(C2Int(4));
+ assert(r == next(m.begin(), 8));
}
{
diff --git a/test/std/containers/associative/map/map.ops/find0.pass.cpp b/test/std/containers/associative/map/map.ops/find0.pass.cpp
new file mode 100644
index 0000000..5f310b0
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/find0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class map
+
+// iterator find(const key_type& k);
+// const_iterator find(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"
+
+int main()
+{
+ typedef std::map<int, double, transparent_less> M;
+
+ M().find(C2Int{5});
+}
diff --git a/test/std/containers/associative/map/map.ops/find1.fail.cpp b/test/std/containers/associative/map/map.ops/find1.fail.cpp
new file mode 100644
index 0000000..c33b5a9
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/find1.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 find(const key_type& k);
+// const_iterator find(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_no_type> M;
+
+ M().find(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/find2.fail.cpp b/test/std/containers/associative/map/map.ops/find2.fail.cpp
new file mode 100644
index 0000000..40bf323
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/find2.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 find(const key_type& k);
+// const_iterator find(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_private> M;
+
+ M().find(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/find3.fail.cpp b/test/std/containers/associative/map/map.ops/find3.fail.cpp
new file mode 100644
index 0000000..9526c0e
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/find3.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 find(const key_type& k);
+// const_iterator find(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().find(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp b/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp
index 87b84ee..3cbfbf7 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -280,6 +281,41 @@
assert(r == next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
+
+ r = m.lower_bound(C2Int(5));
+ assert(r == m.begin());
+ r = m.lower_bound(C2Int(7));
+ assert(r == next(m.begin()));
+ r = m.lower_bound(C2Int(9));
+ assert(r == next(m.begin(), 2));
+ r = m.lower_bound(C2Int(11));
+ assert(r == next(m.begin(), 3));
+ r = m.lower_bound(C2Int(13));
+ assert(r == next(m.begin(), 4));
+ r = m.lower_bound(C2Int(15));
+ assert(r == next(m.begin(), 5));
+ r = m.lower_bound(C2Int(17));
+ assert(r == next(m.begin(), 6));
+ r = m.lower_bound(C2Int(19));
+ assert(r == next(m.begin(), 7));
+ r = m.lower_bound(C2Int(4));
+ assert(r == next(m.begin(), 0));
+ r = m.lower_bound(C2Int(6));
+ assert(r == next(m.begin(), 1));
+ r = m.lower_bound(C2Int(8));
+ assert(r == next(m.begin(), 2));
+ r = m.lower_bound(C2Int(10));
+ assert(r == next(m.begin(), 3));
+ r = m.lower_bound(C2Int(12));
+ assert(r == next(m.begin(), 4));
+ r = m.lower_bound(C2Int(14));
+ assert(r == next(m.begin(), 5));
+ r = m.lower_bound(C2Int(16));
+ assert(r == next(m.begin(), 6));
+ r = m.lower_bound(C2Int(18));
+ assert(r == next(m.begin(), 7));
+ r = m.lower_bound(C2Int(20));
+ assert(r == next(m.begin(), 8));
}
{
diff --git a/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp b/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp
new file mode 100644
index 0000000..2fc095a
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <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"
+
+int main()
+{
+ typedef std::map<int, double, transparent_less> M;
+
+ M().lower_bound(C2Int{5});
+}
diff --git a/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
new file mode 100644
index 0000000..a4a986c
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/lower_bound1.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_no_type> M;
+
+ M().lower_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
new file mode 100644
index 0000000..3f6380e
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/lower_bound2.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_private> M;
+
+ M().lower_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
new file mode 100644
index 0000000..18f2c7b
--- /dev/null
+++ b/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
diff --git a/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp b/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp
new file mode 100644
index 0000000..c58e55f
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class map
+
+// iterator upper_bound(const key_type& k);
+// const_iterator upper_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"
+
+int main()
+{
+ typedef std::map<int, double, transparent_less> M;
+
+ M().upper_bound(C2Int{5});
+}
diff --git a/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
new file mode 100644
index 0000000..4647681
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/upper_bound1.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 upper_bound(const key_type& k);
+// const_iterator upper_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_no_type> M;
+
+ M().upper_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
new file mode 100644
index 0000000..11852fe
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/upper_bound2.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 upper_bound(const key_type& k);
+// const_iterator upper_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_private> M;
+
+ M().upper_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
new file mode 100644
index 0000000..9cddeb8
--- /dev/null
+++ b/test/std/containers/associative/map/map.ops/upper_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 upper_bound(const key_type& k);
+// const_iterator upper_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().upper_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp
index 2f172d1..c666c29 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp
@@ -18,6 +18,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -122,6 +123,21 @@
assert(r == 3);
r = m.count(10);
assert(r == 0);
+
+ r = m.count(C2Int(4));
+ assert(r == 0);
+ r = m.count(C2Int(5));
+ assert(r == 3);
+ r = m.count(C2Int(6));
+ assert(r == 0);
+ r = m.count(C2Int(7));
+ assert(r == 3);
+ r = m.count(C2Int(8));
+ assert(r == 0);
+ r = m.count(C2Int(9));
+ assert(r == 3);
+ r = m.count(C2Int(10));
+ assert(r == 0);
}
{
diff --git a/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp
new file mode 100644
index 0000000..7da13bb
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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"
+
+int main()
+{
+ typedef std::multimap<int, double, transparent_less> M;
+
+ M().count(C2Int{5});
+}
diff --git a/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
new file mode 100644
index 0000000..f30d1bf
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_no_type> M;
+
+ M().count(C2Int{5});
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
new file mode 100644
index 0000000..ffb7eb6
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_private> M;
+
+ M().count(C2Int{5});
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
new file mode 100644
index 0000000..4bb9d14
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_not_a_type> M;
+
+ M().count(C2Int{5});
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
index a408796..5a07104 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// <map>
+// <multimap>
// class multimap
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -219,6 +220,28 @@
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());
+
+ r = m.equal_range(C2Int(4));
+ assert(r.first == m.begin());
+ assert(r.second == m.begin());
+ r = m.equal_range(C2Int(5));
+ assert(r.first == m.begin());
+ assert(r.second == next(m.begin(), 3));
+ r = m.equal_range(C2Int(6));
+ assert(r.first == next(m.begin(), 3));
+ assert(r.second == next(m.begin(), 3));
+ r = m.equal_range(C2Int(7));
+ assert(r.first == next(m.begin(), 3));
+ assert(r.second == next(m.begin(), 6));
+ r = m.equal_range(C2Int(8));
+ assert(r.first == next(m.begin(), 6));
+ assert(r.second == next(m.begin(), 6));
+ r = m.equal_range(C2Int(9));
+ assert(r.first == next(m.begin(), 6));
+ assert(r.second == next(m.begin(), 9));
+ r = m.equal_range(C2Int(10));
+ assert(r.first == m.end());
+ assert(r.second == m.end());
}
{
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp
new file mode 100644
index 0000000..c0f0746
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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"
+
+int main()
+{
+ typedef std::multimap<int, double, transparent_less> M;
+
+ M().equal_range(C2Int{5});
+}
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
new file mode 100644
index 0000000..f022e94
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_no_type> M;
+
+ M().equal_range(C2Int{5});
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
new file mode 100644
index 0000000..695e717
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range2.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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_private> M;
+
+ M().equal_range(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
new file mode 100644
index 0000000..59c2855
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range3.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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_not_a_type> M;
+
+ M().equal_range(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
index fb5afa2..a60e42c 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -174,6 +175,19 @@
assert(r == next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
+
+ r = m.find(C2Int(5));
+ assert(r == m.begin());
+ r = m.find(C2Int(6));
+ assert(r == m.end());
+ r = m.find(C2Int(7));
+ assert(r == next(m.begin(), 3));
+ r = m.find(C2Int(8));
+ assert(r == m.end());
+ r = m.find(C2Int(9));
+ assert(r == next(m.begin(), 6));
+ r = m.find(C2Int(10));
+ assert(r == m.end());
}
{
diff --git a/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp
new file mode 100644
index 0000000..4f33698
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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"
+
+int main()
+{
+ typedef std::multimap<int, double, transparent_less> M;
+
+ M().find(C2Int{5});
+}
diff --git a/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
new file mode 100644
index 0000000..e1eef03
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/find1.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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_no_type> M;
+
+ M().find(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
new file mode 100644
index 0000000..4c03f58
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/find2.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 find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_private> M;
+
+ M().find(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
new file mode 100644
index 0000000..f10bc60
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/find3.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 multimap
+
+// iterator find(const key_type& k);
+// const_iterator find(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::multimap<int, double, transparent_less_not_a_type> M;
+
+ M().find(C2Int{5});
+ }
+}
+#endif
\ No newline at end of file
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
index 49cf6de..38b9318 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -183,6 +184,21 @@
assert(r == next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
+
+ r = m.lower_bound(C2Int(4));
+ assert(r == m.begin());
+ r = m.lower_bound(C2Int(5));
+ assert(r == m.begin());
+ r = m.lower_bound(C2Int(6));
+ assert(r == next(m.begin(), 3));
+ r = m.lower_bound(C2Int(7));
+ assert(r == next(m.begin(), 3));
+ r = m.lower_bound(C2Int(8));
+ assert(r == next(m.begin(), 6));
+ r = m.lower_bound(C2Int(9));
+ assert(r == next(m.begin(), 6));
+ r = m.lower_bound(C2Int(10));
+ assert(r == m.end());
}
{
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp
new file mode 100644
index 0000000..c5271f6
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class multimap
+
+// 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"
+
+int main()
+{
+ typedef std::multimap<int, double, transparent_less> M;
+
+ M().lower_bound(C2Int{5});
+}
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
new file mode 100644
index 0000000..b452be8
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.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 multimap
+
+// 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::multimap<int, double, transparent_less_no_type> M;
+
+ M().lower_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
new file mode 100644
index 0000000..a2ba302
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.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 multimap
+
+// 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::multimap<int, double, transparent_less_private> M;
+
+ M().lower_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
new file mode 100644
index 0000000..50d9fca
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.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 multimap
+
+// 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::multimap<int, double, transparent_less_not_a_type> M;
+
+ M().lower_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
index 1920647..7c647a9 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
@@ -19,6 +19,7 @@
#include "min_allocator.h"
#include "private_constructor.hpp"
+#include "is_transparent.h"
int main()
{
@@ -183,6 +184,20 @@
assert(r == next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
+
+ r = m.upper_bound(C2Int(4));
+ assert(r == m.begin());
+ r = m.upper_bound(C2Int(5));
+ assert(r == next(m.begin(), 3));
+ r = m.upper_bound(C2Int(6));
+ assert(r == next(m.begin(), 3));
+ r = m.upper_bound(C2Int(7));
+ assert(r == next(m.begin(), 6));
+ r = m.upper_bound(C2Int(8));
+ assert(r == next(m.begin(), 6));
+ r = m.upper_bound(C2Int(9));
+ assert(r == next(m.begin(), 9));
+ r = m.upper_bound(C2Int(10));
}
{
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp
new file mode 100644
index 0000000..322c6f5
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: c++03, c++11
+
+// <map>
+
+// class multimap
+
+// iterator upper_bound(const key_type& k);
+// const_iterator upper_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"
+
+int main()
+{
+ typedef std::multimap<int, double, transparent_less> M;
+
+ M().upper_bound(C2Int{5});
+}
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
new file mode 100644
index 0000000..bb78ad6
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.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 multimap
+
+// iterator upper_bound(const key_type& k);
+// const_iterator upper_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::multimap<int, double, transparent_less_no_type> M;
+
+ M().upper_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
new file mode 100644
index 0000000..a79d593
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.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 multimap
+
+// iterator upper_bound(const key_type& k);
+// const_iterator upper_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::multimap<int, double, transparent_less_private> M;
+
+ M().upper_bound(C2Int{5});
+ }
+}
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
new file mode 100644
index 0000000..1c1dc74
--- /dev/null
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_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 multimap
+
+// iterator upper_bound(const key_type& k);
+// const_iterator upper_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::multimap<int, double, transparent_less_not_a_type> M;
+
+ M().upper_bound(C2Int{5});
+ }
+}
+#endif