Author: marshall Date: Tue Jun 30 13:15:41 2015 New Revision: 241091 URL: http://llvm.org/viewvc/llvm-project?rev=241091&view=rev Log: 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>
Added: libcxx/trunk/test/std/containers/associative/map/map.ops/count0.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/count1.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/count2.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/count3.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/find0.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/find1.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/find2.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/find3.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp Modified: libcxx/trunk/include/map libcxx/trunk/test/std/containers/associative/map/map.ops/count.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/find.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp Modified: libcxx/trunk/include/map URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/map?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/include/map (original) +++ libcxx/trunk/include/map Tue Jun 30 13:15:41 2015 @@ -1117,7 +1117,7 @@ public: 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 @@ public: 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) Modified: libcxx/trunk/test/std/containers/associative/map/map.ops/count.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/count.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/count.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/count.pass.cpp Tue Jun 30 13:15:41 2015 @@ -18,6 +18,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -133,6 +134,25 @@ int main() 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); } { Added: libcxx/trunk/test/std/containers/associative/map/map.ops/count0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/count0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/count0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/count0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/map/map.ops/count1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/count1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/count1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/count1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/count2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/count2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/count2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/count2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/count3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/count3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/count3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/count3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range.pass.cpp Tue Jun 30 13:15:41 2015 @@ -19,6 +19,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -365,6 +366,58 @@ int main() 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; Added: libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/map/map.ops/find.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/find.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/find.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/find.pass.cpp Tue Jun 30 13:15:41 2015 @@ -19,6 +19,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -200,6 +201,25 @@ int main() 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)); } { Added: libcxx/trunk/test/std/containers/associative/map/map.ops/find0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/find0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/find0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/find0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/map/map.ops/find1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/find1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/find1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/find1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/find2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/find2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/find2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/find2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/find3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/find3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/find3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/find3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp Tue Jun 30 13:15:41 2015 @@ -19,6 +19,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -280,6 +281,41 @@ int main() 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)); } { Added: libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp Tue Jun 30 13:15:41 2015 @@ -18,6 +18,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -122,6 +123,21 @@ int main() 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); } { Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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 @@ int main() 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()); } { Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp Tue Jun 30 13:15:41 2015 @@ -19,6 +19,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -174,6 +175,19 @@ int main() 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()); } { Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp Tue Jun 30 13:15:41 2015 @@ -19,6 +19,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -183,6 +184,21 @@ int main() 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()); } { Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp?rev=241091&r1=241090&r2=241091&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp Tue Jun 30 13:15:41 2015 @@ -19,6 +19,7 @@ #include "min_allocator.h" #include "private_constructor.hpp" +#include "is_transparent.h" int main() { @@ -183,6 +184,20 @@ int main() 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)); } { Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp Tue Jun 30 13:15:41 2015 @@ -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}); +} Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 Added: libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp?rev=241091&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp (added) +++ libcxx/trunk/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp Tue Jun 30 13:15:41 2015 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits