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>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
07546f3b93
commit
58113db00c
@ -1117,7 +1117,7 @@ public:
|
|||||||
template <typename _K2>
|
template <typename _K2>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
|
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
|
#endif
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
iterator lower_bound(const key_type& __k)
|
iterator lower_bound(const key_type& __k)
|
||||||
@ -1850,7 +1850,7 @@ public:
|
|||||||
template <typename _K2>
|
template <typename _K2>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
|
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
|
#endif
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
iterator lower_bound(const key_type& __k)
|
iterator lower_bound(const key_type& __k)
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -133,6 +134,25 @@ int main()
|
|||||||
assert(r == 1);
|
assert(r == 1);
|
||||||
r = m.count(4);
|
r = m.count(4);
|
||||||
assert(r == 0);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
34
test/std/containers/associative/map/map.ops/count0.pass.cpp
Normal file
34
test/std/containers/associative/map/map.ops/count0.pass.cpp
Normal file
@ -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});
|
||||||
|
}
|
39
test/std/containers/associative/map/map.ops/count1.fail.cpp
Normal file
39
test/std/containers/associative/map/map.ops/count1.fail.cpp
Normal file
@ -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
|
39
test/std/containers/associative/map/map.ops/count2.fail.cpp
Normal file
39
test/std/containers/associative/map/map.ops/count2.fail.cpp
Normal file
@ -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
|
39
test/std/containers/associative/map/map.ops/count3.fail.cpp
Normal file
39
test/std/containers/associative/map/map.ops/count3.fail.cpp
Normal file
@ -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
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -365,6 +366,58 @@ int main()
|
|||||||
r = m.equal_range(20);
|
r = m.equal_range(20);
|
||||||
assert(r.first == next(m.begin(), 8));
|
assert(r.first == next(m.begin(), 8));
|
||||||
assert(r.second == 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;
|
typedef PrivateConstructor PC;
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -200,6 +201,25 @@ int main()
|
|||||||
assert(r == next(m.begin(), 7));
|
assert(r == next(m.begin(), 7));
|
||||||
r = m.find(4);
|
r = m.find(4);
|
||||||
assert(r == next(m.begin(), 8));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
34
test/std/containers/associative/map/map.ops/find0.pass.cpp
Normal file
34
test/std/containers/associative/map/map.ops/find0.pass.cpp
Normal file
@ -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});
|
||||||
|
}
|
39
test/std/containers/associative/map/map.ops/find1.fail.cpp
Normal file
39
test/std/containers/associative/map/map.ops/find1.fail.cpp
Normal file
@ -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
|
39
test/std/containers/associative/map/map.ops/find2.fail.cpp
Normal file
39
test/std/containers/associative/map/map.ops/find2.fail.cpp
Normal file
@ -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
|
39
test/std/containers/associative/map/map.ops/find3.fail.cpp
Normal file
39
test/std/containers/associative/map/map.ops/find3.fail.cpp
Normal file
@ -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
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -280,6 +281,41 @@ int main()
|
|||||||
assert(r == next(m.begin(), 7));
|
assert(r == next(m.begin(), 7));
|
||||||
r = m.lower_bound(20);
|
r = m.lower_bound(20);
|
||||||
assert(r == next(m.begin(), 8));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -122,6 +123,21 @@ int main()
|
|||||||
assert(r == 3);
|
assert(r == 3);
|
||||||
r = m.count(10);
|
r = m.count(10);
|
||||||
assert(r == 0);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -7,7 +7,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// <map>
|
// <multimap>
|
||||||
|
|
||||||
// class multimap
|
// class multimap
|
||||||
|
|
||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -219,6 +220,28 @@ int main()
|
|||||||
r = m.equal_range(10);
|
r = m.equal_range(10);
|
||||||
assert(r.first == m.end());
|
assert(r.first == m.end());
|
||||||
assert(r.second == 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());
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -174,6 +175,19 @@ int main()
|
|||||||
assert(r == next(m.begin(), 6));
|
assert(r == next(m.begin(), 6));
|
||||||
r = m.find(10);
|
r = m.find(10);
|
||||||
assert(r == m.end());
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -183,6 +184,21 @@ int main()
|
|||||||
assert(r == next(m.begin(), 6));
|
assert(r == next(m.begin(), 6));
|
||||||
r = m.lower_bound(10);
|
r = m.lower_bound(10);
|
||||||
assert(r == m.end());
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
#include "private_constructor.hpp"
|
#include "private_constructor.hpp"
|
||||||
|
#include "is_transparent.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -183,6 +184,20 @@ int main()
|
|||||||
assert(r == next(m.begin(), 9));
|
assert(r == next(m.begin(), 9));
|
||||||
r = m.upper_bound(10);
|
r = m.upper_bound(10);
|
||||||
assert(r == m.end());
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -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});
|
||||||
|
}
|
@ -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
|
@ -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
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user