// Enabled checks.
# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message)
# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message)
-// TODO(hardening): Don't enable uncategorized assertions in the hardened mode.
-# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message)
// Disabled checks.
# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSUME(expression)
# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSUME(expression)
+# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSUME(expression)
// Debug mode checks.
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <algorithm>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG_STRICT_WEAK_ORDERING_CHECK
// When the debug mode is enabled, this test fails because we actually catch on the fly that the comparator is not
int main(int, char**) {
static_assert(_LIBCPP_ENABLE_HARDENED_MODE == 1, "Hardened mode should be implicitly enabled");
- _LIBCPP_ASSERT_UNCATEGORIZED(true, "Should not fire");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(true, "Should not fire");
TEST_LIBCPP_ASSERT_FAILURE([] {
- _LIBCPP_ASSERT_UNCATEGORIZED(false, "Should fire");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "Should fire");
}(), "Should fire");
return 0;
#include "check_assertion.h"
int main(int, char**) {
- _LIBCPP_ASSERT_UNCATEGORIZED(true, "Should not fire");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(true, "Should not fire");
TEST_LIBCPP_ASSERT_FAILURE([] {
- _LIBCPP_ASSERT_UNCATEGORIZED(false, "Should fire");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "Should fire");
}(), "Should fire");
return 0;
#include "check_assertion.h"
int main(int, char**) {
- _LIBCPP_ASSERT_UNCATEGORIZED(true, "Should not fire");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(true, "Should not fire");
TEST_LIBCPP_ASSERT_FAILURE([] {
- _LIBCPP_ASSERT_UNCATEGORIZED(false, "Should fire");
+ _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "Should fire");
}(), "Should fire");
return 0;
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_map>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_map>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_map>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_map>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_map>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_map>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_set>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_set>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_set>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_set>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_set>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <unordered_set>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <filesystem>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <list>
//===----------------------------------------------------------------------===//
// REQUIRES: has-unix-headers
-// UNSUPPORTED: c++03, !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: c++03
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <list>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <list>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: no-exceptions
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <ranges>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <ranges>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <ranges>
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// REQUIRES: has-unix-headers
// XFAIL: availability-verbose_abort-missing
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// REQUIRES: has-unix-headers
// XFAIL: availability-verbose_abort-missing
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// Construct a string_view from an invalid length
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// Construct a string_view from a null pointer
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, no-threads
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <future>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, no-threads
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <future>
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// Make sure that calling arrive_and_wait with a negative value triggers an assertion.
// REQUIRES: has-unix-headers
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <latch>
// higher than the internal counter triggers an assertion.
// REQUIRES: has-unix-headers
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <latch>
// Make sure that calling latch with a negative value triggers an assertion
// REQUIRES: has-unix-headers
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
#include <latch>
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -fno-exceptions
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <algorithm>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <algorithm>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <algorithm>
//===----------------------------------------------------------------------===//
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
//===----------------------------------------------------------------------===//
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
//===----------------------------------------------------------------------===//
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
//===----------------------------------------------------------------------===//
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// Test construction from span:
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// <mdspan>
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode
+// UNSUPPORTED: !libcpp-has-debug-mode
// XFAIL: availability-verbose_abort-missing
// Make sure that reaching std::unreachable() with assertions enabled triggers an assertion.