--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+// class Alloc = allocator<pair<const Key, T>>>
+// class unordered_map
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string> C;
+ C c;
+ (void) c.bucket_size(3);
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_map<int, std::string> C;
- C c;
- (void) c.bucket(3);
- assert(false);
- }
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string> C;
+ C c;
+ (void) c.bucket(3);
+ assert(false);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_map<double, int> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C c2;
- C::const_iterator e = c2.end();
- P v(3.5, 3);
- R r = c.insert(e, v);
- assert(false);
- }
+int main(int, char**) {
+ typedef std::unordered_map<double, int> C;
+ typedef C::iterator R;
+ typedef C::value_type P;
+ C c;
+ C c2;
+ C::const_iterator e = c2.end();
+ P v(3.5, 3);
+ R r = c.insert(e, v);
+ assert(false);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_map<double, int> 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, 3));
- assert(false);
- }
+int main(int, char**) {
+ typedef std::unordered_map<double, int> 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, 3));
+ assert(false);
return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c;
+ c.insert(std::make_pair(1, "one"));
+ C::iterator i = c.end();
+ C::value_type j = *i;
+ assert(false);
+
+ return 0;
+}
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#include <unordered_map>
-#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <utility>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_map<int, std::string> C;
C c;
c.insert(std::make_pair(1, "one"));
assert(i == c.end());
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c;
- c.insert(std::make_pair(1, "one"));
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#endif
+
+ return 0;
}
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#include <unordered_map>
-#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <utility>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_map<int, std::string> C;
C c;
c.insert(std::make_pair(1, "one"));
C::iterator i = c.end();
C::value_type j = *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c;
- c.insert(std::make_pair(1, "one"));
- C::iterator i = c.end();
- C::value_type j = *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c;
+ c.insert(std::make_pair(1, "one"));
+ C::iterator i = c.begin();
+ ++i;
+ assert(i == c.end());
+ ++i;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c(1);
+ C::local_iterator i = c.end(0);
+ C::value_type j = *i;
+ assert(false);
+
+ return 0;
+}
#include <unordered_map>
#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_map<int, std::string> C;
C c(1);
C::local_iterator i = c.begin(0);
++i;
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c(1);
- C::local_iterator i = c.begin(0);
- ++i;
- ++i;
- assert(false);
- }
-#endif
+ return 0;
}
#include <unordered_map>
#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_map<int, std::string> C;
C c(1);
C::local_iterator i = c.end(0);
C::value_type j = *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c(1);
- C::local_iterator i = c.end(0);
- C::value_type j = *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c(1);
+ C::local_iterator i = c.begin(0);
+ ++i;
+ ++i;
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
- std::unordered_map<int, int>::iterator i = s1.begin();
- std::pair<const int, int> k = *i;
- std::unordered_map<int, int> s2 = std::move(s1);
- assert(*i == k);
- s2.erase(i);
- assert(s2.size() == 2);
- }
+int main(int, char**) {
+ std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
+ std::unordered_map<int, int>::iterator i = s1.begin();
+ std::pair<const int, int> k = *i;
+ std::unordered_map<int, int> s2 = std::move(s1);
+ assert(*i == k);
+ s2.erase(i);
+ assert(s2.size() == 2);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::pair<int, int> P;
- P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
- P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
- std::unordered_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::unordered_map<int, int>::iterator i1 = c1.begin();
- std::unordered_map<int, int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::unordered_map<int, int>::iterator j = i1;
- c1.erase(i1);
- assert(false);
- }
+int main(int, char**) {
+ typedef std::pair<int, int> P;
+ P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
+ P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
+ std::unordered_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+ std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+ std::unordered_map<int, int>::iterator i1 = c1.begin();
+ std::unordered_map<int, int>::iterator i2 = c2.begin();
+ swap(c1, c2);
+ c1.erase(i2);
+ c2.erase(i1);
+ std::unordered_map<int, int>::iterator j = i1;
+ c1.erase(i1);
+ assert(false);
return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+// class Alloc = allocator<pair<const Key, T>>>
+// class unordered_map
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_map<int, std::string> C;
+ C c;
+ c.max_load_factor(0);
+ assert(false);
+
+ return 0;
+}
#include <unordered_map>
#include <cassert>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_map<int, int> l1(a1, a1+3);
std::unordered_map<int, int>::const_iterator i = l1.end();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <cstdlib>
-#include <exception>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_map<int, int> l1(a1, a1+3);
std::unordered_map<int, int>::const_iterator i = l2.begin();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_map<int, int> l1(a1, a1+3);
std::unordered_map<int, int> l2(a1, a1+3);
std::unordered_map<int, int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_map<int, int> l1(a1, a1+3);
std::unordered_map<int, int> l2(a1, a1+3);
std::unordered_map<int, int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_map<int, int> l1(a1, a1+3);
std::unordered_map<int, int> l2(a1, a1+3);
std::unordered_map<int, int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_map<int, int> l1(a1, a1+3);
std::unordered_map<int, int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
assert(false);
- }
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+// class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string> C;
+ C c;
+ (void) c.bucket(3);
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+// class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string> C;
+ C c;
+ (void) c.bucket_size(3);
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_multimap<double, int> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C c2;
- C::const_iterator e = c2.end();
- P v(3.5, 3);
- R r = c.insert(e, v);
- assert(false);
- }
+int main(int, char**) {
+ typedef std::unordered_multimap<double, int> C;
+ typedef C::iterator R;
+ typedef C::value_type P;
+ C c;
+ C c2;
+ C::const_iterator e = c2.end();
+ P v(3.5, 3);
+ R r = c.insert(e, v);
+ assert(false);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_multimap<double, int> 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, 3));
- assert(false);
- }
+int main(int, char**) {
+ typedef std::unordered_multimap<double, int> 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, 3));
+ assert(false);
return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <cassert>
+#include <functional>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c;
+ c.insert(std::make_pair(1, "one"));
+ C::iterator i = c.end();
+ C::value_type j = *i;
+ assert(false);
+
+ return 0;
+}
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#include <unordered_map>
-#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <utility>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_multimap<int, std::string> C;
C c;
c.insert(std::make_pair(1, "one"));
assert(i == c.end());
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c;
- c.insert(std::make_pair(1, "one"));
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#endif
+
+ return 0;
}
#define _LIBCPP_DEBUG 1
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#include <unordered_map>
-#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <unordered_map>
+#include <utility>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_multimap<int, std::string> C;
C c;
c.insert(std::make_pair(1, "one"));
C::iterator i = c.end();
C::value_type j = *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c;
- c.insert(std::make_pair(1, "one"));
- C::iterator i = c.end();
- C::value_type j = *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <cassert>
+#include <functional>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c;
+ c.insert(std::make_pair(1, "one"));
+ C::iterator i = c.begin();
+ ++i;
+ assert(i == c.end());
+ ++i;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c(1);
+ C::local_iterator i = c.end(0);
+ C::value_type j = *i;
+ assert(false);
+
+ return 0;
+}
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#include <unordered_map>
-#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_multimap<int, std::string> C;
C c(1);
C::local_iterator i = c.begin(0);
++i;
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c(1);
- C::local_iterator i = c.begin(0);
- ++i;
- ++i;
- assert(false);
- }
-#endif
+ return 0;
}
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#include <unordered_map>
-#include <string>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::unordered_multimap<int, std::string> C;
C c(1);
C::local_iterator i = c.end(0);
C::value_type j = *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, std::string>>> C;
- C c(1);
- C::local_iterator i = c.end(0);
- C::value_type j = *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+ min_allocator<std::pair<const int, std::string>>> C;
+ C c(1);
+ C::local_iterator i = c.begin(0);
+ ++i;
+ ++i;
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
- std::unordered_multimap<int, int>::iterator i = s1.begin();
- std::pair<const int, int> k = *i;
- std::unordered_multimap<int, int> s2 = std::move(s1);
- assert(*i == k);
- s2.erase(i);
- assert(s2.size() == 2);
- }
+int main(int, char**) {
+ std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
+ std::unordered_multimap<int, int>::iterator i = s1.begin();
+ std::pair<const int, int> k = *i;
+ std::unordered_multimap<int, int> s2 = std::move(s1);
+ assert(*i == k);
+ s2.erase(i);
+ assert(s2.size() == 2);
return 0;
}
#include <unordered_map>
#include <cassert>
+#include <utility>
#include "test_macros.h"
int main(int, char**)
{
- {
- typedef std::pair<int, int> P;
- P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
- P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
- std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::unordered_multimap<int, int>::iterator i1 = c1.begin();
- std::unordered_multimap<int, int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::unordered_multimap<int, int>::iterator j = i1;
- c1.erase(i1);
- assert(false);
- }
+ typedef std::pair<int, int> P;
+ P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
+ P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
+ std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+ std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+ std::unordered_multimap<int, int>::iterator i1 = c1.begin();
+ std::unordered_multimap<int, int>::iterator i2 = c2.begin();
+ swap(c1, c2);
+ c1.erase(i2);
+ c2.erase(i1);
+ std::unordered_multimap<int, int>::iterator j = i1;
+ c1.erase(i1);
+ assert(false);
return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+// class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_multimap<int, std::string> C;
+ C c;
+ c.max_load_factor(0);
+ assert(false);
+
+ return 0;
+}
#include <unordered_map>
#include <cassert>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_multimap<int, int> l1(a1, a1+3);
std::unordered_multimap<int, int>::const_iterator i = l1.end();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <cstdlib>
-#include <exception>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_multimap<int, int> l1(a1, a1+3);
std::unordered_multimap<int, int>::const_iterator i = l2.begin();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_multimap<int, int> l1(a1, a1+3);
std::unordered_multimap<int, int> l2(a1, a1+3);
std::unordered_multimap<int, int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_multimap<int, int> l1(a1, a1+3);
std::unordered_multimap<int, int> l2(a1, a1+3);
std::unordered_multimap<int, int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_multimap<int, int> l1(a1, a1+3);
std::unordered_multimap<int, int> l2(a1, a1+3);
std::unordered_multimap<int, int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_map>
#include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef std::pair<int, int> P;
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
std::unordered_multimap<int, int> l1(a1, a1+3);
std::unordered_multimap<int, int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
assert(false);
- }
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+// class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_multiset<int> C;
+ C c;
+ (void) c.bucket(3);
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+// class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_multiset<int> C;
+ C c;
+ (void) c.bucket_size(3);
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_multiset<double> 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);
- }
+int main(int, char**) {
+ typedef std::unordered_multiset<double> 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);
return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::iterator i = c.end();
+ (void) *i;
+ assert(false);
+
+ return 0;
+}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_multiset<T> C;
C c(1);
assert(i == c.end());
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#endif
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_multiset<T> C;
C c(1);
C::iterator i = c.end();
(void) *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.end();
- (void) *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::iterator i = c.begin();
+ ++i;
+ assert(i == c.end());
+ ++i;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::local_iterator i = c.end(0);
+ (void) *i;
+ assert(false);
+
+ return 0;
+}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_multiset<T> C;
C c(1);
++i;
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::local_iterator i = c.begin(0);
- ++i;
- ++i;
- assert(false);
- }
-#endif
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_multiset<T> C;
C c(1);
C::local_iterator i = c.end(0);
(void) *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::local_iterator i = c.end(0);
- (void) *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::local_iterator i = c.begin(0);
+ ++i;
+ ++i;
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- std::unordered_multiset<int> s1 = {1, 2, 3};
- std::unordered_multiset<int>::iterator i = s1.begin();
- int k = *i;
- std::unordered_multiset<int> s2 = std::move(s1);
- assert(*i == k);
- s2.erase(i);
- assert(s2.size() == 2);
- }
+int main(int, char**) {
+ std::unordered_multiset<int> s1 = {1, 2, 3};
+ std::unordered_multiset<int>::iterator i = s1.begin();
+ int k = *i;
+ std::unordered_multiset<int> s2 = std::move(s1);
+ assert(*i == k);
+ s2.erase(i);
+ assert(s2.size() == 2);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::unordered_multiset<int>::iterator i1 = c1.begin();
- std::unordered_multiset<int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::unordered_multiset<int>::iterator j = i1;
- c1.erase(i1);
- assert(false);
- }
+int main(int, char**) {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+ std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+ std::unordered_multiset<int>::iterator i1 = c1.begin();
+ std::unordered_multiset<int>::iterator i2 = c2.begin();
+ swap(c1, c2);
+ c1.erase(i2);
+ c2.erase(i1);
+ std::unordered_multiset<int>::iterator j = i1;
+ c1.erase(i1);
+ assert(false);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_multiset<int> l1(a1, a1+3);
std::unordered_multiset<int>::const_iterator i = l1.end();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <cstdlib>
-#include <exception>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_multiset<int> l1(a1, a1+3);
std::unordered_multiset<int> l2(a1, a1+3);
std::unordered_multiset<int>::const_iterator i = l2.begin();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_multiset<int> l1(a1, a1+3);
std::unordered_multiset<int> l2(a1, a1+3);
std::unordered_multiset<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_multiset<int> l1(a1, a1+3);
std::unordered_multiset<int> l2(a1, a1+3);
std::unordered_multiset<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_multiset<int> l1(a1, a1+3);
std::unordered_multiset<int> l2(a1, a1+3);
std::unordered_multiset<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_multiset<int> l1(a1, a1+3);
std::unordered_multiset<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
assert(false);
- }
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+// class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_multiset<int> C;
+ C c;
+ c.max_load_factor(0);
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+// class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_set<int> C;
+ C c;
+ (void) c.bucket(3);
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+// class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_set<int> C;
+ C c;
+ (void) c.bucket_size(3);
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- typedef std::unordered_set<double> 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);
- }
+int main(int, char**) {
+ typedef std::unordered_set<double> 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);
return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::iterator i = c.end();
+ (void) *i;
+ assert(false);
+
+ return 0;
+}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_set<T> C;
C c(1);
assert(i == c.end());
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#endif
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_set<T> C;
C c(1);
C::iterator i = c.end();
(void) *i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.end();
- (void) *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::iterator i = c.begin();
+ ++i;
+ assert(i == c.end());
+ ++i;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::local_iterator i = c.end(0);
+ (void) *i;
+ assert(false);
+
+ return 0;
+}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_set<T> C;
C c(1);
++i;
++i;
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::local_iterator i = c.begin(0);
- ++i;
- ++i;
- assert(false);
- }
-#endif
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-#include "min_allocator.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
typedef int T;
typedef std::unordered_set<T> C;
C c(1);
C::local_iterator i = c.end(0);
(void) *i;
-
assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
- C c(1);
- C::local_iterator i = c.end(0);
- (void) *i;
- assert(false);
- }
-#endif
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+ typedef int T;
+ typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+ C c(1);
+ C::local_iterator i = c.begin(0);
+ ++i;
+ ++i;
+ assert(false);
+
+ return 0;
+}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- std::unordered_set<int> s1 = {1, 2, 3};
- std::unordered_set<int>::iterator i = s1.begin();
- int k = *i;
- std::unordered_set<int> s2 = std::move(s1);
- assert(*i == k);
- s2.erase(i);
- assert(s2.size() == 2);
- }
+int main(int, char**) {
+ std::unordered_set<int> s1 = {1, 2, 3};
+ std::unordered_set<int>::iterator i = s1.begin();
+ int k = *i;
+ std::unordered_set<int> s2 = std::move(s1);
+ assert(*i == k);
+ s2.erase(i);
+ assert(s2.size() == 2);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::unordered_set<int>::iterator i1 = c1.begin();
- std::unordered_set<int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::unordered_set<int>::iterator j = i1;
- c1.erase(i1);
- assert(false);
- }
+int main(int, char**) {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+ std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+ std::unordered_set<int>::iterator i1 = c1.begin();
+ std::unordered_set<int>::iterator i2 = c2.begin();
+ swap(c1, c2);
+ c1.erase(i2);
+ c2.erase(i1);
+ std::unordered_set<int>::iterator j = i1;
+ c1.erase(i1);
+ assert(false);
return 0;
}
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_set<int> l1(a1, a1+3);
std::unordered_set<int>::const_iterator i = l1.end();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
#include <cstdlib>
-#include <exception>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_set<int> l1(a1, a1+3);
std::unordered_set<int> l2(a1, a1+3);
std::unordered_set<int>::const_iterator i = l2.begin();
l1.erase(i);
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_set<int> l1(a1, a1+3);
std::unordered_set<int> l2(a1, a1+3);
std::unordered_set<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_set<int> l1(a1, a1+3);
std::unordered_set<int> l2(a1, a1+3);
std::unordered_set<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_set<int> l1(a1, a1+3);
std::unordered_set<int> l2(a1, a1+3);
std::unordered_set<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
assert(false);
- }
+
+ return 0;
}
#include <unordered_set>
#include <cassert>
-#include <exception>
-#include <cstdlib>
#include "test_macros.h"
-int main(int, char**)
-{
- {
+int main(int, char**) {
int a1[] = {1, 2, 3};
std::unordered_set<int> l1(a1, a1+3);
std::unordered_set<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
assert(false);
- }
+
+ return 0;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+// class Alloc = allocator<Value>>
+// class unordered_set
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ typedef std::unordered_set<int> C;
+ C c;
+ c.max_load_factor(-0.5f);
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// const charT& back() const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::string const s;
+ (void) s.back();
+ assert(false);
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// charT& back();
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::string s;
+ (void) s.back();
+ assert(false);
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// const charT& front() const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::string const s;
+ (void) s.front();
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// charT& front();
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::string s;
+ (void) s.front();
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// const_reference operator[](size_type pos) const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::string const s;
+ char c = s[0];
+ assert(c == '\0');
+ c = s[1];
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// reference operator[](size_type pos);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::string s;
+ char c = s[0];
+ assert(c == '\0');
+ c = s[1];
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T& optional<T>::operator*() &;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::optional<int> opt;
+ int x = *opt; (void)x;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr const T& optional<T>::operator*() const &;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ const std::optional<int> opt;
+ int x = *opt; (void)x;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T&& optional<T>::operator*() const &&;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+#include <utility>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::optional<int> opt;
+ int x = *std::move(opt); (void)x;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T&& optional<T>::operator*() &&;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+#include <utility>
+
+#include "test_macros.h"
+
+
+int main(int, char**) {
+ std::optional<int> opt;
+ int x = *std::move(opt); (void)x;
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T* optional<T>::operator->();
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct X {
+ int test() noexcept {return 3;}
+};
+
+int main(int, char**) {
+ std::optional<X> opt;
+ assert(opt->test() == 3);
+ assert(false);
+
+ return 0;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr const T* optional<T>::operator->() const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct X {
+ constexpr int test() const {return 3;}
+};
+
+int main(int, char**) {
+ const std::optional<X> opt;
+ assert(opt->test() == 3);
+ assert(false);
+
+ return 0;
+}
// size_type bucket_size(size_type n) const
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_map>
#include <string>
#include <cassert>
LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_map<int, std::string> C;
- C c;
- (void) c.bucket_size(3);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// float max_load_factor() const;
// void max_load_factor(float mlf);
-
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_map>
#include <string>
#include <cassert>
assert(c.max_load_factor() == 2.5);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_map<int, std::string> C;
- C c;
- c.max_load_factor(0);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// size_type bucket(const key_type& __k) const;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_map>
#include <string>
#include <cassert>
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_multimap<int, std::string> C;
- C c;
- (void) c.bucket(3);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// size_type bucket_size(size_type n) const
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_map>
#include <string>
#include <cassert>
LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_multimap<int, std::string> C;
- C c;
- (void) c.bucket_size(3);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// float max_load_factor() const;
// void max_load_factor(float mlf);
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_map>
#include <string>
#include <cassert>
assert(c.max_load_factor() == 2.5);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_multimap<int, std::string> C;
- C c;
- c.max_load_factor(0);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// size_type bucket(const key_type& __k) const;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_multiset<int> C;
- C c;
- (void) c.bucket(3);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// size_type bucket_size(size_type n) const
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_multiset<int> C;
- C c;
- (void) c.bucket_size(3);
- assert(false);
- }
-#endif
-
- return 0;
+ return 0;
}
// float max_load_factor() const;
// void max_load_factor(float mlf);
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
assert(c.max_load_factor() == 2.5);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_multiset<int> C;
- C c;
- c.max_load_factor(0);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// size_type bucket(const key_type& __k) const;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_set<int> C;
- C c;
- (void) c.bucket(3);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// size_type bucket_size(size_type n) const
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_set<int> C;
- C c;
- (void) c.bucket_size(3);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// float max_load_factor() const;
// void max_load_factor(float mlf);
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
assert(c.max_load_factor() == 2.5);
}
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
- {
- typedef std::unordered_set<int> C;
- C c;
- c.max_load_factor(-0.5f);
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// const charT& back() const;
// charT& back();
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <string>
#include <cassert>
test(S("1234567890123456789012345678901234567890"));
}
#endif
-#ifdef _LIBCPP_DEBUG
- {
- std::string s;
- (void) s.back();
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// const charT& front() const;
// charT& front();
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <string>
#include <cassert>
test(S("1234567890123456789012345678901234567890"));
}
#endif
-#ifdef _LIBCPP_DEBUG
- {
- std::string s;
- (void) s.front();
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// const_reference operator[](size_type pos) const;
// reference operator[](size_type pos);
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <string>
#include <cassert>
assert(s2[0] == '\0');
}
#endif
-#ifdef _LIBCPP_DEBUG
- {
- std::string s;
- char c = s[0];
- assert(c == '\0');
- c = s[1];
- assert(false);
- }
-#endif
- return 0;
+ return 0;
}
// constexpr T& optional<T>::operator*() &;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <optional>
#include <type_traits>
#include <cassert>
assert((*opt).test() == 4);
}
static_assert(test() == 7, "");
-#ifdef _LIBCPP_DEBUG
- {
- optional<X> opt;
- assert((*opt).test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
- return 0;
+ return 0;
}
// constexpr const T& optional<T>::operator*() const &;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <optional>
#include <type_traits>
#include <cassert>
constexpr optional<Y> opt(Y{});
assert((*opt).test() == 2);
}
-#ifdef _LIBCPP_DEBUG
- {
- const optional<X> opt;
- assert((*opt).test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
- return 0;
+ return 0;
}
// constexpr T&& optional<T>::operator*() const &&;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <optional>
#include <type_traits>
#include <cassert>
constexpr optional<Y> opt(Y{});
assert((*std::move(opt)).test() == 2);
}
-#ifdef _LIBCPP_DEBUG
- {
- optional<X> opt;
- assert((*std::move(opt)).test() == 5);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
- return 0;
+ return 0;
}
// constexpr T&& optional<T>::operator*() &&;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <optional>
#include <type_traits>
#include <cassert>
assert((*std::move(opt)).test() == 6);
}
static_assert(test() == 7, "");
-#ifdef _LIBCPP_DEBUG
- {
- optional<X> opt;
- assert((*std::move(opt)).test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
- return 0;
+ return 0;
}
// constexpr T* optional<T>::operator->();
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <optional>
#include <type_traits>
#include <cassert>
{
static_assert(test() == 3, "");
}
-#ifdef _LIBCPP_DEBUG
- {
- optional<X> opt;
- assert(opt->test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
- return 0;
+ return 0;
}
// constexpr const T* optional<T>::operator->() const;
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <optional>
#include <type_traits>
#include <cassert>
constexpr optional<Z> opt(Z{});
static_assert(opt->test() == 1, "");
}
-#ifdef _LIBCPP_DEBUG
- {
- const optional<X> opt;
- assert(opt->test() == 3);
- assert(false);
- }
-#endif // _LIBCPP_DEBUG
- return 0;
+ return 0;
}