Index: test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp =================================================================== --- test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp +++ test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp @@ -11,9 +11,11 @@ // Increment iterator past end. -#if _LIBCPP_DEBUG >= 1 +// UNSUPPORTED: libcpp-no-exceptions -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_DEBUG 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -33,8 +35,12 @@ C::iterator i = c.begin(); ++i; assert(i == c.end()); - ++i; - assert(false); + try + { + ++i; + assert(false); + } + catch(int) {} } #if __cplusplus >= 201103L { @@ -45,16 +51,12 @@ C::iterator i = c.begin(); ++i; assert(i == c.end()); - ++i; - assert(false); + try + { + ++i; + assert(false); + } + catch(int) {} } #endif } - -#else - -int main() -{ -} - -#endif Index: test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp =================================================================== --- test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp +++ test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp @@ -11,9 +11,11 @@ // Dereference non-dereferenceable iterator. -#if _LIBCPP_DEBUG >= 1 +// UNSUPPORTED: libcpp-no-exceptions -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_DEBUG 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -31,8 +33,12 @@ C c; c.insert(std::make_pair(1, "one")); C::iterator i = c.end(); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #if __cplusplus >= 201103L { @@ -41,16 +47,12 @@ C c; c.insert(std::make_pair(1, "one")); C::iterator i = c.end(); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #endif } - -#else - -int main() -{ -} - -#endif Index: test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp =================================================================== --- test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp +++ test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp @@ -1,57 +1,57 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Increment local_iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef std::unordered_map C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#if __cplusplus >= 201103L - { - typedef std::unordered_map, std::equal_to, - min_allocator>> C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#endif - -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Increment local_iterator past end. + +// UNSUPPORTED: libcpp-no-exceptions + +#define _LIBCPP_DEBUG 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef std::unordered_map C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#if __cplusplus >= 201103L + { + typedef std::unordered_map, std::equal_to, + min_allocator>> C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#endif + +} Index: test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp =================================================================== --- test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp +++ test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp @@ -11,9 +11,11 @@ // Dereference non-dereferenceable iterator. -#if _LIBCPP_DEBUG >= 1 +// UNSUPPORTED: libcpp-no-exceptions -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_DEBUG 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -30,8 +32,12 @@ typedef std::unordered_map C; C c(1); C::local_iterator i = c.end(0); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #if __cplusplus >= 201103L { @@ -39,16 +45,12 @@ min_allocator>> C; C c(1); C::local_iterator i = c.end(0); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #endif } - -#else - -int main() -{ -} - -#endif Index: test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp @@ -11,8 +11,10 @@ // template iterator emplace(const_iterator pos, Args&&... args); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -118,8 +120,12 @@ { std::vector c1; std::vector c2; - std::vector::iterator i = c1.emplace(c2.cbegin(), 2, 3.5); - assert(false); + try + { + std::vector::iterator i = c1.emplace(c2.cbegin(), 2, 3.5); + assert(false); + } + catch(int) {} } #endif #if TEST_STD_VER >= 11 @@ -151,8 +157,12 @@ { std::vector> c1; std::vector> c2; - std::vector>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5); - assert(false); + try + { + std::vector>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5); + assert(false); + } + catch(int) {} } #endif #endif Index: test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp @@ -11,9 +11,11 @@ // Call erase(const_iterator position) with end() +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -28,16 +30,24 @@ int a1[] = {1, 2, 3}; std::vector l1(a1, a1+3); std::vector::const_iterator i = l1.end(); - l1.erase(i); - assert(false); + try + { + l1.erase(i); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { int a1[] = {1, 2, 3}; std::vector> l1(a1, a1+3); std::vector>::const_iterator i = l1.end(); - l1.erase(i); - assert(false); + try + { + l1.erase(i); + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp @@ -11,9 +11,11 @@ // Call erase(const_iterator position) with iterator from another container +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -29,8 +31,12 @@ std::vector l1(a1, a1+3); std::vector l2(a1, a1+3); std::vector::const_iterator i = l2.begin(); - l1.erase(i); - assert(false); + try + { + l1.erase(i); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { @@ -38,8 +44,12 @@ std::vector> l1(a1, a1+3); std::vector> l2(a1, a1+3); std::vector>::const_iterator i = l2.begin(); - l1.erase(i); - assert(false); + try + { + l1.erase(i); + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp @@ -11,9 +11,11 @@ // Call erase(const_iterator first, const_iterator last); with first iterator from another container +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -28,16 +30,24 @@ int a1[] = {1, 2, 3}; std::vector l1(a1, a1+3); std::vector l2(a1, a1+3); - std::vector::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1); - assert(false); + try + { + std::vector::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { int a1[] = {1, 2, 3}; std::vector> l1(a1, a1+3); std::vector> l2(a1, a1+3); - std::vector>::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1); - assert(false); + try + { + std::vector>::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1); + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp @@ -11,9 +11,11 @@ // Call erase(const_iterator first, const_iterator last); with second iterator from another container +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -28,16 +30,24 @@ int a1[] = {1, 2, 3}; std::vector l1(a1, a1+3); std::vector l2(a1, a1+3); - std::vector::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1); - assert(false); + try + { + std::vector::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { int a1[] = {1, 2, 3}; std::vector> l1(a1, a1+3); std::vector> l2(a1, a1+3); - std::vector>::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1); - assert(false); + try + { + std::vector>::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1); + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp @@ -11,9 +11,11 @@ // Call erase(const_iterator first, const_iterator last); with both iterators from another container +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -28,16 +30,24 @@ int a1[] = {1, 2, 3}; std::vector l1(a1, a1+3); std::vector l2(a1, a1+3); - std::vector::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1); - assert(false); + try + { + std::vector::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { int a1[] = {1, 2, 3}; std::vector> l1(a1, a1+3); std::vector> l2(a1, a1+3); - std::vector>::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1); - assert(false); + try + { + std::vector>::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1); + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp @@ -11,9 +11,11 @@ // Call erase(const_iterator first, const_iterator last); with a bad range +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -27,15 +29,23 @@ { int a1[] = {1, 2, 3}; std::vector l1(a1, a1+3); - std::vector::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin()); - assert(false); + try + { + std::vector::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin()); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { int a1[] = {1, 2, 3}; std::vector> l1(a1, a1+3); - std::vector>::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin()); - assert(false); + try + { + std::vector>::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin()); + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp @@ -12,8 +12,10 @@ // template // iterator insert(const_iterator position, Iter first, Iter last); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -135,9 +137,13 @@ std::vector v2(100); int a[] = {1, 2, 3, 4, 5}; const int N = sizeof(a)/sizeof(a[0]); - std::vector::iterator i = v.insert(v2.cbegin() + 10, input_iterator(a), - input_iterator(a+N)); - assert(false); + try + { + std::vector::iterator i = v.insert(v2.cbegin() + 10, input_iterator(a), + input_iterator(a+N)); + assert(false); + } + catch(int) {} } #endif #if TEST_STD_VER >= 11 @@ -181,9 +187,13 @@ std::vector> v2(100); int a[] = {1, 2, 3, 4, 5}; const int N = sizeof(a)/sizeof(a[0]); - std::vector>::iterator i = v.insert(v2.cbegin() + 10, input_iterator(a), - input_iterator(a+N)); - assert(false); + try + { + std::vector>::iterator i = v.insert(v2.cbegin() + 10, input_iterator(a), + input_iterator(a+N)); + assert(false); + } + catch(int) {} } #endif #endif Index: test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp @@ -11,8 +11,10 @@ // iterator insert(const_iterator position, value_type&& x); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -55,8 +57,12 @@ { std::vector v1(3); std::vector v2(3); - v1.insert(v2.begin(), 4); - assert(false); + try + { + v1.insert(v2.begin(), 4); + assert(false); + } + catch(int) {} } #endif #if TEST_STD_VER >= 11 @@ -77,8 +83,12 @@ { std::vector> v1(3); std::vector> v2(3); - v1.insert(v2.begin(), 4); - assert(false); + try + { + v1.insert(v2.begin(), 4); + assert(false); + } + catch(int) {} } #endif #endif Index: test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp @@ -11,8 +11,10 @@ // iterator insert(const_iterator position, size_type n, const value_type& x); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -87,8 +89,12 @@ { std::vector c1(100); std::vector c2; - std::vector::iterator i = c1.insert(c2.cbegin() + 10, 5, 1); - assert(false); + try + { + std::vector::iterator i = c1.insert(c2.cbegin() + 10, 5, 1); + assert(false); + } + catch(int) {} } #endif #if TEST_STD_VER >= 11 @@ -124,8 +130,12 @@ { std::vector> c1(100); std::vector> c2; - std::vector>::iterator i = c1.insert(c2.cbegin() + 10, 5, 1); - assert(false); + try + { + std::vector>::iterator i = c1.insert(c2.cbegin() + 10, 5, 1); + assert(false); + } + catch(int) {} } #endif #endif Index: test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp @@ -11,8 +11,10 @@ // iterator insert(const_iterator position, const value_type& x); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -85,8 +87,12 @@ std::vector v1(3); std::vector v2(3); int i = 4; - v1.insert(v2.begin(), i); - assert(false); + try + { + v1.insert(v2.begin(), i); + assert(false); + } + catch(int) {} } #endif #if TEST_STD_VER >= 11 @@ -108,8 +114,12 @@ std::vector> v1(3); std::vector> v2(3); int i = 4; - v1.insert(v2.begin(), i); - assert(false); + try + { + v1.insert(v2.begin(), i); + assert(false); + } + catch(int) {} } #endif #endif Index: test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp @@ -11,8 +11,10 @@ // void pop_back(); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -35,8 +37,12 @@ c.pop_back(); assert(c.size() == 0); #if _LIBCPP_DEBUG >= 1 - c.pop_back(); - assert(false); + try + { + c.pop_back(); + assert(false); + } + catch(int) {} #endif } #if TEST_STD_VER >= 11 @@ -47,8 +53,12 @@ c.pop_back(); assert(c.size() == 0); #if _LIBCPP_DEBUG >= 1 - c.pop_back(); - assert(false); + try + { + c.pop_back(); + assert(false); + } + catch(int) {} #endif } #endif Index: test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp +++ test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp @@ -12,8 +12,10 @@ // template // void swap(vector& x, vector& y); +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #endif #include @@ -34,8 +36,12 @@ swap(c1, c2); c1.erase(i2); c2.erase(i1); - c1.erase(i1); - assert(false); + try + { + c1.erase(i1); + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { @@ -48,8 +54,12 @@ swap(c1, c2); c1.erase(i2); c2.erase(i1); - c1.erase(i1); - assert(false); + try + { + c1.erase(i1); + assert(false); + } + catch(int) {} } #endif #endif Index: test/std/containers/unord/unord.multimap/db_iterators_7.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/db_iterators_7.pass.cpp +++ test/std/containers/unord/unord.multimap/db_iterators_7.pass.cpp @@ -11,9 +11,11 @@ // Increment iterator past end. +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -33,8 +35,12 @@ C::iterator i = c.begin(); ++i; assert(i == c.end()); - ++i; - assert(false); + try + { + ++i; + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { @@ -45,8 +51,12 @@ C::iterator i = c.begin(); ++i; assert(i == c.end()); - ++i; - assert(false); + try + { + ++i; + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/unord/unord.multimap/db_iterators_8.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/db_iterators_8.pass.cpp +++ test/std/containers/unord/unord.multimap/db_iterators_8.pass.cpp @@ -11,9 +11,11 @@ // Dereference non-dereferenceable iterator. +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -31,8 +33,12 @@ C c; c.insert(std::make_pair(1, "one")); C::iterator i = c.end(); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { @@ -41,8 +47,12 @@ C c; c.insert(std::make_pair(1, "one")); C::iterator i = c.end(); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp +++ test/std/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp @@ -1,57 +1,65 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Increment local_iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef std::unordered_multimap C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef std::unordered_multimap, std::equal_to, - min_allocator>> C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#endif - -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Increment local_iterator past end. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef std::unordered_multimap C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef std::unordered_multimap, std::equal_to, + min_allocator>> C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#endif + +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp =================================================================== --- test/std/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp +++ test/std/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp @@ -11,9 +11,11 @@ // Dereference non-dereferenceable iterator. +// UNSUPPORTED: libcpp-no-exceptions + #if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) #include #include @@ -30,8 +32,12 @@ typedef std::unordered_multimap C; C c(1); C::local_iterator i = c.end(0); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #if TEST_STD_VER >= 11 { @@ -39,8 +45,12 @@ min_allocator>> C; C c(1); C::local_iterator i = c.end(0); - C::value_type j = *i; - assert(false); + try + { + C::value_type j = *i; + assert(false); + } + catch(int) {} } #endif } Index: test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp =================================================================== --- test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp +++ test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp @@ -1,58 +1,69 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Increment iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_multiset C; - C c(1); - C::iterator i = c.begin(); - ++i; - assert(i == c.end()); - ++i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_multiset> C; - C c(1); - C::iterator i = c.begin(); - ++i; - assert(i == c.end()); - ++i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Increment iterator past end. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_multiset C; + C c; + c.insert(T()); + C::iterator i = c.begin(); + ++i; + assert(i == c.end()); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_multiset, std::equal_to, min_allocator> C; + C c({T()}); + C::iterator i = c.begin(); + ++i; + assert(i == c.end()); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#endif +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp =================================================================== --- test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp +++ test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp @@ -1,54 +1,64 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Dereference non-dereferenceable iterator. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_multiset C; - C c(1); - C::iterator i = c.end(); - T j = *i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_multiset> C; - C c(1); - C::iterator i = c.end(); - T j = *i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Dereference non-dereferenceable iterator. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_multiset C; + C c(1); + C::iterator i = c.end(); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_multiset, std::equal_to, min_allocator> C; + C c(1); + C::iterator i = c.end(); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#endif +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp =================================================================== --- test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp +++ test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp @@ -1,57 +1,65 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Increment local_iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_multiset C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_multiset> C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#endif - -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Increment local_iterator past end. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_multiset C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_multiset, std::equal_to, min_allocator> C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#endif + +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp =================================================================== --- test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp +++ test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp @@ -1,54 +1,64 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Dereference non-dereferenceable iterator. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_multiset C; - C c(1); - C::local_iterator i = c.end(0); - T j = *i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_multiset> C; - C c(1); - C::local_iterator i = c.end(0); - T j = *i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Dereference non-dereferenceable iterator. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_multiset C; + C c(1); + C::local_iterator i = c.end(0); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_multiset, std::equal_to, min_allocator> C; + C c(1); + C::local_iterator i = c.end(0); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#endif +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.set/db_iterators_7.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/db_iterators_7.pass.cpp +++ test/std/containers/unord/unord.set/db_iterators_7.pass.cpp @@ -1,58 +1,69 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Increment iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_set C; - C c(1); - C::iterator i = c.begin(); - ++i; - assert(i == c.end()); - ++i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_set> C; - C c(1); - C::iterator i = c.begin(); - ++i; - assert(i == c.end()); - ++i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Increment iterator past end. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_set C; + C c; + c.insert(1); + C::iterator i = c.begin(); + ++i; + assert(i == c.end()); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_set, std::equal_to, min_allocator> C; + C c({1}); + C::iterator i = c.begin(); + ++i; + assert(i == c.end()); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#endif +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.set/db_iterators_8.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/db_iterators_8.pass.cpp +++ test/std/containers/unord/unord.set/db_iterators_8.pass.cpp @@ -1,54 +1,64 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Dereference non-dereferenceable iterator. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_set C; - C c(1); - C::iterator i = c.end(); - T j = *i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_set> C; - C c(1); - C::iterator i = c.end(); - T j = *i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Dereference non-dereferenceable iterator. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_set C; + C c(1); + C::iterator i = c.end(); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_set, std::equal_to, min_allocator> C; + C c(1); + C::iterator i = c.end(); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#endif +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp +++ test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp @@ -1,57 +1,65 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Increment local_iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_set C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_set> C; - C c(1); - C::local_iterator i = c.begin(0); - ++i; - ++i; - assert(false); - } -#endif - -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Increment local_iterator past end. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_set C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_set, std::equal_to, min_allocator> C; + C c(1); + C::local_iterator i = c.begin(0); + try + { + ++i; + assert(false); + } + catch(int) {} + } +#endif + +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp +++ test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp @@ -1,54 +1,64 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Dereference non-dereferenceable iterator. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include -#include -#include -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::unordered_set C; - C c(1); - C::local_iterator i = c.end(0); - T j = *i; - assert(false); - } -#if TEST_STD_VER >= 11 - { - typedef int T; - typedef std::unordered_set> C; - C c(1); - C::local_iterator i = c.end(0); - T j = *i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// Dereference non-dereferenceable iterator. + +// UNSUPPORTED: libcpp-no-exceptions + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw int()) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::unordered_set C; + C c(1); + C::local_iterator i = c.end(0); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#if TEST_STD_VER >= 11 + { + typedef int T; + typedef std::unordered_set, std::equal_to, min_allocator> C; + C c(1); + C::local_iterator i = c.end(0); + try + { + T j = *i; + assert(false); + } + catch(int) {} + } +#endif +} + +#else + +int main() +{ +} + +#endif Index: test/std/containers/unord/unord.set/emplace_hint.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/emplace_hint.pass.cpp +++ test/std/containers/unord/unord.set/emplace_hint.pass.cpp @@ -1,80 +1,80 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator> -// class unordered_set - -// template -// iterator emplace_hint(const_iterator p, Args&&... args); - -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include -#include - -#include "../../Emplaceable.h" -#include "min_allocator.h" - -int main() -{ -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - typedef std::unordered_set C; - typedef C::iterator R; - C c; - C::const_iterator e = c.end(); - R r = c.emplace_hint(e); - assert(c.size() == 1); - assert(*r == Emplaceable()); - - r = c.emplace_hint(e, Emplaceable(5, 6)); - assert(c.size() == 2); - assert(*r == Emplaceable(5, 6)); - - r = c.emplace_hint(r, 5, 6); - assert(c.size() == 2); - assert(*r == Emplaceable(5, 6)); - } -#if TEST_STD_VER >= 11 - { - typedef std::unordered_set, - std::equal_to, min_allocator> C; - typedef C::iterator R; - C c; - C::const_iterator e = c.end(); - R r = c.emplace_hint(e); - assert(c.size() == 1); - assert(*r == Emplaceable()); - - r = c.emplace_hint(e, Emplaceable(5, 6)); - assert(c.size() == 2); - assert(*r == Emplaceable(5, 6)); - - r = c.emplace_hint(r, 5, 6); - assert(c.size() == 2); - assert(*r == Emplaceable(5, 6)); - } -#endif -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_set C; - typedef C::iterator R; - C c1; - C c2; - R r = c1.emplace_hint(c2.begin(), 5, 6); - assert(false); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// template , class Pred = equal_to, +// class Alloc = allocator> +// class unordered_set + +// template +// iterator emplace_hint(const_iterator p, Args&&... args); + +#if _LIBCPP_DEBUG >= 1 +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#endif + +#include +#include + +#include "../../Emplaceable.h" +#include "min_allocator.h" + +int main() +{ +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + { + typedef std::unordered_set C; + typedef C::iterator R; + C c; + C::const_iterator e = c.end(); + R r = c.emplace_hint(e); + assert(c.size() == 1); + assert(*r == Emplaceable()); + + r = c.emplace_hint(c.end(), Emplaceable(5, 6)); + assert(c.size() == 2); + assert(*r == Emplaceable(5, 6)); + + r = c.emplace_hint(r, 5, 6); + assert(c.size() == 2); + assert(*r == Emplaceable(5, 6)); + } +#if TEST_STD_VER >= 11 + { + typedef std::unordered_set, + std::equal_to, min_allocator> C; + typedef C::iterator R; + C c; + C::const_iterator e = c.end(); + R r = c.emplace_hint(e); + assert(c.size() == 1); + assert(*r == Emplaceable()); + + r = c.emplace_hint(c.end(), Emplaceable(5, 6)); + assert(c.size() == 2); + assert(*r == Emplaceable(5, 6)); + + r = c.emplace_hint(r, 5, 6); + assert(c.size() == 2); + assert(*r == Emplaceable(5, 6)); + } +#endif +#if _LIBCPP_DEBUG >= 1 + { + typedef std::unordered_set C; + typedef C::iterator R; + C c1; + C c2; + R r = c1.emplace_hint(c2.begin(), 5, 6); + assert(false); + } +#endif +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +} Index: test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp +++ test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp @@ -1,89 +1,89 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator> -// class unordered_set - -// iterator insert(const_iterator p, const value_type& x); - -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include -#include - -#include "min_allocator.h" - -int main() -{ - { - typedef std::unordered_set C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(4.5)); - assert(c.size() == 2); - assert(*r == 4.5); - - r = c.insert(e, P(5.5)); - assert(c.size() == 3); - assert(*r == 5.5); - } -#if TEST_STD_VER >= 11 - { - typedef std::unordered_set, - std::equal_to, min_allocator> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(4.5)); - assert(c.size() == 2); - assert(*r == 4.5); - - r = c.insert(e, P(5.5)); - assert(c.size() == 3); - assert(*r == 5.5); - } -#endif -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_set C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C c2; - C::const_iterator e = c2.end(); - P v(3.5); - R r = c.insert(e, v); - assert(false); - } -#endif -} +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// template , class Pred = equal_to, +// class Alloc = allocator> +// class unordered_set + +// iterator insert(const_iterator p, const value_type& x); + +#if _LIBCPP_DEBUG >= 1 +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#endif + +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef std::unordered_set C; + typedef C::iterator R; + typedef C::value_type P; + C c; + C::const_iterator e = c.end(); + R r = c.insert(e, P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(c.end(), P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(c.end(), P(4.5)); + assert(c.size() == 2); + assert(*r == 4.5); + + r = c.insert(c.end(), P(5.5)); + assert(c.size() == 3); + assert(*r == 5.5); + } +#if TEST_STD_VER >= 11 + { + typedef std::unordered_set, + std::equal_to, min_allocator> C; + typedef C::iterator R; + typedef C::value_type P; + C c; + C::const_iterator e = c.end(); + R r = c.insert(e, P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(c.end(), P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(c.end(), P(4.5)); + assert(c.size() == 2); + assert(*r == 4.5); + + r = c.insert(c.end(), P(5.5)); + assert(c.size() == 3); + assert(*r == 5.5); + } +#endif +#if _LIBCPP_DEBUG >= 1 + { + typedef std::unordered_set C; + typedef C::iterator R; + typedef C::value_type P; + C c; + C c2; + C::const_iterator e = c2.end(); + P v(3.5); + R r = c.insert(e, v); + assert(false); + } +#endif +} Index: test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp =================================================================== --- test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp +++ test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp @@ -1,138 +1,138 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator> -// class unordered_set - -// iterator insert(const_iterator p, value_type&& x); - -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include -#include - -#include "MoveOnly.h" -#include "min_allocator.h" - -int main() -{ - { - typedef std::unordered_set C; - typedef C::iterator R; - typedef double P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(r, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(4.5)); - assert(c.size() == 2); - assert(*r == 4.5); - - r = c.insert(e, P(5.5)); - assert(c.size() == 3); - assert(*r == 5.5); - } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - typedef std::unordered_set C; - typedef C::iterator R; - typedef MoveOnly P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3)); - assert(c.size() == 1); - assert(*r == 3); - - r = c.insert(r, P(3)); - assert(c.size() == 1); - assert(*r == 3); - - r = c.insert(e, P(4)); - assert(c.size() == 2); - assert(*r == 4); - - r = c.insert(e, P(5)); - assert(c.size() == 3); - assert(*r == 5); - } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 - { - typedef std::unordered_set, - std::equal_to, min_allocator> C; - typedef C::iterator R; - typedef double P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(r, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(4.5)); - assert(c.size() == 2); - assert(*r == 4.5); - - r = c.insert(e, P(5.5)); - assert(c.size() == 3); - assert(*r == 5.5); - } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - typedef std::unordered_set, - std::equal_to, min_allocator> C; - typedef C::iterator R; - typedef MoveOnly P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3)); - assert(c.size() == 1); - assert(*r == 3); - - r = c.insert(r, P(3)); - assert(c.size() == 1); - assert(*r == 3); - - r = c.insert(e, P(4)); - assert(c.size() == 2); - assert(*r == 4); - - r = c.insert(e, P(5)); - assert(c.size() == 3); - assert(*r == 5); - } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_set C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C c2; - C::const_iterator e = c2.end(); - R r = c.insert(e, P(3.5)); - assert(false); - } -#endif -#endif -} +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// template , class Pred = equal_to, +// class Alloc = allocator> +// class unordered_set + +// iterator insert(const_iterator p, value_type&& x); + +#if _LIBCPP_DEBUG >= 1 +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) +#endif + +#include +#include + +#include "MoveOnly.h" +#include "min_allocator.h" + +int main() +{ + { + typedef std::unordered_set C; + typedef C::iterator R; + typedef double P; + C c; + C::const_iterator e = c.end(); + R r = c.insert(e, P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(r, P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(c.end(), P(4.5)); + assert(c.size() == 2); + assert(*r == 4.5); + + r = c.insert(c.end(), P(5.5)); + assert(c.size() == 3); + assert(*r == 5.5); + } +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + { + typedef std::unordered_set C; + typedef C::iterator R; + typedef MoveOnly P; + C c; + C::const_iterator e = c.end(); + R r = c.insert(e, P(3)); + assert(c.size() == 1); + assert(*r == 3); + + r = c.insert(r, P(3)); + assert(c.size() == 1); + assert(*r == 3); + + r = c.insert(c.end(), P(4)); + assert(c.size() == 2); + assert(*r == 4); + + r = c.insert(c.end(), P(5)); + assert(c.size() == 3); + assert(*r == 5); + } +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 + { + typedef std::unordered_set, + std::equal_to, min_allocator> C; + typedef C::iterator R; + typedef double P; + C c; + C::const_iterator e = c.end(); + R r = c.insert(e, P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(r, P(3.5)); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(c.end(), P(4.5)); + assert(c.size() == 2); + assert(*r == 4.5); + + r = c.insert(c.end(), P(5.5)); + assert(c.size() == 3); + assert(*r == 5.5); + } +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + { + typedef std::unordered_set, + std::equal_to, min_allocator> C; + typedef C::iterator R; + typedef MoveOnly P; + C c; + C::const_iterator e = c.end(); + R r = c.insert(e, P(3)); + assert(c.size() == 1); + assert(*r == 3); + + r = c.insert(r, P(3)); + assert(c.size() == 1); + assert(*r == 3); + + r = c.insert(c.end(), P(4)); + assert(c.size() == 2); + assert(*r == 4); + + r = c.insert(c.end(), P(5)); + assert(c.size() == 3); + assert(*r == 5); + } +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if _LIBCPP_DEBUG >= 1 + { + typedef std::unordered_set C; + typedef C::iterator R; + typedef C::value_type P; + C c; + C c2; + C::const_iterator e = c2.end(); + R r = c.insert(e, P(3.5)); + assert(false); + } +#endif +#endif +}