Import Cobalt 24.master.0.1033952
diff --git a/third_party/llvm-project/compiler-rt/BUILD.gn b/third_party/llvm-project/compiler-rt/BUILD.gn
index ba235fc..2887ebf 100644
--- a/third_party/llvm-project/compiler-rt/BUILD.gn
+++ b/third_party/llvm-project/compiler-rt/BUILD.gn
@@ -14,7 +14,7 @@
config("compiler_rt_config") {
cflags_cc = [
- "-std=c++17",
+ "-std=c++20",
"-nostdinc++",
"-fvisibility-inlines-hidden",
"-fms-compatibility-version=19.00",
@@ -92,4 +92,5 @@
}
configs += [ ":compiler_rt_config" ]
+ configs -= [ "//starboard/build/config:default_cpp_standard" ]
}
diff --git a/third_party/llvm-project/compiler-rt/CMakeLists.txt b/third_party/llvm-project/compiler-rt/CMakeLists.txt
index 21ea6e6..c5a7b24 100644
--- a/third_party/llvm-project/compiler-rt/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/CMakeLists.txt
@@ -162,7 +162,7 @@
# We support running instrumented tests when we're not cross-compiling
# and target a UNIX-like system or Windows.
# We can run tests on Android even when we are cross-compiling.
-if(("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${CMAKE_SYSTEM_NAME}" AND (UNIX OR WIN32))
+if((NOT "${CMAKE_CROSSCOMPILING}" AND (UNIX OR WIN32))
OR ANDROID OR COMPILER_RT_EMULATOR)
option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON)
else()
@@ -421,16 +421,12 @@
append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS)
-if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
- list(APPEND THREAD_SAFETY_FLAGS
- "-Wthread-safety"
- "-Wthread-safety-reference"
- "-Wthread-safety-beta"
- )
- list(APPEND SANITIZER_COMMON_CFLAGS ${THREAD_SAFETY_FLAGS})
- string(REPLACE ";" " " thread_safety_flags_space_sep "${THREAD_SAFETY_FLAGS}")
- string(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS " ${thread_safety_flags_space_sep}")
-endif()
+append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG -Wthread-safety THREAD_SAFETY_FLAGS)
+append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_REFERENCE_FLAG -Wthread-safety-reference THREAD_SAFETY_FLAGS)
+append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_BETA_FLAG -Wthread-safety-beta THREAD_SAFETY_FLAGS)
+list(APPEND SANITIZER_COMMON_CFLAGS ${THREAD_SAFETY_FLAGS})
+string(REPLACE ";" " " thread_safety_flags_space_sep "${THREAD_SAFETY_FLAGS}")
+string(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS " ${thread_safety_flags_space_sep}")
# If we're using MSVC,
# always respect the optimization flags set by CMAKE_BUILD_TYPE instead.
diff --git a/third_party/llvm-project/compiler-rt/CODE_OWNERS.TXT b/third_party/llvm-project/compiler-rt/CODE_OWNERS.TXT
index 80f7a93..ad136ed 100644
--- a/third_party/llvm-project/compiler-rt/CODE_OWNERS.TXT
+++ b/third_party/llvm-project/compiler-rt/CODE_OWNERS.TXT
@@ -12,6 +12,10 @@
E: compnerd@compnerd.org
D: builtins library
+N: Andrew Browne
+E: browneee@google.com
+D: DataFlowSanitizer
+
N: Vitaly Buka
E: vitalybuka@google.com
D: Sanitizers
@@ -32,6 +36,10 @@
E: tejohnson@google.com
D: MemProf
+N: Kostya Kortchinsky
+E: kostya.kortchinsky@gmail.com
+D: SCUDO
+
N: Mitch Phillips
E: mitchp@google.com
D: GWP ASAN
diff --git a/third_party/llvm-project/compiler-rt/METADATA b/third_party/llvm-project/compiler-rt/METADATA
index 6a5e1a9..91e5fba 100644
--- a/third_party/llvm-project/compiler-rt/METADATA
+++ b/third_party/llvm-project/compiler-rt/METADATA
@@ -1,21 +1,22 @@
name: "compiler-rt"
description:
- "Filtered subtree at third_party/llvm-project/compiler-rt."
+ "Subdirectory subtree of llvm-project."
third_party {
- url {
- type: LOCAL_SOURCE
- value: "https://cobalt.googlesource.com/third_party/llvm-project/compiler-rt_filtered_mirror"
+ identifier {
+ type: "Git"
+ value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project"
+ version: "27f27d15f6c90b026eca23b8ee238fdbf772fd80"
+ # from https://chromium.googlesource.com/chromium/src/+/refs/tags/114.0.5735.351/tools/clang/scripts/update.py#38
+ closest_version: "llvmorg-17-init-8029-g27f27d15"
}
- url {
- type: GIT
- value: "https://github.com/llvm/llvm-project.git"
+ identifier {
+ type: "UpstreamSubdir"
+ value: "compiler-rt"
}
- # Closest commit hash to llvm-project's 39da55e8f548a11f7dadefa73ea73d809a5f1729.
- version: "1066968d931196d4ab5e1dfb54d4fd53f3cc024f"
last_upgrade_date {
- year: 2023
- month: 1
- day: 17
+ year: 2024
+ month: 2
+ day: 21
}
}
diff --git a/third_party/llvm-project/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake b/third_party/llvm-project/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
index cc929c5..99d672d 100644
--- a/third_party/llvm-project/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
@@ -42,7 +42,7 @@
elseif (OS_NAME MATCHES "Windows")
set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64})
elseif(OS_NAME MATCHES "Android")
- set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64})
+ set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64})
else()
set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64})
endif()
@@ -70,7 +70,7 @@
set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}
${HEXAGON})
set(ALL_SCUDO_STANDALONE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
- ${MIPS32} ${MIPS64} ${PPC64} ${HEXAGON} ${LOONGARCH64})
+ ${MIPS32} ${MIPS64} ${PPC64} ${HEXAGON} ${LOONGARCH64} ${RISCV64})
if(APPLE)
set(ALL_XRAY_SUPPORTED_ARCH ${X86_64})
else()
diff --git a/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
index a826c51..6a62d3b 100644
--- a/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -147,6 +147,11 @@
list(REMOVE_ITEM archs "i386")
endif()
+ if(${os} MATCHES "^ios$")
+ message(STATUS "Disabling sanitizers armv7* slice for ios")
+ list(FILTER archs EXCLUDE REGEX "armv7.*")
+ endif()
+
set(working_archs)
foreach(arch ${archs})
diff --git a/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake b/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake
index 4b71369..be14992 100644
--- a/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake
@@ -46,8 +46,13 @@
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang|GNU")
# Note: Clang also supports `-print-target-triple` but gcc doesn't
# support this flag.
+ set(DUMPMACHINE_ARG -dumpmachine)
+ if(MSVC)
+ # Use /clang:-dumpmachine for clang-cl.
+ set(DUMPMACHINE_ARG /clang:-dumpmachine)
+ endif()
execute_process(
- COMMAND "${CMAKE_C_COMPILER}" -dumpmachine
+ COMMAND "${CMAKE_C_COMPILER}" ${DUMPMACHINE_ARG}
RESULT_VARIABLE HAD_ERROR
OUTPUT_VARIABLE COMPILER_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE)
diff --git a/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 4c85551..f15917f 100644
--- a/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -358,6 +358,10 @@
if(DEFINED COMPILER_RT_DEFAULT_TARGET_TRIPLE)
message(FATAL_ERROR "COMPILER_RT_DEFAULT_TARGET_TRIPLE isn't supported when building for default target only")
endif()
+ if ("${CMAKE_C_COMPILER_TARGET}" STREQUAL "")
+ message(FATAL_ERROR "CMAKE_C_COMPILER_TARGET must also be set when COMPILER_RT_DEFAUT_TARGET_ONLY is ON")
+ endif()
+ message(STATUS "cmake c compiler target: ${CMAKE_C_COMPILER_TARGET}")
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${CMAKE_C_COMPILER_TARGET})
else()
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${LLVM_TARGET_TRIPLE} CACHE STRING
@@ -433,6 +437,25 @@
string(REGEX REPLACE "mipsisa64" "mipsisa32" triple_cpu_mips "${triple_cpu}")
string(REGEX REPLACE "mips64" "mips" triple_cpu_mips "${triple_cpu_mips}")
set(target "${triple_cpu_mips}${triple_suffix_gnu}")
+ elseif("${arch}" MATCHES "^arm")
+ # Arch is arm, armhf, armv6m (anything else would come from using
+ # COMPILER_RT_DEFAULT_TARGET_ONLY, which is checked above).
+ if (${arch} STREQUAL "armhf")
+ # If we are building for hard float but our ABI is soft float.
+ if ("${triple_suffix}" MATCHES ".*eabi$")
+ # Change "eabi" -> "eabihf"
+ set(triple_suffix "${triple_suffix}hf")
+ endif()
+ # ABI is already set in the triple, don't repeat it in the architecture.
+ set(arch "arm")
+ else ()
+ # If we are building for soft float, but the triple's ABI is hard float.
+ if ("${triple_suffix}" MATCHES ".*eabihf$")
+ # Change "eabihf" -> "eabi"
+ string(REGEX REPLACE "hf$" "" triple_suffix "${triple_suffix}")
+ endif()
+ endif()
+ set(target "${arch}${triple_suffix}")
else()
set(target "${arch}${triple_suffix}")
endif()
diff --git a/third_party/llvm-project/compiler-rt/cmake/base-config-ix.cmake b/third_party/llvm-project/compiler-rt/cmake/base-config-ix.cmake
index 0ad95d5..c6e9505 100644
--- a/third_party/llvm-project/compiler-rt/cmake/base-config-ix.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/base-config-ix.cmake
@@ -8,6 +8,7 @@
include(CheckCXXSourceCompiles)
include(GNUInstallDirs)
include(ExtendPath)
+include(CompilerRTDarwinUtils)
check_include_file(unwind.h HAVE_UNWIND_H)
@@ -145,7 +146,18 @@
"-darwin-target-variant" "x86_64-apple-ios13.1-macabi"
"-Werror")
option(COMPILER_RT_ENABLE_MACCATALYST "Enable building for Mac Catalyst" ${COMPILER_RT_HAS_DARWIN_TARGET_VARIANT_FLAG})
- option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On)
+
+ # Don't enable COMPILER_RT_ENABLE_IOS if we can't find the sdk dir.
+ # This can happen when you only have the commandline tools installed
+ # which doesn't come with the iOS SDK.
+ find_darwin_sdk_dir(HAS_IOS_SDK "iphoneos")
+ set(COMPILER_RT_ENABLE_IOS_DEFAULT On)
+ if("${HAS_IOS_SDK}" STREQUAL "")
+ message(WARNING "iOS SDK not found! Building compiler-rt without iOS support.")
+ set(COMPILER_RT_ENABLE_IOS_DEFAULT Off)
+ endif()
+ option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" ${COMPILER_RT_ENABLE_IOS_DEFAULT})
+
option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off)
option(COMPILER_RT_ENABLE_TVOS "Enable building for tvOS - Experimental" Off)
diff --git a/third_party/llvm-project/compiler-rt/cmake/builtin-config-ix.cmake b/third_party/llvm-project/compiler-rt/cmake/builtin-config-ix.cmake
index 9f81849..3638cff 100644
--- a/third_party/llvm-project/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/builtin-config-ix.cmake
@@ -22,22 +22,6 @@
}
")
-builtin_check_c_compiler_source(COMPILER_RT_HAS_FLOAT16
-"
-_Float16 foo(_Float16 x) {
- return x;
-}
-"
-)
-
-builtin_check_c_compiler_source(COMPILER_RT_HAS_BFLOAT16
-"
-__bf16 foo(__bf16 x) {
- return x;
-}
-"
-)
-
builtin_check_c_compiler_source(COMPILER_RT_HAS_ASM_LSE
"
asm(\".arch armv8-a+lse\");
@@ -45,7 +29,7 @@
")
set(ARM64 aarch64)
-set(ARM32 arm armhf armv4t armv5te armv6 armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main)
+set(ARM32 arm armhf armv4t armv5te armv6 armv6m armv7m armv7em armv7 armv7s armv7k armv8m.base armv8m.main armv8.1m.main)
set(AVR avr)
set(HEXAGON hexagon)
set(X86 i386)
diff --git a/third_party/llvm-project/compiler-rt/cmake/config-ix.cmake b/third_party/llvm-project/compiler-rt/cmake/config-ix.cmake
index 39cd9e8..5f51bef 100644
--- a/third_party/llvm-project/compiler-rt/cmake/config-ix.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/config-ix.cmake
@@ -122,6 +122,9 @@
check_cxx_compiler_flag("-Werror -Wunused-parameter" COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG)
check_cxx_compiler_flag("-Werror -Wcovered-switch-default" COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG)
check_cxx_compiler_flag("-Werror -Wsuggest-override" COMPILER_RT_HAS_WSUGGEST_OVERRIDE_FLAG)
+check_cxx_compiler_flag("-Werror -Wthread-safety" COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG)
+check_cxx_compiler_flag("-Werror -Wthread-safety-reference" COMPILER_RT_HAS_WTHREAD_SAFETY_REFERENCE_FLAG)
+check_cxx_compiler_flag("-Werror -Wthread-safety-beta" COMPILER_RT_HAS_WTHREAD_SAFETY_BETA_FLAG)
check_cxx_compiler_flag(-Wno-pedantic COMPILER_RT_HAS_WNO_PEDANTIC)
check_cxx_compiler_flag(-Wno-format COMPILER_RT_HAS_WNO_FORMAT)
check_cxx_compiler_flag(-Wno-format-pedantic COMPILER_RT_HAS_WNO_FORMAT_PEDANTIC)
diff --git a/third_party/llvm-project/compiler-rt/cmake/crt-config-ix.cmake b/third_party/llvm-project/compiler-rt/cmake/crt-config-ix.cmake
index 066a0ed..dc3265e 100644
--- a/third_party/llvm-project/compiler-rt/cmake/crt-config-ix.cmake
+++ b/third_party/llvm-project/compiler-rt/cmake/crt-config-ix.cmake
@@ -24,6 +24,8 @@
set(X86 i386)
set(X86_64 x86_64)
set(LOONGARCH64 loongarch64)
+set(MIPS32 mips mipsel)
+set(MIPS64 mips64 mips64el)
set(PPC32 powerpc powerpcspe)
set(PPC64 powerpc64 powerpc64le)
set(RISCV32 riscv32)
@@ -31,7 +33,8 @@
set(VE ve)
set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC32}
- ${PPC64} ${RISCV32} ${RISCV64} ${VE} ${HEXAGON} ${LOONGARCH64})
+ ${PPC64} ${RISCV32} ${RISCV64} ${VE} ${HEXAGON} ${LOONGARCH64}
+ ${MIPS32} ${MIPS64} ${SPARC} ${SPARCV9})
include(CompilerRTUtils)
diff --git a/third_party/llvm-project/compiler-rt/include/orc_rt/c_api.h b/third_party/llvm-project/compiler-rt/include/orc_rt/c_api.h
index 96d01df..628c5cd 100644
--- a/third_party/llvm-project/compiler-rt/include/orc_rt/c_api.h
+++ b/third_party/llvm-project/compiler-rt/include/orc_rt/c_api.h
@@ -48,17 +48,17 @@
typedef union {
char *ValuePtr;
char Value[sizeof(char *)];
-} __orc_rt_CWrapperFunctionResultDataUnion;
+} orc_rt_CWrapperFunctionResultDataUnion;
/**
- * __orc_rt_CWrapperFunctionResult is a kind of C-SmallVector with an
+ * orc_rt_CWrapperFunctionResult is a kind of C-SmallVector with an
* out-of-band error state.
*
* If Size == 0 and Data.ValuePtr is non-zero then the value is in the
* 'out-of-band error' state, and Data.ValuePtr points at a malloc-allocated,
* null-terminated string error message.
*
- * If Size <= sizeof(__orc_rt_CWrapperFunctionResultData) then the value is in
+ * If Size <= sizeof(orc_rt_CWrapperFunctionResultData) then the value is in
* the 'small' state and the content is held in the first Size bytes of
* Data.Value.
*
@@ -68,29 +68,29 @@
* malloc, and will be freed with free when this value is destroyed.
*/
typedef struct {
- __orc_rt_CWrapperFunctionResultDataUnion Data;
+ orc_rt_CWrapperFunctionResultDataUnion Data;
size_t Size;
-} __orc_rt_CWrapperFunctionResult;
+} orc_rt_CWrapperFunctionResult;
-typedef struct __orc_rt_CSharedOpaqueJITProcessControl
- *__orc_rt_SharedJITProcessControlRef;
+typedef struct orc_rt_CSharedOpaqueJITProcessControl
+ *orc_rt_SharedJITProcessControlRef;
/**
- * Zero-initialize an __orc_rt_CWrapperFunctionResult.
+ * Zero-initialize an orc_rt_CWrapperFunctionResult.
*/
static inline void
-__orc_rt_CWrapperFunctionResultInit(__orc_rt_CWrapperFunctionResult *R) {
+orc_rt_CWrapperFunctionResultInit(orc_rt_CWrapperFunctionResult *R) {
R->Size = 0;
R->Data.ValuePtr = 0;
}
/**
- * Create an __orc_rt_CWrapperFunctionResult with an uninitialized buffer of
+ * Create an orc_rt_CWrapperFunctionResult with an uninitialized buffer of
* size Size. The buffer is returned via the DataPtr argument.
*/
-static inline __orc_rt_CWrapperFunctionResult
-__orc_rt_CWrapperFunctionResultAllocate(size_t Size) {
- __orc_rt_CWrapperFunctionResult R;
+static inline orc_rt_CWrapperFunctionResult
+orc_rt_CWrapperFunctionResultAllocate(size_t Size) {
+ orc_rt_CWrapperFunctionResult R;
R.Size = Size;
// If Size is 0 ValuePtr must be 0 or it is considered an out-of-band error.
R.Data.ValuePtr = 0;
@@ -100,11 +100,11 @@
}
/**
- * Create an __orc_rt_WrapperFunctionResult from the given data range.
+ * Create an orc_rt_WrapperFunctionResult from the given data range.
*/
-static inline __orc_rt_CWrapperFunctionResult
-__orc_rt_CreateCWrapperFunctionResultFromRange(const char *Data, size_t Size) {
- __orc_rt_CWrapperFunctionResult R;
+static inline orc_rt_CWrapperFunctionResult
+orc_rt_CreateCWrapperFunctionResultFromRange(const char *Data, size_t Size) {
+ orc_rt_CWrapperFunctionResult R;
R.Size = Size;
if (R.Size > sizeof(R.Data.Value)) {
char *Tmp = (char *)malloc(Size);
@@ -116,28 +116,28 @@
}
/**
- * Create an __orc_rt_CWrapperFunctionResult by copying the given string,
+ * Create an orc_rt_CWrapperFunctionResult by copying the given string,
* including the null-terminator.
*
* This function copies the input string. The client is responsible for freeing
* the ErrMsg arg.
*/
-static inline __orc_rt_CWrapperFunctionResult
-__orc_rt_CreateCWrapperFunctionResultFromString(const char *Source) {
- return __orc_rt_CreateCWrapperFunctionResultFromRange(Source,
- strlen(Source) + 1);
+static inline orc_rt_CWrapperFunctionResult
+orc_rt_CreateCWrapperFunctionResultFromString(const char *Source) {
+ return orc_rt_CreateCWrapperFunctionResultFromRange(Source,
+ strlen(Source) + 1);
}
/**
- * Create an __orc_rt_CWrapperFunctionResult representing an out-of-band
+ * Create an orc_rt_CWrapperFunctionResult representing an out-of-band
* error.
*
* This function copies the input string. The client is responsible for freeing
* the ErrMsg arg.
*/
-static inline __orc_rt_CWrapperFunctionResult
-__orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(const char *ErrMsg) {
- __orc_rt_CWrapperFunctionResult R;
+static inline orc_rt_CWrapperFunctionResult
+orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(const char *ErrMsg) {
+ orc_rt_CWrapperFunctionResult R;
R.Size = 0;
char *Tmp = (char *)malloc(strlen(ErrMsg) + 1);
strcpy(Tmp, ErrMsg);
@@ -146,11 +146,11 @@
}
/**
- * This should be called to destroy __orc_rt_CWrapperFunctionResult values
+ * This should be called to destroy orc_rt_CWrapperFunctionResult values
* regardless of their state.
*/
static inline void
-__orc_rt_DisposeCWrapperFunctionResult(__orc_rt_CWrapperFunctionResult *R) {
+orc_rt_DisposeCWrapperFunctionResult(orc_rt_CWrapperFunctionResult *R) {
if (R->Size > sizeof(R->Data.Value) ||
(R->Size == 0 && R->Data.ValuePtr))
free(R->Data.ValuePtr);
@@ -158,22 +158,22 @@
/**
* Get a pointer to the data contained in the given
- * __orc_rt_CWrapperFunctionResult.
+ * orc_rt_CWrapperFunctionResult.
*/
static inline char *
-__orc_rt_CWrapperFunctionResultData(__orc_rt_CWrapperFunctionResult *R) {
+orc_rt_CWrapperFunctionResultData(orc_rt_CWrapperFunctionResult *R) {
assert((R->Size != 0 || R->Data.ValuePtr == NULL) &&
"Cannot get data for out-of-band error value");
return R->Size > sizeof(R->Data.Value) ? R->Data.ValuePtr : R->Data.Value;
}
/**
- * Safely get the size of the given __orc_rt_CWrapperFunctionResult.
+ * Safely get the size of the given orc_rt_CWrapperFunctionResult.
*
* Asserts that we're not trying to access the size of an error value.
*/
static inline size_t
-__orc_rt_CWrapperFunctionResultSize(const __orc_rt_CWrapperFunctionResult *R) {
+orc_rt_CWrapperFunctionResultSize(const orc_rt_CWrapperFunctionResult *R) {
assert((R->Size != 0 || R->Data.ValuePtr == NULL) &&
"Cannot get size for out-of-band error value");
return R->Size;
@@ -181,22 +181,22 @@
/**
* Returns 1 if this value is equivalent to a value just initialized by
- * __orc_rt_CWrapperFunctionResultInit, 0 otherwise.
+ * orc_rt_CWrapperFunctionResultInit, 0 otherwise.
*/
static inline size_t
-__orc_rt_CWrapperFunctionResultEmpty(const __orc_rt_CWrapperFunctionResult *R) {
+orc_rt_CWrapperFunctionResultEmpty(const orc_rt_CWrapperFunctionResult *R) {
return R->Size == 0 && R->Data.ValuePtr == 0;
}
/**
* Returns a pointer to the out-of-band error string for this
- * __orc_rt_CWrapperFunctionResult, or null if there is no error.
+ * orc_rt_CWrapperFunctionResult, or null if there is no error.
*
- * The __orc_rt_CWrapperFunctionResult retains ownership of the error
+ * The orc_rt_CWrapperFunctionResult retains ownership of the error
* string, so it should be copied if the caller wishes to preserve it.
*/
-static inline const char *__orc_rt_CWrapperFunctionResultGetOutOfBandError(
- const __orc_rt_CWrapperFunctionResult *R) {
+static inline const char *orc_rt_CWrapperFunctionResultGetOutOfBandError(
+ const orc_rt_CWrapperFunctionResult *R) {
return R->Size == 0 ? R->Data.ValuePtr : 0;
}
diff --git a/third_party/llvm-project/compiler-rt/include/profile/InstrProfData.inc b/third_party/llvm-project/compiler-rt/include/profile/InstrProfData.inc
index 05419bf..94261f4 100644
--- a/third_party/llvm-project/compiler-rt/include/profile/InstrProfData.inc
+++ b/third_party/llvm-project/compiler-rt/include/profile/InstrProfData.inc
@@ -650,7 +650,7 @@
/* Raw profile format version (start from 1). */
#define INSTR_PROF_RAW_VERSION 8
/* Indexed profile format version (start from 1). */
-#define INSTR_PROF_INDEX_VERSION 9
+#define INSTR_PROF_INDEX_VERSION 10
/* Coverage mapping format version (start from 0). */
#define INSTR_PROF_COVMAP_VERSION 5
@@ -663,6 +663,7 @@
* The 60th bit indicates single byte coverage instrumentation.
* The 61st bit indicates function entry instrumentation only.
* The 62nd bit indicates whether memory profile information is present.
+ * The 63rd bit indicates if this is a temporal profile.
*/
#define VARIANT_MASKS_ALL 0xff00000000000000ULL
#define GET_VERSION(V) ((V) & ~VARIANT_MASKS_ALL)
@@ -673,9 +674,11 @@
#define VARIANT_MASK_BYTE_COVERAGE (0x1ULL << 60)
#define VARIANT_MASK_FUNCTION_ENTRY_ONLY (0x1ULL << 61)
#define VARIANT_MASK_MEMPROF (0x1ULL << 62)
+#define VARIANT_MASK_TEMPORAL_PROF (0x1ULL << 63)
#define INSTR_PROF_RAW_VERSION_VAR __llvm_profile_raw_version
#define INSTR_PROF_PROFILE_RUNTIME_VAR __llvm_profile_runtime
#define INSTR_PROF_PROFILE_COUNTER_BIAS_VAR __llvm_profile_counter_bias
+#define INSTR_PROF_PROFILE_SET_TIMESTAMP __llvm_profile_set_timestamp
/* The variable that holds the name of the profile data
* specified via command line. */
diff --git a/third_party/llvm-project/compiler-rt/include/profile/MemProfData.inc b/third_party/llvm-project/compiler-rt/include/profile/MemProfData.inc
index c533073..b82a4ba 100644
--- a/third_party/llvm-project/compiler-rt/include/profile/MemProfData.inc
+++ b/third_party/llvm-project/compiler-rt/include/profile/MemProfData.inc
@@ -19,6 +19,7 @@
* synced up.
*
\*===----------------------------------------------------------------------===*/
+#include <string.h>
#ifdef _MSC_VER
#define PACKED(...) __pragma(pack(push,1)) __VA_ARGS__ __pragma(pack(pop))
@@ -32,7 +33,9 @@
(uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
// The version number of the raw binary format.
-#define MEMPROF_RAW_VERSION 2ULL
+#define MEMPROF_RAW_VERSION 3ULL
+
+#define MEMPROF_BUILDID_MAX_SIZE 32ULL
namespace llvm {
namespace memprof {
@@ -46,37 +49,40 @@
uint64_t StackOffset;
});
-
// A struct describing the information necessary to describe a /proc/maps
// segment entry for a particular binary/library identified by its build id.
PACKED(struct SegmentEntry {
uint64_t Start;
uint64_t End;
uint64_t Offset;
- // This field is unused until sanitizer procmaps support for build ids for
- // Linux-Elf is implemented.
- uint8_t BuildId[32] = {0};
+ uint64_t BuildIdSize;
+ uint8_t BuildId[MEMPROF_BUILDID_MAX_SIZE] = {0};
- SegmentEntry(uint64_t S, uint64_t E, uint64_t O) :
- Start(S), End(E), Offset(O) {}
+ // This constructor is only used in tests so don't set the BuildId.
+ SegmentEntry(uint64_t S, uint64_t E, uint64_t O)
+ : Start(S), End(E), Offset(O), BuildIdSize(0) {}
SegmentEntry(const SegmentEntry& S) {
Start = S.Start;
End = S.End;
Offset = S.Offset;
+ BuildIdSize = S.BuildIdSize;
+ memcpy(BuildId, S.BuildId, S.BuildIdSize);
}
SegmentEntry& operator=(const SegmentEntry& S) {
Start = S.Start;
End = S.End;
Offset = S.Offset;
+ BuildIdSize = S.BuildIdSize;
+ memcpy(BuildId, S.BuildId, S.BuildIdSize);
return *this;
}
bool operator==(const SegmentEntry& S) const {
- return Start == S.Start &&
- End == S.End &&
- Offset == S.Offset;
+ return Start == S.Start && End == S.End && Offset == S.Offset &&
+ BuildIdSize == S.BuildIdSize &&
+ memcmp(BuildId, S.BuildId, S.BuildIdSize) == 0;
}
});
diff --git a/third_party/llvm-project/compiler-rt/include/sanitizer/allocator_interface.h b/third_party/llvm-project/compiler-rt/include/sanitizer/allocator_interface.h
index 6226135..d0cfce7 100644
--- a/third_party/llvm-project/compiler-rt/include/sanitizer/allocator_interface.h
+++ b/third_party/llvm-project/compiler-rt/include/sanitizer/allocator_interface.h
@@ -26,6 +26,10 @@
is not yet freed. */
int __sanitizer_get_ownership(const volatile void *p);
+ /* If a pointer lies within an allocation, it will return the start address
+ of the allocation. Otherwise, it returns nullptr. */
+ const void *__sanitizer_get_allocated_begin(const void *p);
+
/* Returns the number of bytes reserved for the pointer p.
Requires (get_ownership(p) == true) or (p == 0). */
size_t __sanitizer_get_allocated_size(const volatile void *p);
diff --git a/third_party/llvm-project/compiler-rt/include/sanitizer/tsan_interface.h b/third_party/llvm-project/compiler-rt/include/sanitizer/tsan_interface.h
index 2782e61..58f2513 100644
--- a/third_party/llvm-project/compiler-rt/include/sanitizer/tsan_interface.h
+++ b/third_party/llvm-project/compiler-rt/include/sanitizer/tsan_interface.h
@@ -172,6 +172,12 @@
// Release TSan internal memory in a best-effort manner.
void __tsan_flush_memory();
+// User-provided default TSAN options.
+const char* __tsan_default_options(void);
+
+// User-provided default TSAN suppressions.
+const char* __tsan_default_suppressions(void);
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_allocator.cpp b/third_party/llvm-project/compiler-rt/lib/asan/asan_allocator.cpp
index 74183fc..19d7777 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_allocator.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_allocator.cpp
@@ -1100,6 +1100,10 @@
return m ? m->Beg() : 0;
}
+uptr GetUserAddr(uptr chunk) {
+ return chunk;
+}
+
LsanMetadata::LsanMetadata(uptr chunk) {
metadata_ = chunk ? reinterpret_cast<void *>(chunk - __asan::kChunkHeaderSize)
: nullptr;
@@ -1140,7 +1144,7 @@
__asan::get_allocator().ForEachChunk(callback, arg);
}
-IgnoreObjectResult IgnoreObjectLocked(const void *p) {
+IgnoreObjectResult IgnoreObject(const void *p) {
uptr addr = reinterpret_cast<uptr>(p);
__asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddr(addr);
if (!m ||
@@ -1160,6 +1164,17 @@
// ---------------------- Interface ---------------- {{{1
using namespace __asan;
+static const void *AllocationBegin(const void *p) {
+ AsanChunk *m = __asan::instance.GetAsanChunkByAddr((uptr)p);
+ if (!m)
+ return nullptr;
+ if (atomic_load(&m->chunk_state, memory_order_acquire) != CHUNK_ALLOCATED)
+ return nullptr;
+ if (m->UsedSize() == 0)
+ return nullptr;
+ return (const void *)(m->Beg());
+}
+
// ASan allocator doesn't reserve extra bytes, so normally we would
// just return "size". We don't want to expose our redzone sizes, etc here.
uptr __sanitizer_get_estimated_allocated_size(uptr size) {
@@ -1183,6 +1198,10 @@
return allocated_size;
}
+const void *__sanitizer_get_allocated_begin(const void *p) {
+ return AllocationBegin(p);
+}
+
void __sanitizer_purge_allocator() {
GET_STACK_TRACE_MALLOC;
instance.Purge(&stack);
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_globals.cpp b/third_party/llvm-project/compiler-rt/lib/asan/asan_globals.cpp
index b780128..4d391cb 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_globals.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_globals.cpp
@@ -92,6 +92,10 @@
if (info.line != 0) {
Report(" location: name=%s, %d\n", info.file, static_cast<int>(info.line));
}
+ else if (g.gcc_location != 0) {
+ // Fallback to Global::gcc_location
+ Report(" location: name=%s, %d\n", g.gcc_location->filename, g.gcc_location->line_no);
+ }
}
static u32 FindRegistrationSite(const Global *g) {
@@ -302,6 +306,11 @@
if (info.line != 0) {
str->append("%s:%d", info.file, static_cast<int>(info.line));
+ } else if (g.gcc_location != 0) {
+ // Fallback to Global::gcc_location
+ str->append("%s", g.gcc_location->filename ? g.gcc_location->filename : g.module_name);
+ if (g.gcc_location->line_no) str->append(":%d", g.gcc_location->line_no);
+ if (g.gcc_location->column_no) str->append(":%d", g.gcc_location->column_no);
} else {
str->append("%s", g.module_name);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp b/third_party/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp
index 8170082..013bdb6 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp
@@ -257,12 +257,36 @@
PoisonShadow(bottom, ssize, 0);
}
-INTERCEPTOR(int, getcontext, struct ucontext_t *ucp) {
- // API does not requires to have ucp clean, and sets only part of fields. We
- // use ucp->uc_stack to unpoison new stack. We prefer to have zeroes then
- // uninitialized bytes.
- ResetContextStack(ucp);
- return REAL(getcontext)(ucp);
+INTERCEPTOR(void, makecontext, struct ucontext_t *ucp, void (*func)(), int argc,
+ ...) {
+ va_list ap;
+ uptr args[64];
+ // We don't know a better way to forward ... into REAL function. We can
+ // increase args size if neccecary.
+ CHECK_LE(argc, ARRAY_SIZE(args));
+ internal_memset(args, 0, sizeof(args));
+ va_start(ap, argc);
+ for (int i = 0; i < argc; ++i) args[i] = va_arg(ap, uptr);
+ va_end(ap);
+
+# define ENUMERATE_ARRAY_4(start) \
+ args[start], args[start + 1], args[start + 2], args[start + 3]
+# define ENUMERATE_ARRAY_16(start) \
+ ENUMERATE_ARRAY_4(start), ENUMERATE_ARRAY_4(start + 4), \
+ ENUMERATE_ARRAY_4(start + 8), ENUMERATE_ARRAY_4(start + 12)
+# define ENUMERATE_ARRAY_64() \
+ ENUMERATE_ARRAY_16(0), ENUMERATE_ARRAY_16(16), ENUMERATE_ARRAY_16(32), \
+ ENUMERATE_ARRAY_16(48)
+
+ REAL(makecontext)
+ ((struct ucontext_t *)ucp, func, argc, ENUMERATE_ARRAY_64());
+
+# undef ENUMERATE_ARRAY_4
+# undef ENUMERATE_ARRAY_16
+# undef ENUMERATE_ARRAY_64
+
+ // Sign the stack so we can identify it for unpoisoning.
+ SignContextStack(ucp);
}
INTERCEPTOR(int, swapcontext, struct ucontext_t *oucp,
@@ -279,9 +303,6 @@
ReadContextStack(ucp, &stack, &ssize);
ClearShadowMemoryForContextStack(stack, ssize);
- // See getcontext interceptor.
- ResetContextStack(oucp);
-
# if __has_attribute(__indirect_return__) && \
(defined(__x86_64__) || defined(__i386__))
int (*real_swapcontext)(struct ucontext_t *, struct ucontext_t *)
@@ -453,7 +474,9 @@
}
GET_STACK_TRACE_MALLOC;
void *new_mem = asan_malloc(length + 1, &stack);
- REAL(memcpy)(new_mem, s, length + 1);
+ if (new_mem) {
+ REAL(memcpy)(new_mem, s, length + 1);
+ }
return reinterpret_cast<char*>(new_mem);
}
@@ -469,7 +492,9 @@
}
GET_STACK_TRACE_MALLOC;
void *new_mem = asan_malloc(length + 1, &stack);
- REAL(memcpy)(new_mem, s, length + 1);
+ if (new_mem) {
+ REAL(memcpy)(new_mem, s, length + 1);
+ }
return reinterpret_cast<char*>(new_mem);
}
#endif // ASAN_INTERCEPT___STRDUP
@@ -658,11 +683,11 @@
// Intecept jump-related functions.
ASAN_INTERCEPT_FUNC(longjmp);
-#if ASAN_INTERCEPT_SWAPCONTEXT
- ASAN_INTERCEPT_FUNC(getcontext);
+# if ASAN_INTERCEPT_SWAPCONTEXT
ASAN_INTERCEPT_FUNC(swapcontext);
-#endif
-#if ASAN_INTERCEPT__LONGJMP
+ ASAN_INTERCEPT_FUNC(makecontext);
+# endif
+# if ASAN_INTERCEPT__LONGJMP
ASAN_INTERCEPT_FUNC(_longjmp);
#endif
#if ASAN_INTERCEPT___LONGJMP_CHK
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_interface_internal.h b/third_party/llvm-project/compiler-rt/lib/asan/asan_interface_internal.h
index 987f855..a998263 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_interface_internal.h
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_interface_internal.h
@@ -53,9 +53,10 @@
const char *module_name; // Module name as a C string. This pointer is a
// unique identifier of a module.
uptr has_dynamic_init; // Non-zero if the global has dynamic initializer.
- uptr windows_padding; // TODO: Figure out how to remove this padding
- // that's simply here to make the MSVC incremental
- // linker happy...
+ __asan_global_source_location *gcc_location; // Source location of a global,
+ // used by GCC compiler. LLVM uses
+ // llvm-symbolizer that relies
+ // on DWARF debugging info.
uptr odr_indicator; // The address of the ODR indicator symbol.
};
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_internal.h b/third_party/llvm-project/compiler-rt/lib/asan/asan_internal.h
index 959fdec..a5348e3 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_internal.h
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_internal.h
@@ -105,8 +105,8 @@
void AsanOnDeadlySignal(int, void *siginfo, void *context);
+void SignContextStack(void *context);
void ReadContextStack(void *context, uptr *stack, uptr *ssize);
-void ResetContextStack(void *context);
void StopInitOrderChecking();
// Wrapper for TLS/TSD.
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_linux.cpp b/third_party/llvm-project/compiler-rt/lib/asan/asan_linux.cpp
index 4c01ff9..e19b447 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_linux.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_linux.cpp
@@ -15,55 +15,56 @@
#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
SANITIZER_SOLARIS
-#include "asan_interceptors.h"
-#include "asan_internal.h"
-#include "asan_premap_shadow.h"
-#include "asan_thread.h"
-#include "sanitizer_common/sanitizer_flags.h"
-#include "sanitizer_common/sanitizer_freebsd.h"
-#include "sanitizer_common/sanitizer_libc.h"
-#include "sanitizer_common/sanitizer_procmaps.h"
+# include <dlfcn.h>
+# include <fcntl.h>
+# include <limits.h>
+# include <pthread.h>
+# include <stdio.h>
+# include <sys/mman.h>
+# include <sys/resource.h>
+# include <sys/syscall.h>
+# include <sys/time.h>
+# include <sys/types.h>
+# include <unistd.h>
+# include <unwind.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/mman.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <unwind.h>
+# include "asan_interceptors.h"
+# include "asan_internal.h"
+# include "asan_premap_shadow.h"
+# include "asan_thread.h"
+# include "sanitizer_common/sanitizer_flags.h"
+# include "sanitizer_common/sanitizer_freebsd.h"
+# include "sanitizer_common/sanitizer_hash.h"
+# include "sanitizer_common/sanitizer_libc.h"
+# include "sanitizer_common/sanitizer_procmaps.h"
-#if SANITIZER_FREEBSD
-#include <sys/link_elf.h>
-#endif
+# if SANITIZER_FREEBSD
+# include <sys/link_elf.h>
+# endif
-#if SANITIZER_SOLARIS
-#include <link.h>
-#endif
+# if SANITIZER_SOLARIS
+# include <link.h>
+# endif
-#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
-#include <ucontext.h>
-extern "C" void* _DYNAMIC;
-#elif SANITIZER_NETBSD
-#include <link_elf.h>
-#include <ucontext.h>
+# if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
+# include <ucontext.h>
+extern "C" void *_DYNAMIC;
+# elif SANITIZER_NETBSD
+# include <link_elf.h>
+# include <ucontext.h>
extern Elf_Dyn _DYNAMIC;
-#else
-#include <sys/ucontext.h>
-#include <link.h>
+# else
+# include <link.h>
+# include <sys/ucontext.h>
extern ElfW(Dyn) _DYNAMIC[];
-#endif
+# endif
// x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in
// 32-bit mode.
-#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \
- __FreeBSD_version <= 902001 // v9.2
-#define ucontext_t xucontext_t
-#endif
+# if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \
+ __FreeBSD_version <= 902001 // v9.2
+# define ucontext_t xucontext_t
+# endif
typedef enum {
ASAN_RT_VERSION_UNDEFINED = 0,
@@ -74,21 +75,21 @@
// FIXME: perhaps also store abi version here?
extern "C" {
SANITIZER_INTERFACE_ATTRIBUTE
-asan_rt_version_t __asan_rt_version;
+asan_rt_version_t __asan_rt_version;
}
namespace __asan {
void InitializePlatformInterceptors() {}
void InitializePlatformExceptionHandlers() {}
-bool IsSystemHeapAddress (uptr addr) { return false; }
+bool IsSystemHeapAddress(uptr addr) { return false; }
void *AsanDoesNotSupportStaticLinkage() {
// This will fail to link with -static.
return &_DYNAMIC;
}
-#if ASAN_PREMAP_SHADOW
+# if ASAN_PREMAP_SHADOW
uptr FindPremappedShadowStart(uptr shadow_size_bytes) {
uptr granularity = GetMmapGranularity();
uptr shadow_start = reinterpret_cast<uptr>(&__asan_shadow);
@@ -98,14 +99,14 @@
UnmapFromTo(shadow_start + shadow_size, shadow_start + premap_shadow_size);
return shadow_start;
}
-#endif
+# endif
uptr FindDynamicShadowStart() {
uptr shadow_size_bytes = MemToShadowSize(kHighMemEnd);
-#if ASAN_PREMAP_SHADOW
+# if ASAN_PREMAP_SHADOW
if (!PremapShadowFailed())
return FindPremappedShadowStart(shadow_size_bytes);
-#endif
+# endif
return MapDynamicShadow(shadow_size_bytes, ASAN_SHADOW_SCALE,
/*min_shadow_base_alignment*/ 0, kHighMemEnd);
@@ -121,11 +122,11 @@
ReleaseMemoryPagesToOS(MemToShadow(p), MemToShadow(p + size));
}
-#if SANITIZER_ANDROID
+# if SANITIZER_ANDROID
// FIXME: should we do anything for Android?
void AsanCheckDynamicRTPrereqs() {}
void AsanCheckIncompatibleRT() {}
-#else
+# else
static int FindFirstDSOCallback(struct dl_phdr_info *info, size_t size,
void *data) {
VReport(2, "info->dlpi_name = %s\tinfo->dlpi_addr = %p\n", info->dlpi_name,
@@ -154,7 +155,7 @@
static bool IsDynamicRTName(const char *libname) {
return internal_strstr(libname, "libclang_rt.asan") ||
- internal_strstr(libname, "libasan.so");
+ internal_strstr(libname, "libasan.so");
}
static void ReportIncompatibleRT() {
@@ -170,9 +171,10 @@
const char *first_dso_name = nullptr;
dl_iterate_phdr(FindFirstDSOCallback, &first_dso_name);
if (first_dso_name && first_dso_name[0] && !IsDynamicRTName(first_dso_name)) {
- Report("ASan runtime does not come first in initial library list; "
- "you should either link runtime to your application or "
- "manually preload it with LD_PRELOAD.\n");
+ Report(
+ "ASan runtime does not come first in initial library list; "
+ "you should either link runtime to your application or "
+ "manually preload it with LD_PRELOAD.\n");
Die();
}
}
@@ -190,13 +192,14 @@
// as early as possible, otherwise ASan interceptors could bind to
// the functions in dynamic ASan runtime instead of the functions in
// system libraries, causing crashes later in ASan initialization.
- MemoryMappingLayout proc_maps(/*cache_enabled*/true);
+ MemoryMappingLayout proc_maps(/*cache_enabled*/ true);
char filename[PATH_MAX];
MemoryMappedSegment segment(filename, sizeof(filename));
while (proc_maps.Next(&segment)) {
if (IsDynamicRTName(segment.filename)) {
- Report("Your application is linked against "
- "incompatible ASan runtimes.\n");
+ Report(
+ "Your application is linked against "
+ "incompatible ASan runtimes.\n");
Die();
}
}
@@ -206,25 +209,36 @@
}
}
}
-#endif // SANITIZER_ANDROID
+# endif // SANITIZER_ANDROID
# if ASAN_INTERCEPT_SWAPCONTEXT
-void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
- ucontext_t *ucp = (ucontext_t*)context;
- *stack = (uptr)ucp->uc_stack.ss_sp;
- *ssize = ucp->uc_stack.ss_size;
+constexpr u32 kAsanContextStackFlagsMagic = 0x51260eea;
+
+static int HashContextStack(const ucontext_t &ucp) {
+ MurMur2Hash64Builder hash(kAsanContextStackFlagsMagic);
+ hash.add(reinterpret_cast<uptr>(ucp.uc_stack.ss_sp));
+ hash.add(ucp.uc_stack.ss_size);
+ return static_cast<int>(hash.get());
}
-void ResetContextStack(void *context) {
- ucontext_t *ucp = (ucontext_t *)context;
- ucp->uc_stack.ss_sp = nullptr;
- ucp->uc_stack.ss_size = 0;
+void SignContextStack(void *context) {
+ ucontext_t *ucp = reinterpret_cast<ucontext_t *>(context);
+ ucp->uc_stack.ss_flags = HashContextStack(*ucp);
+}
+
+void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
+ const ucontext_t *ucp = reinterpret_cast<const ucontext_t *>(context);
+ if (HashContextStack(*ucp) == ucp->uc_stack.ss_flags) {
+ *stack = reinterpret_cast<uptr>(ucp->uc_stack.ss_sp);
+ *ssize = ucp->uc_stack.ss_size;
+ return;
+ }
+ *stack = 0;
+ *ssize = 0;
}
# endif // ASAN_INTERCEPT_SWAPCONTEXT
-void *AsanDlSymNext(const char *sym) {
- return dlsym(RTLD_NEXT, sym);
-}
+void *AsanDlSymNext(const char *sym) { return dlsym(RTLD_NEXT, sym); }
bool HandleDlopenInit() {
// Not supported on this platform.
@@ -233,7 +247,7 @@
return false;
}
-} // namespace __asan
+} // namespace __asan
#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD ||
// SANITIZER_SOLARIS
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_memory_profile.cpp b/third_party/llvm-project/compiler-rt/lib/asan/asan_memory_profile.cpp
index 4fcd560..3396fc2 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_memory_profile.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_memory_profile.cpp
@@ -11,12 +11,11 @@
// This file implements __sanitizer_print_memory_profile.
//===----------------------------------------------------------------------===//
+#include "asan/asan_allocator.h"
+#include "lsan/lsan_common.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
#include "sanitizer_common/sanitizer_stacktrace.h"
-#include "sanitizer_common/sanitizer_stoptheworld.h"
-#include "lsan/lsan_common.h"
-#include "asan/asan_allocator.h"
#if CAN_SANITIZE_LEAKS
@@ -100,17 +99,16 @@
FindHeapChunkByAllocBeg(chunk));
}
-static void MemoryProfileCB(const SuspendedThreadsList &suspended_threads_list,
- void *argument) {
+static void MemoryProfileCB(uptr top_percent, uptr max_number_of_contexts) {
HeapProfile hp;
+ __lsan::LockAllocator();
__lsan::ForEachChunk(ChunkCallback, &hp);
- uptr *Arg = reinterpret_cast<uptr*>(argument);
- hp.Print(Arg[0], Arg[1]);
+ __lsan::UnlockAllocator();
+ hp.Print(top_percent, max_number_of_contexts);
if (Verbosity())
__asan_print_accumulated_stats();
}
-
} // namespace __asan
#endif // CAN_SANITIZE_LEAKS
@@ -120,10 +118,7 @@
void __sanitizer_print_memory_profile(uptr top_percent,
uptr max_number_of_contexts) {
#if CAN_SANITIZE_LEAKS
- uptr Arg[2];
- Arg[0] = top_percent;
- Arg[1] = max_number_of_contexts;
- __sanitizer::StopTheWorld(__asan::MemoryProfileCB, Arg);
+ __asan::MemoryProfileCB(top_percent, max_number_of_contexts);
#endif // CAN_SANITIZE_LEAKS
}
} // extern "C"
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/asan_thread.cpp b/third_party/llvm-project/compiler-rt/lib/asan/asan_thread.cpp
index 003cd2b..56636b5 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/asan_thread.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/asan_thread.cpp
@@ -306,6 +306,7 @@
GetThreadStackAndTls(tid() == kMainTid, &stack_bottom_, &stack_size,
&tls_begin_, &tls_size);
stack_top_ = RoundDownTo(stack_bottom_ + stack_size, ASAN_SHADOW_GRANULARITY);
+ stack_bottom_ = RoundDownTo(stack_bottom_, ASAN_SHADOW_GRANULARITY);
tls_end_ = tls_begin_ + tls_size;
dtls_ = DTLS_Get();
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_str_test.cpp b/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_str_test.cpp
index 1bf6c35..8b1c1dc 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_str_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_str_test.cpp
@@ -110,8 +110,16 @@
}
#endif
+// This test fails on MinGW-w64 because it still ships a static copy of strnlen
+// despite it being available from UCRT.
+#if defined(__MINGW32__)
+# define MAYBE_StrNLenOOBTest DISABLED_StrNLenOOBTest
+#else
+# define MAYBE_StrNLenOOBTest StrNLenOOBTest
+#endif
+
#if SANITIZER_TEST_HAS_STRNLEN
-TEST(AddressSanitizer, StrNLenOOBTest) {
+TEST(AddressSanitizer, MAYBE_StrNLenOOBTest) {
size_t size = Ident(123);
char *str = MallocAndMemsetString(size);
// Normal strnlen calls.
@@ -132,10 +140,10 @@
// This test fails with the WinASan dynamic runtime because we fail to intercept
// strdup.
-#if defined(_MSC_VER) && defined(_DLL)
-#define MAYBE_StrDupOOBTest DISABLED_StrDupOOBTest
+#if (defined(_MSC_VER) && defined(_DLL)) || defined(__MINGW32__)
+# define MAYBE_StrDupOOBTest DISABLED_StrDupOOBTest
#else
-#define MAYBE_StrDupOOBTest StrDupOOBTest
+# define MAYBE_StrDupOOBTest StrDupOOBTest
#endif
TEST(AddressSanitizer, MAYBE_StrDupOOBTest) {
diff --git a/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_test.cpp b/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_test.cpp
index 40b335d..827c2ae 100644
--- a/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/asan/tests/asan_test.cpp
@@ -203,8 +203,16 @@
TEST(AddressSanitizer, UAF_long_double) {
if (sizeof(long double) == sizeof(double)) return;
long double *p = Ident(new long double[10]);
+#if defined(_WIN32)
+ // https://google.github.io/googletest/advanced.html#regular-expression-syntax
+ // GoogleTest's regular expression engine on Windows does not support `[]`
+ // brackets.
+ EXPECT_DEATH(Ident(p)[12] = 0, "WRITE of size 10");
+ EXPECT_DEATH(Ident(p)[0] = Ident(p)[12], "READ of size 10");
+#else
EXPECT_DEATH(Ident(p)[12] = 0, "WRITE of size 1[026]");
EXPECT_DEATH(Ident(p)[0] = Ident(p)[12], "READ of size 1[026]");
+#endif
delete [] Ident(p);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt
index 5e2274d..a302306 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt
@@ -58,6 +58,7 @@
endif()
include(builtin-config-ix)
+include(CMakePushCheckState)
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
include(CompilerRTAIXUtils)
@@ -190,14 +191,11 @@
umodti3.c
)
-# Build BF16 files only when "__bf16" is available.
-if(COMPILER_RT_HAS_BFLOAT16 AND NOT APPLE)
- set(GENERIC_SOURCES
- ${GENERIC_SOURCES}
+# We only build BF16 files when "__bf16" is available.
+set(BF16_SOURCES
truncdfbf2.c
truncsfbf2.c
- )
-endif()
+)
# TODO: Several "tf" files (and divtc3.c, but not multc3.c) are in
# GENERIC_SOURCES instead of here.
@@ -312,17 +310,27 @@
${x86_ARCH_SOURCES}
x86_64/floatdidf.c
x86_64/floatdisf.c
- x86_64/floatundidf.S
- x86_64/floatundisf.S
)
+ if (NOT WIN32)
+ set(x86_64_SOURCES
+ ${x86_64_SOURCES}
+ x86_64/floatundidf.S
+ x86_64/floatundisf.S
+ )
+ endif()
if (NOT ANDROID)
set(x86_64_SOURCES
${x86_64_SOURCES}
${x86_80_BIT_SOURCES}
x86_64/floatdixf.c
- x86_64/floatundixf.S
)
+ if (NOT WIN32)
+ set(x86_64_SOURCES
+ ${x86_64_SOURCES}
+ x86_64/floatundixf.S
+ )
+ endif()
endif()
# Darwin x86_64 Haswell
@@ -607,6 +615,7 @@
set(armv6m_SOURCES ${thumb1_SOURCES})
set(armv7m_SOURCES ${arm_SOURCES})
set(armv7em_SOURCES ${arm_SOURCES})
+set(armv8m.base_SOURCES ${thumb1_SOURCES})
set(armv8m.main_SOURCES ${arm_SOURCES})
set(armv8.1m.main_SOURCES ${arm_SOURCES})
@@ -735,6 +744,10 @@
add_custom_target(builtins)
set_target_properties(builtins PROPERTIES FOLDER "Compiler-RT Misc")
+option(COMPILER_RT_ENABLE_SOFTWARE_INT128
+ "Enable the int128 builtin routines for all targets."
+ OFF)
+
if (APPLE)
add_subdirectory(Darwin-excludes)
add_subdirectory(macho_embedded)
@@ -747,8 +760,6 @@
append_list_if(COMPILER_RT_ENABLE_CET -fcf-protection=full BUILTIN_CFLAGS)
endif()
- append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS)
-
append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS)
# These flags would normally be added to CMAKE_C_FLAGS by the llvm
@@ -780,7 +791,11 @@
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
if (CAN_TARGET_${arch})
+ cmake_push_check_state()
+ # TODO: we should probably make most of the checks in builtin-config depend on the target flags.
+ message(STATUS "Performing additional configure checks with target flags: ${TARGET_${arch}_CFLAGS}")
set(BUILTIN_CFLAGS_${arch} ${BUILTIN_CFLAGS})
+ list(APPEND CMAKE_REQUIRED_FLAGS ${TARGET_${arch}_CFLAGS} ${BUILTIN_CFLAGS_${arch}})
# For ARM archs, exclude any VFP builtins if VFP is not supported
if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
@@ -799,6 +814,15 @@
endif()
endif()
endif()
+ check_c_source_compiles("_Float16 foo(_Float16 x) { return x; }"
+ COMPILER_RT_HAS_${arch}_FLOAT16)
+ append_list_if(COMPILER_RT_HAS_${arch}_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch})
+ check_c_source_compiles("__bf16 foo(__bf16 x) { return x; }"
+ COMPILER_RT_HAS_${arch}_BFLOAT16)
+ # Build BF16 files only when "__bf16" is available.
+ if(COMPILER_RT_HAS_${arch}_BFLOAT16)
+ list(APPEND ${arch}_SOURCES ${BF16_SOURCES})
+ endif()
# Remove a generic C builtin when an arch-specific builtin is specified.
filter_builtin_sources(${arch}_SOURCES ${arch})
@@ -811,7 +835,7 @@
# For RISCV32, we must force enable int128 for compiling long
# double routines.
- if("${arch}" STREQUAL "riscv32")
+ if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32")
list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
endif()
@@ -833,6 +857,7 @@
DEFS ${BUILTIN_DEFS}
CFLAGS ${BUILTIN_CFLAGS_${arch}}
PARENT_TARGET builtins)
+ cmake_pop_check_state()
endif ()
endforeach ()
endif ()
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/README.txt b/third_party/llvm-project/compiler-rt/lib/builtins/README.txt
index 53d656d..5637183 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/README.txt
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/README.txt
@@ -35,13 +35,13 @@
// Integral bit manipulation
-di_int __ashldi3(di_int a, si_int b); // a << b
-ti_int __ashlti3(ti_int a, si_int b); // a << b
+di_int __ashldi3(di_int a, int b); // a << b
+ti_int __ashlti3(ti_int a, int b); // a << b
-di_int __ashrdi3(di_int a, si_int b); // a >> b arithmetic (sign fill)
-ti_int __ashrti3(ti_int a, si_int b); // a >> b arithmetic (sign fill)
-di_int __lshrdi3(di_int a, si_int b); // a >> b logical (zero fill)
-ti_int __lshrti3(ti_int a, si_int b); // a >> b logical (zero fill)
+di_int __ashrdi3(di_int a, int b); // a >> b arithmetic (sign fill)
+ti_int __ashrti3(ti_int a, int b); // a >> b arithmetic (sign fill)
+di_int __lshrdi3(di_int a, int b); // a >> b logical (zero fill)
+ti_int __lshrti3(ti_int a, int b); // a >> b logical (zero fill)
int __clzsi2(si_int a); // count leading zeros
int __clzdi2(di_int a); // count leading zeros
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/arm/divsi3.S b/third_party/llvm-project/compiler-rt/lib/builtins/arm/divsi3.S
index 761bf49..faf9af9 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/arm/divsi3.S
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/arm/divsi3.S
@@ -37,7 +37,8 @@
sdiv r0, r0, r1
bx lr
LOCAL_LABEL(divzero):
- mov r0,#0
+ // Use movs for compatibility with v8-m.base.
+ movs r0,#0
bx lr
#else
ESTABLISH_FRAME
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/arm/udivsi3.S b/third_party/llvm-project/compiler-rt/lib/builtins/arm/udivsi3.S
index 9b1b035..0567ab4 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/arm/udivsi3.S
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/arm/udivsi3.S
@@ -32,7 +32,8 @@
bx lr
LOCAL_LABEL(divby0):
- mov r0, #0
+ // Use movs for compatibility with v8-m.base.
+ movs r0, #0
# ifdef __ARM_EABI__
b __aeabi_idiv0
# else
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/ashlti3.c b/third_party/llvm-project/compiler-rt/lib/builtins/ashlti3.c
index 2d7bd4a..99a133f 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/ashlti3.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/ashlti3.c
@@ -18,7 +18,7 @@
// Precondition: 0 <= b < bits_in_tword
-COMPILER_RT_ABI ti_int __ashlti3(ti_int a, si_int b) {
+COMPILER_RT_ABI ti_int __ashlti3(ti_int a, int b) {
const int bits_in_dword = (int)(sizeof(di_int) * CHAR_BIT);
twords input;
twords result;
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/ashrti3.c b/third_party/llvm-project/compiler-rt/lib/builtins/ashrti3.c
index f573b6d..b306051 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/ashrti3.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/ashrti3.c
@@ -18,7 +18,7 @@
// Precondition: 0 <= b < bits_in_tword
-COMPILER_RT_ABI ti_int __ashrti3(ti_int a, si_int b) {
+COMPILER_RT_ABI ti_int __ashrti3(ti_int a, int b) {
const int bits_in_dword = (int)(sizeof(di_int) * CHAR_BIT);
twords input;
twords result;
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/assembly.h b/third_party/llvm-project/compiler-rt/lib/builtins/assembly.h
index 69a3d86..169d496 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/assembly.h
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/assembly.h
@@ -267,7 +267,7 @@
#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \
.globl SYMBOL_NAME(name) SEPARATOR \
SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
- DECLARE_SYMBOL_VISIBILITY(SYMBOL_NAME(name)) SEPARATOR \
+ DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \
.set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR
#if defined(__ARM_EABI__)
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/cpu_model.c b/third_party/llvm-project/compiler-rt/lib/builtins/cpu_model.c
index c5d7ae3..01bab46 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/cpu_model.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/cpu_model.c
@@ -646,7 +646,7 @@
static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
unsigned *Features) {
- unsigned EAX, EBX;
+ unsigned EAX = 0, EBX = 0;
#define setFeature(F) \
Features[F / 32] |= 1U << (F % 32)
@@ -924,6 +924,9 @@
#define HWCAP_SB (1 << 29)
#endif
+#ifndef AT_HWCAP2
+#define AT_HWCAP2 26
+#endif
#ifndef HWCAP2_DCPODP
#define HWCAP2_DCPODP (1 << 0)
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/floatdidf.c b/third_party/llvm-project/compiler-rt/lib/builtins/floatdidf.c
index d37c43b..c994aad 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/floatdidf.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/floatdidf.c
@@ -50,7 +50,7 @@
return 0.0;
const unsigned N = sizeof(di_int) * CHAR_BIT;
const di_int s = a >> (N - 1);
- a = (a ^ s) - s;
+ a = (du_int)(a ^ s) - s;
int sd = N - __builtin_clzll(a); // number of significant digits
int e = sd - 1; // exponent
if (sd > DBL_MANT_DIG) {
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/floatdisf.c b/third_party/llvm-project/compiler-rt/lib/builtins/floatdisf.c
index 5c63164..0b62ed8 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/floatdisf.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/floatdisf.c
@@ -24,7 +24,7 @@
return 0.0F;
const unsigned N = sizeof(di_int) * CHAR_BIT;
const di_int s = a >> (N - 1);
- a = (a ^ s) - s;
+ a = (du_int)(a ^ s) - s;
int sd = N - __builtin_clzll(a); // number of significant digits
si_int e = sd - 1; // exponent
if (sd > FLT_MANT_DIG) {
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/int_mulo_impl.inc b/third_party/llvm-project/compiler-rt/lib/builtins/int_mulo_impl.inc
index 567d8b9..27e7c8c 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/int_mulo_impl.inc
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/int_mulo_impl.inc
@@ -18,10 +18,10 @@
static __inline fixint_t __muloXi4(fixint_t a, fixint_t b, int *overflow) {
const int N = (int)(sizeof(fixint_t) * CHAR_BIT);
- const fixint_t MIN = (fixint_t)1 << (N - 1);
+ const fixint_t MIN = (fixint_t)((fixuint_t)1 << (N - 1));
const fixint_t MAX = ~MIN;
*overflow = 0;
- fixint_t result = a * b;
+ fixint_t result = (fixuint_t)a * b;
if (a == MIN) {
if (b != 0 && b != 1)
*overflow = 1;
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/int_mulv_impl.inc b/third_party/llvm-project/compiler-rt/lib/builtins/int_mulv_impl.inc
index 1e92071..06559cf 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/int_mulv_impl.inc
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/int_mulv_impl.inc
@@ -18,7 +18,7 @@
static __inline fixint_t __mulvXi3(fixint_t a, fixint_t b) {
const int N = (int)(sizeof(fixint_t) * CHAR_BIT);
- const fixint_t MIN = (fixint_t)1 << (N - 1);
+ const fixint_t MIN = (fixint_t)((fixuint_t)1 << (N - 1));
const fixint_t MAX = ~MIN;
if (a == MIN) {
if (b == 0 || b == 1)
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/lshrti3.c b/third_party/llvm-project/compiler-rt/lib/builtins/lshrti3.c
index d00a220..5dc8a0a 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/lshrti3.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/lshrti3.c
@@ -18,7 +18,7 @@
// Precondition: 0 <= b < bits_in_tword
-COMPILER_RT_ABI ti_int __lshrti3(ti_int a, si_int b) {
+COMPILER_RT_ABI ti_int __lshrti3(ti_int a, int b) {
const int bits_in_dword = (int)(sizeof(di_int) * CHAR_BIT);
utwords input;
utwords result;
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/mulodi4.c b/third_party/llvm-project/compiler-rt/lib/builtins/mulodi4.c
index 7209676..6ecf926 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/mulodi4.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/mulodi4.c
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#define fixint_t di_int
+#define fixuint_t du_int
#include "int_mulo_impl.inc"
// Returns: a * b
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/mulosi4.c b/third_party/llvm-project/compiler-rt/lib/builtins/mulosi4.c
index 4e03c24..3fd18a1 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/mulosi4.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/mulosi4.c
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#define fixint_t si_int
+#define fixuint_t su_int
#include "int_mulo_impl.inc"
// Returns: a * b
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/muloti4.c b/third_party/llvm-project/compiler-rt/lib/builtins/muloti4.c
index 9a7aa85..9aab6fc 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/muloti4.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/muloti4.c
@@ -19,6 +19,7 @@
// Effects: sets *overflow to 1 if a * b overflows
#define fixint_t ti_int
+#define fixuint_t tu_int
#include "int_mulo_impl.inc"
COMPILER_RT_ABI ti_int __muloti4(ti_int a, ti_int b, int *overflow) {
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/mulvdi3.c b/third_party/llvm-project/compiler-rt/lib/builtins/mulvdi3.c
index 1d672c6..d787d29 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/mulvdi3.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/mulvdi3.c
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#define fixint_t di_int
+#define fixuint_t du_int
#include "int_mulv_impl.inc"
// Returns: a * b
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/mulvsi3.c b/third_party/llvm-project/compiler-rt/lib/builtins/mulvsi3.c
index 00b2e50..2571881 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/mulvsi3.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/mulvsi3.c
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#define fixint_t si_int
+#define fixuint_t su_int
#include "int_mulv_impl.inc"
// Returns: a * b
diff --git a/third_party/llvm-project/compiler-rt/lib/builtins/mulvti3.c b/third_party/llvm-project/compiler-rt/lib/builtins/mulvti3.c
index ba35514..fad9b2a 100644
--- a/third_party/llvm-project/compiler-rt/lib/builtins/mulvti3.c
+++ b/third_party/llvm-project/compiler-rt/lib/builtins/mulvti3.c
@@ -19,6 +19,7 @@
// Effects: aborts if a * b overflows
#define fixint_t ti_int
+#define fixuint_t tu_int
#include "int_mulv_impl.inc"
COMPILER_RT_ABI ti_int __mulvti3(ti_int a, ti_int b) { return __mulvXi3(a, b); }
diff --git a/third_party/llvm-project/compiler-rt/lib/crt/crtbegin.c b/third_party/llvm-project/compiler-rt/lib/crt/crtbegin.c
index 7b041ff..a0860ca 100644
--- a/third_party/llvm-project/compiler-rt/lib/crt/crtbegin.c
+++ b/third_party/llvm-project/compiler-rt/lib/crt/crtbegin.c
@@ -50,25 +50,29 @@
used)) static void (*__init)(void) = __do_init;
#elif defined(__i386__) || defined(__x86_64__)
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
- "call " __USER_LABEL_PREFIX__ "__do_init\n\t"
- ".popsection");
+ "call __do_init\n\t"
+ ".popsection");
#elif defined(__riscv)
__asm__(".pushsection .init,\"ax\",%progbits\n\t"
- "call " __USER_LABEL_PREFIX__ "__do_init\n\t"
+ "call __do_init\n\t"
".popsection");
#elif defined(__arm__) || defined(__aarch64__)
__asm__(".pushsection .init,\"ax\",%progbits\n\t"
- "bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
- ".popsection");
+ "bl __do_init\n\t"
+ ".popsection");
+#elif defined(__mips__)
+__asm__(".pushsection .init,\"ax\",@progbits\n\t"
+ "jal __do_init\n\t"
+ ".popsection");
#elif defined(__powerpc__) || defined(__powerpc64__)
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
- "bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
- "nop\n\t"
- ".popsection");
+ "bl __do_init\n\t"
+ "nop\n\t"
+ ".popsection");
#elif defined(__sparc__)
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
- "call " __USER_LABEL_PREFIX__ "__do_init\n\t"
- ".popsection");
+ "call __do_init\n\t"
+ ".popsection");
#else
#error "crtbegin without .init_fini array unimplemented for this architecture"
#endif // CRT_HAS_INITFINI_ARRAY
@@ -103,25 +107,29 @@
used)) static void (*__fini)(void) = __do_fini;
#elif defined(__i386__) || defined(__x86_64__)
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
- "call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
- ".popsection");
+ "call __do_fini\n\t"
+ ".popsection");
#elif defined(__arm__) || defined(__aarch64__)
__asm__(".pushsection .fini,\"ax\",%progbits\n\t"
- "bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
- ".popsection");
+ "bl __do_fini\n\t"
+ ".popsection");
+#elif defined(__mips__)
+__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
+ "jal __do_fini\n\t"
+ ".popsection");
#elif defined(__powerpc__) || defined(__powerpc64__)
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
- "bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
- "nop\n\t"
- ".popsection");
+ "bl __do_fini\n\t"
+ "nop\n\t"
+ ".popsection");
#elif defined(__riscv)
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
- "call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
+ "call __do_fini\n\t"
".popsection");
#elif defined(__sparc__)
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
- "call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
- ".popsection");
+ "call __do_fini\n\t"
+ ".popsection");
#else
#error "crtbegin without .init_fini array unimplemented for this architecture"
#endif // CRT_HAS_INIT_FINI_ARRAY
diff --git a/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan.cpp b/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan.cpp
index faf5a66..a579c9e 100644
--- a/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan.cpp
@@ -197,8 +197,7 @@
#define PRINT_CALLER_STACK_TRACE \
{ \
- GET_CALLER_PC_BP_SP; \
- (void)sp; \
+ GET_CALLER_PC_BP; \
GET_STORE_STACK_TRACE_PC_BP(pc, bp) \
stack.Print(); \
}
@@ -381,8 +380,7 @@
}
#define RET_CHAIN_ORIGIN(id) \
- GET_CALLER_PC_BP_SP; \
- (void)sp; \
+ GET_CALLER_PC_BP; \
GET_STORE_STACK_TRACE_PC_BP(pc, bp); \
return ChainOrigin(id, &stack);
@@ -567,8 +565,7 @@
extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __dfsan_maybe_store_origin(
dfsan_label s, void *p, uptr size, dfsan_origin o) {
if (UNLIKELY(s)) {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
GET_STORE_STACK_TRACE_PC_BP(pc, bp);
SetOrigin(p, size, ChainOrigin(o, &stack));
}
diff --git a/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan_allocator.cpp b/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan_allocator.cpp
index 5fb8fef..3075b6d 100644
--- a/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan_allocator.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/dfsan/dfsan_allocator.cpp
@@ -174,6 +174,20 @@
return DFsanAllocate(nmemb * size, sizeof(u64), true /*zeroise*/);
}
+static const void *AllocationBegin(const void *p) {
+ if (!p)
+ return nullptr;
+ void *beg = allocator.GetBlockBegin(p);
+ if (!beg)
+ return nullptr;
+ Metadata *b = (Metadata *)allocator.GetMetaData(beg);
+ if (!b)
+ return nullptr;
+ if (b->requested_size == 0)
+ return nullptr;
+ return (const void *)beg;
+}
+
static uptr AllocationSize(const void *p) {
if (!p)
return 0;
@@ -294,4 +308,8 @@
int __sanitizer_get_ownership(const void *p) { return AllocationSize(p) != 0; }
+const void *__sanitizer_get_allocated_begin(const void *p) {
+ return AllocationBegin(p);
+}
+
uptr __sanitizer_get_allocated_size(const void *p) { return AllocationSize(p); }
diff --git a/third_party/llvm-project/compiler-rt/lib/dfsan/scripts/build-libc-list.py b/third_party/llvm-project/compiler-rt/lib/dfsan/scripts/build-libc-list.py
index 5247496..aa155b2 100755
--- a/third_party/llvm-project/compiler-rt/lib/dfsan/scripts/build-libc-list.py
+++ b/third_party/llvm-project/compiler-rt/lib/dfsan/scripts/build-libc-list.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#===- lib/dfsan/scripts/build-libc-list.py ---------------------------------===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -40,11 +40,13 @@
import sys
from optparse import OptionParser
-def defined_function_list(object):
+
+def defined_function_list(lib):
+ """Get non-local function symbols from lib."""
functions = []
- readelf_proc = subprocess.Popen(['readelf', '-s', '-W', object],
+ readelf_proc = subprocess.Popen(['readelf', '-s', '-W', lib],
stdout=subprocess.PIPE)
- readelf = readelf_proc.communicate()[0].split('\n')
+ readelf = readelf_proc.communicate()[0].decode().split('\n')
if readelf_proc.returncode != 0:
raise subprocess.CalledProcessError(readelf_proc.returncode, 'readelf')
for line in readelf:
@@ -69,7 +71,7 @@
libs = options.lib_file
if not libs:
- print >> sys.stderr, 'No libraries provided.'
+ print('No libraries provided.', file=sys.stderr)
exit(1)
missing_lib = False
@@ -79,14 +81,11 @@
functions += defined_function_list(l)
else:
missing_lib = True
- print >> sys.stderr, 'warning: library %s not found' % l
+ print('warning: library %s not found' % l, file=sys.stderr)
if options.error_missing_lib and missing_lib:
- print >> sys.stderr, 'Exiting with failure code due to missing library.'
+ print('Exiting with failure code due to missing library.', file=sys.stderr)
exit(1)
-functions = list(set(functions))
-functions.sort()
-
-for f in functions:
- print 'fun:%s=uninstrumented' % f
+for f in sorted(set(functions)):
+ print('fun:%s=uninstrumented' % f)
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerCommand.h b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerCommand.h
index f653fe3..eb68be9 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerCommand.h
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerCommand.h
@@ -139,7 +139,7 @@
// be the equivalent command line.
std::string toString() const {
std::stringstream SS;
- for (auto arg : getArguments())
+ for (const auto &arg : getArguments())
SS << arg << " ";
if (hasOutputFile())
SS << ">" << getOutputFile() << " ";
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp
index 2f9a4d2..93bf817 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp
@@ -88,7 +88,7 @@
// * a function with a less frequently executed code gets bigger weight.
std::vector<double> BlockCoverage::FunctionWeights(size_t NumFunctions) const {
std::vector<double> Res(NumFunctions);
- for (auto It : Functions) {
+ for (const auto &It : Functions) {
auto FunctionID = It.first;
auto Counters = It.second;
assert(FunctionID < NumFunctions);
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
index 6b007f2..8c8c953 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
@@ -463,7 +463,7 @@
CurrentFilePath = Flags.exact_artifact_path;
WriteToFile(U, CurrentFilePath);
}
- Printf("CRASH_MIN: failed to minimize beyond %s (%d bytes), exiting\n",
+ Printf("CRASH_MIN: failed to minimize beyond %s (%zu bytes), exiting\n",
CurrentFilePath.c_str(), U.size());
break;
}
@@ -501,7 +501,6 @@
F->MinimizeCrashLoop(U);
Printf("INFO: Done MinimizeCrashInputInternalStep, no crashes found\n");
exit(0);
- return 0;
}
void Merge(Fuzzer *F, FuzzingOptions &Options,
@@ -535,7 +534,7 @@
int AnalyzeDictionary(Fuzzer *F, const std::vector<Unit> &Dict,
UnitVector &Corpus) {
- Printf("Started dictionary minimization (up to %d tests)\n",
+ Printf("Started dictionary minimization (up to %zu tests)\n",
Dict.size() * Corpus.size() * 2);
// Scores and usage count for each dictionary unit.
@@ -779,7 +778,7 @@
if (!Options.FocusFunction.empty())
Options.Entropic = false; // FocusFunction overrides entropic scheduling.
if (Options.Entropic)
- Printf("INFO: Running with entropic power schedule (0x%X, %d).\n",
+ Printf("INFO: Running with entropic power schedule (0x%zX, %zu).\n",
Options.EntropicFeatureFrequencyThreshold,
Options.EntropicNumberOfRarestFeatures);
struct EntropicOptions Entropic;
@@ -797,7 +796,7 @@
if (Flags.verbosity)
Printf("INFO: Seed: %u\n", Seed);
- if (Flags.collect_data_flow && !Flags.fork &&
+ if (Flags.collect_data_flow && Flags.data_flow_trace && !Flags.fork &&
!(Flags.merge || Flags.set_cover_merge)) {
if (RunIndividualFiles)
return CollectDataFlow(Flags.collect_data_flow, Flags.data_flow_trace,
@@ -860,7 +859,7 @@
RunOneTest(F, Path.c_str(), Options.MaxLen);
auto StopTime = system_clock::now();
auto MS = duration_cast<milliseconds>(StopTime - StartTime).count();
- Printf("Executed %s in %zd ms\n", Path.c_str(), (long)MS);
+ Printf("Executed %s in %ld ms\n", Path.c_str(), (long)MS);
}
Printf("***\n"
"*** NOTE: fuzzing was not performed, you have only\n"
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerFork.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerFork.cpp
index d59d513..c248a1d 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerFork.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerFork.cpp
@@ -220,7 +220,7 @@
}
}
// if (!FilesToAdd.empty() || Job->ExitCode != 0)
- Printf("#%zd: cov: %zd ft: %zd corp: %zd exec/s %zd "
+ Printf("#%zd: cov: %zd ft: %zd corp: %zd exec/s: %zd "
"oom/timeout/crash: %zd/%zd/%zd time: %zds job: %zd dft_time: %d\n",
NumRuns, Cov.size(), Features.size(), Files.size(),
Stats.average_exec_per_sec, NumOOMs, NumTimeouts, NumCrashes,
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.cpp
index 0a58c53..54cc4ee 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.cpp
@@ -65,7 +65,7 @@
}
void CopyFileToErr(const std::string &Path) {
- Printf("%s", FileToString(Path).c_str());
+ Puts(FileToString(Path).c_str());
}
void WriteToFile(const Unit &U, const std::string &Path) {
@@ -151,6 +151,11 @@
DiscardOutput(1);
}
+void Puts(const char *Str) {
+ fputs(Str, OutputFile);
+ fflush(OutputFile);
+}
+
void Printf(const char *Fmt, ...) {
va_list ap;
va_start(ap, Fmt);
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.h b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.h
index 401afa0..874caad 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.h
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.h
@@ -58,6 +58,7 @@
FILE *GetOutputFile();
void SetOutputFile(FILE *NewOutputFile);
+void Puts(const char *Str);
void Printf(const char *Fmt, ...);
void VPrintf(bool Verbose, const char *Fmt, ...);
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerInternal.h b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerInternal.h
index a732ca8..8850470 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerInternal.h
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerInternal.h
@@ -29,12 +29,11 @@
using namespace std::chrono;
-class Fuzzer {
+class Fuzzer final {
public:
-
Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD,
- FuzzingOptions Options);
- ~Fuzzer();
+ const FuzzingOptions &Options);
+ ~Fuzzer() = delete;
void Loop(std::vector<SizedFile> &CorporaFiles);
void ReadAndExecuteSeedCorpora(std::vector<SizedFile> &CorporaFiles);
void MinimizeCrashLoop(const Unit &U);
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
index 00f5ed7..8b430c5 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
@@ -136,7 +136,7 @@
}
Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD,
- FuzzingOptions Options)
+ const FuzzingOptions &Options)
: CB(CB), Corpus(Corpus), MD(MD), Options(Options) {
if (EF->__sanitizer_set_death_callback)
EF->__sanitizer_set_death_callback(StaticDeathCallback);
@@ -160,8 +160,6 @@
memset(BaseSha1, 0, sizeof(BaseSha1));
}
-Fuzzer::~Fuzzer() {}
-
void Fuzzer::AllocateCurrentUnitData() {
if (CurrentUnitData || MaxInputLen == 0)
return;
@@ -301,7 +299,7 @@
Printf(" and the timeout value is %d (use -timeout=N to change)\n",
Options.UnitTimeoutSec);
DumpCurrentUnit("timeout-");
- Printf("==%lu== ERROR: libFuzzer: timeout after %d seconds\n", GetPid(),
+ Printf("==%lu== ERROR: libFuzzer: timeout after %zu seconds\n", GetPid(),
Seconds);
PrintStackTrace();
Printf("SUMMARY: libFuzzer: timeout\n");
@@ -314,9 +312,8 @@
if (EF->__sanitizer_acquire_crash_state &&
!EF->__sanitizer_acquire_crash_state())
return;
- Printf(
- "==%lu== ERROR: libFuzzer: out-of-memory (used: %zdMb; limit: %zdMb)\n",
- GetPid(), GetPeakRSSMb(), Options.RssLimitMb);
+ Printf("==%lu== ERROR: libFuzzer: out-of-memory (used: %zdMb; limit: %dMb)\n",
+ GetPid(), GetPeakRSSMb(), Options.RssLimitMb);
Printf(" To change the out-of-memory limit use -rss_limit_mb=<N>\n\n");
PrintMemoryProfile();
DumpCurrentUnit("oom-");
@@ -371,7 +368,7 @@
Printf("stat::number_of_executed_units: %zd\n", TotalNumberOfRuns);
Printf("stat::average_exec_per_sec: %zd\n", ExecPerSec);
Printf("stat::new_units_added: %zd\n", NumberOfNewUnitsAdded);
- Printf("stat::slowest_unit_time_sec: %zd\n", TimeOfLongestUnitInSeconds);
+ Printf("stat::slowest_unit_time_sec: %ld\n", TimeOfLongestUnitInSeconds);
Printf("stat::peak_rss_mb: %zd\n", GetPeakRSSMb());
}
@@ -455,7 +452,7 @@
static_cast<long>(static_cast<double>(TimeOfLongestUnitInSeconds) * 1.1);
if (TimeOfUnit > Threshhold && TimeOfUnit >= Options.ReportSlowUnits) {
TimeOfLongestUnitInSeconds = TimeOfUnit;
- Printf("Slowest unit: %zd s:\n", TimeOfLongestUnitInSeconds);
+ Printf("Slowest unit: %ld s:\n", TimeOfLongestUnitInSeconds);
WriteUnitToFileWithPrefix({Data, Data + Size}, "slow-unit-");
}
}
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMerge.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMerge.cpp
index 24bd119..8c8806e 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMerge.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMerge.cpp
@@ -77,6 +77,7 @@
size_t ExpectedStartMarker = 0;
const size_t kInvalidStartMarker = -1;
size_t LastSeenStartMarker = kInvalidStartMarker;
+ bool HaveFtMarker = true;
std::vector<uint32_t> TmpFeatures;
std::set<uint32_t> PCs;
while (std::getline(IS, Line, '\n')) {
@@ -93,12 +94,13 @@
LastSeenStartMarker = ExpectedStartMarker;
assert(ExpectedStartMarker < Files.size());
ExpectedStartMarker++;
+ HaveFtMarker = false;
} else if (Marker == "FT") {
// FT FILE_ID COV1 COV2 COV3 ...
size_t CurrentFileIdx = N;
if (CurrentFileIdx != LastSeenStartMarker)
return false;
- LastSeenStartMarker = kInvalidStartMarker;
+ HaveFtMarker = true;
if (ParseCoverage) {
TmpFeatures.clear(); // use a vector from outer scope to avoid resizes.
while (ISS1 >> N)
@@ -108,6 +110,8 @@
}
} else if (Marker == "COV") {
size_t CurrentFileIdx = N;
+ if (CurrentFileIdx != LastSeenStartMarker)
+ return false;
if (ParseCoverage)
while (ISS1 >> N)
if (PCs.insert(N).second)
@@ -116,7 +120,7 @@
return false;
}
}
- if (LastSeenStartMarker != kInvalidStartMarker)
+ if (!HaveFtMarker && LastSeenStartMarker != kInvalidStartMarker)
LastFailure = Files[LastSeenStartMarker].Name;
FirstNotProcessedFile = ExpectedStartMarker;
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMutate.cpp b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMutate.cpp
index d663900..1abce16 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMutate.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/FuzzerMutate.cpp
@@ -521,7 +521,7 @@
std::string MutationDispatcher::MutationSequence() {
std::string MS;
- for (auto M : CurrentMutatorSequence) {
+ for (const auto &M : CurrentMutatorSequence) {
MS += M.Name;
MS += "-";
}
diff --git a/third_party/llvm-project/compiler-rt/lib/fuzzer/tests/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/fuzzer/tests/CMakeLists.txt
index 10fcfba..dd82c49 100644
--- a/third_party/llvm-project/compiler-rt/lib/fuzzer/tests/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/fuzzer/tests/CMakeLists.txt
@@ -20,7 +20,7 @@
set(LIBFUZZER_UNITTEST_LINK_FLAGS ${COMPILER_RT_UNITTEST_LINK_FLAGS})
list(APPEND LIBFUZZER_UNITTEST_LINK_FLAGS --driver-mode=g++)
-if(WIN32)
+if(MSVC)
list(APPEND LIBFUZZER_UNITTEST_LINK_FLAGS -Wl,-defaultlib:libcmt,-defaultlib:oldnames)
else()
if (APPLE)
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
index e012963..198db5c 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
@@ -99,6 +99,12 @@
ThreadBuffer);
}
+static bool HasReportedBadPoolAccess = false;
+static const char *kUnknownCrashText =
+ "GWP-ASan cannot provide any more information about this error. This may "
+ "occur due to a wild memory access into the GWP-ASan pool, or an "
+ "overflow/underflow that is > 512B in length.\n";
+
void dumpReport(uintptr_t ErrorPtr, const gwp_asan::AllocatorState *State,
const gwp_asan::AllocationMetadata *Metadata,
SegvBacktrace_t SegvBacktrace, Printf_t Printf,
@@ -117,6 +123,15 @@
const gwp_asan::AllocationMetadata *AllocMeta =
__gwp_asan_get_metadata(State, Metadata, ErrorPtr);
+ if (AllocMeta == nullptr) {
+ if (HasReportedBadPoolAccess) return;
+ HasReportedBadPoolAccess = true;
+ Printf("*** GWP-ASan detected a memory error ***\n");
+ ScopedEndOfReportDecorator Decorator(Printf);
+ Printf(kUnknownCrashText);
+ return;
+ }
+
// It's unusual for a signal handler to be invoked multiple times for the same
// allocation, but it's possible in various scenarios, like:
// 1. A double-free or invalid-free was invoked in one thread at the same
@@ -132,9 +147,7 @@
Error E = __gwp_asan_diagnose_error(State, Metadata, ErrorPtr);
if (E == Error::UNKNOWN) {
- Printf("GWP-ASan cannot provide any more information about this error. "
- "This may occur due to a wild memory access into the GWP-ASan pool, "
- "or an overflow/underflow that is > 512B in length.\n");
+ Printf(kUnknownCrashText);
return;
}
@@ -149,9 +162,6 @@
PrintBacktrace(Trace, TraceLength, Printf);
- if (AllocMeta == nullptr)
- return;
-
// Maybe print the deallocation trace.
if (__gwp_asan_is_deallocated(AllocMeta)) {
uint64_t ThreadID = __gwp_asan_get_deallocation_thread_id(AllocMeta);
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
index 046ca7c..c961e41 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
@@ -27,7 +27,8 @@
enable_disable.cpp
late_init.cpp
options.cpp
- recoverable.cpp)
+ recoverable.cpp
+ never_allocated.cpp)
set(GWP_ASAN_UNIT_TEST_HEADERS
${GWP_ASAN_HEADERS}
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/backtrace.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/backtrace.cpp
index e878994..7cbbcf5 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/backtrace.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/backtrace.cpp
@@ -68,10 +68,6 @@
;
}
-INSTANTIATE_TEST_SUITE_P(RecoverableSignalDeathTest,
- BacktraceGuardedPoolAllocatorDeathTest,
- /* Recoverable */ testing::Bool());
-
TEST(Backtrace, Short) {
gwp_asan::AllocationMetadata Meta;
Meta.AllocationTrace.RecordBacktrace(
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/crash_handler_api.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/crash_handler_api.cpp
index 598b7b8..d270ed8 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/crash_handler_api.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/crash_handler_api.cpp
@@ -16,7 +16,7 @@
using AllocationMetadata = gwp_asan::AllocationMetadata;
using AllocatorState = gwp_asan::AllocatorState;
-class CrashHandlerAPITest : public Test {
+class CrashHandlerAPITest : public ::testing::Test {
public:
void SetUp() override { setupState(); }
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.cpp
index ccad80e..6d41630 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.cpp
@@ -8,6 +8,8 @@
#include "gwp_asan/tests/harness.h"
+#include <string>
+
namespace gwp_asan {
namespace test {
bool OnlyOnce() {
@@ -34,3 +36,19 @@
__attribute__((optnone)) void TouchMemory(void *Ptr) {
*(reinterpret_cast<volatile char *>(Ptr)) = 7;
}
+
+void CheckOnlyOneGwpAsanCrash(const std::string &OutputBuffer) {
+ const char *kGwpAsanErrorString = "GWP-ASan detected a memory error";
+ size_t FirstIndex = OutputBuffer.find(kGwpAsanErrorString);
+ ASSERT_NE(FirstIndex, std::string::npos) << "Didn't detect a GWP-ASan crash";
+ ASSERT_EQ(OutputBuffer.find(kGwpAsanErrorString, FirstIndex + 1),
+ std::string::npos)
+ << "Detected more than one GWP-ASan crash:\n"
+ << OutputBuffer;
+}
+
+INSTANTIATE_TEST_SUITE_P(RecoverableTests, BacktraceGuardedPoolAllocator,
+ /* Recoverable */ testing::Values(true));
+INSTANTIATE_TEST_SUITE_P(RecoverableAndNonRecoverableTests,
+ BacktraceGuardedPoolAllocatorDeathTest,
+ /* Recoverable */ testing::Bool());
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.h b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.h
index c8f643d..3e85935 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.h
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/harness.h
@@ -12,13 +12,11 @@
#include <stdarg.h>
#if defined(__Fuchsia__)
+#define ZXTEST_USE_STREAMABLE_MACROS
#include <zxtest/zxtest.h>
-using Test = ::zxtest::Test;
-template <typename T> using TestWithParam = ::zxtest::TestWithParam<T>;
+namespace testing = zxtest;
#else
#include "gtest/gtest.h"
-using Test = ::testing::Test;
-template <typename T> using TestWithParam = ::testing::TestWithParam<T>;
#endif
#include "gwp_asan/guarded_pool_allocator.h"
@@ -46,7 +44,9 @@
void DeallocateMemory2(gwp_asan::GuardedPoolAllocator &GPA, void *Ptr);
void TouchMemory(void *Ptr);
-class DefaultGuardedPoolAllocator : public Test {
+void CheckOnlyOneGwpAsanCrash(const std::string &OutputBuffer);
+
+class DefaultGuardedPoolAllocator : public ::testing::Test {
public:
void SetUp() override {
gwp_asan::options::Options Opts;
@@ -65,7 +65,7 @@
MaxSimultaneousAllocations;
};
-class CustomGuardedPoolAllocator : public Test {
+class CustomGuardedPoolAllocator : public ::testing::Test {
public:
void
InitNumSlots(decltype(gwp_asan::options::Options::MaxSimultaneousAllocations)
@@ -89,7 +89,7 @@
};
class BacktraceGuardedPoolAllocator
- : public TestWithParam</* Recoverable */ bool> {
+ : public ::testing::TestWithParam</* Recoverable */ bool> {
public:
void SetUp() override {
gwp_asan::options::Options Opts;
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/never_allocated.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/never_allocated.cpp
new file mode 100644
index 0000000..bd43b22
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/never_allocated.cpp
@@ -0,0 +1,55 @@
+//===-- never_allocated.cpp -------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <string>
+
+#include "gwp_asan/common.h"
+#include "gwp_asan/crash_handler.h"
+#include "gwp_asan/tests/harness.h"
+
+TEST_P(BacktraceGuardedPoolAllocatorDeathTest, NeverAllocated) {
+ SCOPED_TRACE("");
+ void *Ptr = GPA.allocate(0x1000);
+ GPA.deallocate(Ptr);
+
+ std::string DeathNeedle =
+ "GWP-ASan cannot provide any more information about this error";
+
+ // Trigger a guard page in a completely different slot that's never allocated.
+ // Previously, there was a bug that this would result in nullptr-dereference
+ // in the posix crash handler.
+ char *volatile NeverAllocatedPtr = static_cast<char *>(Ptr) + 0x3000;
+ if (!Recoverable) {
+ ASSERT_DEATH(*NeverAllocatedPtr = 0, DeathNeedle);
+ return;
+ }
+
+ *NeverAllocatedPtr = 0;
+ CheckOnlyOneGwpAsanCrash(GetOutputBuffer());
+ ASSERT_NE(std::string::npos, GetOutputBuffer().find(DeathNeedle));
+
+ // Check that subsequent invalid touches of the pool don't print a report.
+ GetOutputBuffer().clear();
+ for (size_t i = 0; i < 100; ++i) {
+ *NeverAllocatedPtr = 0;
+ *(NeverAllocatedPtr + 0x2000) = 0;
+ *(NeverAllocatedPtr + 0x3000) = 0;
+ ASSERT_TRUE(GetOutputBuffer().empty());
+ }
+
+ // Check that reports on the other slots still report a double-free, but only
+ // once.
+ GetOutputBuffer().clear();
+ GPA.deallocate(Ptr);
+ ASSERT_NE(std::string::npos, GetOutputBuffer().find("Double Free"));
+ GetOutputBuffer().clear();
+ for (size_t i = 0; i < 100; ++i) {
+ DeallocateMemory(GPA, Ptr);
+ ASSERT_TRUE(GetOutputBuffer().empty());
+ }
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/recoverable.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/recoverable.cpp
index a4c5c3f..2c14ff5 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/recoverable.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/recoverable.cpp
@@ -17,16 +17,6 @@
#include "gwp_asan/crash_handler.h"
#include "gwp_asan/tests/harness.h"
-void CheckOnlyOneGwpAsanCrash(const std::string &OutputBuffer) {
- const char *kGwpAsanErrorString = "GWP-ASan detected a memory error";
- size_t FirstIndex = OutputBuffer.find(kGwpAsanErrorString);
- ASSERT_NE(FirstIndex, std::string::npos) << "Didn't detect a GWP-ASan crash";
- ASSERT_EQ(OutputBuffer.find(kGwpAsanErrorString, FirstIndex + 1),
- std::string::npos)
- << "Detected more than one GWP-ASan crash:\n"
- << OutputBuffer;
-}
-
TEST_P(BacktraceGuardedPoolAllocator, MultipleDoubleFreeOnlyOneOutput) {
SCOPED_TRACE("");
void *Ptr = AllocateMemory(GPA);
@@ -182,9 +172,6 @@
std::atomic<bool> StartingGun{false};
std::vector<std::thread> Threads;
constexpr unsigned kNumThreads = 4;
- if (std::thread::hardware_concurrency() < kNumThreads) {
- GTEST_SKIP() << "Not enough threads to run this test";
- }
char *Ptr = static_cast<char *>(AllocateMemory(*GPA));
@@ -205,6 +192,3 @@
runInterThreadThrashingSingleAlloc(kNumIterations, &GPA);
CheckOnlyOneGwpAsanCrash(GetOutputBuffer());
}
-
-INSTANTIATE_TEST_SUITE_P(RecoverableTests, BacktraceGuardedPoolAllocator,
- /* Recoverable */ testing::Values(true));
diff --git a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/thread_contention.cpp b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/thread_contention.cpp
index 0992b97..26ccd8e 100644
--- a/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/thread_contention.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/gwp_asan/tests/thread_contention.cpp
@@ -44,12 +44,8 @@
void runThreadContentionTest(unsigned NumThreads, unsigned NumIterations,
gwp_asan::GuardedPoolAllocator *GPA) {
-
std::atomic<bool> StartingGun{false};
std::vector<std::thread> Threads;
- if (std::thread::hardware_concurrency() < NumThreads) {
- NumThreads = std::thread::hardware_concurrency();
- }
for (unsigned i = 0; i < NumThreads; ++i) {
Threads.emplace_back(asyncTask, GPA, &StartingGun, NumIterations);
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.cpp
index 9db4fb0..097136f 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.cpp
@@ -86,6 +86,9 @@
cf.clear_shadow_mmap_threshold = 4096 * (SANITIZER_ANDROID ? 2 : 8);
// Sigtrap is used in error reporting.
cf.handle_sigtrap = kHandleSignalExclusive;
+ // For now only tested on Linux. Other plantforms can be turned on as they
+ // become ready.
+ cf.detect_leaks = cf.detect_leaks && SANITIZER_LINUX && !SANITIZER_ANDROID;
#if SANITIZER_ANDROID
// Let platform handle other signals. It is better at reporting them then we
@@ -106,6 +109,15 @@
RegisterHwasanFlags(&parser, f);
RegisterCommonFlags(&parser);
+#if CAN_SANITIZE_LEAKS
+ __lsan::Flags *lf = __lsan::flags();
+ lf->SetDefaults();
+
+ FlagParser lsan_parser;
+ __lsan::RegisterLsanFlags(&lsan_parser, lf);
+ RegisterCommonFlags(&lsan_parser);
+#endif
+
#if HWASAN_CONTAINS_UBSAN
__ubsan::Flags *uf = __ubsan::flags();
uf->SetDefaults();
@@ -118,12 +130,18 @@
// Override from user-specified string.
if (__hwasan_default_options)
parser.ParseString(__hwasan_default_options());
+#if CAN_SANITIZE_LEAKS
+ lsan_parser.ParseString(__lsan_default_options());
+#endif
#if HWASAN_CONTAINS_UBSAN
const char *ubsan_default_options = __ubsan_default_options();
ubsan_parser.ParseString(ubsan_default_options);
#endif
parser.ParseStringFromEnv("HWASAN_OPTIONS");
+#if CAN_SANITIZE_LEAKS
+ lsan_parser.ParseStringFromEnv("LSAN_OPTIONS");
+#endif
#if HWASAN_CONTAINS_UBSAN
ubsan_parser.ParseStringFromEnv("UBSAN_OPTIONS");
#endif
@@ -133,6 +151,12 @@
if (Verbosity()) ReportUnrecognizedFlags();
if (common_flags()->help) parser.PrintFlagDescriptions();
+ // Flag validation:
+ if (!CAN_SANITIZE_LEAKS && common_flags()->detect_leaks) {
+ Report("%s: detect_leaks is not supported on this platform.\n",
+ SanitizerToolName);
+ Die();
+ }
}
static void CheckUnwind() {
@@ -368,10 +392,20 @@
HwasanAllocatorInit();
HwasanInstallAtForkHandler();
+ if (CAN_SANITIZE_LEAKS) {
+ __lsan::InitCommonLsan();
+ InstallAtExitCheckLeaks();
+ }
+
#if HWASAN_CONTAINS_UBSAN
__ubsan::InitAsPlugin();
#endif
+ if (CAN_SANITIZE_LEAKS && common_flags()->detect_leaks) {
+ __lsan::ScopedInterceptorDisabler disabler;
+ Symbolizer::LateInitialize();
+ }
+
VPrintf(1, "HWAddressSanitizer init done\n");
hwasan_init_is_running = 0;
@@ -519,7 +553,7 @@
}
void __hwasan_tag_memory(uptr p, u8 tag, uptr sz) {
- TagMemoryAligned(p, sz, tag);
+ TagMemoryAligned(UntagAddr(p), sz, tag);
}
uptr __hwasan_tag_pointer(uptr p, u8 tag) {
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.h b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.h
index ef4055a..c3d71a2 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.h
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan.h
@@ -144,6 +144,8 @@
void HwasanInstallAtForkHandler();
+void InstallAtExitCheckLeaks();
+
void UpdateMemoryUsage();
void AppendToErrorMessageBuffer(const char *buffer);
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
index 9cd82db..59ad633 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
@@ -16,14 +16,25 @@
#include "interception/interception.h"
#include "sanitizer_common/sanitizer_allocator_dlsym.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
+#include "sanitizer_common/sanitizer_mallinfo.h"
#include "sanitizer_common/sanitizer_tls_get_addr.h"
-#if !SANITIZER_FUCHSIA
-
using namespace __hwasan;
struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
static bool UseImpl() { return !hwasan_inited; }
+ static void OnAllocate(const void *ptr, uptr size) {
+# if CAN_SANITIZE_LEAKS
+ // Suppress leaks from dlerror(). Previously dlsym hack on global array was
+ // used by leak sanitizer as a root region.
+ __lsan_register_root_region(ptr, size);
+# endif
+ }
+ static void OnFree(const void *ptr, uptr size) {
+# if CAN_SANITIZE_LEAKS
+ __lsan_unregister_root_region(ptr, size);
+# endif
+ }
};
extern "C" {
@@ -143,12 +154,19 @@
} // extern "C"
-#if HWASAN_WITH_INTERCEPTORS
+#if HWASAN_WITH_INTERCEPTORS || SANITIZER_FUCHSIA
+#if SANITIZER_FUCHSIA
+// Fuchsia does not use WRAP/wrappers used for the interceptor infrastructure.
+# define INTERCEPTOR_ALIAS(RET, FN, ARGS...) \
+ extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
+ ARGS) ALIAS("__sanitizer_" #FN)
+#else
# define INTERCEPTOR_ALIAS(RET, FN, ARGS...) \
extern "C" SANITIZER_INTERFACE_ATTRIBUTE RET WRAP(FN)(ARGS) \
ALIAS("__sanitizer_" #FN); \
extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
ARGS) ALIAS("__sanitizer_" #FN)
+#endif
INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
SIZE_T size);
@@ -171,5 +189,3 @@
INTERCEPTOR_ALIAS(void, malloc_stats, void);
# endif
#endif // #if HWASAN_WITH_INTERCEPTORS
-
-#endif // SANITIZER_FUCHSIA
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.cpp
index 9f7d1f3..d3cb5c8 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.cpp
@@ -45,6 +45,7 @@
// Initialized in HwasanAllocatorInit, an never changed.
static ALIGNED(16) u8 tail_magic[kShadowAlignment - 1];
+static uptr max_malloc_size;
bool HwasanChunkView::IsAllocated() const {
return metadata_ && metadata_->IsAllocated();
@@ -63,6 +64,10 @@
return metadata_->GetAllocStackId();
}
+u32 HwasanChunkView::GetAllocThreadId() const {
+ return metadata_->GetAllocThreadId();
+}
+
uptr HwasanChunkView::ActualSize() const {
return allocator.GetActuallyAllocatedSize(reinterpret_cast<void *>(block_));
}
@@ -94,8 +99,7 @@
}
inline bool Metadata::IsAllocated() const {
- return atomic_load(&chunk_state, memory_order_relaxed) == CHUNK_ALLOCATED &&
- GetRequestedSize();
+ return atomic_load(&chunk_state, memory_order_relaxed) == CHUNK_ALLOCATED;
}
inline u64 Metadata::GetRequestedSize() const {
@@ -106,6 +110,11 @@
return atomic_load(&alloc_context_id, memory_order_relaxed);
}
+inline u32 Metadata::GetAllocThreadId() const {
+ u64 context = atomic_load(&alloc_context_id, memory_order_relaxed);
+ u32 tid = context >> 32;
+ return tid;
+}
void GetAllocatorStats(AllocatorStatCounters s) {
allocator.GetStats(s);
@@ -144,6 +153,12 @@
GetAliasRegionStart());
for (uptr i = 0; i < sizeof(tail_magic); i++)
tail_magic[i] = GetCurrentThread()->GenerateRandomTag();
+ if (common_flags()->max_allocation_size_mb) {
+ max_malloc_size = common_flags()->max_allocation_size_mb << 20;
+ max_malloc_size = Min(max_malloc_size, kMaxAllowedMallocSize);
+ } else {
+ max_malloc_size = kMaxAllowedMallocSize;
+ }
}
void HwasanAllocatorLock() { allocator.ForceLock(); }
@@ -163,13 +178,16 @@
static void *HwasanAllocate(StackTrace *stack, uptr orig_size, uptr alignment,
bool zeroise) {
- if (orig_size > kMaxAllowedMallocSize) {
+ // Keep this consistent with LSAN and ASAN behavior.
+ if (UNLIKELY(orig_size == 0))
+ orig_size = 1;
+ if (UNLIKELY(orig_size > max_malloc_size)) {
if (AllocatorMayReturnNull()) {
Report("WARNING: HWAddressSanitizer failed to allocate 0x%zx bytes\n",
orig_size);
return nullptr;
}
- ReportAllocationSizeTooBig(orig_size, kMaxAllowedMallocSize, stack);
+ ReportAllocationSizeTooBig(orig_size, max_malloc_size, stack);
}
if (UNLIKELY(IsRssLimitExceeded())) {
if (AllocatorMayReturnNull())
@@ -288,6 +306,7 @@
uptr orig_size = meta->GetRequestedSize();
u32 free_context_id = StackDepotPut(*stack);
u32 alloc_context_id = meta->GetAllocStackId();
+ u32 alloc_thread_id = meta->GetAllocThreadId();
// Check tail magic.
uptr tagged_size = TaggedSize(orig_size);
@@ -339,8 +358,9 @@
if (t) {
allocator.Deallocate(t->allocator_cache(), aligned_ptr);
if (auto *ha = t->heap_allocations())
- ha->push({reinterpret_cast<uptr>(tagged_ptr), alloc_context_id,
- free_context_id, static_cast<u32>(orig_size)});
+ ha->push({reinterpret_cast<uptr>(tagged_ptr), alloc_thread_id,
+ alloc_context_id, free_context_id,
+ static_cast<u32>(orig_size)});
} else {
SpinMutexLock l(&fallback_mutex);
AllocatorCache *cache = &fallback_allocator_cache;
@@ -389,14 +409,21 @@
return HwasanChunkView(reinterpret_cast<uptr>(block), metadata);
}
-static inline HwasanChunkView FindHeapChunkByAddressFastLocked(uptr address) {
- void *block =
- allocator.GetBlockBeginFastLocked(reinterpret_cast<void *>(address));
- if (!block)
- return HwasanChunkView();
- Metadata *metadata =
- reinterpret_cast<Metadata *>(allocator.GetMetaData(block));
- return HwasanChunkView(reinterpret_cast<uptr>(block), metadata);
+static const void *AllocationBegin(const void *p) {
+ const void *untagged_ptr = UntagPtr(p);
+ if (!untagged_ptr)
+ return nullptr;
+
+ const void *beg = allocator.GetBlockBegin(untagged_ptr);
+ if (!beg)
+ return nullptr;
+
+ Metadata *b = (Metadata *)allocator.GetMetaData(beg);
+ if (b->GetRequestedSize() == 0)
+ return nullptr;
+
+ tag_t tag = GetTagFromPointer((uptr)p);
+ return (const void *)AddTagToPointer((uptr)beg, tag);
}
static uptr AllocationSize(const void *tagged_ptr) {
@@ -513,28 +540,51 @@
}
uptr PointsIntoChunk(void *p) {
+ p = __hwasan::InTaggableRegion(reinterpret_cast<uptr>(p)) ? UntagPtr(p) : p;
uptr addr = reinterpret_cast<uptr>(p);
- __hwasan::HwasanChunkView view =
- __hwasan::FindHeapChunkByAddressFastLocked(addr);
- if (!view.IsAllocated())
+ uptr chunk =
+ reinterpret_cast<uptr>(__hwasan::allocator.GetBlockBeginFastLocked(p));
+ if (!chunk)
return 0;
- uptr chunk = view.Beg();
- if (view.AddrIsInside(addr))
+ __hwasan::Metadata *metadata = reinterpret_cast<__hwasan::Metadata *>(
+ __hwasan::allocator.GetMetaData(reinterpret_cast<void *>(chunk)));
+ if (!metadata || !metadata->IsAllocated())
+ return 0;
+ if (addr < chunk + metadata->GetRequestedSize())
return chunk;
- if (IsSpecialCaseOfOperatorNew0(chunk, view.UsedSize(), addr))
+ if (IsSpecialCaseOfOperatorNew0(chunk, metadata->GetRequestedSize(), addr))
return chunk;
return 0;
}
uptr GetUserBegin(uptr chunk) {
- // FIXME: All usecases provide chunk address, FindHeapChunkByAddressFastLocked
- // is not needed.
- return __hwasan::FindHeapChunkByAddressFastLocked(chunk).Beg();
+ if (__hwasan::InTaggableRegion(chunk))
+ CHECK_EQ(UntagAddr(chunk), chunk);
+ void *block = __hwasan::allocator.GetBlockBeginFastLocked(
+ reinterpret_cast<void *>(chunk));
+ if (!block)
+ return 0;
+ __hwasan::Metadata *metadata = reinterpret_cast<__hwasan::Metadata *>(
+ __hwasan::allocator.GetMetaData(block));
+ if (!metadata || !metadata->IsAllocated())
+ return 0;
+
+ return reinterpret_cast<uptr>(block);
+}
+
+uptr GetUserAddr(uptr chunk) {
+ tag_t mem_tag = *(tag_t *)__hwasan::MemToShadow(chunk);
+ if (!__hwasan::InTaggableRegion(chunk))
+ return chunk;
+ return AddTagToPointer(chunk, mem_tag);
}
LsanMetadata::LsanMetadata(uptr chunk) {
+ if (__hwasan::InTaggableRegion(chunk))
+ CHECK_EQ(UntagAddr(chunk), chunk);
metadata_ =
- chunk ? (reinterpret_cast<__hwasan::Metadata *>(chunk) - 1) : nullptr;
+ chunk ? __hwasan::allocator.GetMetaData(reinterpret_cast<void *>(chunk))
+ : nullptr;
}
bool LsanMetadata::allocated() const {
@@ -568,20 +618,21 @@
__hwasan::allocator.ForEachChunk(callback, arg);
}
-IgnoreObjectResult IgnoreObjectLocked(const void *p) {
- void *block =
- __hwasan::allocator.GetBlockBeginFastLocked(const_cast<void *>(p));
- if (!block)
+IgnoreObjectResult IgnoreObject(const void *p) {
+ p = __hwasan::InTaggableRegion(reinterpret_cast<uptr>(p)) ? UntagPtr(p) : p;
+ uptr addr = reinterpret_cast<uptr>(p);
+ uptr chunk = reinterpret_cast<uptr>(__hwasan::allocator.GetBlockBegin(p));
+ if (!chunk)
return kIgnoreObjectInvalid;
__hwasan::Metadata *metadata = reinterpret_cast<__hwasan::Metadata *>(
- __hwasan::allocator.GetMetaData(block));
- uptr addr = reinterpret_cast<uptr>(p);
- __hwasan::HwasanChunkView view(reinterpret_cast<uptr>(block), metadata);
- if (!view.IsAllocated() || !view.AddrIsInside(addr)) {
+ __hwasan::allocator.GetMetaData(reinterpret_cast<void *>(chunk)));
+ if (!metadata || !metadata->IsAllocated())
return kIgnoreObjectInvalid;
- }
+ if (addr >= chunk + metadata->GetRequestedSize())
+ return kIgnoreObjectInvalid;
if (metadata->GetLsanTag() == kIgnored)
return kIgnoreObjectAlreadyIgnored;
+
metadata->SetLsanTag(kIgnored);
return kIgnoreObjectSuccess;
}
@@ -618,4 +669,8 @@
int __sanitizer_get_ownership(const void *p) { return AllocationSize(p) != 0; }
+const void *__sanitizer_get_allocated_begin(const void *p) {
+ return AllocationBegin(p);
+}
+
uptr __sanitizer_get_allocated_size(const void *p) { return AllocationSize(p); }
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.h b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.h
index 67982ca..b7a06da 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.h
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_allocator.h
@@ -46,6 +46,7 @@
inline bool IsAllocated() const;
inline u64 GetRequestedSize() const;
inline u32 GetAllocStackId() const;
+ inline u32 GetAllocThreadId() const;
inline void SetLsanTag(__lsan::ChunkTag tag);
inline __lsan::ChunkTag GetLsanTag() const;
};
@@ -68,15 +69,21 @@
#if defined(HWASAN_ALIASING_MODE)
static const uptr kSpaceSize = 1ULL << kAddressTagShift;
+ typedef __sanitizer::DefaultSizeClassMap SizeClassMap;
+#elif SANITIZER_LINUX && !SANITIZER_ANDROID
+ static const uptr kSpaceSize = 0x40000000000ULL; // 4T.
+ typedef __sanitizer::DefaultSizeClassMap SizeClassMap;
#else
- static const uptr kSpaceSize = 0x2000000000ULL;
-#endif
- static const uptr kMetadataSize = sizeof(Metadata);
+ static const uptr kSpaceSize = 0x2000000000ULL; // 128G.
typedef __sanitizer::VeryDenseSizeClassMap SizeClassMap;
+#endif
+
+ static const uptr kMetadataSize = sizeof(Metadata);
using AddressSpaceView = LocalAddressSpaceView;
typedef HwasanMapUnmapCallback MapUnmapCallback;
static const uptr kFlags = 0;
};
+
typedef SizeClassAllocator64<AP64> PrimaryAllocator;
typedef CombinedAllocator<PrimaryAllocator> Allocator;
typedef Allocator::AllocatorCache AllocatorCache;
@@ -94,6 +101,7 @@
uptr UsedSize() const; // Size requested by the user
uptr ActualSize() const; // Size allocated by the allocator.
u32 GetAllocStackId() const;
+ u32 GetAllocThreadId() const;
bool FromSmallHeap() const;
bool AddrIsInside(uptr addr) const;
@@ -107,13 +115,12 @@
// Information about one (de)allocation that happened in the past.
// These are recorded in a thread-local ring buffer.
-// TODO: this is currently 24 bytes (20 bytes + alignment).
-// Compress it to 16 bytes or extend it to be more useful.
struct HeapAllocationRecord {
uptr tagged_addr;
- u32 alloc_context_id;
- u32 free_context_id;
- u32 requested_size;
+ u32 alloc_thread_id;
+ u32 alloc_context_id;
+ u32 free_context_id;
+ u32 requested_size;
};
typedef RingBuffer<HeapAllocationRecord> HeapAllocationsRingBuffer;
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_checks.h b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_checks.h
index b0b37d7..514d351 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_checks.h
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_checks.h
@@ -15,17 +15,49 @@
#include "hwasan_allocator.h"
#include "hwasan_mapping.h"
+#include "hwasan_registers.h"
#include "sanitizer_common/sanitizer_common.h"
namespace __hwasan {
-template <unsigned X>
+
+enum class ErrorAction { Abort, Recover };
+enum class AccessType { Load, Store };
+
+// Used when the access size is known.
+constexpr unsigned SigTrapEncoding(ErrorAction EA, AccessType AT,
+ unsigned LogSize) {
+ return 0x20 * (EA == ErrorAction::Recover) +
+ 0x10 * (AT == AccessType::Store) + LogSize;
+}
+
+// Used when the access size varies at runtime.
+constexpr unsigned SigTrapEncoding(ErrorAction EA, AccessType AT) {
+ return SigTrapEncoding(EA, AT, 0xf);
+}
+
+template <ErrorAction EA, AccessType AT, size_t LogSize>
__attribute__((always_inline)) static void SigTrap(uptr p) {
-#if defined(__aarch64__)
+ // Other platforms like linux can use signals for intercepting an exception
+ // and dispatching to HandleTagMismatch. The fuchsias implementation doesn't
+ // use signals so we can call it here directly instead.
+#if CAN_GET_REGISTERS && SANITIZER_FUCHSIA
+ auto regs = GetRegisters();
+ size_t size = 2 << LogSize;
+ AccessInfo access_info = {
+ .addr = p,
+ .size = size,
+ .is_store = AT == AccessType::Store,
+ .is_load = AT == AccessType::Load,
+ .recover = EA == ErrorAction::Recover,
+ };
+ HandleTagMismatch(access_info, (uptr)__builtin_return_address(0),
+ (uptr)__builtin_frame_address(0), /*uc=*/nullptr, regs.x);
+#elif defined(__aarch64__)
(void)p;
// 0x900 is added to do not interfere with the kernel use of lower values of
// brk immediate.
register uptr x0 asm("x0") = p;
- asm("brk %1\n\t" ::"r"(x0), "n"(0x900 + X));
+ asm("brk %1\n\t" ::"r"(x0), "n"(0x900 + SigTrapEncoding(EA, AT, LogSize)));
#elif defined(__x86_64__)
// INT3 + NOP DWORD ptr [EAX + X] to pass X to our signal handler, 5 bytes
// total. The pointer is passed via rdi.
@@ -34,7 +66,7 @@
// different nop command, the three bytes one).
asm volatile(
"int3\n"
- "nopl %c0(%%rax)\n" ::"n"(0x40 + X),
+ "nopl %c0(%%rax)\n" ::"n"(0x40 + SigTrapEncoding(EA, AT, LogSize)),
"D"(p));
#elif SANITIZER_RISCV64
// Put pointer into x10
@@ -44,7 +76,7 @@
asm volatile(
"ebreak\n"
"addiw x0, x0, %1\n" ::"r"(x10),
- "I"(0x40 + X));
+ "I"(0x40 + SigTrapEncoding(EA, AT, LogSize)));
#else
// FIXME: not always sigill.
__builtin_trap();
@@ -53,17 +85,31 @@
}
// Version with access size which is not power of 2
-template <unsigned X>
+template <ErrorAction EA, AccessType AT>
__attribute__((always_inline)) static void SigTrap(uptr p, uptr size) {
-#if defined(__aarch64__)
+ // Other platforms like linux can use signals for intercepting an exception
+ // and dispatching to HandleTagMismatch. The fuchsias implementation doesn't
+ // use signals so we can call it here directly instead.
+#if CAN_GET_REGISTERS && SANITIZER_FUCHSIA
+ auto regs = GetRegisters();
+ AccessInfo access_info = {
+ .addr = p,
+ .size = size,
+ .is_store = AT == AccessType::Store,
+ .is_load = AT == AccessType::Load,
+ .recover = EA == ErrorAction::Recover,
+ };
+ HandleTagMismatch(access_info, (uptr)__builtin_return_address(0),
+ (uptr)__builtin_frame_address(0), /*uc=*/nullptr, regs.x);
+#elif defined(__aarch64__)
register uptr x0 asm("x0") = p;
register uptr x1 asm("x1") = size;
- asm("brk %2\n\t" ::"r"(x0), "r"(x1), "n"(0x900 + X));
+ asm("brk %2\n\t" ::"r"(x0), "r"(x1), "n"(0x900 + SigTrapEncoding(EA, AT)));
#elif defined(__x86_64__)
// Size is stored in rsi.
asm volatile(
"int3\n"
- "nopl %c0(%%rax)\n" ::"n"(0x40 + X),
+ "nopl %c0(%%rax)\n" ::"n"(0x40 + SigTrapEncoding(EA, AT)),
"D"(p), "S"(size));
#elif SANITIZER_RISCV64
// Put access size into x11
@@ -72,7 +118,7 @@
asm volatile(
"ebreak\n"
"addiw x0, x0, %2\n" ::"r"(x10),
- "r"(x11), "I"(0x40 + X));
+ "r"(x11), "I"(0x40 + SigTrapEncoding(EA, AT)));
#else
__builtin_trap();
#endif
@@ -94,9 +140,6 @@
return *(u8 *)(ptr | (kShadowAlignment - 1)) == ptr_tag;
}
-enum class ErrorAction { Abort, Recover };
-enum class AccessType { Load, Store };
-
template <ErrorAction EA, AccessType AT, unsigned LogSize>
__attribute__((always_inline, nodebug)) static void CheckAddress(uptr p) {
if (!InTaggableRegion(p))
@@ -104,8 +147,7 @@
uptr ptr_raw = p & ~kAddressTagMask;
tag_t mem_tag = *(tag_t *)MemToShadow(ptr_raw);
if (UNLIKELY(!PossiblyShortTagMatches(mem_tag, p, 1 << LogSize))) {
- SigTrap<0x20 * (EA == ErrorAction::Recover) +
- 0x10 * (AT == AccessType::Store) + LogSize>(p);
+ SigTrap<EA, AT, LogSize>(p);
if (EA == ErrorAction::Abort)
__builtin_unreachable();
}
@@ -122,8 +164,7 @@
tag_t *shadow_last = (tag_t *)MemToShadow(ptr_raw + sz);
for (tag_t *t = shadow_first; t < shadow_last; ++t)
if (UNLIKELY(ptr_tag != *t)) {
- SigTrap<0x20 * (EA == ErrorAction::Recover) +
- 0x10 * (AT == AccessType::Store) + 0xf>(p, sz);
+ SigTrap<EA, AT>(p, sz);
if (EA == ErrorAction::Abort)
__builtin_unreachable();
}
@@ -132,8 +173,7 @@
if (UNLIKELY(tail_sz != 0 &&
!PossiblyShortTagMatches(
*shadow_last, end & ~(kShadowAlignment - 1), tail_sz))) {
- SigTrap<0x20 * (EA == ErrorAction::Recover) +
- 0x10 * (AT == AccessType::Store) + 0xf>(p, sz);
+ SigTrap<EA, AT>(p, sz);
if (EA == ErrorAction::Abort)
__builtin_unreachable();
}
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
index 858fac0..d1696f8 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
@@ -185,6 +185,8 @@
void HwasanInstallAtForkHandler() {}
+void InstallAtExitCheckLeaks() {}
+
void InitializeOsSupport() {
#ifdef __aarch64__
uint32_t features = 0;
@@ -202,6 +204,12 @@
} // namespace __hwasan
+namespace __lsan {
+
+bool UseExitcodeOnLeak() { return __hwasan::flags()->halt_on_error; }
+
+} // namespace __lsan
+
extern "C" {
void *__sanitizer_before_thread_create_hook(thrd_t thread, bool detached,
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
index c67927d..16ac85e 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
@@ -39,11 +39,19 @@
INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*),
void * param) {
- ScopedTaggingDisabler disabler;
+ EnsureMainThreadIDIsCorrect();
+ ScopedTaggingDisabler tagging_disabler;
ThreadStartArg *A = reinterpret_cast<ThreadStartArg *> (MmapOrDie(
GetPageSizeCached(), "pthread_create"));
*A = {callback, param};
- int res = REAL(pthread_create)(th, attr, &HwasanThreadStartFunc, A);
+ int res;
+ {
+ // ASAN uses the same approach to disable leaks from pthread_create.
+# if CAN_SANITIZE_LEAKS
+ __lsan::ScopedInterceptorDisabler lsan_disabler;
+# endif
+ res = REAL(pthread_create)(th, attr, &HwasanThreadStartFunc, A);
+ }
return res;
}
@@ -220,6 +228,10 @@
namespace __hwasan {
int OnExit() {
+ if (CAN_SANITIZE_LEAKS && common_flags()->detect_leaks &&
+ __lsan::HasReportedLeaks()) {
+ return common_flags()->exitcode;
+ }
// FIXME: ask frontend whether we need to return failure.
return 0;
}
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_linux.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_linux.cpp
index 88ccfde..d3e4b53 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_linux.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_linux.cpp
@@ -541,6 +541,17 @@
pthread_atfork(before, after, after);
}
+void InstallAtExitCheckLeaks() {
+ if (CAN_SANITIZE_LEAKS) {
+ if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
+ if (flags()->halt_on_error)
+ Atexit(__lsan::DoLeakCheck);
+ else
+ Atexit(__lsan::DoRecoverableLeakCheckVoid);
+ }
+ }
+}
+
} // namespace __hwasan
#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_new_delete.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_new_delete.cpp
index 495046a..f0fd372 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_new_delete.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_new_delete.cpp
@@ -92,6 +92,14 @@
void *ptr, std::nothrow_t const &) {
OPERATOR_DELETE_BODY;
}
+INTERCEPTOR_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void operator delete(
+ void *ptr, size_t) NOEXCEPT {
+ OPERATOR_DELETE_BODY;
+}
+INTERCEPTOR_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void operator delete[](
+ void *ptr, size_t) NOEXCEPT {
+ OPERATOR_DELETE_BODY;
+}
#endif // OPERATOR_NEW_BODY
@@ -134,5 +142,21 @@
void *ptr, std::align_val_t, std::nothrow_t const &) NOEXCEPT {
OPERATOR_DELETE_BODY;
}
+INTERCEPTOR_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void operator delete(
+ void *ptr, size_t, std::align_val_t) NOEXCEPT {
+ OPERATOR_DELETE_BODY;
+}
+INTERCEPTOR_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void operator delete[](
+ void *ptr, size_t, std::align_val_t) NOEXCEPT {
+ OPERATOR_DELETE_BODY;
+}
+INTERCEPTOR_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void operator delete(
+ void *ptr, size_t, std::align_val_t, std::nothrow_t const &) NOEXCEPT {
+ OPERATOR_DELETE_BODY;
+}
+INTERCEPTOR_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void operator delete[](
+ void *ptr, size_t, std::align_val_t, std::nothrow_t const &) NOEXCEPT {
+ OPERATOR_DELETE_BODY;
+}
#endif // OPERATOR_NEW_ALIGN_BODY
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_registers.h b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_registers.h
new file mode 100644
index 0000000..48a140f
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_registers.h
@@ -0,0 +1,56 @@
+//===-- hwasan_registers.h --------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This describes the register state retrieved by hwasan when error reporting.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef HWASAN_REGISTERS_H
+#define HWASAN_REGISTERS_H
+
+#include "sanitizer_common/sanitizer_common.h"
+#include "sanitizer_common/sanitizer_platform.h"
+
+#if defined(__aarch64__)
+
+# define CAN_GET_REGISTERS 1
+
+struct Registers {
+ uptr x[32];
+};
+
+__attribute__((always_inline, unused)) static Registers GetRegisters() {
+ Registers regs;
+ __asm__ volatile(
+ "stp x0, x1, [%1, #(8 * 0)]\n"
+ "stp x2, x3, [%1, #(8 * 2)]\n"
+ "stp x4, x5, [%1, #(8 * 4)]\n"
+ "stp x6, x7, [%1, #(8 * 6)]\n"
+ "stp x8, x9, [%1, #(8 * 8)]\n"
+ "stp x10, x11, [%1, #(8 * 10)]\n"
+ "stp x12, x13, [%1, #(8 * 12)]\n"
+ "stp x14, x15, [%1, #(8 * 14)]\n"
+ "stp x16, x17, [%1, #(8 * 16)]\n"
+ "stp x18, x19, [%1, #(8 * 18)]\n"
+ "stp x20, x21, [%1, #(8 * 20)]\n"
+ "stp x22, x23, [%1, #(8 * 22)]\n"
+ "stp x24, x25, [%1, #(8 * 24)]\n"
+ "stp x26, x27, [%1, #(8 * 26)]\n"
+ "stp x28, x29, [%1, #(8 * 28)]\n"
+ : "=m"(regs)
+ : "r"(regs.x));
+ regs.x[30] = reinterpret_cast<uintptr_t>(__builtin_return_address(0));
+ regs.x[31] = reinterpret_cast<uintptr_t>(__builtin_frame_address(0));
+ return regs;
+}
+
+#else
+# define CAN_GET_REGISTERS 0
+#endif
+
+#endif // HWASAN_REGISTERS_H
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_report.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_report.cpp
index 31e190a..e720cb4 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -331,7 +331,7 @@
untagged_addr, offset, whence, chunk.UsedSize(), chunk.Beg(),
chunk.End());
Printf("%s", d.Allocation());
- Printf("allocated here:\n");
+ Printf("allocated by thread T%u here:\n", chunk.GetAllocThreadId());
Printf("%s", d.Default());
GetStackTraceFromId(chunk.GetAllocStackId()).Print();
return;
@@ -473,12 +473,12 @@
har.requested_size, UntagAddr(har.tagged_addr),
UntagAddr(har.tagged_addr) + har.requested_size);
Printf("%s", d.Allocation());
- Printf("freed by thread T%zd here:\n", t->unique_id());
+ Printf("freed by thread T%u here:\n", t->unique_id());
Printf("%s", d.Default());
GetStackTraceFromId(har.free_context_id).Print();
Printf("%s", d.Allocation());
- Printf("previously allocated here:\n", t);
+ Printf("previously allocated by thread T%u here:\n", har.alloc_thread_id);
Printf("%s", d.Default());
GetStackTraceFromId(har.alloc_context_id).Print();
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
index 7566c1e..a5a3858 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S
@@ -37,13 +37,14 @@
CFI_STARTPROC
_CET_ENDBR
xorl %esi, %esi
- jmp __interceptor_sigsetjmp
+ jmp .Linterceptor_sigsetjmp
CFI_ENDPROC
ASM_SIZE(__interceptor_setjmp)
.global __interceptor_sigsetjmp
ASM_TYPE_FUNCTION(__interceptor_sigsetjmp)
__interceptor_sigsetjmp:
+.Linterceptor_sigsetjmp:
CFI_STARTPROC
_CET_ENDBR
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.cpp b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.cpp
index 4a78f60..3375782 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.cpp
@@ -44,6 +44,8 @@
static atomic_uint64_t unique_id;
unique_id_ = atomic_fetch_add(&unique_id, 1, memory_order_relaxed);
+ if (!IsMainThread())
+ os_id_ = GetTid();
if (auto sz = flags()->heap_history_size)
heap_allocations_ = HeapAllocationsRingBuffer::New(sz);
@@ -149,6 +151,12 @@
return tag;
}
+void EnsureMainThreadIDIsCorrect() {
+ auto *t = __hwasan::GetCurrentThread();
+ if (t && (t->IsMainThread()))
+ t->set_os_id(GetTid());
+}
+
} // namespace __hwasan
// --- Implementation of LSan-specific functions --- {{{1
@@ -169,11 +177,7 @@
void UnlockThreadRegistry() { __hwasan::hwasanThreadList().Unlock(); }
-void EnsureMainThreadIDIsCorrect() {
- auto *t = __hwasan::GetCurrentThread();
- if (t && (t->IsMainThread()))
- t->set_os_id(GetTid());
-}
+void EnsureMainThreadIDIsCorrect() { __hwasan::EnsureMainThreadIDIsCorrect(); }
bool GetThreadRangesLocked(tid_t os_id, uptr *stack_begin, uptr *stack_end,
uptr *tls_begin, uptr *tls_end, uptr *cache_begin,
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.h b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.h
index 9727585..9e1b438 100644
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.h
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/hwasan_thread.h
@@ -110,6 +110,9 @@
Thread *GetCurrentThread();
uptr *GetCurrentThreadLongPtr();
+// Used to handle fork().
+void EnsureMainThreadIDIsCorrect();
+
struct ScopedTaggingDisabler {
ScopedTaggingDisabler() { GetCurrentThread()->DisableTagging(); }
~ScopedTaggingDisabler() { GetCurrentThread()->EnableTagging(); }
diff --git a/third_party/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize b/third_party/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
index 6de4fe1..0408e0e 100755
--- a/third_party/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
+++ b/third_party/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
@@ -307,7 +307,7 @@
match = re.match(r'^(.*?)HWAddressSanitizer: tag-mismatch on address (0x[0-9a-f]+) ', line, re.UNICODE)
if match:
self.__last_access_address = int(match.group(2), 16)
- match = re.match(r'^(.*?) of size [0-9]+ at 0x[0-9a-f]* tags: ([0-9a-f]+)/[0-9a-f]+ \(ptr/mem\)', line, re.UNICODE)
+ match = re.match(r'^(.*?) of size [0-9]+ at 0x[0-9a-f]* tags: ([0-9a-f]+)/[0-9a-f]+(\([0-9a-f]+\))? \(ptr/mem\)', line, re.UNICODE)
if match:
self.__last_access_tag = int(match.group(2), 16)
diff --git a/third_party/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp b/third_party/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp
index b18d829..ee7faca 100644
--- a/third_party/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp
@@ -145,6 +145,22 @@
*end = *begin + sizeof(AllocatorCache);
}
+static const void *GetMallocBegin(const void *p) {
+ if (!p)
+ return nullptr;
+ void *beg = allocator.GetBlockBegin(p);
+ if (!beg)
+ return nullptr;
+ ChunkMetadata *m = Metadata(beg);
+ if (!m)
+ return nullptr;
+ if (!m->allocated)
+ return nullptr;
+ if (m->requested_size == 0)
+ return nullptr;
+ return (const void *)beg;
+}
+
uptr GetMallocUsableSize(const void *p) {
if (!p)
return 0;
@@ -275,6 +291,10 @@
return chunk;
}
+uptr GetUserAddr(uptr chunk) {
+ return chunk;
+}
+
LsanMetadata::LsanMetadata(uptr chunk) {
metadata_ = Metadata(reinterpret_cast<void *>(chunk));
CHECK(metadata_);
@@ -304,7 +324,7 @@
allocator.ForEachChunk(callback, arg);
}
-IgnoreObjectResult IgnoreObjectLocked(const void *p) {
+IgnoreObjectResult IgnoreObject(const void *p) {
void *chunk = allocator.GetBlockBegin(p);
if (!chunk || p < chunk) return kIgnoreObjectInvalid;
ChunkMetadata *m = Metadata(chunk);
@@ -360,6 +380,11 @@
int __sanitizer_get_ownership(const void *p) { return Metadata(p) != nullptr; }
SANITIZER_INTERFACE_ATTRIBUTE
+const void * __sanitizer_get_allocated_begin(const void *p) {
+ return GetMallocBegin(p);
+}
+
+SANITIZER_INTERFACE_ATTRIBUTE
uptr __sanitizer_get_allocated_size(const void *p) {
return GetMallocUsableSize(p);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.cpp b/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.cpp
index 1b47e83..ae29e4a 100644
--- a/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.cpp
@@ -270,13 +270,17 @@
if (p < kMinAddress)
return false;
# if defined(__x86_64__)
+ // TODO: add logic similar to ARM when Intel LAM is available.
// Accept only canonical form user-space addresses.
return ((p >> 47) == 0);
# elif defined(__mips64)
return ((p >> 40) == 0);
# elif defined(__aarch64__)
+ // TBI (Top Byte Ignore) feature of AArch64: bits [63:56] are ignored in
+ // address translation and can be used to store a tag.
+ constexpr uptr kPointerMask = 255ULL << 48;
// Accept up to 48 bit VMA.
- return ((p >> 48) == 0);
+ return ((p & kPointerMask) == 0);
# elif defined(__loongarch_lp64)
// Allow 47-bit user-space VMA at current.
return ((p >> 47) == 0);
@@ -859,7 +863,7 @@
leaks_.push_back(leak);
}
if (flags()->report_objects) {
- LeakedObject obj = {leaks_[i].id, chunk, leaked_size};
+ LeakedObject obj = {leaks_[i].id, GetUserAddr(chunk), leaked_size};
leaked_objects_.push_back(obj);
}
}
@@ -944,7 +948,7 @@
uptr LeakReport::ApplySuppressions() {
LeakSuppressionContext *suppressions = GetSuppressionContext();
- uptr new_suppressions = false;
+ uptr new_suppressions = 0;
for (uptr i = 0; i < leaks_.size(); i++) {
if (suppressions->Suppress(leaks_[i].stack_trace_id, leaks_[i].hit_count,
leaks_[i].total_size)) {
@@ -993,7 +997,7 @@
// Cannot use PointsIntoChunk or LsanMetadata here, since the allocator is not
// locked.
Lock l(&global_mutex);
- IgnoreObjectResult res = IgnoreObjectLocked(p);
+ IgnoreObjectResult res = IgnoreObject(p);
if (res == kIgnoreObjectInvalid)
VReport(1, "__lsan_ignore_object(): no heap object found at %p\n", p);
if (res == kIgnoreObjectAlreadyIgnored)
diff --git a/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.h b/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.h
index 0d5c003..a1f2d1a 100644
--- a/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.h
+++ b/third_party/llvm-project/compiler-rt/lib/lsan/lsan_common.h
@@ -131,6 +131,9 @@
uptr PointsIntoChunk(void *p);
// Returns address of user-visible chunk contained in this allocator chunk.
uptr GetUserBegin(uptr chunk);
+// Returns user-visible address for chunk. If memory tagging is used this
+// function will return the tagged address.
+uptr GetUserAddr(uptr chunk);
// Wrapper for chunk metadata operations.
class LsanMetadata {
@@ -151,7 +154,7 @@
void ForEachChunk(ForEachChunkCallback callback, void *arg);
// Helper for __lsan_ignore_object().
-IgnoreObjectResult IgnoreObjectLocked(const void *p);
+IgnoreObjectResult IgnoreObject(const void *p);
// The rest of the LSan interface which is implemented by library.
diff --git a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_allocator.cpp b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_allocator.cpp
index c21e4e8..1e0d05d 100644
--- a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_allocator.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_allocator.cpp
@@ -23,11 +23,11 @@
#include "sanitizer_common/sanitizer_allocator_checks.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_allocator_report.h"
+#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_errno.h"
#include "sanitizer_common/sanitizer_file.h"
#include "sanitizer_common/sanitizer_flags.h"
#include "sanitizer_common/sanitizer_internal_defs.h"
-#include "sanitizer_common/sanitizer_procmaps.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
#include <sched.h>
@@ -75,7 +75,7 @@
// _memprof_preinit is called via the preinit_array, which subsequently calls
// malloc. Since this is before _dl_init calls VDSO_SETUP, sched_getcpu
// will seg fault as the address of __vdso_getcpu will be null.
- if (!memprof_init_done)
+ if (!memprof_inited)
return -1;
return sched_getcpu();
}
@@ -295,8 +295,10 @@
// memprof_rawprofile.h.
char *Buffer = nullptr;
- MemoryMappingLayout Layout(/*cache_enabled=*/true);
- u64 BytesSerialized = SerializeToRawProfile(MIBMap, Layout, Buffer);
+ __sanitizer::ListOfModules List;
+ List.init();
+ ArrayRef<LoadedModule> Modules(List.begin(), List.end());
+ u64 BytesSerialized = SerializeToRawProfile(MIBMap, Modules, Buffer);
CHECK(Buffer && BytesSerialized && "could not serialize to buffer");
report_file.Write(Buffer, BytesSerialized);
}
@@ -445,8 +447,7 @@
u64 user_requested_size =
atomic_exchange(&m->user_requested_size, 0, memory_order_acquire);
- if (memprof_inited && memprof_init_done &&
- atomic_load_relaxed(&constructed) &&
+ if (memprof_inited && atomic_load_relaxed(&constructed) &&
!atomic_load_relaxed(&destructing)) {
u64 c = GetShadowCount(p, user_requested_size);
long curtime = GetTimestamp();
@@ -680,6 +681,18 @@
return 0;
}
+static const void *memprof_malloc_begin(const void *p) {
+ u64 user_requested_size;
+ MemprofChunk *m =
+ instance.GetMemprofChunkByAddr((uptr)p, user_requested_size);
+ if (!m)
+ return nullptr;
+ if (user_requested_size == 0)
+ return nullptr;
+
+ return (const void *)m->Beg();
+}
+
uptr memprof_malloc_usable_size(const void *ptr, uptr pc, uptr bp) {
if (!ptr)
return 0;
@@ -698,6 +711,10 @@
return memprof_malloc_usable_size(p, 0, 0) != 0;
}
+const void *__sanitizer_get_allocated_begin(const void *p) {
+ return memprof_malloc_begin(p);
+}
+
uptr __sanitizer_get_allocated_size(const void *p) {
return memprof_malloc_usable_size(p, 0, 0);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_internal.h b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_internal.h
index bba465e..990e62c 100644
--- a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_internal.h
+++ b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_internal.h
@@ -76,7 +76,6 @@
extern int memprof_inited;
extern int memprof_timestamp_inited;
-extern int memprof_init_done;
// Used to avoid infinite recursion in __memprof_init().
extern bool memprof_init_is_running;
extern void (*death_callback)(void);
diff --git a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.cpp b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.cpp
index f065e8d..1a65fbb 100644
--- a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.cpp
@@ -20,7 +20,7 @@
using Header = ::llvm::memprof::Header;
namespace {
-template <class T> char *WriteBytes(T Pod, char *&Buffer) {
+template <class T> char *WriteBytes(const T &Pod, char *Buffer) {
*(T *)Buffer = Pod;
return Buffer + sizeof(T);
}
@@ -33,12 +33,14 @@
}
} // namespace
-u64 SegmentSizeBytes(MemoryMappingLayoutBase &Layout) {
+u64 SegmentSizeBytes(ArrayRef<LoadedModule> Modules) {
u64 NumSegmentsToRecord = 0;
- MemoryMappedSegment segment;
- for (Layout.Reset(); Layout.Next(&segment);)
- if (segment.IsReadable() && segment.IsExecutable())
- NumSegmentsToRecord++;
+ for (const auto &Module : Modules) {
+ for (const auto &Segment : Module.ranges()) {
+ if (Segment.executable)
+ NumSegmentsToRecord++;
+ }
+ }
return sizeof(u64) // A header which stores the number of records.
+ sizeof(SegmentEntry) * NumSegmentsToRecord;
@@ -51,28 +53,31 @@
// Start
// End
// Offset
-// BuildID 32B
+// UuidSize
+// Uuid 32B
// ----------
// ...
-void SerializeSegmentsToBuffer(MemoryMappingLayoutBase &Layout,
+void SerializeSegmentsToBuffer(ArrayRef<LoadedModule> Modules,
const u64 ExpectedNumBytes, char *&Buffer) {
char *Ptr = Buffer;
// Reserve space for the final count.
Ptr += sizeof(u64);
u64 NumSegmentsRecorded = 0;
- MemoryMappedSegment segment;
- for (Layout.Reset(); Layout.Next(&segment);) {
- if (segment.IsReadable() && segment.IsExecutable()) {
- // TODO: Record segment.uuid when it is implemented for Linux-Elf.
- SegmentEntry Entry(segment.start, segment.end, segment.offset);
- memcpy(Ptr, &Entry, sizeof(SegmentEntry));
- Ptr += sizeof(SegmentEntry);
- NumSegmentsRecorded++;
+ for (const auto &Module : Modules) {
+ for (const auto &Segment : Module.ranges()) {
+ if (Segment.executable) {
+ SegmentEntry Entry(Segment.beg, Segment.end, Module.base_address());
+ CHECK(Module.uuid_size() <= MEMPROF_BUILDID_MAX_SIZE);
+ Entry.BuildIdSize = Module.uuid_size();
+ memcpy(Entry.BuildId, Module.uuid(), Module.uuid_size());
+ memcpy(Ptr, &Entry, sizeof(SegmentEntry));
+ Ptr += sizeof(SegmentEntry);
+ NumSegmentsRecorded++;
+ }
}
}
-
// Store the number of segments we recorded in the space we reserved.
*((u64 *)Buffer) = NumSegmentsRecorded;
CHECK(ExpectedNumBytes >= static_cast<u64>(Ptr - Buffer) &&
@@ -198,11 +203,11 @@
// ----------
// Optional Padding Bytes
// ...
-u64 SerializeToRawProfile(MIBMapTy &MIBMap, MemoryMappingLayoutBase &Layout,
+u64 SerializeToRawProfile(MIBMapTy &MIBMap, ArrayRef<LoadedModule> Modules,
char *&Buffer) {
// Each section size is rounded up to 8b since the first entry in each section
// is a u64 which holds the number of entries in the section by convention.
- const u64 NumSegmentBytes = RoundUpTo(SegmentSizeBytes(Layout), 8);
+ const u64 NumSegmentBytes = RoundUpTo(SegmentSizeBytes(Modules), 8);
Vector<u64> StackIds;
MIBMap.ForEach(RecordStackId, reinterpret_cast<void *>(&StackIds));
@@ -232,7 +237,7 @@
sizeof(Header) + NumSegmentBytes + NumMIBInfoBytes};
Ptr = WriteBytes(header, Ptr);
- SerializeSegmentsToBuffer(Layout, NumSegmentBytes, Ptr);
+ SerializeSegmentsToBuffer(Modules, NumSegmentBytes, Ptr);
Ptr += NumSegmentBytes;
SerializeMIBInfoToBuffer(MIBMap, StackIds, NumMIBInfoBytes, Ptr);
diff --git a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.h b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.h
index 575104e..a4e9fd4 100644
--- a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.h
+++ b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rawprofile.h
@@ -2,12 +2,12 @@
#define MEMPROF_RAWPROFILE_H_
#include "memprof_mibmap.h"
-#include "sanitizer_common/sanitizer_procmaps.h"
+#include "sanitizer_common/sanitizer_common.h"
namespace __memprof {
// Serialize the in-memory representation of the memprof profile to the raw
// binary format. The format itself is documented memprof_rawprofile.cpp.
-u64 SerializeToRawProfile(MIBMapTy &BlockCache, MemoryMappingLayoutBase &Layout,
+u64 SerializeToRawProfile(MIBMapTy &BlockCache, ArrayRef<LoadedModule> Modules,
char *&Buffer);
} // namespace __memprof
diff --git a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rtl.cpp b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rtl.cpp
index d30b803..5e2e7bc 100644
--- a/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rtl.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/memprof/memprof_rtl.cpp
@@ -65,7 +65,6 @@
// -------------------------- Globals --------------------- {{{1
int memprof_inited;
-int memprof_init_done;
bool memprof_init_is_running;
int memprof_timestamp_inited;
long memprof_init_timestamp_s;
@@ -195,11 +194,6 @@
InitializeAllocator();
- // On Linux MemprofThread::ThreadStart() calls malloc() that's why
- // memprof_inited should be set to 1 prior to initializing the threads.
- memprof_inited = 1;
- memprof_init_is_running = false;
-
if (flags()->atexit)
Atexit(memprof_atexit);
@@ -218,7 +212,8 @@
VReport(1, "MemProfiler Init done\n");
- memprof_init_done = 1;
+ memprof_init_is_running = false;
+ memprof_inited = 1;
}
void MemprofInitTime() {
diff --git a/third_party/llvm-project/compiler-rt/lib/memprof/tests/rawprofile.cpp b/third_party/llvm-project/compiler-rt/lib/memprof/tests/rawprofile.cpp
index 7f6398d..3c7372a 100644
--- a/third_party/llvm-project/compiler-rt/lib/memprof/tests/rawprofile.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/memprof/tests/rawprofile.cpp
@@ -15,22 +15,9 @@
using ::__memprof::MIBMapTy;
using ::__memprof::SerializeToRawProfile;
-using ::__sanitizer::MemoryMappedSegment;
-using ::__sanitizer::MemoryMappingLayoutBase;
using ::__sanitizer::StackDepotPut;
using ::__sanitizer::StackTrace;
using ::llvm::memprof::MemInfoBlock;
-using ::testing::_;
-using ::testing::Action;
-using ::testing::DoAll;
-using ::testing::Return;
-using ::testing::SetArgPointee;
-
-class MockMemoryMappingLayout final : public MemoryMappingLayoutBase {
-public:
- MOCK_METHOD(bool, Next, (MemoryMappedSegment *), (override));
- MOCK_METHOD(void, Reset, (), (override));
-};
uint64_t PopulateFakeMap(const MemInfoBlock &FakeMIB, uint64_t StackPCBegin,
MIBMapTy &FakeMap) {
@@ -56,26 +43,13 @@
}
TEST(MemProf, Basic) {
- MockMemoryMappingLayout Layout;
- MemoryMappedSegment FakeSegment;
- memset(&FakeSegment, 0, sizeof(FakeSegment));
- FakeSegment.start = 0x10;
- FakeSegment.end = 0x20;
- FakeSegment.offset = 0x10;
- uint8_t uuid[__sanitizer::kModuleUUIDSize] = {0xC, 0x0, 0xF, 0xF, 0xE, 0xE};
- memcpy(FakeSegment.uuid, uuid, __sanitizer::kModuleUUIDSize);
- FakeSegment.protection =
- __sanitizer::kProtectionExecute | __sanitizer::kProtectionRead;
-
- const Action<bool(MemoryMappedSegment *)> SetSegment =
- DoAll(SetArgPointee<0>(FakeSegment), Return(true));
- EXPECT_CALL(Layout, Next(_))
- .WillOnce(SetSegment)
- .WillOnce(Return(false))
- .WillOnce(SetSegment)
- .WillRepeatedly(Return(false));
-
- EXPECT_CALL(Layout, Reset).Times(2);
+ __sanitizer::LoadedModule FakeModule;
+ FakeModule.addAddressRange(/*begin=*/0x10, /*end=*/0x20, /*executable=*/true,
+ /*writable=*/false, /*name=*/"");
+ const char uuid[MEMPROF_BUILDID_MAX_SIZE] = {0xC, 0x0, 0xF, 0xF, 0xE, 0xE};
+ FakeModule.setUuid(uuid, MEMPROF_BUILDID_MAX_SIZE);
+ __sanitizer::ArrayRef<__sanitizer::LoadedModule> Modules(&FakeModule,
+ (&FakeModule) + 1);
MIBMapTy FakeMap;
MemInfoBlock FakeMIB;
@@ -90,7 +64,7 @@
FakeIds[1] = PopulateFakeMap(FakeMIB, /*StackPCBegin=*/3, FakeMap);
char *Ptr = nullptr;
- uint64_t NumBytes = SerializeToRawProfile(FakeMap, Layout, Ptr);
+ uint64_t NumBytes = SerializeToRawProfile(FakeMap, Modules, Ptr);
const char *Buffer = Ptr;
ASSERT_GT(NumBytes, 0ULL);
@@ -111,16 +85,16 @@
// Should be equal to the size of the raw profile header.
EXPECT_EQ(SegmentOffset, 48ULL);
- // We expect only 1 segment entry, 8b for the count and 56b for SegmentEntry
+ // We expect only 1 segment entry, 8b for the count and 64b for SegmentEntry
// in memprof_rawprofile.cpp.
- EXPECT_EQ(MIBOffset - SegmentOffset, 64ULL);
+ EXPECT_EQ(MIBOffset - SegmentOffset, 72ULL);
- EXPECT_EQ(MIBOffset, 112ULL);
+ EXPECT_EQ(MIBOffset, 120ULL);
// We expect 2 mib entry, 8b for the count and sizeof(uint64_t) +
// sizeof(MemInfoBlock) contains stack id + MeminfoBlock.
EXPECT_EQ(StackOffset - MIBOffset, 8 + 2 * (8 + sizeof(MemInfoBlock)));
- EXPECT_EQ(StackOffset, 336ULL);
+ EXPECT_EQ(StackOffset, 408ULL);
// We expect 2 stack entries, with 5 frames - 8b for total count,
// 2 * (8b for id, 8b for frame count and 5*8b for fake frames).
// Since this is the last section, there may be additional padding at the end
@@ -128,16 +102,15 @@
EXPECT_GE(TotalSize - StackOffset, 8ULL + 2 * (8 + 8 + 5 * 8));
// ============= Check contents.
- // The Uuid field is not yet populated on Linux-Elf by the sanitizer procmaps
- // library, so we expect it to be filled with 0 for now.
- unsigned char ExpectedSegmentBytes[64] = {
- 0x01, 0, 0, 0, 0, 0, 0, 0, // Number of entries
- 0x10, 0, 0, 0, 0, 0, 0, 0, // Start
- 0x20, 0, 0, 0, 0, 0, 0, 0, // End
- 0x10, 0, 0, 0, 0, 0, 0, 0, // Offset
- 0x0, // Uuid
+ unsigned char ExpectedSegmentBytes[72] = {
+ 0x01, 0, 0, 0, 0, 0, 0, 0, // Number of entries
+ 0x10, 0, 0, 0, 0, 0, 0, 0, // Start
+ 0x20, 0, 0, 0, 0, 0, 0, 0, // End
+ 0x0, 0, 0, 0, 0, 0, 0, 0, // Offset
+ 0x20, 0, 0, 0, 0, 0, 0, 0, // UuidSize
+ 0xC, 0x0, 0xF, 0xF, 0xE, 0xE // Uuid
};
- EXPECT_EQ(memcmp(Buffer + SegmentOffset, ExpectedSegmentBytes, 64), 0);
+ EXPECT_EQ(memcmp(Buffer + SegmentOffset, ExpectedSegmentBytes, 72), 0);
// Check that the number of entries is 2.
EXPECT_EQ(*reinterpret_cast<const uint64_t *>(Buffer + MIBOffset), 2ULL);
@@ -193,5 +166,4 @@
sizeof(ExpectedStackBytes[1])),
0);
}
-
} // namespace
diff --git a/third_party/llvm-project/compiler-rt/lib/msan/msan.cpp b/third_party/llvm-project/compiler-rt/lib/msan/msan.cpp
index 3e3bc3c..987c556 100644
--- a/third_party/llvm-project/compiler-rt/lib/msan/msan.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/msan/msan.cpp
@@ -345,8 +345,7 @@
#define MSAN_MAYBE_WARNING(type, size) \
void __msan_maybe_warning_##size(type s, u32 o) { \
- GET_CALLER_PC_BP_SP; \
- (void) sp; \
+ GET_CALLER_PC_BP; \
if (UNLIKELY(s)) { \
PrintWarningWithOrigin(pc, bp, o); \
if (__msan::flags()->halt_on_error) { \
@@ -365,8 +364,7 @@
void __msan_maybe_store_origin_##size(type s, void *p, u32 o) { \
if (UNLIKELY(s)) { \
if (__msan_get_track_origins() > 1) { \
- GET_CALLER_PC_BP_SP; \
- (void) sp; \
+ GET_CALLER_PC_BP; \
GET_STORE_STACK_TRACE_PC_BP(pc, bp); \
o = ChainOrigin(o, &stack); \
} \
@@ -380,8 +378,7 @@
MSAN_MAYBE_STORE_ORIGIN(u64, 8)
void __msan_warning() {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
PrintWarningWithOrigin(pc, bp, 0);
if (__msan::flags()->halt_on_error) {
if (__msan::flags()->print_stats)
@@ -392,8 +389,7 @@
}
void __msan_warning_noreturn() {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
PrintWarningWithOrigin(pc, bp, 0);
if (__msan::flags()->print_stats)
ReportStats();
@@ -402,8 +398,7 @@
}
void __msan_warning_with_origin(u32 origin) {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
PrintWarningWithOrigin(pc, bp, origin);
if (__msan::flags()->halt_on_error) {
if (__msan::flags()->print_stats)
@@ -414,8 +409,7 @@
}
void __msan_warning_with_origin_noreturn(u32 origin) {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
PrintWarningWithOrigin(pc, bp, origin);
if (__msan::flags()->print_stats)
ReportStats();
@@ -513,8 +507,7 @@
if (expect_umr) {
msan_expected_umr_found = 0;
} else if (!msan_expected_umr_found) {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
GET_FATAL_STACK_TRACE_PC_BP(pc, bp);
ReportExpectedUMRNotFound(&stack);
Die();
@@ -562,8 +555,7 @@
if (offset < 0)
return;
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
ReportUMRInsideAddressRange(__func__, x, size, offset);
__msan::PrintWarningWithOrigin(pc, bp,
__msan_get_origin(((const char *)x) + offset));
@@ -622,8 +614,7 @@
}
u32 __msan_chain_origin(u32 id) {
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
GET_STORE_STACK_TRACE_PC_BP(pc, bp);
return ChainOrigin(id, &stack);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp b/third_party/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp
index 3308ee7..c32a029 100644
--- a/third_party/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp
@@ -260,6 +260,21 @@
return MsanAllocate(stack, nmemb * size, sizeof(u64), true);
}
+static const void *AllocationBegin(const void *p) {
+ if (!p)
+ return nullptr;
+ void *beg = allocator.GetBlockBegin(p);
+ if (!beg)
+ return nullptr;
+ Metadata *b = (Metadata *)allocator.GetMetaData(beg);
+ if (!b)
+ return nullptr;
+ if (b->requested_size == 0)
+ return nullptr;
+
+ return (const void *)beg;
+}
+
static uptr AllocationSize(const void *p) {
if (!p) return 0;
const void *beg = allocator.GetBlockBegin(p);
@@ -373,4 +388,8 @@
int __sanitizer_get_ownership(const void *p) { return AllocationSize(p) != 0; }
+const void *__sanitizer_get_allocated_begin(const void *p) {
+ return AllocationBegin(p);
+}
+
uptr __sanitizer_get_allocated_size(const void *p) { return AllocationSize(p); }
diff --git a/third_party/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp b/third_party/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp
index 058c10a..757dc46 100644
--- a/third_party/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp
@@ -93,8 +93,7 @@
if (__msan::IsInSymbolizerOrUnwider()) \
break; \
if (__offset >= 0 && __msan::flags()->report_umrs) { \
- GET_CALLER_PC_BP_SP; \
- (void)sp; \
+ GET_CALLER_PC_BP; \
ReportUMRInsideAddressRange(__func__, x, n, __offset); \
__msan::PrintWarningWithOrigin( \
pc, bp, __msan_get_origin((const char *)x + __offset)); \
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/coff_platform.cpp b/third_party/llvm-project/compiler-rt/lib/orc/coff_platform.cpp
index 83ce07b..78c86c8 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/coff_platform.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/coff_platform.cpp
@@ -595,19 +595,19 @@
return Range.Header;
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_coff_platform_bootstrap(char *ArgData, size_t ArgSize) {
COFFPlatformRuntimeState::initialize();
return WrapperFunctionResult().release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_coff_platform_shutdown(char *ArgData, size_t ArgSize) {
COFFPlatformRuntimeState::destroy();
return WrapperFunctionResult().release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_coff_register_jitdylib(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSString, SPSExecutorAddr)>::handle(
ArgData, ArgSize,
@@ -618,7 +618,7 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_coff_deregister_jitdylib(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSExecutorAddr)>::handle(
ArgData, ArgSize,
@@ -629,7 +629,7 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_coff_register_object_sections(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSExecutorAddr, SPSCOFFObjectSectionsMap,
bool)>::
@@ -644,7 +644,7 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_coff_deregister_object_sections(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSExecutorAddr, SPSCOFFObjectSectionsMap)>::
handle(ArgData, ArgSize,
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/common.h b/third_party/llvm-project/compiler-rt/lib/orc/common.h
index 5e01fee..73c5c4a 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/common.h
+++ b/third_party/llvm-project/compiler-rt/lib/orc/common.h
@@ -41,7 +41,7 @@
/// This is declared for use by the runtime, but should be implemented in the
/// executor or provided by a definition added to the JIT before the runtime
/// is loaded.
-ORC_RT_IMPORT __orc_rt_CWrapperFunctionResult
+ORC_RT_IMPORT orc_rt_CWrapperFunctionResult
__orc_rt_jit_dispatch(__orc_rt_Opaque *DispatchCtx, const void *FnTag,
const char *Data, size_t Size) ORC_RT_WEAK_IMPORT;
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/dlfcn_wrapper.cpp b/third_party/llvm-project/compiler-rt/lib/orc/dlfcn_wrapper.cpp
index c513aae..ece63da 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/dlfcn_wrapper.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/dlfcn_wrapper.cpp
@@ -22,7 +22,7 @@
extern "C" void *__orc_rt_jit_dlopen(const char *path, int mode);
extern "C" int __orc_rt_jit_dlclose(void *dso_handle);
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_jit_dlerror_wrapper(const char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSString()>::handle(
ArgData, ArgSize,
@@ -30,7 +30,7 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_jit_dlopen_wrapper(const char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSExecutorAddr(SPSString, int32_t)>::handle(
ArgData, ArgSize,
@@ -41,7 +41,7 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_jit_dlclose_wrapper(const char *ArgData, size_t ArgSize) {
return WrapperFunction<int32_t(SPSExecutorAddr)>::handle(
ArgData, ArgSize,
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/elfnix_platform.cpp b/third_party/llvm-project/compiler-rt/lib/orc/elfnix_platform.cpp
index 771e21d..c087e71 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/elfnix_platform.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/elfnix_platform.cpp
@@ -12,6 +12,7 @@
#include "elfnix_platform.h"
#include "common.h"
+#include "compiler.h"
#include "error.h"
#include "wrapper_function_utils.h"
@@ -33,8 +34,13 @@
// eh-frame registration functions, made available via aliases
// installed by the Platform
-extern "C" void __orc_rt_register_eh_frame_section(const void *);
-extern "C" void __orc_rt_deregister_eh_frame_section(const void *);
+extern "C" void __register_frame(const void *);
+extern "C" void __deregister_frame(const void *);
+
+extern "C" void
+__unw_add_dynamic_eh_frame_section(const void *) ORC_RT_WEAK_IMPORT;
+extern "C" void
+__unw_remove_dynamic_eh_frame_section(const void *) ORC_RT_WEAK_IMPORT;
namespace {
@@ -96,8 +102,7 @@
static ELFNixPlatformRuntimeState &get();
static void destroy();
- ELFNixPlatformRuntimeState(void *DSOHandle)
- : PlatformJDDSOHandle(DSOHandle) {}
+ ELFNixPlatformRuntimeState(void *DSOHandle);
// Delete copy and move constructors.
ELFNixPlatformRuntimeState(const ELFNixPlatformRuntimeState &) = delete;
@@ -143,6 +148,10 @@
void *PlatformJDDSOHandle;
+ // Frame registration functions:
+ void (*registerEHFrameSection)(const void *) = nullptr;
+ void (*deregisterEHFrameSection)(const void *) = nullptr;
+
// FIXME: Move to thread-state.
std::string DLFcnError;
@@ -171,11 +180,22 @@
delete MOPS;
}
+ELFNixPlatformRuntimeState::ELFNixPlatformRuntimeState(void *DSOHandle)
+ : PlatformJDDSOHandle(DSOHandle) {
+ if (__unw_add_dynamic_eh_frame_section &&
+ __unw_remove_dynamic_eh_frame_section) {
+ registerEHFrameSection = __unw_add_dynamic_eh_frame_section;
+ deregisterEHFrameSection = __unw_remove_dynamic_eh_frame_section;
+ } else {
+ registerEHFrameSection = __register_frame;
+ deregisterEHFrameSection = __deregister_frame;
+ }
+}
+
Error ELFNixPlatformRuntimeState::registerObjectSections(
ELFNixPerObjectSectionsToRegister POSR) {
if (POSR.EHFrameSection.Start)
- __orc_rt_register_eh_frame_section(
- POSR.EHFrameSection.Start.toPtr<const char *>());
+ registerEHFrameSection(POSR.EHFrameSection.Start.toPtr<const char *>());
if (POSR.ThreadDataSection.Start) {
if (auto Err = registerThreadDataSection(
@@ -189,8 +209,7 @@
Error ELFNixPlatformRuntimeState::deregisterObjectSections(
ELFNixPerObjectSectionsToRegister POSR) {
if (POSR.EHFrameSection.Start)
- __orc_rt_deregister_eh_frame_section(
- POSR.EHFrameSection.Start.toPtr<const char *>());
+ deregisterEHFrameSection(POSR.EHFrameSection.Start.toPtr<const char *>());
return Error::success();
}
@@ -451,7 +470,7 @@
// JIT entry points
//------------------------------------------------------------------------------
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_elfnix_platform_bootstrap(char *ArgData, size_t ArgSize) {
return WrapperFunction<void(uint64_t)>::handle(
ArgData, ArgSize,
@@ -462,14 +481,14 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_elfnix_platform_shutdown(char *ArgData, size_t ArgSize) {
ELFNixPlatformRuntimeState::destroy();
return WrapperFunctionResult().release();
}
/// Wrapper function for registering metadata on a per-object basis.
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_elfnix_register_object_sections(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSELFNixPerObjectSectionsToRegister)>::
handle(ArgData, ArgSize,
@@ -481,7 +500,7 @@
}
/// Wrapper for releasing per-object metadat.
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_elfnix_deregister_object_sections(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSELFNixPerObjectSectionsToRegister)>::
handle(ArgData, ArgSize,
@@ -517,7 +536,7 @@
return TLVPtr - ThreadPointer;
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_elfnix_create_pthread_key(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSExpected<uint64_t>(void)>::handle(
ArgData, ArgSize,
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/interval_map.h b/third_party/llvm-project/compiler-rt/lib/orc/interval_map.h
index 16f22c6..8c1609d 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/interval_map.h
+++ b/third_party/llvm-project/compiler-rt/lib/orc/interval_map.h
@@ -26,8 +26,7 @@
/// NOTE: The interface is kept mostly compatible with LLVM's IntervalMap
/// collection to make it easy to swap over in the future if we choose
/// to.
-template <typename KeyT, typename ValT, IntervalCoalescing Coalescing>
-class IntervalMap {
+template <typename KeyT, typename ValT> class IntervalMapBase {
private:
using KeyPairT = std::pair<KeyT, KeyT>;
@@ -76,7 +75,7 @@
}
const_iterator find(KeyT K) const {
- return const_cast<IntervalMap<KeyT, ValT, Coalescing> *>(this)->find(K);
+ return const_cast<IntervalMapBase<KeyT, ValT> *>(this)->find(K);
}
ValT lookup(KeyT K, ValT NotFound = ValT()) const {
@@ -86,31 +85,6 @@
return I->second;
}
- void insert(KeyT KS, KeyT KE, ValT V) {
- if (Coalescing == IntervalCoalescing::Enabled) {
- auto J = Impl.upper_bound(KS);
-
- // Coalesce-right if possible. Either way, J points at our insertion
- // point.
- if (J != end() && KE == J->first.first && J->second == V) {
- KE = J->first.second;
- auto Tmp = J++;
- Impl.erase(Tmp);
- }
-
- // Coalesce-left if possible.
- if (J != begin()) {
- auto I = std::prev(J);
- if (I->first.second == KS && I->second == V) {
- KS = I->first.first;
- Impl.erase(I);
- }
- }
- Impl.insert(J, std::make_pair(std::make_pair(KS, KE), std::move(V)));
- } else
- Impl.insert(std::make_pair(std::make_pair(KS, KE), std::move(V)));
- }
-
// Erase [KS, KE), which must be entirely containing within one existing
// range in the map. Removal is allowed to split the range.
void erase(KeyT KS, KeyT KE) {
@@ -144,10 +118,51 @@
J, std::make_pair(std::make_pair(Tmp.first.first, KS), Tmp.second));
}
-private:
+protected:
ImplMap Impl;
};
+template <typename KeyT, typename ValT, IntervalCoalescing Coalescing>
+class IntervalMap;
+
+template <typename KeyT, typename ValT>
+class IntervalMap<KeyT, ValT, IntervalCoalescing::Enabled>
+ : public IntervalMapBase<KeyT, ValT> {
+public:
+ // Coalescing insert. Requires that ValTs be equality-comparable.
+ void insert(KeyT KS, KeyT KE, ValT V) {
+ auto J = this->Impl.upper_bound(KS);
+
+ // Coalesce-right if possible. Either way, J points at our insertion
+ // point.
+ if (J != this->end() && KE == J->first.first && J->second == V) {
+ KE = J->first.second;
+ auto Tmp = J++;
+ this->Impl.erase(Tmp);
+ }
+
+ // Coalesce-left if possible.
+ if (J != this->begin()) {
+ auto I = std::prev(J);
+ if (I->first.second == KS && I->second == V) {
+ KS = I->first.first;
+ this->Impl.erase(I);
+ }
+ }
+ this->Impl.insert(J, std::make_pair(std::make_pair(KS, KE), std::move(V)));
+ }
+};
+
+template <typename KeyT, typename ValT>
+class IntervalMap<KeyT, ValT, IntervalCoalescing::Disabled>
+ : public IntervalMapBase<KeyT, ValT> {
+public:
+ // Non-coalescing insert. Does not require ValT to be equality-comparable.
+ void insert(KeyT KS, KeyT KE, ValT V) {
+ this->Impl.insert(std::make_pair(std::make_pair(KS, KE), std::move(V)));
+ }
+};
+
} // End namespace __orc_rt
#endif // ORC_RT_INTERVAL_MAP_H
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/macho_platform.cpp b/third_party/llvm-project/compiler-rt/lib/orc/macho_platform.cpp
index 5a5c8e4..33f7fbb 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/macho_platform.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/macho_platform.cpp
@@ -36,40 +36,38 @@
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_push_initializers_tag)
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_symbol_lookup_tag)
-// Objective-C types.
-struct objc_class;
struct objc_image_info;
-struct objc_object;
-struct objc_selector;
-
-using Class = objc_class *;
-using id = objc_object *;
-using SEL = objc_selector *;
+struct mach_header;
// Objective-C registration functions.
// These are weakly imported. If the Objective-C runtime has not been loaded
// then code containing Objective-C sections will generate an error.
-extern "C" id objc_msgSend(id, SEL, ...) ORC_RT_WEAK_IMPORT;
-extern "C" Class objc_readClassPair(Class,
- const objc_image_info *) ORC_RT_WEAK_IMPORT;
-extern "C" SEL sel_registerName(const char *) ORC_RT_WEAK_IMPORT;
-
-// Swift types.
-class ProtocolRecord;
-class ProtocolConformanceRecord;
-class TypeMetadataRecord;
-
extern "C" void
-swift_registerProtocols(const ProtocolRecord *begin,
- const ProtocolRecord *end) ORC_RT_WEAK_IMPORT;
+_objc_map_images(unsigned count, const char *const paths[],
+ const mach_header *const mhdrs[]) ORC_RT_WEAK_IMPORT;
-extern "C" void swift_registerProtocolConformances(
- const ProtocolConformanceRecord *begin,
- const ProtocolConformanceRecord *end) ORC_RT_WEAK_IMPORT;
+extern "C" void _objc_load_image(const char *path,
+ const mach_header *mh) ORC_RT_WEAK_IMPORT;
-extern "C" void swift_registerTypeMetadataRecords(
- const TypeMetadataRecord *begin,
- const TypeMetadataRecord *end) ORC_RT_WEAK_IMPORT;
+// Libunwind prototypes.
+struct unw_dynamic_unwind_sections {
+ uintptr_t dso_base;
+ uintptr_t dwarf_section;
+ size_t dwarf_section_length;
+ uintptr_t compact_unwind_section;
+ size_t compact_unwind_section_length;
+};
+
+typedef int (*unw_find_dynamic_unwind_sections)(
+ uintptr_t addr, struct unw_dynamic_unwind_sections *info);
+
+extern "C" int __unw_add_find_dynamic_unwind_sections(
+ unw_find_dynamic_unwind_sections find_dynamic_unwind_sections)
+ ORC_RT_WEAK_IMPORT;
+
+extern "C" int __unw_remove_find_dynamic_unwind_sections(
+ unw_find_dynamic_unwind_sections find_dynamic_unwind_sections)
+ ORC_RT_WEAK_IMPORT;
namespace {
@@ -111,6 +109,35 @@
}
};
+struct UnwindSectionInfo {
+ std::vector<ExecutorAddrRange> CodeRanges;
+ ExecutorAddrRange DwarfSection;
+ ExecutorAddrRange CompactUnwindSection;
+};
+
+using SPSUnwindSectionInfo =
+ SPSTuple<SPSSequence<SPSExecutorAddrRange>, SPSExecutorAddrRange,
+ SPSExecutorAddrRange>;
+
+template <>
+class SPSSerializationTraits<SPSUnwindSectionInfo, UnwindSectionInfo> {
+public:
+ static size_t size(const UnwindSectionInfo &USI) {
+ return SPSUnwindSectionInfo::AsArgList::size(
+ USI.CodeRanges, USI.DwarfSection, USI.CompactUnwindSection);
+ }
+
+ static bool serialize(SPSOutputBuffer &OB, const UnwindSectionInfo &USI) {
+ return SPSUnwindSectionInfo::AsArgList::serialize(
+ OB, USI.CodeRanges, USI.DwarfSection, USI.CompactUnwindSection);
+ }
+
+ static bool deserialize(SPSInputBuffer &IB, UnwindSectionInfo &USI) {
+ return SPSUnwindSectionInfo::AsArgList::deserialize(
+ IB, USI.CodeRanges, USI.DwarfSection, USI.CompactUnwindSection);
+ }
+};
+
} // namespace __orc_rt
namespace {
@@ -216,6 +243,18 @@
std::vector<span<RecordElement>> New;
};
+ struct UnwindSections {
+ UnwindSections(const UnwindSectionInfo &USI)
+ : DwarfSection(USI.DwarfSection.toSpan<char>()),
+ CompactUnwindSection(USI.CompactUnwindSection.toSpan<char>()) {}
+
+ span<char> DwarfSection;
+ span<char> CompactUnwindSection;
+ };
+
+ using UnwindSectionsMap =
+ IntervalMap<char *, UnwindSections, IntervalCoalescing::Disabled>;
+
struct JITDylibState {
std::string Name;
void *Header = nullptr;
@@ -227,12 +266,9 @@
const objc_image_info *ObjCImageInfo = nullptr;
std::unordered_map<void *, std::vector<char>> DataSectionContent;
std::unordered_map<void *, size_t> ZeroInitRanges;
+ UnwindSectionsMap UnwindSections;
RecordSectionsTracker<void (*)()> ModInitsSections;
- RecordSectionsTracker<void *> ObjCClassListSections;
- RecordSectionsTracker<void *> ObjCSelRefsSections;
- RecordSectionsTracker<char> Swift5ProtocolsSections;
- RecordSectionsTracker<char> Swift5ProtocolConformancesSections;
- RecordSectionsTracker<char> Swift5TypesSections;
+ RecordSectionsTracker<char> ObjCRuntimeRegistrationObjects;
bool referenced() const {
return LinkedAgainstRefCount != 0 || DlRefCount != 0;
@@ -240,9 +276,9 @@
};
public:
- static void initialize();
+ static Error create();
static MachOPlatformRuntimeState &get();
- static void destroy();
+ static Error destroy();
MachOPlatformRuntimeState() = default;
@@ -253,15 +289,18 @@
MachOPlatformRuntimeState(MachOPlatformRuntimeState &&) = delete;
MachOPlatformRuntimeState &operator=(MachOPlatformRuntimeState &&) = delete;
+ Error initialize();
+ Error shutdown();
+
Error registerJITDylib(std::string Name, void *Header);
Error deregisterJITDylib(void *Header);
Error registerThreadDataSection(span<const char> ThreadDataSection);
Error deregisterThreadDataSection(span<const char> ThreadDataSection);
Error registerObjectPlatformSections(
- ExecutorAddr HeaderAddr,
+ ExecutorAddr HeaderAddr, std::optional<UnwindSectionInfo> UnwindSections,
std::vector<std::pair<std::string_view, ExecutorAddrRange>> Secs);
Error deregisterObjectPlatformSections(
- ExecutorAddr HeaderAddr,
+ ExecutorAddr HeaderAddr, std::optional<UnwindSectionInfo> UnwindSections,
std::vector<std::pair<std::string_view, ExecutorAddrRange>> Secs);
const char *dlerror();
@@ -285,14 +324,14 @@
Expected<ExecutorAddr> lookupSymbolInJITDylib(void *DSOHandle,
std::string_view Symbol);
+ bool lookupUnwindSections(void *Addr, unw_dynamic_unwind_sections &Info);
+
+ static int findDynamicUnwindSections(uintptr_t addr,
+ unw_dynamic_unwind_sections *info);
static Error registerEHFrames(span<const char> EHFrameSection);
static Error deregisterEHFrames(span<const char> EHFrameSection);
- static Error registerObjCSelectors(JITDylibState &JDS);
- static Error registerObjCClasses(JITDylibState &JDS);
- static Error registerSwift5Protocols(JITDylibState &JDS);
- static Error registerSwift5ProtocolConformances(JITDylibState &JDS);
- static Error registerSwift5Types(JITDylibState &JDS);
+ static Error registerObjCRegistrationObjects(JITDylibState &JDS);
static Error runModInits(std::unique_lock<std::mutex> &JDStatesLock,
JITDylibState &JDS);
@@ -308,6 +347,8 @@
static MachOPlatformRuntimeState *MOPS;
+ bool UseCallbackStyleUnwindInfo = false;
+
// FIXME: Move to thread-state.
std::string DLFcnError;
@@ -327,9 +368,10 @@
MachOPlatformRuntimeState *MachOPlatformRuntimeState::MOPS = nullptr;
-void MachOPlatformRuntimeState::initialize() {
+Error MachOPlatformRuntimeState::create() {
assert(!MOPS && "MachOPlatformRuntimeState should be null");
MOPS = new MachOPlatformRuntimeState();
+ return MOPS->initialize();
}
MachOPlatformRuntimeState &MachOPlatformRuntimeState::get() {
@@ -337,9 +379,41 @@
return *MOPS;
}
-void MachOPlatformRuntimeState::destroy() {
+Error MachOPlatformRuntimeState::destroy() {
assert(MOPS && "MachOPlatformRuntimeState not initialized");
+ auto Err = MOPS->shutdown();
delete MOPS;
+ return Err;
+}
+
+Error MachOPlatformRuntimeState::initialize() {
+ UseCallbackStyleUnwindInfo = __unw_add_find_dynamic_unwind_sections &&
+ __unw_remove_find_dynamic_unwind_sections;
+ if (UseCallbackStyleUnwindInfo) {
+ ORC_RT_DEBUG({
+ printdbg("__unw_add/remove_find_dynamic_unwind_sections available."
+ " Using callback-based frame info lookup.\n");
+ });
+ if (__unw_add_find_dynamic_unwind_sections(&findDynamicUnwindSections))
+ return make_error<StringError>(
+ "Could not register findDynamicUnwindSections");
+ } else {
+ ORC_RT_DEBUG({
+ printdbg("__unw_add/remove_find_dynamic_unwind_sections not available."
+ " Using classic frame info registration.\n");
+ });
+ }
+ return Error::success();
+}
+
+Error MachOPlatformRuntimeState::shutdown() {
+ if (UseCallbackStyleUnwindInfo) {
+ if (__unw_remove_find_dynamic_unwind_sections(&findDynamicUnwindSections)) {
+ ORC_RT_DEBUG(
+ { printdbg("__unw_remove_find_dynamic_unwind_sections failed.\n"); });
+ }
+ }
+ return Error::success();
}
Error MachOPlatformRuntimeState::registerJITDylib(std::string Name,
@@ -419,7 +493,7 @@
}
Error MachOPlatformRuntimeState::registerObjectPlatformSections(
- ExecutorAddr HeaderAddr,
+ ExecutorAddr HeaderAddr, std::optional<UnwindSectionInfo> UnwindInfo,
std::vector<std::pair<std::string_view, ExecutorAddrRange>> Secs) {
// FIXME: Reject platform section registration after the JITDylib is
@@ -440,11 +514,35 @@
return make_error<StringError>(ErrStream.str());
}
+ if (UnwindInfo && UseCallbackStyleUnwindInfo) {
+ ORC_RT_DEBUG({
+ printdbg(" Registering new-style unwind info for:\n"
+ " DWARF: %p -- %p\n"
+ " Compact-unwind: %p -- %p\n"
+ " for:\n",
+ UnwindInfo->DwarfSection.Start.toPtr<void *>(),
+ UnwindInfo->DwarfSection.End.toPtr<void *>(),
+ UnwindInfo->CompactUnwindSection.Start.toPtr<void *>(),
+ UnwindInfo->CompactUnwindSection.End.toPtr<void *>());
+ });
+ for (auto &CodeRange : UnwindInfo->CodeRanges) {
+ JDS->UnwindSections.insert(CodeRange.Start.toPtr<char *>(),
+ CodeRange.End.toPtr<char *>(), *UnwindInfo);
+ ORC_RT_DEBUG({
+ printdbg(" [ %p -- %p ]\n", CodeRange.Start.toPtr<void *>(),
+ CodeRange.End.toPtr<void *>());
+ });
+ }
+ }
+
for (auto &KV : Secs) {
// FIXME: Validate section ranges?
if (KV.first == "__TEXT,__eh_frame") {
- if (auto Err = registerEHFrames(KV.second.toSpan<const char>()))
- return Err;
+ if (!UseCallbackStyleUnwindInfo) {
+ // Use classic libunwind registration.
+ if (auto Err = registerEHFrames(KV.second.toSpan<const char>()))
+ return Err;
+ }
} else if (KV.first == "__DATA,__data") {
assert(!JDS->DataSectionContent.count(KV.second.Start.toPtr<char *>()) &&
"Address already registered.");
@@ -452,22 +550,12 @@
JDS->DataSectionContent[KV.second.Start.toPtr<char *>()] =
std::vector<char>(S.begin(), S.end());
} else if (KV.first == "__DATA,__common") {
- // fprintf(stderr, "Adding zero-init range %llx -- %llx\n",
- // KV.second.Start.getValue(), KV.second.size());
JDS->ZeroInitRanges[KV.second.Start.toPtr<char *>()] = KV.second.size();
} else if (KV.first == "__DATA,__thread_data") {
if (auto Err = registerThreadDataSection(KV.second.toSpan<const char>()))
return Err;
- } else if (KV.first == "__DATA,__objc_selrefs")
- JDS->ObjCSelRefsSections.add(KV.second.toSpan<void *>());
- else if (KV.first == "__DATA,__objc_classlist")
- JDS->ObjCClassListSections.add(KV.second.toSpan<void *>());
- else if (KV.first == "__TEXT,__swift5_protos")
- JDS->Swift5ProtocolsSections.add(KV.second.toSpan<char>());
- else if (KV.first == "__TEXT,__swift5_proto")
- JDS->Swift5ProtocolConformancesSections.add(KV.second.toSpan<char>());
- else if (KV.first == "__TEXT,__swift5_types")
- JDS->Swift5TypesSections.add(KV.second.toSpan<char>());
+ } else if (KV.first == "__llvm_jitlink_ObjCRuntimeRegistrationObject")
+ JDS->ObjCRuntimeRegistrationObjects.add(KV.second.toSpan<char>());
else if (KV.first == "__DATA,__mod_init_func")
JDS->ModInitsSections.add(KV.second.toSpan<void (*)()>());
else {
@@ -483,7 +571,7 @@
}
Error MachOPlatformRuntimeState::deregisterObjectPlatformSections(
- ExecutorAddr HeaderAddr,
+ ExecutorAddr HeaderAddr, std::optional<UnwindSectionInfo> UnwindInfo,
std::vector<std::pair<std::string_view, ExecutorAddrRange>> Secs) {
// TODO: Make this more efficient? (maybe unnecessary if removal is rare?)
// TODO: Add a JITDylib prepare-for-teardown operation that clears all
@@ -510,11 +598,35 @@
// any Swift or ObjC. Once this happens we can clear (and no longer record)
// data section content, as the library could never be re-initialized.
+ if (UnwindInfo && UseCallbackStyleUnwindInfo) {
+ ORC_RT_DEBUG({
+ printdbg(" Deregistering new-style unwind info for:\n"
+ " DWARF: %p -- %p\n"
+ " Compact-unwind: %p -- %p\n"
+ " for:\n",
+ UnwindInfo->DwarfSection.Start.toPtr<void *>(),
+ UnwindInfo->DwarfSection.End.toPtr<void *>(),
+ UnwindInfo->CompactUnwindSection.Start.toPtr<void *>(),
+ UnwindInfo->CompactUnwindSection.End.toPtr<void *>());
+ });
+ for (auto &CodeRange : UnwindInfo->CodeRanges) {
+ JDS->UnwindSections.erase(CodeRange.Start.toPtr<char *>(),
+ CodeRange.End.toPtr<char *>());
+ ORC_RT_DEBUG({
+ printdbg(" [ %p -- %p ]\n", CodeRange.Start.toPtr<void *>(),
+ CodeRange.End.toPtr<void *>());
+ });
+ }
+ }
+
for (auto &KV : Secs) {
// FIXME: Validate section ranges?
if (KV.first == "__TEXT,__eh_frame") {
- if (auto Err = deregisterEHFrames(KV.second.toSpan<const char>()))
- return Err;
+ if (!UseCallbackStyleUnwindInfo) {
+ // Use classic libunwind registration.
+ if (auto Err = deregisterEHFrames(KV.second.toSpan<const char>()))
+ return Err;
+ }
} else if (KV.first == "__DATA,__data") {
JDS->DataSectionContent.erase(KV.second.Start.toPtr<char *>());
} else if (KV.first == "__DATA,__common") {
@@ -523,16 +635,8 @@
if (auto Err =
deregisterThreadDataSection(KV.second.toSpan<const char>()))
return Err;
- } else if (KV.first == "__DATA,__objc_selrefs")
- JDS->ObjCSelRefsSections.removeIfPresent(KV.second);
- else if (KV.first == "__DATA,__objc_classlist")
- JDS->ObjCClassListSections.removeIfPresent(KV.second);
- else if (KV.first == "__TEXT,__swift5_protos")
- JDS->Swift5ProtocolsSections.removeIfPresent(KV.second);
- else if (KV.first == "__TEXT,__swift5_proto")
- JDS->Swift5ProtocolConformancesSections.removeIfPresent(KV.second);
- else if (KV.first == "__TEXT,__swift5_types")
- JDS->Swift5TypesSections.removeIfPresent(KV.second);
+ } else if (KV.first == "__llvm_jitlink_ObjCRuntimeRegistrationObject")
+ JDS->ObjCRuntimeRegistrationObjects.removeIfPresent(KV.second);
else if (KV.first == "__DATA,__mod_init_func")
JDS->ModInitsSections.removeIfPresent(KV.second);
else {
@@ -710,6 +814,37 @@
}
}
+bool MachOPlatformRuntimeState::lookupUnwindSections(
+ void *Addr, unw_dynamic_unwind_sections &Info) {
+ ORC_RT_DEBUG(
+ { printdbg("Tried to lookup unwind-info via new lookup call.\n"); });
+ std::lock_guard<std::mutex> Lock(JDStatesMutex);
+ for (auto &KV : JDStates) {
+ auto &JD = KV.second;
+ auto I = JD.UnwindSections.find(reinterpret_cast<char *>(Addr));
+ if (I != JD.UnwindSections.end()) {
+ Info.dso_base = reinterpret_cast<uintptr_t>(JD.Header);
+ Info.dwarf_section =
+ reinterpret_cast<uintptr_t>(I->second.DwarfSection.data());
+ Info.dwarf_section_length = I->second.DwarfSection.size();
+ Info.compact_unwind_section =
+ reinterpret_cast<uintptr_t>(I->second.CompactUnwindSection.data());
+ Info.compact_unwind_section_length =
+ I->second.CompactUnwindSection.size();
+ return true;
+ }
+ }
+ return false;
+}
+
+int MachOPlatformRuntimeState::findDynamicUnwindSections(
+ uintptr_t addr, unw_dynamic_unwind_sections *info) {
+ if (!info)
+ return 0;
+ return MachOPlatformRuntimeState::get().lookupUnwindSections((void *)addr,
+ *info);
+}
+
Error MachOPlatformRuntimeState::registerEHFrames(
span<const char> EHFrameSection) {
walkEHFrameSection(EHFrameSection, __register_frame);
@@ -722,115 +857,26 @@
return Error::success();
}
-Error MachOPlatformRuntimeState::registerObjCSelectors(JITDylibState &JDS) {
- if (!JDS.ObjCSelRefsSections.hasNewSections())
- return Error::success();
-
- if (ORC_RT_UNLIKELY(!sel_registerName))
- return make_error<StringError>("sel_registerName is not available");
-
- JDS.ObjCSelRefsSections.processNewSections([](span<void *> SelRefs) {
- for (void *&SelEntry : SelRefs) {
- const char *SelName = reinterpret_cast<const char *>(SelEntry);
- auto Sel = sel_registerName(SelName);
- *reinterpret_cast<SEL *>(&SelEntry) = Sel;
- }
- });
-
- return Error::success();
-}
-
-Error MachOPlatformRuntimeState::registerObjCClasses(JITDylibState &JDS) {
- if (!JDS.ObjCClassListSections.hasNewSections())
- return Error::success();
-
- if (ORC_RT_UNLIKELY(!objc_msgSend))
- return make_error<StringError>("objc_msgSend is not available");
- if (ORC_RT_UNLIKELY(!objc_readClassPair))
- return make_error<StringError>("objc_readClassPair is not available");
-
- struct ObjCClassCompiled {
- void *Metaclass;
- void *Parent;
- void *Cache1;
- void *Cache2;
- void *Data;
- };
-
- auto ClassSelector = sel_registerName("class");
-
- return JDS.ObjCClassListSections.processNewSections(
- [&](span<void *> ClassPtrs) -> Error {
- for (void *ClassPtr : ClassPtrs) {
- auto *Cls = reinterpret_cast<Class>(ClassPtr);
- auto *ClassCompiled = reinterpret_cast<ObjCClassCompiled *>(ClassPtr);
- objc_msgSend(reinterpret_cast<id>(ClassCompiled->Parent),
- ClassSelector);
- auto Registered = objc_readClassPair(Cls, JDS.ObjCImageInfo);
- // FIXME: Improve diagnostic by reporting the failed class's name.
- if (Registered != Cls)
- return make_error<StringError>(
- "Unable to register Objective-C class");
- }
- return Error::success();
- });
-}
-
-Error MachOPlatformRuntimeState::registerSwift5Protocols(JITDylibState &JDS) {
-
- if (!JDS.Swift5ProtocolsSections.hasNewSections())
- return Error::success();
-
- if (ORC_RT_UNLIKELY(!swift_registerProtocols))
- return make_error<StringError>("swift_registerProtocols is not available");
-
- JDS.Swift5ProtocolsSections.processNewSections([](span<char> ProtoSec) {
- swift_registerProtocols(
- reinterpret_cast<const ProtocolRecord *>(ProtoSec.data()),
- reinterpret_cast<const ProtocolRecord *>(ProtoSec.data() +
- ProtoSec.size()));
- });
-
- return Error::success();
-}
-
-Error MachOPlatformRuntimeState::registerSwift5ProtocolConformances(
+Error MachOPlatformRuntimeState::registerObjCRegistrationObjects(
JITDylibState &JDS) {
+ ORC_RT_DEBUG(printdbg("Registering Objective-C / Swift metadata.\n"));
- if (!JDS.Swift5ProtocolConformancesSections.hasNewSections())
- return Error::success();
-
- if (ORC_RT_UNLIKELY(!swift_registerProtocolConformances))
+ if (!_objc_map_images || !_objc_load_image)
return make_error<StringError>(
- "swift_registerProtocolConformances is not available");
+ "Could not register Objective-C / Swift metadata: _objc_map_images / "
+ "_objc_load_image not found");
- JDS.Swift5ProtocolConformancesSections.processNewSections(
- [](span<char> ProtoConfSec) {
- swift_registerProtocolConformances(
- reinterpret_cast<const ProtocolConformanceRecord *>(
- ProtoConfSec.data()),
- reinterpret_cast<const ProtocolConformanceRecord *>(
- ProtoConfSec.data() + ProtoConfSec.size()));
- });
+ std::vector<char *> RegObjBases;
+ JDS.ObjCRuntimeRegistrationObjects.processNewSections(
+ [&](span<char> RegObj) { RegObjBases.push_back(RegObj.data()); });
- return Error::success();
-}
+ std::vector<char *> Paths;
+ Paths.resize(RegObjBases.size());
+ _objc_map_images(RegObjBases.size(), Paths.data(),
+ reinterpret_cast<mach_header **>(RegObjBases.data()));
-Error MachOPlatformRuntimeState::registerSwift5Types(JITDylibState &JDS) {
-
- if (!JDS.Swift5TypesSections.hasNewSections())
- return Error::success();
-
- if (ORC_RT_UNLIKELY(!swift_registerTypeMetadataRecords))
- return make_error<StringError>(
- "swift_registerTypeMetadataRecords is not available");
-
- JDS.Swift5TypesSections.processNewSections([&](span<char> TypesSec) {
- swift_registerTypeMetadataRecords(
- reinterpret_cast<const TypeMetadataRecord *>(TypesSec.data()),
- reinterpret_cast<const TypeMetadataRecord *>(TypesSec.data() +
- TypesSec.size()));
- });
+ for (void *RegObjBase : RegObjBases)
+ _objc_load_image(nullptr, reinterpret_cast<mach_header *>(RegObjBase));
return Error::success();
}
@@ -968,15 +1014,7 @@
}
// Initialize this JITDylib.
- if (auto Err = registerObjCSelectors(JDS))
- return Err;
- if (auto Err = registerObjCClasses(JDS))
- return Err;
- if (auto Err = registerSwift5Protocols(JDS))
- return Err;
- if (auto Err = registerSwift5ProtocolConformances(JDS))
- return Err;
- if (auto Err = registerSwift5Types(JDS))
+ if (auto Err = registerObjCRegistrationObjects(JDS))
return Err;
if (auto Err = runModInits(JDStatesLock, JDS))
return Err;
@@ -1097,29 +1135,23 @@
// JIT entry points
//------------------------------------------------------------------------------
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_platform_bootstrap(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError()>::handle(
ArgData, ArgSize,
- []() -> Error {
- MachOPlatformRuntimeState::initialize();
- return Error::success();
- })
+ []() { return MachOPlatformRuntimeState::create(); })
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_platform_shutdown(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError()>::handle(
ArgData, ArgSize,
- []() -> Error {
- MachOPlatformRuntimeState::destroy();
- return Error::success();
- })
+ []() { return MachOPlatformRuntimeState::destroy(); })
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_register_jitdylib(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSString, SPSExecutorAddr)>::handle(
ArgData, ArgSize,
@@ -1130,7 +1162,7 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_deregister_jitdylib(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSExecutorAddr)>::handle(
ArgData, ArgSize,
@@ -1141,38 +1173,41 @@
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_register_object_platform_sections(char *ArgData,
size_t ArgSize) {
return WrapperFunction<SPSError(SPSExecutorAddr,
+ SPSOptional<SPSUnwindSectionInfo>,
SPSMachOObjectPlatformSectionsMap)>::
handle(ArgData, ArgSize,
- [](ExecutorAddr HeaderAddr,
+ [](ExecutorAddr HeaderAddr, std::optional<UnwindSectionInfo> USI,
std::vector<std::pair<std::string_view, ExecutorAddrRange>>
&Secs) {
return MachOPlatformRuntimeState::get()
- .registerObjectPlatformSections(HeaderAddr, std::move(Secs));
+ .registerObjectPlatformSections(HeaderAddr, std::move(USI),
+ std::move(Secs));
})
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_deregister_object_platform_sections(char *ArgData,
size_t ArgSize) {
return WrapperFunction<SPSError(SPSExecutorAddr,
+ SPSOptional<SPSUnwindSectionInfo>,
SPSMachOObjectPlatformSectionsMap)>::
handle(ArgData, ArgSize,
- [](ExecutorAddr HeaderAddr,
+ [](ExecutorAddr HeaderAddr, std::optional<UnwindSectionInfo> USI,
std::vector<std::pair<std::string_view, ExecutorAddrRange>>
&Secs) {
return MachOPlatformRuntimeState::get()
- .deregisterObjectPlatformSections(HeaderAddr,
+ .deregisterObjectPlatformSections(HeaderAddr, std::move(USI),
std::move(Secs));
})
.release();
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_run_wrapper_function_calls(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSError(SPSSequence<SPSWrapperFunctionCall>)>::handle(
ArgData, ArgSize, runWrapperFunctionCalls)
@@ -1198,7 +1233,7 @@
reinterpret_cast<char *>(static_cast<uintptr_t>(D->DataAddress)));
}
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_macho_create_pthread_key(char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSExpected<uint64_t>(void)>::handle(
ArgData, ArgSize,
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/run_program_wrapper.cpp b/third_party/llvm-project/compiler-rt/lib/orc/run_program_wrapper.cpp
index bb4edc5..24a7b4f 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/run_program_wrapper.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/run_program_wrapper.cpp
@@ -22,7 +22,7 @@
const char *EntrySymbolName, int argc,
char *argv[]);
-ORC_RT_INTERFACE __orc_rt_CWrapperFunctionResult
+ORC_RT_INTERFACE orc_rt_CWrapperFunctionResult
__orc_rt_run_program_wrapper(const char *ArgData, size_t ArgSize) {
return WrapperFunction<int64_t(SPSString, SPSString,
SPSSequence<SPSString>)>::
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/c_api_test.cpp b/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/c_api_test.cpp
index ad3f055..497cb93 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/c_api_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/c_api_test.cpp
@@ -14,24 +14,24 @@
#include "gtest/gtest.h"
TEST(CAPITest, CWrapperFunctionResultInit) {
- __orc_rt_CWrapperFunctionResult R;
- __orc_rt_CWrapperFunctionResultInit(&R);
+ orc_rt_CWrapperFunctionResult R;
+ orc_rt_CWrapperFunctionResultInit(&R);
EXPECT_EQ(R.Size, 0U);
EXPECT_EQ(R.Data.ValuePtr, nullptr);
// Check that this value isn't treated as an out-of-band error.
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultAllocSmall) {
constexpr size_t SmallAllocSize = sizeof(const char *);
- auto R = __orc_rt_CWrapperFunctionResultAllocate(SmallAllocSize);
- char *DataPtr = __orc_rt_CWrapperFunctionResultData(&R);
+ auto R = orc_rt_CWrapperFunctionResultAllocate(SmallAllocSize);
+ char *DataPtr = orc_rt_CWrapperFunctionResultData(&R);
for (size_t I = 0; I != SmallAllocSize; ++I)
DataPtr[I] = 0x55 + I;
@@ -44,24 +44,24 @@
<< "Unexpected value at index " << I;
// Check that this value isn't treated as an out-of-band error.
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
- // Check that __orc_rt_CWrapperFunctionResult(Data|Result|Size) and
- // __orc_rt_CWrapperFunctionResultGetOutOfBandError behave as expected.
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultData(&R), R.Data.Value);
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultSize(&R), SmallAllocSize);
- EXPECT_FALSE(__orc_rt_CWrapperFunctionResultEmpty(&R));
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
+ // Check that orc_rt_CWrapperFunctionResult(Data|Result|Size) and
+ // orc_rt_CWrapperFunctionResultGetOutOfBandError behave as expected.
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultData(&R), R.Data.Value);
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultSize(&R), SmallAllocSize);
+ EXPECT_FALSE(orc_rt_CWrapperFunctionResultEmpty(&R));
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultAllocLarge) {
constexpr size_t LargeAllocSize = sizeof(const char *) + 1;
- auto R = __orc_rt_CWrapperFunctionResultAllocate(LargeAllocSize);
- char *DataPtr = __orc_rt_CWrapperFunctionResultData(&R);
+ auto R = orc_rt_CWrapperFunctionResultAllocate(LargeAllocSize);
+ char *DataPtr = orc_rt_CWrapperFunctionResultData(&R);
for (size_t I = 0; I != LargeAllocSize; ++I)
DataPtr[I] = 0x55 + I;
@@ -75,17 +75,17 @@
<< "Unexpected value at index " << I;
// Check that this value isn't treated as an out-of-band error.
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
- // Check that __orc_rt_CWrapperFunctionResult(Data|Result|Size) and
- // __orc_rt_CWrapperFunctionResultGetOutOfBandError behave as expected.
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultData(&R), R.Data.ValuePtr);
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultSize(&R), LargeAllocSize);
- EXPECT_FALSE(__orc_rt_CWrapperFunctionResultEmpty(&R));
- EXPECT_EQ(__orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
+ // Check that orc_rt_CWrapperFunctionResult(Data|Result|Size) and
+ // orc_rt_CWrapperFunctionResultGetOutOfBandError behave as expected.
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultData(&R), R.Data.ValuePtr);
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultSize(&R), LargeAllocSize);
+ EXPECT_FALSE(orc_rt_CWrapperFunctionResultEmpty(&R));
+ EXPECT_EQ(orc_rt_CWrapperFunctionResultGetOutOfBandError(&R), nullptr);
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultFromRangeSmall) {
@@ -95,8 +95,8 @@
for (size_t I = 0; I != SmallAllocSize; ++I)
Source[I] = 0x55 + I;
- __orc_rt_CWrapperFunctionResult R =
- __orc_rt_CreateCWrapperFunctionResultFromRange(Source, SmallAllocSize);
+ orc_rt_CWrapperFunctionResult R =
+ orc_rt_CreateCWrapperFunctionResultFromRange(Source, SmallAllocSize);
// Check that the inline storage in R.Data.Value contains the expected
// sequence.
@@ -106,7 +106,7 @@
<< "Unexpected value at index " << I;
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultFromRangeLarge) {
@@ -116,8 +116,8 @@
for (size_t I = 0; I != LargeAllocSize; ++I)
Source[I] = 0x55 + I;
- __orc_rt_CWrapperFunctionResult R =
- __orc_rt_CreateCWrapperFunctionResultFromRange(Source, LargeAllocSize);
+ orc_rt_CWrapperFunctionResult R =
+ orc_rt_CreateCWrapperFunctionResultFromRange(Source, LargeAllocSize);
// Check that the inline storage in R.Data.Value contains the expected
// sequence.
@@ -127,7 +127,7 @@
<< "Unexpected value at index " << I;
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultFromStringSmall) {
@@ -138,8 +138,8 @@
Source[I] = 'a' + I;
Source[SmallAllocSize - 1] = '\0';
- __orc_rt_CWrapperFunctionResult R =
- __orc_rt_CreateCWrapperFunctionResultFromString(Source);
+ orc_rt_CWrapperFunctionResult R =
+ orc_rt_CreateCWrapperFunctionResultFromString(Source);
// Check that the inline storage in R.Data.Value contains the expected
// sequence.
@@ -151,7 +151,7 @@
<< "Unexpected value at index " << (SmallAllocSize - 1);
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultFromStringLarge) {
@@ -162,8 +162,8 @@
Source[I] = 'a' + I;
Source[LargeAllocSize - 1] = '\0';
- __orc_rt_CWrapperFunctionResult R =
- __orc_rt_CreateCWrapperFunctionResultFromString(Source);
+ orc_rt_CWrapperFunctionResult R =
+ orc_rt_CreateCWrapperFunctionResultFromString(Source);
// Check that the inline storage in R.Data.Value contains the expected
// sequence.
@@ -175,26 +175,26 @@
<< "Unexpected value at index " << (LargeAllocSize - 1);
// Check that we can dispose of the value.
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
TEST(CAPITest, CWrapperFunctionResultFromOutOfBandError) {
constexpr const char *ErrMsg = "test error message";
- __orc_rt_CWrapperFunctionResult R =
- __orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(ErrMsg);
+ orc_rt_CWrapperFunctionResult R =
+ orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(ErrMsg);
#ifndef NDEBUG
- EXPECT_DEATH({ __orc_rt_CWrapperFunctionResultData(&R); },
+ EXPECT_DEATH({ orc_rt_CWrapperFunctionResultData(&R); },
"Cannot get data for out-of-band error value");
- EXPECT_DEATH({ __orc_rt_CWrapperFunctionResultSize(&R); },
+ EXPECT_DEATH({ orc_rt_CWrapperFunctionResultSize(&R); },
"Cannot get size for out-of-band error value");
#endif
- EXPECT_FALSE(__orc_rt_CWrapperFunctionResultEmpty(&R));
- const char *OOBErrMsg = __orc_rt_CWrapperFunctionResultGetOutOfBandError(&R);
+ EXPECT_FALSE(orc_rt_CWrapperFunctionResultEmpty(&R));
+ const char *OOBErrMsg = orc_rt_CWrapperFunctionResultGetOutOfBandError(&R);
EXPECT_NE(OOBErrMsg, nullptr);
EXPECT_NE(OOBErrMsg, ErrMsg);
EXPECT_TRUE(strcmp(OOBErrMsg, ErrMsg) == 0);
- __orc_rt_DisposeCWrapperFunctionResult(&R);
+ orc_rt_DisposeCWrapperFunctionResult(&R);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/interval_map_test.cpp b/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/interval_map_test.cpp
index 6f6474b..a1c6958 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/interval_map_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/interval_map_test.cpp
@@ -186,3 +186,19 @@
EXPECT_EQ(std::next(M.begin())->first.first, 9U);
EXPECT_EQ(std::next(M.begin())->first.second, 10U);
}
+
+TEST(IntervalMapTest, NonCoalescingMapPermitsNonComparableKeys) {
+ // Test that values that can't be equality-compared are still usable when
+ // coalescing is disabled and behave as expected.
+
+ struct S {}; // Struct with no equality comparison.
+
+ IntervalMap<unsigned, S, IntervalCoalescing::Disabled> M;
+
+ M.insert(7, 8, S());
+
+ EXPECT_FALSE(M.empty());
+ EXPECT_EQ(std::next(M.begin()), M.end());
+ EXPECT_EQ(M.find(7), M.begin());
+ EXPECT_EQ(M.find(8), M.end());
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/wrapper_function_utils_test.cpp b/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/wrapper_function_utils_test.cpp
index 8d4b9b3..f10c509 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/wrapper_function_utils_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/orc/tests/unit/wrapper_function_utils_test.cpp
@@ -27,8 +27,8 @@
}
TEST(WrapperFunctionUtilsTest, WrapperFunctionResultFromCStruct) {
- __orc_rt_CWrapperFunctionResult CR =
- __orc_rt_CreateCWrapperFunctionResultFromString(TestString);
+ orc_rt_CWrapperFunctionResult CR =
+ orc_rt_CreateCWrapperFunctionResultFromString(TestString);
WrapperFunctionResult R(CR);
EXPECT_EQ(R.size(), strlen(TestString) + 1);
EXPECT_TRUE(strcmp(R.data(), TestString) == 0);
@@ -72,13 +72,13 @@
static void voidNoop() {}
-static __orc_rt_CWrapperFunctionResult voidNoopWrapper(const char *ArgData,
- size_t ArgSize) {
+static orc_rt_CWrapperFunctionResult voidNoopWrapper(const char *ArgData,
+ size_t ArgSize) {
return WrapperFunction<void()>::handle(ArgData, ArgSize, voidNoop).release();
}
-static __orc_rt_CWrapperFunctionResult addWrapper(const char *ArgData,
- size_t ArgSize) {
+static orc_rt_CWrapperFunctionResult addWrapper(const char *ArgData,
+ size_t ArgSize) {
return WrapperFunction<int32_t(int32_t, int32_t)>::handle(
ArgData, ArgSize,
[](int32_t X, int32_t Y) -> int32_t { return X + Y; })
@@ -87,11 +87,11 @@
extern "C" __orc_rt_Opaque __orc_rt_jit_dispatch_ctx{};
-extern "C" __orc_rt_CWrapperFunctionResult
+extern "C" orc_rt_CWrapperFunctionResult
__orc_rt_jit_dispatch(__orc_rt_Opaque *Ctx, const void *FnTag,
const char *ArgData, size_t ArgSize) {
using WrapperFunctionType =
- __orc_rt_CWrapperFunctionResult (*)(const char *, size_t);
+ orc_rt_CWrapperFunctionResult (*)(const char *, size_t);
return reinterpret_cast<WrapperFunctionType>(const_cast<void *>(FnTag))(
ArgData, ArgSize);
@@ -117,8 +117,8 @@
int32_t X;
};
-static __orc_rt_CWrapperFunctionResult addMethodWrapper(const char *ArgData,
- size_t ArgSize) {
+static orc_rt_CWrapperFunctionResult addMethodWrapper(const char *ArgData,
+ size_t ArgSize) {
return WrapperFunction<int32_t(SPSExecutorAddr, int32_t)>::handle(
ArgData, ArgSize, makeMethodWrapperHandler(&AddClass::addMethod))
.release();
@@ -132,8 +132,8 @@
EXPECT_EQ(Result, (int32_t)3);
}
-static __orc_rt_CWrapperFunctionResult sumArrayWrapper(const char *ArgData,
- size_t ArgSize) {
+static orc_rt_CWrapperFunctionResult sumArrayWrapper(const char *ArgData,
+ size_t ArgSize) {
return WrapperFunction<int8_t(SPSExecutorAddrRange)>::handle(
ArgData, ArgSize,
[](ExecutorAddrRange R) {
diff --git a/third_party/llvm-project/compiler-rt/lib/orc/wrapper_function_utils.h b/third_party/llvm-project/compiler-rt/lib/orc/wrapper_function_utils.h
index b48891b..dcb6d0e 100644
--- a/third_party/llvm-project/compiler-rt/lib/orc/wrapper_function_utils.h
+++ b/third_party/llvm-project/compiler-rt/lib/orc/wrapper_function_utils.h
@@ -27,66 +27,66 @@
class WrapperFunctionResult {
public:
/// Create a default WrapperFunctionResult.
- WrapperFunctionResult() { __orc_rt_CWrapperFunctionResultInit(&R); }
+ WrapperFunctionResult() { orc_rt_CWrapperFunctionResultInit(&R); }
/// Create a WrapperFunctionResult from a CWrapperFunctionResult. This
/// instance takes ownership of the result object and will automatically
/// call dispose on the result upon destruction.
- WrapperFunctionResult(__orc_rt_CWrapperFunctionResult R) : R(R) {}
+ WrapperFunctionResult(orc_rt_CWrapperFunctionResult R) : R(R) {}
WrapperFunctionResult(const WrapperFunctionResult &) = delete;
WrapperFunctionResult &operator=(const WrapperFunctionResult &) = delete;
WrapperFunctionResult(WrapperFunctionResult &&Other) {
- __orc_rt_CWrapperFunctionResultInit(&R);
+ orc_rt_CWrapperFunctionResultInit(&R);
std::swap(R, Other.R);
}
WrapperFunctionResult &operator=(WrapperFunctionResult &&Other) {
- __orc_rt_CWrapperFunctionResult Tmp;
- __orc_rt_CWrapperFunctionResultInit(&Tmp);
+ orc_rt_CWrapperFunctionResult Tmp;
+ orc_rt_CWrapperFunctionResultInit(&Tmp);
std::swap(Tmp, Other.R);
std::swap(R, Tmp);
return *this;
}
- ~WrapperFunctionResult() { __orc_rt_DisposeCWrapperFunctionResult(&R); }
+ ~WrapperFunctionResult() { orc_rt_DisposeCWrapperFunctionResult(&R); }
/// Relinquish ownership of and return the
- /// __orc_rt_CWrapperFunctionResult.
- __orc_rt_CWrapperFunctionResult release() {
- __orc_rt_CWrapperFunctionResult Tmp;
- __orc_rt_CWrapperFunctionResultInit(&Tmp);
+ /// orc_rt_CWrapperFunctionResult.
+ orc_rt_CWrapperFunctionResult release() {
+ orc_rt_CWrapperFunctionResult Tmp;
+ orc_rt_CWrapperFunctionResultInit(&Tmp);
std::swap(R, Tmp);
return Tmp;
}
/// Get a pointer to the data contained in this instance.
- char *data() { return __orc_rt_CWrapperFunctionResultData(&R); }
+ char *data() { return orc_rt_CWrapperFunctionResultData(&R); }
/// Returns the size of the data contained in this instance.
- size_t size() const { return __orc_rt_CWrapperFunctionResultSize(&R); }
+ size_t size() const { return orc_rt_CWrapperFunctionResultSize(&R); }
/// Returns true if this value is equivalent to a default-constructed
/// WrapperFunctionResult.
- bool empty() const { return __orc_rt_CWrapperFunctionResultEmpty(&R); }
+ bool empty() const { return orc_rt_CWrapperFunctionResultEmpty(&R); }
/// Create a WrapperFunctionResult with the given size and return a pointer
/// to the underlying memory.
static WrapperFunctionResult allocate(size_t Size) {
WrapperFunctionResult R;
- R.R = __orc_rt_CWrapperFunctionResultAllocate(Size);
+ R.R = orc_rt_CWrapperFunctionResultAllocate(Size);
return R;
}
/// Copy from the given char range.
static WrapperFunctionResult copyFrom(const char *Source, size_t Size) {
- return __orc_rt_CreateCWrapperFunctionResultFromRange(Source, Size);
+ return orc_rt_CreateCWrapperFunctionResultFromRange(Source, Size);
}
/// Copy from the given null-terminated string (includes the null-terminator).
static WrapperFunctionResult copyFrom(const char *Source) {
- return __orc_rt_CreateCWrapperFunctionResultFromString(Source);
+ return orc_rt_CreateCWrapperFunctionResultFromString(Source);
}
/// Copy from the given std::string (includes the null terminator).
@@ -96,7 +96,7 @@
/// Create an out-of-band error by copying the given string.
static WrapperFunctionResult createOutOfBandError(const char *Msg) {
- return __orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(Msg);
+ return orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(Msg);
}
/// Create an out-of-band error by copying the given string.
@@ -117,11 +117,11 @@
/// If this value is an out-of-band error then this returns the error message,
/// otherwise returns nullptr.
const char *getOutOfBandError() const {
- return __orc_rt_CWrapperFunctionResultGetOutOfBandError(&R);
+ return orc_rt_CWrapperFunctionResultGetOutOfBandError(&R);
}
private:
- __orc_rt_CWrapperFunctionResult R;
+ orc_rt_CWrapperFunctionResult R;
};
namespace detail {
@@ -434,7 +434,7 @@
/// Run call returning raw WrapperFunctionResult.
WrapperFunctionResult run() const {
using FnTy =
- __orc_rt_CWrapperFunctionResult(const char *ArgData, size_t ArgSize);
+ orc_rt_CWrapperFunctionResult(const char *ArgData, size_t ArgSize);
return WrapperFunctionResult(
FnAddr.toPtr<FnTy *>()(ArgData.data(), ArgData.size()));
}
diff --git a/third_party/llvm-project/compiler-rt/lib/profile/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/profile/CMakeLists.txt
index 5ddb7bc..45e5164 100644
--- a/third_party/llvm-project/compiler-rt/lib/profile/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/profile/CMakeLists.txt
@@ -60,6 +60,7 @@
InstrProfilingNameVar.c
InstrProfilingVersionVar.c
InstrProfilingWriter.c
+ InstrProfilingPlatformAIX.c
InstrProfilingPlatformDarwin.c
InstrProfilingPlatformFuchsia.c
InstrProfilingPlatformLinux.c
diff --git a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfiling.c b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfiling.c
index fdb7b7c..0dd5ff5 100644
--- a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfiling.c
+++ b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfiling.c
@@ -20,6 +20,14 @@
#define INSTR_PROF_VALUE_PROF_DATA
#include "profile/InstrProfData.inc"
+static uint32_t __llvm_profile_global_timestamp = 1;
+
+COMPILER_RT_VISIBILITY
+void INSTR_PROF_PROFILE_SET_TIMESTAMP(uint64_t *Probe) {
+ if (*Probe == 0 || *Probe == (uint64_t)-1)
+ *Probe = __llvm_profile_global_timestamp++;
+}
+
COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) {
return sizeof(void *) == sizeof(uint64_t) ? (INSTR_PROF_RAW_MAGIC_64)
: (INSTR_PROF_RAW_MAGIC_32);
@@ -42,6 +50,9 @@
}
COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) {
+ if (__llvm_profile_get_version() & VARIANT_MASK_TEMPORAL_PROF)
+ __llvm_profile_global_timestamp = 1;
+
char *I = __llvm_profile_begin_counters();
char *E = __llvm_profile_end_counters();
diff --git a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingInternal.h b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingInternal.h
index b2ce110..360165e 100644
--- a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingInternal.h
+++ b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingInternal.h
@@ -198,4 +198,12 @@
*/
int __llvm_write_binary_ids(ProfDataWriter *Writer);
+/*
+ * Write binary id length and then its data, because binary id does not
+ * have a fixed length.
+ */
+int lprofWriteOneBinaryId(ProfDataWriter *Writer, uint64_t BinaryIdLen,
+ const uint8_t *BinaryIdData,
+ uint64_t BinaryIdPadding);
+
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
new file mode 100644
index 0000000..6e12fb9
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
@@ -0,0 +1,204 @@
+/*===- InstrProfilingPlatformAIX.c - Profile data AIX platform ------------===*\
+|*
+|* 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
+|*
+\*===----------------------------------------------------------------------===*/
+
+#if defined(_AIX)
+
+#ifdef __64BIT__
+#define __XCOFF64__
+#endif
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ldr.h>
+#include <xcoff.h>
+
+#include "InstrProfiling.h"
+#include "InstrProfilingInternal.h"
+
+#define BIN_ID_PREFIX "xcoff_binary_id:"
+
+// If found, write the build-id into the Result buffer.
+static size_t FindBinaryId(char *Result, size_t Size) {
+ unsigned long EntryAddr = (unsigned long)__builtin_return_address(0);
+
+ // Use loadquery to get information about loaded modules; loadquery writes
+ // its result into a buffer of unknown size.
+ char Buf[1024];
+ size_t BufSize = sizeof(Buf);
+ char *BufPtr = Buf;
+ int RC = -1;
+
+ errno = 0;
+ RC = loadquery(L_GETXINFO | L_IGNOREUNLOAD, BufPtr, (unsigned int)BufSize);
+ if (RC == -1 && errno == ENOMEM) {
+ BufSize = 64000; // should be plenty for any program.
+ BufPtr = malloc(BufSize);
+ if (BufPtr != 0)
+ RC = loadquery(L_GETXINFO | L_IGNOREUNLOAD, BufPtr, (unsigned int)BufSize);
+ }
+
+ if (RC == -1)
+ goto done;
+
+ // Locate the ld_xinfo corresponding to this module.
+ struct ld_xinfo *CurInfo = (struct ld_xinfo *)BufPtr;
+ while (1) {
+ unsigned long CurTextStart = (uint64_t)CurInfo->ldinfo_textorg;
+ unsigned long CurTextEnd = CurTextStart + CurInfo->ldinfo_textsize;
+ if (CurTextStart <= EntryAddr && EntryAddr < CurTextEnd) {
+ // Found my slot. Now search for the build-id.
+ char *p = (char *)CurInfo->ldinfo_textorg;
+
+ FILHDR *f = (FILHDR *)p;
+ AOUTHDR *a = (AOUTHDR *)(p + FILHSZ);
+ SCNHDR *s =
+ (SCNHDR *)(p + FILHSZ + f->f_opthdr + SCNHSZ * (a->o_snloader - 1));
+ LDHDR *ldhdr = (LDHDR *)(p + s->s_scnptr);
+ // This is the loader string table
+ char *lstr = (char *)ldhdr + ldhdr->l_stoff;
+
+ // If the build-id exists, it's the first entry.
+ // Each entry is comprised of a 2-byte size component, followed by the
+ // data.
+ size_t len = *(short *)lstr;
+ char *str = (char *)(lstr + 2);
+ size_t PrefixLen = sizeof(BIN_ID_PREFIX) - 1;
+ if (len > PrefixLen && (len - PrefixLen) <= Size &&
+ strncmp(str, BIN_ID_PREFIX, PrefixLen) == 0) {
+ memcpy(Result, str + PrefixLen, len - PrefixLen);
+ RC = len - PrefixLen;
+ goto done;
+ }
+ break;
+ }
+ if (CurInfo->ldinfo_next == 0u)
+ break;
+ CurInfo = (struct ld_xinfo *)((char *)CurInfo + CurInfo->ldinfo_next);
+ }
+done:
+ if (BufSize != sizeof(Buf) && BufPtr != 0)
+ free(BufPtr);
+ return RC;
+}
+
+static int StrToHexError = 0;
+static uint8_t StrToHex(char c) {
+ if (c >= '0' && c <= '9')
+ return c - '0';
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 0xa;
+ if (c >= 'A' && c <= 'F')
+ return c - 'A' + 0xa;
+ StrToHexError = 1;
+ return 0;
+}
+
+COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) {
+ // 200 bytes should be enough for the build-id hex string.
+ static char Buf[200];
+ // Profile reading tools expect this to be 8-bytes long.
+ static int64_t BinaryIdLen = 0;
+ static uint8_t *BinaryIdData = 0;
+
+ // -1 means we already checked for a BinaryId and didn't find one.
+ if (BinaryIdLen == -1)
+ return 0;
+
+ // Are we being called for the first time?
+ if (BinaryIdLen == 0) {
+ if (getenv("LLVM_PROFILE_NO_BUILD_ID"))
+ goto fail;
+
+ int BuildIdLen = FindBinaryId(Buf, sizeof(Buf));
+ if (BuildIdLen <= 0)
+ goto fail;
+
+ if (Buf[BuildIdLen - 1] == '\0')
+ BuildIdLen--;
+
+ // assume even number of digits/chars, so 0xabc must be 0x0abc
+ if ((BuildIdLen % 2) != 0 || BuildIdLen == 0)
+ goto fail;
+
+ // The numeric ID is represented as an ascii string in the loader section,
+ // so convert it to raw binary.
+ BinaryIdLen = BuildIdLen / 2;
+ BinaryIdData = (uint8_t *)Buf;
+
+ // Skip "0x" prefix if it exists.
+ if (Buf[0] == '0' && Buf[1] == 'x') {
+ BinaryIdLen -= 1;
+ BinaryIdData += 2;
+ }
+
+ StrToHexError = 0;
+ for (int i = 0; i < BinaryIdLen; i++)
+ BinaryIdData[i] = (StrToHex(BinaryIdData[2 * i]) << 4) +
+ StrToHex(BinaryIdData[2 * i + 1]);
+
+ if (StrToHexError)
+ goto fail;
+
+ if (getenv("LLVM_PROFILE_VERBOSE")) {
+ char *StrBuf = (char *)COMPILER_RT_ALLOCA(2 * BinaryIdLen + 1);
+ for (int i = 0; i < (int)BinaryIdLen; i++)
+ sprintf(&StrBuf[2 * i], "%02x", BinaryIdData[i]);
+ PROF_NOTE("Writing binary id: %s\n", StrBuf);
+ }
+ }
+
+ uint8_t BinaryIdPadding = __llvm_profile_get_num_padding_bytes(BinaryIdLen);
+ if (Writer && lprofWriteOneBinaryId(Writer, BinaryIdLen, BinaryIdData,
+ BinaryIdPadding) == -1)
+ return -1; // Return -1 rather goto fail to match the NT_GNU_BUILD_ID path.
+
+ return sizeof(BinaryIdLen) + BinaryIdLen + BinaryIdPadding;
+
+fail:
+ if (getenv("LLVM_PROFILE_VERBOSE"))
+ fprintf(stderr, "no or invalid binary id: %.*s\n", (int)sizeof(Buf), Buf);
+ BinaryIdLen = -1;
+ return 0;
+}
+
+// Empty stubs to allow linking object files using the registration-based scheme
+COMPILER_RT_VISIBILITY
+void __llvm_profile_register_function(void *Data_) {}
+
+COMPILER_RT_VISIBILITY
+void __llvm_profile_register_names_function(void *NamesStart,
+ uint64_t NamesSize) {}
+
+// The __start_SECNAME and __stop_SECNAME symbols (for SECNAME \in
+// {"__llvm_prf_cnts", "__llvm_prf_data", "__llvm_prf_name", "__llvm_prf_vnds"})
+// are always live when linking on AIX, regardless if the .o's being linked
+// reference symbols from the profile library (for example when no files were
+// compiled with -fprofile-generate). That's because these symbols are kept
+// alive through references in constructor functions that are always live in the
+// default linking model on AIX (-bcdtors:all). The __start_SECNAME and
+// __stop_SECNAME symbols are only resolved by the linker when the SECNAME
+// section exists. So for the scenario where the user objects have no such
+// section (i.e. when they are compiled with -fno-profile-generate), we always
+// define these zero length variables in each of the above 4 sections.
+static int dummy_cnts[0] COMPILER_RT_SECTION(
+ COMPILER_RT_SEG INSTR_PROF_CNTS_SECT_NAME);
+static int dummy_data[0] COMPILER_RT_SECTION(
+ COMPILER_RT_SEG INSTR_PROF_DATA_SECT_NAME);
+static const int dummy_name[0] COMPILER_RT_SECTION(
+ COMPILER_RT_SEG INSTR_PROF_NAME_SECT_NAME);
+static int dummy_vnds[0] COMPILER_RT_SECTION(
+ COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME);
+
+// To avoid GC'ing of the dummy variables by the linker, reference them in an
+// array and reference the array in the runtime registration code
+// (InstrProfilingRuntime.cpp)
+COMPILER_RT_VISIBILITY
+void *__llvm_profile_keep[] = {(void *)&dummy_cnts, (void *)&dummy_data,
+ (void *)&dummy_name, (void *)&dummy_vnds};
+
+#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
index adf4132..2cce0a4 100644
--- a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
+++ b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
@@ -94,26 +94,6 @@
}
/*
- * Write binary id length and then its data, because binary id does not
- * have a fixed length.
- */
-static int WriteOneBinaryId(ProfDataWriter *Writer, uint64_t BinaryIdLen,
- const uint8_t *BinaryIdData,
- uint64_t BinaryIdPadding) {
- ProfDataIOVec BinaryIdIOVec[] = {
- {&BinaryIdLen, sizeof(uint64_t), 1, 0},
- {BinaryIdData, sizeof(uint8_t), BinaryIdLen, 0},
- {NULL, sizeof(uint8_t), BinaryIdPadding, 1},
- };
- if (Writer->Write(Writer, BinaryIdIOVec,
- sizeof(BinaryIdIOVec) / sizeof(*BinaryIdIOVec)))
- return -1;
-
- /* Successfully wrote binary id, report success. */
- return 0;
-}
-
-/*
* Look for the note that has the name "GNU\0" and type NT_GNU_BUILD_ID
* that contains build id. If build id exists, write binary id.
*
@@ -135,8 +115,9 @@
const uint8_t *BinaryIdData =
(const uint8_t *)(NoteName + RoundUp(Note->n_namesz, 4));
uint8_t BinaryIdPadding = __llvm_profile_get_num_padding_bytes(BinaryIdLen);
- if (Writer != NULL && WriteOneBinaryId(Writer, BinaryIdLen, BinaryIdData,
- BinaryIdPadding) == -1)
+ if (Writer != NULL &&
+ lprofWriteOneBinaryId(Writer, BinaryIdLen, BinaryIdData,
+ BinaryIdPadding) == -1)
return -1;
BinaryIdSize = sizeof(BinaryIdLen) + BinaryIdLen + BinaryIdPadding;
@@ -220,7 +201,7 @@
return TotalBinaryIdsSize;
}
-#else /* !NT_GNU_BUILD_ID */
+#elif !defined(_AIX) /* !NT_GNU_BUILD_ID */
/*
* Fallback implementation for targets that don't support the GNU
* extensions NT_GNU_BUILD_ID and __ehdr_start.
@@ -230,41 +211,4 @@
}
#endif
-#if defined(_AIX)
-// Empty stubs to allow linking object files using the registration-based scheme
-COMPILER_RT_VISIBILITY
-void __llvm_profile_register_function(void *Data_) {}
-
-COMPILER_RT_VISIBILITY
-void __llvm_profile_register_names_function(void *NamesStart,
- uint64_t NamesSize) {}
-
-// The __start_SECNAME and __stop_SECNAME symbols (for SECNAME \in
-// {"__llvm_prf_cnts", "__llvm_prf_data", "__llvm_prf_name", "__llvm_prf_vnds"})
-// are always live when linking on AIX, regardless if the .o's being linked
-// reference symbols from the profile library (for example when no files were
-// compiled with -fprofile-generate). That's because these symbols are kept
-// alive through references in constructor functions that are always live in the
-// default linking model on AIX (-bcdtors:all). The __start_SECNAME and
-// __stop_SECNAME symbols are only resolved by the linker when the SECNAME
-// section exists. So for the scenario where the user objects have no such
-// section (i.e. when they are compiled with -fno-profile-generate), we always
-// define these zero length variables in each of the above 4 sections.
-static int dummy_cnts[0] COMPILER_RT_SECTION(
- COMPILER_RT_SEG INSTR_PROF_CNTS_SECT_NAME);
-static int dummy_data[0] COMPILER_RT_SECTION(
- COMPILER_RT_SEG INSTR_PROF_DATA_SECT_NAME);
-static const int dummy_name[0] COMPILER_RT_SECTION(
- COMPILER_RT_SEG INSTR_PROF_NAME_SECT_NAME);
-static int dummy_vnds[0] COMPILER_RT_SECTION(
- COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME);
-
-// To avoid GC'ing of the dummy variables by the linker, reference them in an
-// array and reference the array in the runtime registration code
-// (InstrProfilingRuntime.cpp)
-COMPILER_RT_VISIBILITY
-void *__llvm_profile_keep[] = {(void *)&dummy_cnts, (void *)&dummy_data,
- (void *)&dummy_name, (void *)&dummy_vnds};
-#endif
-
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingWriter.c b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingWriter.c
index 366451a..4a39298 100644
--- a/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingWriter.c
+++ b/third_party/llvm-project/compiler-rt/lib/profile/InstrProfilingWriter.c
@@ -336,3 +336,24 @@
return writeValueProfData(Writer, VPDataReader, DataBegin, DataEnd);
}
+
+/*
+ * Write binary id length and then its data, because binary id does not
+ * have a fixed length.
+ */
+COMPILER_RT_VISIBILITY
+int lprofWriteOneBinaryId(ProfDataWriter *Writer, uint64_t BinaryIdLen,
+ const uint8_t *BinaryIdData,
+ uint64_t BinaryIdPadding) {
+ ProfDataIOVec BinaryIdIOVec[] = {
+ {&BinaryIdLen, sizeof(uint64_t), 1, 0},
+ {BinaryIdData, sizeof(uint8_t), BinaryIdLen, 0},
+ {NULL, sizeof(uint8_t), BinaryIdPadding, 1},
+ };
+ if (Writer->Write(Writer, BinaryIdIOVec,
+ sizeof(BinaryIdIOVec) / sizeof(*BinaryIdIOVec)))
+ return -1;
+
+ /* Successfully wrote binary id, report success. */
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
index b92cfa5..b76d36d 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
@@ -134,7 +134,7 @@
// This function does the same as GetBlockBegin, but is much faster.
// Must be called with the allocator locked.
- void *GetBlockBeginFastLocked(void *p) {
+ void *GetBlockBeginFastLocked(const void *p) {
if (primary_.PointerIsMine(p))
return primary_.GetBlockBegin(p);
return secondary_.GetBlockBeginFastLocked(p);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h
index c1b2756..504109e 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h
@@ -21,6 +21,8 @@
SANITIZER_INTERFACE_ATTRIBUTE
uptr __sanitizer_get_estimated_allocated_size(uptr size);
SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_get_ownership(const void *p);
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const void *
+__sanitizer_get_allocated_begin(const void *p);
SANITIZER_INTERFACE_ATTRIBUTE uptr
__sanitizer_get_allocated_size(const void *p);
SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_current_allocated_bytes();
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h
index 3899473..62523c7 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h
@@ -51,7 +51,6 @@
void InternalAllocatorLock();
void InternalAllocatorUnlock();
InternalAllocator *internal_allocator();
-
} // namespace __sanitizer
#endif // SANITIZER_ALLOCATOR_INTERNAL_H
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
index 48afb2a..1576455 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
@@ -215,7 +215,7 @@
// This function does the same as GetBlockBegin, but is much faster.
// Must be called with the allocator locked.
- void *GetBlockBeginFastLocked(void *ptr) {
+ void *GetBlockBeginFastLocked(const void *ptr) {
mutex_.CheckLocked();
uptr p = reinterpret_cast<uptr>(ptr);
uptr n = n_chunks_;
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp
index 8223645..79b7748 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp
@@ -61,6 +61,26 @@
UNREACHABLE("unable to mmap");
}
+void NORETURN ReportMunmapFailureAndDie(void *addr, uptr size, error_t err,
+ bool raw_report) {
+ static int recursion_count;
+ if (raw_report || recursion_count) {
+ // If raw report is requested or we went into recursion just die. The
+ // Report() and CHECK calls below may call munmap recursively and fail.
+ RawWrite("ERROR: Failed to munmap\n");
+ Die();
+ }
+ recursion_count++;
+ Report(
+ "ERROR: %s failed to deallocate 0x%zx (%zd) bytes at address %p (error "
+ "code: %d)\n",
+ SanitizerToolName, size, size, addr, err);
+#if !SANITIZER_GO
+ DumpProcessMap();
+#endif
+ UNREACHABLE("unable to unmmap");
+}
+
typedef bool UptrComparisonFunction(const uptr &a, const uptr &b);
typedef bool U32ComparisonFunction(const u32 &a, const u32 &b);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index b462e38..72b3794 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -315,6 +315,8 @@
void NORETURN ReportMmapFailureAndDie(uptr size, const char *mem_type,
const char *mmap_type, error_t err,
bool raw_report = false);
+void NORETURN ReportMunmapFailureAndDie(void *ptr, uptr size, error_t err,
+ bool raw_report = false);
// Returns true if the platform-specific error reported is an OOM error.
bool ErrorIsOOM(error_t err);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index e50bc87..3bd73cf 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -1350,7 +1350,7 @@
char *name = (char *)arg5;
COMMON_INTERCEPTOR_READ_RANGE(ctx, name, internal_strlen(name) + 1);
}
- int res = REAL(prctl(option, arg2, arg3, arg4, arg5));
+ int res = REAL(prctl)(option, arg2, arg3, arg4, arg5);
if (option == PR_SET_NAME) {
char buff[16];
internal_strncpy(buff, (char *)arg2, 15);
@@ -5763,8 +5763,10 @@
// its metadata. See
// https://github.com/google/sanitizers/issues/321.
int res = REAL(capget)(hdrp, datap);
- if (res == 0 && datap)
- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, datap, __user_cap_data_struct_sz);
+ if (res == 0 && datap) {
+ unsigned datasz = __user_cap_data_struct_sz(hdrp);
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, datap, datasz);
+ }
// We can also return -1 and write to hdrp->version if the version passed in
// hdrp->version is unsupported. But that's not a trivial condition to check,
// and anyway COMMON_INTERCEPTOR_READ_RANGE protects us to some extent.
@@ -5775,8 +5777,10 @@
COMMON_INTERCEPTOR_ENTER(ctx, capset, hdrp, datap);
if (hdrp)
COMMON_INTERCEPTOR_READ_RANGE(ctx, hdrp, __user_cap_header_struct_sz);
- if (datap)
- COMMON_INTERCEPTOR_READ_RANGE(ctx, datap, __user_cap_data_struct_sz);
+ if (datap) {
+ unsigned datasz = __user_cap_data_struct_sz(hdrp);
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, datap, datasz);
+ }
return REAL(capset)(hdrp, datap);
}
#define INIT_CAPGET \
@@ -10357,6 +10361,39 @@
#define INIT___XUNAME
#endif
+#if SANITIZER_INTERCEPT_HEXDUMP
+INTERCEPTOR(void, hexdump, const void *ptr, int length, const char *header, int flags) {
+ void *ctx;
+ COMMON_INTERCEPTOR_ENTER(ctx, hexdump, ptr, length, header, flags);
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, length);
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, header, internal_strlen(header) + 1);
+ REAL(hexdump)(ptr, length, header, flags);
+}
+
+#define INIT_HEXDUMP COMMON_INTERCEPT_FUNCTION(hexdump);
+#else
+#define INIT_HEXDUMP
+#endif
+
+#if SANITIZER_INTERCEPT_ARGP_PARSE
+INTERCEPTOR(int, argp_parse, const struct argp *argp, int argc, char **argv,
+ unsigned flags, int *arg_index, void *input) {
+ void *ctx;
+ COMMON_INTERCEPTOR_ENTER(ctx, argp_parse, argp, argc, argv, flags, arg_index,
+ input);
+ for (int i = 0; i < argc; i++)
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, argv[i], internal_strlen(argv[i]) + 1);
+ int res = REAL(argp_parse)(argp, argc, argv, flags, arg_index, input);
+ if (!res && arg_index)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, arg_index, sizeof(int));
+ return res;
+}
+
+#define INIT_ARGP_PARSE COMMON_INTERCEPT_FUNCTION(argp_parse);
+#else
+#define INIT_ARGP_PARSE
+#endif
+
#include "sanitizer_common_interceptors_netbsd_compat.inc"
static void InitializeCommonInterceptors() {
@@ -10675,6 +10712,8 @@
INIT_PROCCTL
INIT_UNAME;
INIT___XUNAME;
+ INIT_HEXDUMP;
+ INIT_ARGP_PARSE;
INIT___PRINTF_CHK;
}
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
index 958f071..01be600 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
@@ -32,6 +32,7 @@
INTERFACE_FUNCTION(__sanitizer_symbolize_global)
INTERFACE_FUNCTION(__sanitizer_symbolize_pc)
// Allocator interface.
+INTERFACE_FUNCTION(__sanitizer_get_allocated_begin)
INTERFACE_FUNCTION(__sanitizer_get_allocated_size)
INTERFACE_FUNCTION(__sanitizer_get_current_allocated_bytes)
INTERFACE_FUNCTION(__sanitizer_get_estimated_allocated_size)
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
index 9d7518a..93b988b 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
@@ -417,14 +417,14 @@
POST_SYSCALL(capget)(long res, void *header, void *dataptr) {
if (res >= 0)
if (dataptr)
- POST_WRITE(dataptr, __user_cap_data_struct_sz);
+ POST_WRITE(dataptr, __user_cap_data_struct_sz(header));
}
PRE_SYSCALL(capset)(void *header, const void *data) {
if (header)
PRE_READ(header, __user_cap_header_struct_sz);
if (data)
- PRE_READ(data, __user_cap_data_struct_sz);
+ PRE_READ(data, __user_cap_data_struct_sz(header));
}
POST_SYSCALL(capset)(long res, void *header, const void *data) {}
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp
index 956b48e..ce43269 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -282,7 +282,14 @@
// Weak definition for code instrumented with -fsanitize-coverage=stack-depth
// and later linked with code containing a strong definition.
// E.g., -fsanitize=fuzzer-no-link
+// FIXME: Update Apple deployment target so that thread_local is always
+// supported, and remove the #if.
+// FIXME: Figure out how this should work on Windows, exported thread_local
+// symbols are not supported:
+// "data with thread storage duration may not have dll interface"
+#if !SANITIZER_APPLE && !SANITIZER_WINDOWS
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE uptr __sancov_lowest_stack;
+thread_local uptr __sancov_lowest_stack;
+#endif
#endif // !SANITIZER_FUCHSIA
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
index 9683b97..16b2a10 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
@@ -1267,8 +1267,6 @@
_(TIOCGFLAGS, WRITE, sizeof(int));
_(TIOCSFLAGS, READ, sizeof(int));
_(TIOCDCDTIMESTAMP, WRITE, struct_timeval_sz);
- _(TIOCRCVFRAME, READ, sizeof(uptr));
- _(TIOCXMTFRAME, READ, sizeof(uptr));
_(TIOCPTMGET, WRITE, struct_ptmget_sz);
_(TIOCGRANTPT, NONE, 0);
_(TIOCPTSNAME, WRITE, struct_ptmget_sz);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index 6b80082..98186c4 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -37,15 +37,6 @@
# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
#endif
-// TLS is handled differently on different platforms
-#if SANITIZER_LINUX || SANITIZER_NETBSD || \
- SANITIZER_FREEBSD
-# define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE \
- __attribute__((tls_model("initial-exec"))) thread_local
-#else
-# define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE
-#endif
-
//--------------------------- WEAK FUNCTIONS ---------------------------------//
// When working with weak functions, to simplify the code and make it more
// portable, when possible define a default implementation using this macro:
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
index 2c769dd..c84c04a 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
@@ -152,6 +152,9 @@
"rdhwr %0,$29\n" \
".set pop\n" : "=r"(__v)); \
__v; })
+#elif defined (__riscv)
+# define __get_tls() \
+ ({ void** __v; __asm__("mv %0, tp" : "=r"(__v)); __v; })
#elif defined(__i386__)
# define __get_tls() \
({ void** __v; __asm__("movl %%gs:0, %0" : "=r"(__v)); __v; })
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index ec860fd..37b2b57 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -583,6 +583,7 @@
*addr = (uptr)tcb->tcb_dtv[1];
}
}
+#else
#error "Unknown OS"
#endif
}
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
index 23c4c66..fa04fda 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
@@ -989,7 +989,7 @@
// "wrap_puts" within our own dylib.
Dl_info info_puts, info_runtime;
RAW_CHECK(dladdr(dlsym(RTLD_DEFAULT, "puts"), &info_puts));
- RAW_CHECK(dladdr((void *)__sanitizer_report_error_summary, &info_runtime));
+ RAW_CHECK(dladdr((void *)&VerifyInterceptorsWorking, &info_runtime));
if (internal_strcmp(info_puts.dli_fname, info_runtime.dli_fname) != 0) {
Report(
"ERROR: Interceptors are not working. This may be because %s is "
@@ -1039,7 +1039,7 @@
return;
Dl_info info;
- RAW_CHECK(dladdr((void *)__sanitizer_report_error_summary, &info));
+ RAW_CHECK(dladdr((void *)&StripEnv, &info));
const char *dylib_name = StripModuleName(info.dli_fname);
bool lib_is_in_env = internal_strstr(dyld_insert_libraries, dylib_name);
if (!lib_is_in_env)
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mallinfo.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mallinfo.h
new file mode 100644
index 0000000..4e58c02
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mallinfo.h
@@ -0,0 +1,38 @@
+//===-- sanitizer_mallinfo.h ----------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of Sanitizer common code.
+//
+// Definition for mallinfo on different platforms.
+//===----------------------------------------------------------------------===//
+
+#ifndef SANITIZER_MALLINFO_H
+#define SANITIZER_MALLINFO_H
+
+#include "sanitizer_internal_defs.h"
+#include "sanitizer_platform.h"
+
+namespace __sanitizer {
+
+#if SANITIZER_ANDROID
+
+struct __sanitizer_struct_mallinfo {
+ uptr v[10];
+};
+
+#elif SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_FUCHSIA
+
+struct __sanitizer_struct_mallinfo {
+ int v[10];
+};
+
+#endif
+
+} // namespace __sanitizer
+
+#endif // SANITIZER_MALLINFO_H
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index fca769d..eb39fab 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -591,6 +591,8 @@
#define SANITIZER_INTERCEPT___XUNAME SI_FREEBSD
#define SANITIZER_INTERCEPT_FLOPEN SI_FREEBSD
#define SANITIZER_INTERCEPT_PROCCTL SI_FREEBSD
+#define SANITIZER_INTERCEPT_HEXDUMP SI_FREEBSD
+#define SANITIZER_INTERCEPT_ARGP_PARSE SI_GLIBC
// This macro gives a way for downstream users to override the above
// interceptor macros irrespective of the platform they are on. They have
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
index 648e502..c40877b 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
@@ -2342,8 +2342,6 @@
unsigned IOCTL_TIOCGFLAGS = TIOCGFLAGS;
unsigned IOCTL_TIOCSFLAGS = TIOCSFLAGS;
unsigned IOCTL_TIOCDCDTIMESTAMP = TIOCDCDTIMESTAMP;
-unsigned IOCTL_TIOCRCVFRAME = TIOCRCVFRAME;
-unsigned IOCTL_TIOCXMTFRAME = TIOCXMTFRAME;
unsigned IOCTL_TIOCPTMGET = TIOCPTMGET;
unsigned IOCTL_TIOCGRANTPT = TIOCGRANTPT;
unsigned IOCTL_TIOCPTSNAME = TIOCPTSNAME;
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
index dc6eb59..4c697b4 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
@@ -2195,8 +2195,6 @@
extern unsigned IOCTL_TIOCGFLAGS;
extern unsigned IOCTL_TIOCSFLAGS;
extern unsigned IOCTL_TIOCDCDTIMESTAMP;
-extern unsigned IOCTL_TIOCRCVFRAME;
-extern unsigned IOCTL_TIOCXMTFRAME;
extern unsigned IOCTL_TIOCPTMGET;
extern unsigned IOCTL_TIOCGRANTPT;
extern unsigned IOCTL_TIOCPTSNAME;
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index cb647be..a04eed7 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -18,6 +18,7 @@
// depends on _FILE_OFFSET_BITS setting.
// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
#undef _FILE_OFFSET_BITS
+#undef _TIME_BITS
#endif
// Must go after undef _FILE_OFFSET_BITS.
@@ -247,7 +248,23 @@
unsigned struct_sysinfo_sz = sizeof(struct sysinfo);
unsigned __user_cap_header_struct_sz =
sizeof(struct __user_cap_header_struct);
- unsigned __user_cap_data_struct_sz = sizeof(struct __user_cap_data_struct);
+ unsigned __user_cap_data_struct_sz(void *hdrp) {
+ int u32s = 0;
+ if (hdrp) {
+ switch (((struct __user_cap_header_struct *)hdrp)->version) {
+ case _LINUX_CAPABILITY_VERSION_1:
+ u32s = _LINUX_CAPABILITY_U32S_1;
+ break;
+ case _LINUX_CAPABILITY_VERSION_2:
+ u32s = _LINUX_CAPABILITY_U32S_2;
+ break;
+ case _LINUX_CAPABILITY_VERSION_3:
+ u32s = _LINUX_CAPABILITY_U32S_3;
+ break;
+ }
+ }
+ return sizeof(struct __user_cap_data_struct) * u32s;
+ }
unsigned struct_new_utsname_sz = sizeof(struct new_utsname);
unsigned struct_old_utsname_sz = sizeof(struct old_utsname);
unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname);
@@ -1125,6 +1142,15 @@
CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_restorer);
#endif
+#if SANITIZER_HAS_SIGINFO
+COMPILER_CHECK(alignof(siginfo_t) == alignof(__sanitizer_siginfo));
+using __sanitizer_siginfo_t = __sanitizer_siginfo;
+CHECK_TYPE_SIZE(siginfo_t);
+CHECK_SIZE_AND_OFFSET(siginfo_t, si_signo);
+CHECK_SIZE_AND_OFFSET(siginfo_t, si_errno);
+CHECK_SIZE_AND_OFFSET(siginfo_t, si_code);
+#endif
+
#if SANITIZER_LINUX
CHECK_TYPE_SIZE(__sysctl_args);
CHECK_SIZE_AND_OFFSET(__sysctl_args, name);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 2146daf..cfca7bd 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -18,6 +18,7 @@
#include "sanitizer_internal_defs.h"
#include "sanitizer_platform.h"
+#include "sanitizer_mallinfo.h"
#if SANITIZER_APPLE
#include <sys/cdefs.h>
@@ -135,7 +136,7 @@
extern unsigned struct_epoll_event_sz;
extern unsigned struct_sysinfo_sz;
extern unsigned __user_cap_header_struct_sz;
-extern unsigned __user_cap_data_struct_sz;
+extern unsigned __user_cap_data_struct_sz(void *hdrp);
extern unsigned struct_new_utsname_sz;
extern unsigned struct_old_utsname_sz;
extern unsigned struct_oldold_utsname_sz;
@@ -204,17 +205,7 @@
};
#endif // SANITIZER_LINUX
-#if SANITIZER_ANDROID
-struct __sanitizer_struct_mallinfo {
- uptr v[10];
-};
-#endif
-
#if SANITIZER_LINUX && !SANITIZER_ANDROID
-struct __sanitizer_struct_mallinfo {
- int v[10];
-};
-
extern unsigned struct_ustat_sz;
extern unsigned struct_rlimit64_sz;
extern unsigned struct_statvfs64_sz;
@@ -586,11 +577,31 @@
};
#endif
-struct __sanitizer_siginfo {
- // The size is determined by looking at sizeof of real siginfo_t on linux.
- u64 opaque[128 / sizeof(u64)];
+struct __sanitizer_siginfo_pad {
+ // Require uptr, because siginfo_t is always pointer-size aligned on Linux.
+ uptr pad[128 / sizeof(uptr)];
};
+#if SANITIZER_LINUX
+# define SANITIZER_HAS_SIGINFO 1
+union __sanitizer_siginfo {
+ struct {
+ int si_signo;
+# if SANITIZER_MIPS
+ int si_code;
+ int si_errno;
+# else
+ int si_errno;
+ int si_code;
+# endif
+ };
+ __sanitizer_siginfo_pad pad;
+};
+#else
+# define SANITIZER_HAS_SIGINFO 0
+typedef __sanitizer_siginfo_pad __sanitizer_siginfo;
+#endif
+
using __sanitizer_sighandler_ptr = void (*)(int sig);
using __sanitizer_sigactionhandler_ptr = void (*)(int sig,
__sanitizer_siginfo *siginfo,
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
index 75968ad..f6b0bbd 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
@@ -57,11 +57,9 @@
void UnmapOrDie(void *addr, uptr size) {
if (!addr || !size) return;
uptr res = internal_munmap(addr, size);
- if (UNLIKELY(internal_iserror(res))) {
- Report("ERROR: %s failed to deallocate 0x%zx (%zd) bytes at address %p\n",
- SanitizerToolName, size, size, addr);
- CHECK("unable to unmap" && 0);
- }
+ int reserrno;
+ if (UNLIKELY(internal_iserror(res, &reserrno)))
+ ReportMunmapFailureAndDie(addr, size, reserrno);
DecreaseTotalMmap(size);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
index 19bad15..18940c5 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
@@ -65,6 +65,8 @@
MemoryMappedSegmentData *data_;
};
+struct ImageHeader;
+
class MemoryMappingLayoutBase {
public:
virtual bool Next(MemoryMappedSegment *segment) { UNIMPLEMENTED(); }
@@ -75,10 +77,18 @@
~MemoryMappingLayoutBase() {}
};
-class MemoryMappingLayout final : public MemoryMappingLayoutBase {
+class MemoryMappingLayout : public MemoryMappingLayoutBase {
public:
explicit MemoryMappingLayout(bool cache_enabled);
+
+// This destructor cannot be virtual, as it would cause an operator new() linking
+// failures in hwasan test cases. However non-virtual destructors emit warnings
+// in macOS build, hence disabling those
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
~MemoryMappingLayout();
+#pragma clang diagnostic pop
+
virtual bool Next(MemoryMappedSegment *segment) override;
virtual bool Error() const override;
virtual void Reset() override;
@@ -90,10 +100,14 @@
// Adds all mapped objects into a vector.
void DumpListOfModules(InternalMmapVectorNoCtor<LoadedModule> *modules);
+ protected:
+#if SANITIZER_APPLE
+ virtual const ImageHeader *CurrentImageHeader();
+#endif
+ MemoryMappingLayoutData data_;
+
private:
void LoadFromCache();
-
- MemoryMappingLayoutData data_;
};
// Returns code range for the specified module.
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
index 1f489b7..36a82c4 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
@@ -39,6 +39,22 @@
namespace __sanitizer {
+#if SANITIZER_FREEBSD
+void GetMemoryProfile(fill_profile_f cb, uptr *stats) {
+ const int Mib[] = {
+ CTL_KERN,
+ KERN_PROC,
+ KERN_PROC_PID,
+ getpid()
+ };
+
+ struct kinfo_proc InfoProc;
+ uptr Len = sizeof(InfoProc);
+ CHECK_EQ(internal_sysctl(Mib, ARRAY_SIZE(Mib), nullptr, (uptr *)&InfoProc, &Len, 0), 0);
+ cb(0, InfoProc.ki_rssize * GetPageSizeCached(), false, stats);
+}
+#endif
+
void ReadProcMaps(ProcSelfMapsBuff *proc_maps) {
const int Mib[] = {
#if SANITIZER_FREEBSD
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cpp
index eb351b0..a7805ad 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cpp
@@ -145,6 +145,7 @@
}
}
+#if SANITIZER_LINUX || SANITIZER_ANDROID || SANITIZER_SOLARIS || SANITIZER_NETBSD
void GetMemoryProfile(fill_profile_f cb, uptr *stats) {
char *smaps = nullptr;
uptr smaps_cap = 0;
@@ -184,6 +185,7 @@
while (*pos++ != '\n') {}
}
}
+#endif
} // namespace __sanitizer
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp
index 4b0e678..b44e016 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp
@@ -250,7 +250,9 @@
MemoryMappedSegmentData *seg_data,
MemoryMappingLayoutData *layout_data) {
const char *lc = layout_data->current_load_cmd_addr;
+
layout_data->current_load_cmd_addr += ((const load_command *)lc)->cmdsize;
+ layout_data->current_load_cmd_count--;
if (((const load_command *)lc)->cmd == kLCSegment) {
const SegmentCommand* sc = (const SegmentCommand *)lc;
uptr base_virt_addr, addr_mask;
@@ -358,11 +360,16 @@
return false;
}
+const ImageHeader *MemoryMappingLayout::CurrentImageHeader() {
+ const mach_header *hdr = (data_.current_image == kDyldImageIdx)
+ ? get_dyld_hdr()
+ : _dyld_get_image_header(data_.current_image);
+ return (const ImageHeader *)hdr;
+}
+
bool MemoryMappingLayout::Next(MemoryMappedSegment *segment) {
for (; data_.current_image >= kDyldImageIdx; data_.current_image--) {
- const mach_header *hdr = (data_.current_image == kDyldImageIdx)
- ? get_dyld_hdr()
- : _dyld_get_image_header(data_.current_image);
+ const mach_header *hdr = (const mach_header *)CurrentImageHeader();
if (!hdr) continue;
if (data_.current_load_cmd_count < 0) {
// Set up for this image;
@@ -392,7 +399,7 @@
(const load_command *)data_.current_load_cmd_addr);
}
- for (; data_.current_load_cmd_count >= 0; data_.current_load_cmd_count--) {
+ while (data_.current_load_cmd_count > 0) {
switch (data_.current_magic) {
// data_.current_magic may be only one of MH_MAGIC, MH_MAGIC_64.
#ifdef MH_MAGIC_64
@@ -413,6 +420,7 @@
}
// If we get here, no more load_cmd's in this image talk about
// segments. Go on to the next image.
+ data_.current_load_cmd_count = -1; // This will trigger loading next image
}
return false;
}
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
index ee996c3..47aed48 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
@@ -91,10 +91,10 @@
#elif defined(__sparc__) || defined(__mips__)
return pc - 8;
#elif SANITIZER_RISCV64
- // RV-64 has variable instruciton length...
+ // RV-64 has variable instruction length...
// C extentions gives us 2-byte instructoins
// RV-64 has 4-byte instructions
- // + RISCV architecture allows instructions up to 8 bytes
+ // + RISC-V architecture allows instructions up to 8 bytes
// It seems difficult to figure out the exact instruction length -
// pc - 2 seems like a safe option for the purposes of stack tracing
return pc - 2;
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
index a674034..f381852 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
@@ -86,6 +86,7 @@
}
Parse(file_contents);
+ UnmapOrDie(file_contents, contents_size);
}
bool SuppressionContext::Match(const char *str, const char *type,
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
index f4f2a03..06c05a5 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
@@ -163,7 +163,7 @@
uptr start_address = AddressInfo::kUnknown;
if (!ParseCommandOutput(buf, addr, &stack->info.function, &stack->info.module,
&stack->info.file, &line, &start_address)) {
- process_ = nullptr;
+ Report("WARNING: atos failed to symbolize address \"0x%zx\"\n", addr);
return false;
}
stack->info.line = (int)line;
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index d5c028e..7391571 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -107,8 +107,7 @@
stack->Reset();
uptr top = 0;
uptr bottom = 0;
- GET_CALLER_PC_BP_SP;
- (void)sp;
+ GET_CALLER_PC_BP;
bool fast = common_flags()->fast_unwind_on_fatal;
if (StackTrace::WillUseFastUnwind(fast)) {
GetThreadStackTopAndBottom(false, &top, &bottom);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
index c647ab1..ac2afe4 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
@@ -231,8 +231,6 @@
// Check that tool command lines are simple and that complete escaping is
// unnecessary.
CHECK(!internal_strchr(arg, '"') && "quotes in args unsupported");
- CHECK(!internal_strstr(arg, "\\\\") &&
- "double backslashes in args unsupported");
CHECK(arglen > 0 && arg[arglen - 1] != '\\' &&
"args ending in backslash and empty args unsupported");
command_line.append("\"%s\" ", arg);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
index e0568c9..1c9b2dd 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -718,13 +718,24 @@
// atexit() as soon as it is ready for use (i.e. after .CRT$XIC initializers).
InternalMmapVectorNoCtor<void (*)(void)> atexit_functions;
-int Atexit(void (*function)(void)) {
+static int queueAtexit(void (*function)(void)) {
atexit_functions.push_back(function);
return 0;
}
+// If Atexit() is being called after RunAtexit() has already been run, it needs
+// to be able to call atexit() directly. Here we use a function ponter to
+// switch out its behaviour.
+// An example of where this is needed is the asan_dynamic runtime on MinGW-w64.
+// On this environment, __asan_init is called during global constructor phase,
+// way after calling the .CRT$XID initializer.
+static int (*volatile queueOrCallAtExit)(void (*)(void)) = &queueAtexit;
+
+int Atexit(void (*function)(void)) { return queueOrCallAtExit(function); }
+
static int RunAtexit() {
TraceLoggingUnregister(g_asan_provider);
+ queueOrCallAtExit = &atexit;
int ret = 0;
for (uptr i = 0; i < atexit_functions.size(); ++i) {
ret |= atexit(atexit_functions[i]);
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
index d923b1f..49515f2 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
@@ -50,6 +50,7 @@
abort U
access U
aligned_alloc U
+arc4random U
bcmp U
calloc U
catclose U
@@ -111,6 +112,7 @@
memmove U
memset U
mkdir U
+modf U
munmap U
newlocale U
perror U
@@ -154,12 +156,15 @@
strncpy U
strrchr U
strsep U
+strtod U
strtod_l U
strtof_l U
strtok_r U
strtol U
strtold_l U
+strtoll U
strtoll_l U
+strtoull U
strtoull_l U
syscall U
sysconf U
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
index 0c729ec..22bad61 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
@@ -35,6 +35,7 @@
sanitizer_posix_test.cpp
sanitizer_printf_test.cpp
sanitizer_procmaps_test.cpp
+ sanitizer_procmaps_mac_test.cpp
sanitizer_ring_buffer_test.cpp
sanitizer_quarantine_test.cpp
sanitizer_stack_store_test.cpp
@@ -112,6 +113,8 @@
# The default stack size for clang is 8M.
if(MSVC)
list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -Wl,/STACK:0xC00000)
+elseif (MINGW)
+ list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -Wl,--stack=0xC00000)
endif()
set(SANITIZER_TEST_LINK_LIBS)
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_mac_test.cpp b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_mac_test.cpp
new file mode 100644
index 0000000..f622bba
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_mac_test.cpp
@@ -0,0 +1,137 @@
+//===-- sanitizer_procmaps_mac_test.cpp ---------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of ThreadSanitizer/AddressSanitizer runtime.
+//
+//===----------------------------------------------------------------------===//
+
+# include "sanitizer_common/sanitizer_platform.h"
+
+# if SANITIZER_APPLE
+
+# include <stdlib.h>
+# include <string.h>
+# include <stdint.h>
+# include <stdio.h>
+
+# include <vector>
+# include <mach-o/dyld.h>
+# include <mach-o/loader.h>
+
+# include "gtest/gtest.h"
+
+# include "sanitizer_common/sanitizer_procmaps.h"
+
+namespace __sanitizer {
+
+class MemoryMappingLayoutMock final : public MemoryMappingLayout {
+private:
+ static constexpr uuid_command mock_uuid_command = {
+ .cmd = LC_UUID,
+ .cmdsize = sizeof(uuid_command),
+ .uuid = {}
+ };
+
+ static constexpr char dylib_name[] = "libclang_rt.\0\0\0"; // 8 bytes aligned, padded with zeros per loader.h
+ static constexpr dylib_command mock_dylib_command = {
+ .cmd = LC_LOAD_DYLIB,
+ .cmdsize = sizeof(dylib_command) + sizeof(dylib_name),
+ .dylib = {
+ .name = {
+ .offset = sizeof(dylib_command)
+ }
+ }
+ };
+
+ static constexpr uuid_command mock_trap_command = {
+ .cmd = LC_UUID,
+ .cmdsize = 0x10000,
+ .uuid = {}
+ };
+
+ const char *start_load_cmd_addr;
+ size_t sizeofcmds;
+ std::vector<unsigned char> mock_header;
+
+public:
+ MemoryMappingLayoutMock(): MemoryMappingLayout(false) {
+ EXPECT_EQ(mock_uuid_command.cmdsize % 8, 0u);
+ EXPECT_EQ(mock_dylib_command.cmdsize % 8, 0u);
+
+ Reset();
+
+#ifdef MH_MAGIC_64
+ const struct mach_header_64 *header = (mach_header_64 *)_dyld_get_image_header(0); // Any header will do
+ const size_t header_size = sizeof(mach_header_64);
+#else
+ const struct mach_header *header = _dyld_get_image_header(0);
+ const size_t header_size = sizeof(mach_header);
+#endif
+ const size_t mock_header_size_with_extras = header_size + header->sizeofcmds +
+ mock_uuid_command.cmdsize + mock_dylib_command.cmdsize + sizeof(uuid_command);
+
+ mock_header.reserve(mock_header_size_with_extras);
+ // Copy the original header
+ copy((unsigned char *)header,
+ (unsigned char *)header + header_size + header->sizeofcmds,
+ back_inserter(mock_header));
+ // The following commands are not supposed to be processed
+ // by the (correct) ::Next method at all, since they're not
+ // accounted for in header->ncmds .
+ copy((unsigned char *)&mock_uuid_command,
+ ((unsigned char *)&mock_uuid_command) + mock_uuid_command.cmdsize,
+ back_inserter(mock_header));
+ copy((unsigned char *)&mock_dylib_command,
+ ((unsigned char *)&mock_dylib_command) + sizeof(dylib_command), // as mock_dylib_command.cmdsize contains the following string
+ back_inserter(mock_header));
+ copy((unsigned char *)dylib_name,
+ ((unsigned char *)dylib_name) + sizeof(dylib_name),
+ back_inserter(mock_header));
+
+ // Append a command w. huge size to have the test detect the read overrun
+ copy((unsigned char *)&mock_trap_command,
+ ((unsigned char *)&mock_trap_command) + sizeof(uuid_command),
+ back_inserter(mock_header));
+
+ start_load_cmd_addr = (const char *)(mock_header.data() + header_size);
+ sizeofcmds = header->sizeofcmds;
+
+ const char *last_byte_load_cmd_addr = (start_load_cmd_addr+sizeofcmds-1);
+ data_.current_image = -1; // So the loop in ::Next runs just once
+ }
+
+ size_t SizeOfLoadCommands() {
+ return sizeofcmds;
+ }
+
+ size_t CurrentLoadCommandOffset() {
+ size_t offset = data_.current_load_cmd_addr - start_load_cmd_addr;
+ return offset;
+ }
+
+protected:
+ virtual ImageHeader *CurrentImageHeader() override {
+ return (ImageHeader *)mock_header.data();
+ }
+};
+
+TEST(MemoryMappingLayout, Next) {
+ __sanitizer::MemoryMappingLayoutMock memory_mapping;
+ __sanitizer::MemoryMappedSegment segment;
+ size_t size = memory_mapping.SizeOfLoadCommands();
+ while (memory_mapping.Next(&segment)) {
+ size_t offset = memory_mapping.CurrentLoadCommandOffset();
+ EXPECT_LE(offset, size);
+ }
+ size_t final_offset = memory_mapping.CurrentLoadCommandOffset();
+ EXPECT_EQ(final_offset, size); // All commands processed, no more, no less
+}
+
+} // namespace __sanitizer
+
+# endif // SANITIZER_APPLE
diff --git a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
index 016ce9e..5fd94a0 100644
--- a/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
+++ b/third_party/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
@@ -127,8 +127,8 @@
# define SANITIZER_TEST_HAS_PRINTF_L 0
#endif
-#if !defined(_MSC_VER)
-# define SANITIZER_TEST_HAS_STRNDUP 1
+#if !defined(_WIN32)
+# define SANITIZER_TEST_HAS_STRNDUP 1
#else
# define SANITIZER_TEST_HAS_STRNDUP 0
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/CMakeLists.txt
index 9ac3340..0f9a483 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/CMakeLists.txt
@@ -30,6 +30,9 @@
list(APPEND SCUDO_CFLAGS -O3)
endif()
+append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG -Werror=thread-safety
+ SCUDO_CFLAGS)
+
set(SCUDO_LINK_FLAGS)
list(APPEND SCUDO_LINK_FLAGS -Wl,-z,defs,-z,now,-z,relro)
@@ -68,6 +71,8 @@
list.h
local_cache.h
memtag.h
+ mem_map.h
+ mem_map_base.h
mutex.h
options.h
platform.h
@@ -82,6 +87,7 @@
stack_depot.h
stats.h
string_utils.h
+ timing.h
tsd_exclusive.h
tsd_shared.h
tsd.h
@@ -100,10 +106,12 @@
flags.cpp
fuchsia.cpp
linux.cpp
+ mem_map.cpp
release.cpp
report.cpp
rss_limit_checker.cpp
string_utils.cpp
+ timing.cpp
)
# Enable the necessary instruction set for scudo_crc32.cpp, if available.
@@ -129,8 +137,19 @@
)
set(SCUDO_OBJECT_LIBS)
+set(SCUDO_LINK_LIBS)
if (COMPILER_RT_HAS_GWP_ASAN)
+ if(COMPILER_RT_USE_LLVM_UNWINDER)
+ list(APPEND SCUDO_LINK_LIBS ${COMPILER_RT_UNWINDER_LINK_LIBS} dl)
+ elseif (COMPILER_RT_HAS_GCC_S_LIB)
+ list(APPEND SCUDO_LINK_LIBS gcc_s)
+ elseif (COMPILER_RT_HAS_GCC_LIB)
+ list(APPEND SCUDO_LINK_LIBS gcc)
+ elseif (NOT COMPILER_RT_USE_BUILTINS_LIBRARY)
+ message(FATAL_ERROR "No suitable unwinder library")
+ endif()
+
add_dependencies(scudo_standalone gwp_asan)
list(APPEND SCUDO_OBJECT_LIBS
RTGwpAsan RTGwpAsanBacktraceLibc RTGwpAsanSegvHandler
@@ -143,8 +162,6 @@
endif()
-set(SCUDO_LINK_LIBS ${COMPILER_RT_UNWINDER_LINK_LIBS})
-
if(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC)
include_directories(${COMPILER_RT_BINARY_DIR}/../libc/include/)
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/allocator_config.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/allocator_config.h
index 63eb325..6430606 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/allocator_config.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/allocator_config.h
@@ -26,7 +26,7 @@
// allocator.
//
// struct ExampleConfig {
-// // SizeClasMmap to use with the Primary.
+// // SizeClassMap to use with the Primary.
// using SizeClassMap = DefaultSizeClassMap;
// // Indicates possible support for Memory Tagging.
// static const bool MaySupportMemoryTagging = false;
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/chunk.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/chunk.h
index 88bada8..32874a8 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/chunk.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/chunk.h
@@ -85,7 +85,7 @@
constexpr uptr ChecksumMask = (1UL << 16) - 1;
constexpr uptr getHeaderSize() {
- return roundUpTo(sizeof(PackedHeader), 1U << SCUDO_MIN_ALIGNMENT_LOG);
+ return roundUp(sizeof(PackedHeader), 1U << SCUDO_MIN_ALIGNMENT_LOG);
}
inline AtomicPackedHeader *getAtomicHeader(void *Ptr) {
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/combined.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/combined.h
index b6d74ab..250eba0 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/combined.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/combined.h
@@ -249,9 +249,9 @@
// - unlinking the local stats from the global ones (destroying the cache does
// the last two items).
void commitBack(TSD<ThisT> *TSD) {
- Quarantine.drain(&TSD->QuarantineCache,
- QuarantineCallback(*this, TSD->Cache));
- TSD->Cache.destroy(&Stats);
+ Quarantine.drain(&TSD->getQuarantineCache(),
+ QuarantineCallback(*this, TSD->getCache()));
+ TSD->getCache().destroy(&Stats);
}
ALWAYS_INLINE void *getHeaderTaggedPointer(void *Ptr) {
@@ -305,7 +305,7 @@
NOINLINE void *allocate(uptr Size, Chunk::Origin Origin,
uptr Alignment = MinAlignment,
- bool ZeroContents = false) {
+ bool ZeroContents = false) NO_THREAD_SAFETY_ANALYSIS {
initThreadMaybe();
const Options Options = Primary.Options.load();
@@ -342,7 +342,7 @@
// to be sure that there will be an address in the block that will satisfy
// the alignment.
const uptr NeededSize =
- roundUpTo(Size, MinAlignment) +
+ roundUp(Size, MinAlignment) +
((Alignment > MinAlignment) ? Alignment : Chunk::getHeaderSize());
// Takes care of extravagantly large sizes as well as integer overflows.
@@ -375,23 +375,24 @@
DCHECK_NE(ClassId, 0U);
bool UnlockRequired;
auto *TSD = TSDRegistry.getTSDAndLock(&UnlockRequired);
- Block = TSD->Cache.allocate(ClassId);
+ Block = TSD->getCache().allocate(ClassId);
// If the allocation failed, the most likely reason with a 32-bit primary
// is the region being full. In that event, retry in each successively
// larger class until it fits. If it fails to fit in the largest class,
// fallback to the Secondary.
if (UNLIKELY(!Block)) {
while (ClassId < SizeClassMap::LargestClassId && !Block)
- Block = TSD->Cache.allocate(++ClassId);
+ Block = TSD->getCache().allocate(++ClassId);
if (!Block)
ClassId = 0;
}
if (UnlockRequired)
TSD->unlock();
}
- if (UNLIKELY(ClassId == 0))
+ if (UNLIKELY(ClassId == 0)) {
Block = Secondary.allocate(Options, Size, Alignment, &SecondaryBlockEnd,
FillContents);
+ }
if (UNLIKELY(!Block)) {
if (Options.get(OptionBit::MayReturnNull))
@@ -401,7 +402,7 @@
const uptr BlockUptr = reinterpret_cast<uptr>(Block);
const uptr UnalignedUserPtr = BlockUptr + Chunk::getHeaderSize();
- const uptr UserPtr = roundUpTo(UnalignedUserPtr, Alignment);
+ const uptr UserPtr = roundUp(UnalignedUserPtr, Alignment);
void *Ptr = reinterpret_cast<void *>(UserPtr);
void *TaggedPtr = Ptr;
@@ -460,7 +461,7 @@
PrevUserPtr == UserPtr &&
(TaggedUserPtr = loadTag(UserPtr)) != UserPtr) {
uptr PrevEnd = TaggedUserPtr + Header.SizeOrUnusedBytes;
- const uptr NextPage = roundUpTo(TaggedUserPtr, getPageSizeCached());
+ const uptr NextPage = roundUp(TaggedUserPtr, getPageSizeCached());
if (NextPage < PrevEnd && loadTag(NextPage) != NextPage)
PrevEnd = NextPage;
TaggedPtr = reinterpret_cast<void *>(TaggedUserPtr);
@@ -473,8 +474,8 @@
// was freed, it would not have been retagged and thus zeroed, and
// therefore it needs to be zeroed now.
memset(TaggedPtr, 0,
- Min(Size, roundUpTo(PrevEnd - TaggedUserPtr,
- archMemoryTagGranuleSize())));
+ Min(Size, roundUp(PrevEnd - TaggedUserPtr,
+ archMemoryTagGranuleSize())));
} else if (Size) {
// Clear any stack metadata that may have previously been stored in
// the chunk data.
@@ -687,6 +688,8 @@
void *NewPtr = allocate(NewSize, Chunk::Origin::Malloc, Alignment);
if (LIKELY(NewPtr)) {
memcpy(NewPtr, OldTaggedPtr, Min(NewSize, OldSize));
+ if (UNLIKELY(&__scudo_deallocate_hook))
+ __scudo_deallocate_hook(OldTaggedPtr);
quarantineOrDeallocateChunk(Options, OldTaggedPtr, &OldHeader, OldSize);
}
return NewPtr;
@@ -695,7 +698,7 @@
// TODO(kostyak): disable() is currently best-effort. There are some small
// windows of time when an allocation could still succeed after
// this function finishes. We will revisit that later.
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
initThreadMaybe();
#ifdef GWP_ASAN_HOOKS
GuardedAlloc.disable();
@@ -707,7 +710,7 @@
Secondary.disable();
}
- void enable() {
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
initThreadMaybe();
Secondary.enable();
Primary.enable();
@@ -726,9 +729,7 @@
// sizing purposes.
uptr getStats(char *Buffer, uptr Size) {
ScopedString Str;
- disable();
const uptr Length = getStats(&Str) + 1;
- enable();
if (Length < Size)
Size = Length;
if (Buffer && Size) {
@@ -740,15 +741,13 @@
void printStats() {
ScopedString Str;
- disable();
getStats(&Str);
- enable();
Str.output();
}
- void releaseToOS() {
+ void releaseToOS(ReleaseToOS ReleaseType) {
initThreadMaybe();
- Primary.releaseToOS();
+ Primary.releaseToOS(ReleaseType);
Secondary.releaseToOS();
}
@@ -1126,7 +1125,8 @@
}
void quarantineOrDeallocateChunk(Options Options, void *TaggedPtr,
- Chunk::UnpackedHeader *Header, uptr Size) {
+ Chunk::UnpackedHeader *Header,
+ uptr Size) NO_THREAD_SAFETY_ANALYSIS {
void *Ptr = getHeaderTaggedPointer(TaggedPtr);
Chunk::UnpackedHeader NewHeader = *Header;
// If the quarantine is disabled, the actual size of a chunk is 0 or larger
@@ -1168,7 +1168,7 @@
if (LIKELY(ClassId)) {
bool UnlockRequired;
auto *TSD = TSDRegistry.getTSDAndLock(&UnlockRequired);
- TSD->Cache.deallocate(ClassId, BlockBegin);
+ TSD->getCache().deallocate(ClassId, BlockBegin);
if (UnlockRequired)
TSD->unlock();
} else {
@@ -1180,8 +1180,8 @@
} else {
bool UnlockRequired;
auto *TSD = TSDRegistry.getTSDAndLock(&UnlockRequired);
- Quarantine.put(&TSD->QuarantineCache,
- QuarantineCallback(*this, TSD->Cache), Ptr, Size);
+ Quarantine.put(&TSD->getQuarantineCache(),
+ QuarantineCallback(*this, TSD->getCache()), Ptr, Size);
if (UnlockRequired)
TSD->unlock();
}
@@ -1241,15 +1241,15 @@
void resizeTaggedChunk(uptr OldPtr, uptr NewPtr, uptr NewSize,
uptr BlockEnd) {
- uptr RoundOldPtr = roundUpTo(OldPtr, archMemoryTagGranuleSize());
+ uptr RoundOldPtr = roundUp(OldPtr, archMemoryTagGranuleSize());
uptr RoundNewPtr;
if (RoundOldPtr >= NewPtr) {
// If the allocation is shrinking we just need to set the tag past the end
// of the allocation to 0. See explanation in storeEndMarker() above.
- RoundNewPtr = roundUpTo(NewPtr, archMemoryTagGranuleSize());
+ RoundNewPtr = roundUp(NewPtr, archMemoryTagGranuleSize());
} else {
// Set the memory tag of the region
- // [RoundOldPtr, roundUpTo(NewPtr, archMemoryTagGranuleSize()))
+ // [RoundOldPtr, roundUp(NewPtr, archMemoryTagGranuleSize()))
// to the pointer tag stored in OldPtr.
RoundNewPtr = storeTags(RoundOldPtr, NewPtr);
}
@@ -1505,7 +1505,8 @@
MapPlatformData Data = {};
RawRingBuffer = static_cast<char *>(
map(/*Addr=*/nullptr,
- roundUpTo(ringBufferSizeInBytes(AllocationRingBufferSize), getPageSizeCached()),
+ roundUp(ringBufferSizeInBytes(AllocationRingBufferSize),
+ getPageSizeCached()),
"AllocatorRingBuffer", /*Flags=*/0, &Data));
auto *RingBuffer = reinterpret_cast<AllocationRingBuffer *>(RawRingBuffer);
RingBuffer->Size = AllocationRingBufferSize;
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/common.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/common.h
index 2ec9a63..82e6cf4 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/common.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/common.h
@@ -27,17 +27,31 @@
return D;
}
-inline constexpr uptr roundUpTo(uptr X, uptr Boundary) {
+inline constexpr bool isPowerOfTwo(uptr X) { return (X & (X - 1)) == 0; }
+
+inline constexpr uptr roundUp(uptr X, uptr Boundary) {
+ DCHECK(isPowerOfTwo(Boundary));
return (X + Boundary - 1) & ~(Boundary - 1);
}
+inline constexpr uptr roundUpSlow(uptr X, uptr Boundary) {
+ return ((X + Boundary - 1) / Boundary) * Boundary;
+}
-inline constexpr uptr roundDownTo(uptr X, uptr Boundary) {
+inline constexpr uptr roundDown(uptr X, uptr Boundary) {
+ DCHECK(isPowerOfTwo(Boundary));
return X & ~(Boundary - 1);
}
+inline constexpr uptr roundDownSlow(uptr X, uptr Boundary) {
+ return (X / Boundary) * Boundary;
+}
inline constexpr bool isAligned(uptr X, uptr Alignment) {
+ DCHECK(isPowerOfTwo(Alignment));
return (X & (Alignment - 1)) == 0;
}
+inline constexpr bool isAlignedSlow(uptr X, uptr Alignment) {
+ return X % Alignment == 0;
+}
template <class T> constexpr T Min(T A, T B) { return A < B ? A : B; }
@@ -49,14 +63,12 @@
B = Tmp;
}
-inline bool isPowerOfTwo(uptr X) { return (X & (X - 1)) == 0; }
-
inline uptr getMostSignificantSetBitIndex(uptr X) {
DCHECK_NE(X, 0U);
return SCUDO_WORDSIZE - 1U - static_cast<uptr>(__builtin_clzl(X));
}
-inline uptr roundUpToPowerOfTwo(uptr Size) {
+inline uptr roundUpPowerOfTwo(uptr Size) {
DCHECK(Size);
if (isPowerOfTwo(Size))
return Size;
@@ -135,6 +147,9 @@
uptr GetRSS();
u64 getMonotonicTime();
+// Gets the time faster but with less accuracy. Can call getMonotonicTime
+// if no fast version is available.
+u64 getMonotonicTimeFast();
u32 getThreadID();
@@ -200,6 +215,13 @@
MaxTSDsCount, // Number of usable TSDs for the shared registry.
};
+enum class ReleaseToOS : u8 {
+ Normal, // Follow the normal rules for releasing pages to the OS
+ Force, // Force release pages to the OS, but avoid cases that take too long.
+ ForceAll, // Force release every page possible regardless of how long it will
+ // take.
+};
+
constexpr unsigned char PatternFillByte = 0xAB;
enum FillContentsMode {
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/fuchsia.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/fuchsia.cpp
index 70e4e71..ef93542 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/fuchsia.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/fuchsia.cpp
@@ -166,6 +166,8 @@
void releasePagesToOS(UNUSED uptr BaseAddress, uptr Offset, uptr Size,
MapPlatformData *Data) {
+ // TODO: DCHECK the BaseAddress is consistent with the data in
+ // MapPlatformData.
DCHECK(Data);
DCHECK_NE(Data->Vmar, ZX_HANDLE_INVALID);
DCHECK_NE(Data->Vmo, ZX_HANDLE_INVALID);
@@ -195,7 +197,10 @@
sync_mutex_unlock(&M);
}
+void HybridMutex::assertHeldImpl() __TA_NO_THREAD_SAFETY_ANALYSIS {}
+
u64 getMonotonicTime() { return _zx_clock_get_monotonic(); }
+u64 getMonotonicTimeFast() { return _zx_clock_get_monotonic(); }
u32 getNumberOfCPUs() { return _zx_system_get_num_cpus(); }
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/include/scudo/interface.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/include/scudo/interface.h
index 23bcfba..3c083ed 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/include/scudo/interface.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/include/scudo/interface.h
@@ -118,6 +118,10 @@
#define M_PURGE -101
#endif
+#ifndef M_PURGE_ALL
+#define M_PURGE_ALL -104
+#endif
+
// Tune the allocator's choice of memory tags to make it more likely that
// a certain class of memory errors will be detected. The value argument should
// be one of the M_MEMTAG_TUNING_* constants below.
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/linux.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/linux.cpp
index 9c5755a..e285d8a 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/linux.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/linux.cpp
@@ -11,6 +11,7 @@
#if SCUDO_LINUX
#include "common.h"
+#include "internal_defs.h"
#include "linux.h"
#include "mutex.h"
#include "string_utils.h"
@@ -128,6 +129,10 @@
}
}
+void HybridMutex::assertHeldImpl() {
+ CHECK(atomic_load(&M, memory_order_acquire) != Unlocked);
+}
+
u64 getMonotonicTime() {
timespec TS;
clock_gettime(CLOCK_MONOTONIC, &TS);
@@ -135,6 +140,17 @@
static_cast<u64>(TS.tv_nsec);
}
+u64 getMonotonicTimeFast() {
+#if defined(CLOCK_MONOTONIC_COARSE)
+ timespec TS;
+ clock_gettime(CLOCK_MONOTONIC_COARSE, &TS);
+ return static_cast<u64>(TS.tv_sec) * (1000ULL * 1000 * 1000) +
+ static_cast<u64>(TS.tv_nsec);
+#else
+ return getMonotonicTime();
+#endif
+}
+
u32 getNumberOfCPUs() {
cpu_set_t CPUs;
// sched_getaffinity can fail for a variety of legitimate reasons (lack of
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/local_cache.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/local_cache.h
index 6e84158..92869ea 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/local_cache.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/local_cache.h
@@ -62,17 +62,16 @@
struct BatchGroup {
// `Next` is used by IntrusiveList.
BatchGroup *Next;
- // The identifier of each group
- uptr GroupId;
+ // The compact base address of each group
+ uptr CompactPtrGroupBase;
// Cache value of TransferBatch::getMaxCached()
u16 MaxCachedPerBatch;
// Number of blocks pushed into this group. This is an increment-only
// counter.
uptr PushedBlocks;
- // This is used to track how many blocks are pushed since last time we
- // checked `PushedBlocks`. It's useful for page releasing to determine the
- // usage of a BatchGroup.
- uptr PushedBlocksAtLastCheckpoint;
+ // This is used to track how many bytes are not in-use since last time we
+ // tried to release pages.
+ uptr BytesInBGAtLastCheckpoint;
// Blocks are managed by TransferBatch in a list.
SinglyLinkedList<TransferBatch> Batches;
};
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map.cpp
new file mode 100644
index 0000000..662d684
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map.cpp
@@ -0,0 +1,77 @@
+//===-- mem_map.cpp ---------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mem_map.h"
+
+#include "common.h"
+
+namespace scudo {
+
+bool MemMapDefault::mapImpl(uptr Addr, uptr Size, const char *Name,
+ uptr Flags) {
+ void *MappedAddr =
+ ::scudo::map(reinterpret_cast<void *>(Addr), Size, Name, Flags, &Data);
+ if (MappedAddr == nullptr)
+ return false;
+ Base = reinterpret_cast<uptr>(MappedAddr);
+ Capacity = Size;
+ return true;
+}
+
+void MemMapDefault::unmapImpl(uptr Addr, uptr Size) {
+ if (Size == Capacity) {
+ Base = Capacity = 0;
+ } else {
+ if (Base == Addr)
+ Base = Addr + Size;
+ Capacity -= Size;
+ }
+
+ ::scudo::unmap(reinterpret_cast<void *>(Addr), Size, UNMAP_ALL, &Data);
+}
+
+bool MemMapDefault::remapImpl(uptr Addr, uptr Size, const char *Name,
+ uptr Flags) {
+ void *RemappedAddr =
+ ::scudo::map(reinterpret_cast<void *>(Addr), Size, Name, Flags, &Data);
+ return reinterpret_cast<uptr>(RemappedAddr) == Addr;
+}
+
+void MemMapDefault::releaseAndZeroPagesToOSImpl(uptr From, uptr Size) {
+ return ::scudo::releasePagesToOS(Base, From - Base, Size, &Data);
+}
+
+void MemMapDefault::setMemoryPermissionImpl(uptr Addr, uptr Size, uptr Flags) {
+ return ::scudo::setMemoryPermission(Addr, Size, Flags);
+}
+
+void ReservedMemoryDefault::releaseImpl() {
+ ::scudo::unmap(reinterpret_cast<void *>(Base), Capacity, UNMAP_ALL, &Data);
+}
+
+bool ReservedMemoryDefault::createImpl(uptr Addr, uptr Size, const char *Name,
+ uptr Flags) {
+ void *Reserved = ::scudo::map(reinterpret_cast<void *>(Addr), Size, Name,
+ Flags | MAP_NOACCESS, &Data);
+ if (Reserved == nullptr)
+ return false;
+
+ Base = reinterpret_cast<uptr>(Reserved);
+ Capacity = Size;
+
+ return true;
+}
+
+ReservedMemoryDefault::MemMapT ReservedMemoryDefault::dispatchImpl(uptr Addr,
+ uptr Size) {
+ ReservedMemoryDefault::MemMapT NewMap(Addr, Size);
+ NewMap.setMapPlatformData(Data);
+ return NewMap;
+}
+
+} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map.h
new file mode 100644
index 0000000..6179e8a
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map.h
@@ -0,0 +1,88 @@
+//===-- mem_map.h -----------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_MEM_MAP_H_
+#define SCUDO_MEM_MAP_H_
+
+#include "mem_map_base.h"
+
+#include "common.h"
+#include "internal_defs.h"
+
+// TODO: This is only used for `MapPlatformData`. Remove these includes when we
+// have all three platform specific `MemMap` and `ReservedMemory`
+// implementations.
+#include "fuchsia.h"
+#include "linux.h"
+#include "trusty.h"
+
+namespace scudo {
+
+// This will be deprecated when every allocator has been supported by each
+// platform's `MemMap` implementation.
+class MemMapDefault final : public MemMapBase<MemMapDefault> {
+public:
+ constexpr MemMapDefault() = default;
+ MemMapDefault(uptr Base, uptr Capacity) : Base(Base), Capacity(Capacity) {}
+
+ // Impls for base functions.
+ bool mapImpl(uptr Addr, uptr Size, const char *Name, uptr Flags);
+ void unmapImpl(uptr Addr, uptr Size);
+ bool remapImpl(uptr Addr, uptr Size, const char *Name, uptr Flags);
+ void setMemoryPermissionImpl(uptr Addr, uptr Size, uptr Flags);
+ void releasePagesToOSImpl(uptr From, uptr Size) {
+ return releaseAndZeroPagesToOSImpl(From, Size);
+ }
+ void releaseAndZeroPagesToOSImpl(uptr From, uptr Size);
+ uptr getBaseImpl() { return Base; }
+ uptr getCapacityImpl() { return Capacity; }
+
+ void setMapPlatformData(MapPlatformData &NewData) { Data = NewData; }
+
+private:
+ uptr Base = 0;
+ uptr Capacity = 0;
+ MapPlatformData Data = {};
+};
+
+// This will be deprecated when every allocator has been supported by each
+// platform's `MemMap` implementation.
+class ReservedMemoryDefault final
+ : public ReservedMemory<ReservedMemoryDefault, MemMapDefault> {
+public:
+ constexpr ReservedMemoryDefault() = default;
+
+ bool createImpl(uptr Addr, uptr Size, const char *Name, uptr Flags);
+ void releaseImpl();
+ MemMapT dispatchImpl(uptr Addr, uptr Size);
+ uptr getBaseImpl() { return Base; }
+ uptr getCapacityImpl() { return Capacity; }
+
+private:
+ uptr Base = 0;
+ uptr Capacity = 0;
+ MapPlatformData Data = {};
+};
+
+#if SCUDO_LINUX
+using ReservedMemoryT = ReservedMemoryDefault;
+using MemMapT = ReservedMemoryT::MemMapT;
+#elif SCUDO_FUCHSIA
+using ReservedMemoryT = ReservedMemoryDefault;
+using MemMapT = ReservedMemoryT::MemMapT;
+#elif SCUDO_TRUSTY
+using ReservedMemoryT = ReservedMemoryDefault;
+using MemMapT = ReservedMemoryT::MemMapT;
+#else
+#error \
+ "Unsupported platform, please implement the ReservedMemory for your platform!"
+#endif
+
+} // namespace scudo
+
+#endif // SCUDO_MEM_MAP_H_
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map_base.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map_base.h
new file mode 100644
index 0000000..0560f41
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mem_map_base.h
@@ -0,0 +1,130 @@
+//===-- mem_map_base.h ------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_MEM_MAP_BASE_H_
+#define SCUDO_MEM_MAP_BASE_H_
+
+#include "common.h"
+
+namespace scudo {
+
+// In Scudo, every memory operation will be fulfilled through a
+// platform-specific `MemMap` instance. The essential APIs are listed in the
+// `MemMapBase` below. This is implemented in CRTP, so for each implementation,
+// it has to implement all of the 'Impl' named functions.
+template <class Derived> class MemMapBase {
+public:
+ constexpr MemMapBase() = default;
+
+ // This is used to map a new set of contiguous pages. Note that the `Addr` is
+ // only a suggestion to the system.
+ bool map(uptr Addr, uptr Size, const char *Name, uptr Flags = 0) {
+ DCHECK(!isAllocated());
+ return invokeImpl(&Derived::mapImpl, Addr, Size, Name, Flags);
+ }
+
+ // This is used to unmap partial/full pages from the beginning or the end.
+ // I.e., the result pages are expected to be still contiguous.
+ void unmap(uptr Addr, uptr Size) {
+ DCHECK(isAllocated());
+ DCHECK((Addr == getBase()) || (Addr + Size == getBase() + getCapacity()));
+ invokeImpl(&Derived::unmapImpl, Addr, Size);
+ }
+
+ // This is used to remap a mapped range (either from map() or dispatched from
+ // ReservedMemory). For example, we have reserved several pages and then we
+ // want to remap them with different accessibility.
+ bool remap(uptr Addr, uptr Size, const char *Name, uptr Flags = 0) {
+ DCHECK(isAllocated());
+ DCHECK((Addr >= getBase()) || (Addr + Size <= getBase() + getCapacity()));
+ return invokeImpl(&Derived::remapImpl, Addr, Size, Name, Flags);
+ }
+
+ // This is used to update the pages' access permission. For example, mark
+ // pages as no read/write permission.
+ void setMemoryPermission(uptr Addr, uptr Size, uptr Flags) {
+ DCHECK(isAllocated());
+ DCHECK((Addr >= getBase()) || (Addr + Size <= getBase() + getCapacity()));
+ return static_cast<Derived *>(this)->setMemoryPermissionImpl(Addr, Size,
+ Flags);
+ }
+
+ // Suggest releasing a set of contiguous physical pages back to the OS. Note
+ // that only physical pages are supposed to be released. Any release of
+ // virtual pages may lead to undefined behavior.
+ void releasePagesToOS(uptr From, uptr Size) {
+ DCHECK(isAllocated());
+ DCHECK((From >= getBase()) || (From + Size <= getBase() + getCapacity()));
+ invokeImpl(&Derived::releasePagesToOSImpl, From, Size);
+ }
+ // This is similar to the above one except that any subsequent access to the
+ // released pages will return with zero-filled pages.
+ void releaseAndZeroPagesToOS(uptr From, uptr Size) {
+ DCHECK(isAllocated());
+ DCHECK((From >= getBase()) || (From + Size <= getBase() + getCapacity()));
+ invokeImpl(&Derived::releaseAndZeroPagesToOSImpl, From, Size);
+ }
+
+ uptr getBase() { return invokeImpl(&Derived::getBaseImpl); }
+ uptr getCapacity() { return invokeImpl(&Derived::getCapacityImpl); }
+
+ bool isAllocated() { return getBase() != 0U; }
+
+protected:
+ template <typename R, typename... Args>
+ R invokeImpl(R (Derived::*MemFn)(Args...), Args... args) {
+ return (static_cast<Derived *>(this)->*MemFn)(args...);
+ }
+};
+
+// `ReservedMemory` is a special memory handle which can be viewed as a page
+// allocator. `ReservedMemory` will reserve a contiguous pages and the later
+// page request can be fulfilled at the designated address. This is used when
+// we want to ensure the virtual address of the MemMap will be in a known range.
+// This is implemented in CRTP, so for each
+// implementation, it has to implement all of the 'Impl' named functions.
+template <class Derived, typename MemMapTy> class ReservedMemory {
+public:
+ using MemMapT = MemMapTy;
+ constexpr ReservedMemory() = default;
+
+ // Reserve a chunk of memory at a suggested address.
+ bool create(uptr Addr, uptr Size, const char *Name, uptr Flags = 0) {
+ DCHECK(!isCreated());
+ return invokeImpl(&Derived::createImpl, Addr, Size, Name, Flags);
+ }
+
+ // Release the entire reserved memory.
+ void release() {
+ DCHECK(isCreated());
+ invokeImpl(&Derived::releaseImpl);
+ }
+
+ // Dispatch a sub-range of reserved memory. Note that any fragmentation of
+ // the reserved pages is managed by each implementation.
+ MemMapT dispatch(uptr Addr, uptr Size) {
+ DCHECK(isCreated());
+ DCHECK((Addr >= getBase()) || (Addr + Size <= getBase() + getCapacity()));
+ return invokeImpl(&Derived::dispatchImpl, Addr, Size);
+ }
+
+ uptr getBase() { return invokeImpl(&Derived::getBaseImpl); }
+ uptr getCapacity() { return invokeImpl(&Derived::getCapacityImpl); }
+
+ bool isCreated() { return getBase() != 0U; }
+
+protected:
+ template <typename R, typename... Args>
+ R invokeImpl(R (Derived::*MemFn)(Args...), Args... args) {
+ return (static_cast<Derived *>(this)->*MemFn)(args...);
+ }
+};
+
+} // namespace scudo
+
+#endif // SCUDO_MEM_MAP_BASE_H_
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mutex.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mutex.h
index c8504c0..05340de 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mutex.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/mutex.h
@@ -11,6 +11,7 @@
#include "atomic_helpers.h"
#include "common.h"
+#include "thread_annotations.h"
#include <string.h>
@@ -20,10 +21,10 @@
namespace scudo {
-class HybridMutex {
+class CAPABILITY("mutex") HybridMutex {
public:
- bool tryLock();
- NOINLINE void lock() {
+ bool tryLock() TRY_ACQUIRE(true);
+ NOINLINE void lock() ACQUIRE() {
if (LIKELY(tryLock()))
return;
// The compiler may try to fully unroll the loop, ending up in a
@@ -40,9 +41,20 @@
}
lockSlow();
}
- void unlock();
+ void unlock() RELEASE();
+
+ // TODO(chiahungduan): In general, we may want to assert the owner of lock as
+ // well. Given the current uses of HybridMutex, it's acceptable without
+ // asserting the owner. Re-evaluate this when we have certain scenarios which
+ // requires a more fine-grained lock granularity.
+ ALWAYS_INLINE void assertHeld() ASSERT_CAPABILITY(this) {
+ if (SCUDO_DEBUG)
+ assertHeldImpl();
+ }
private:
+ void assertHeldImpl();
+
static constexpr u8 NumberOfTries = 8U;
static constexpr u8 NumberOfYields = 8U;
@@ -52,13 +64,13 @@
sync_mutex_t M = {};
#endif
- void lockSlow();
+ void lockSlow() ACQUIRE();
};
-class ScopedLock {
+class SCOPED_CAPABILITY ScopedLock {
public:
- explicit ScopedLock(HybridMutex &M) : Mutex(M) { Mutex.lock(); }
- ~ScopedLock() { Mutex.unlock(); }
+ explicit ScopedLock(HybridMutex &M) ACQUIRE(M) : Mutex(M) { Mutex.lock(); }
+ ~ScopedLock() RELEASE() { Mutex.unlock(); }
private:
HybridMutex &Mutex;
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary32.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary32.h
index a3d908c..7ac8df9 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary32.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary32.h
@@ -18,6 +18,7 @@
#include "report.h"
#include "stats.h"
#include "string_utils.h"
+#include "thread_annotations.h"
namespace scudo {
@@ -62,7 +63,7 @@
static bool canAllocate(uptr Size) { return Size <= SizeClassMap::MaxSize; }
- void init(s32 ReleaseToOsInterval) {
+ void init(s32 ReleaseToOsInterval) NO_THREAD_SAFETY_ANALYSIS {
if (SCUDO_FUCHSIA)
reportError("SizeClassAllocator32 is not supported on Fuchsia");
@@ -72,7 +73,7 @@
DCHECK(isAligned(reinterpret_cast<uptr>(this), alignof(ThisT)));
PossibleRegions.init();
u32 Seed;
- const u64 Time = getMonotonicTime();
+ const u64 Time = getMonotonicTimeFast();
if (!getRandom(reinterpret_cast<void *>(&Seed), sizeof(Seed)))
Seed = static_cast<u32>(
Time ^ (reinterpret_cast<uptr>(SizeClassInfoArray) >> 6));
@@ -87,18 +88,26 @@
}
void unmapTestOnly() {
- while (NumberOfStashedRegions > 0)
- unmap(reinterpret_cast<void *>(RegionsStash[--NumberOfStashedRegions]),
- RegionSize);
+ {
+ ScopedLock L(RegionsStashMutex);
+ while (NumberOfStashedRegions > 0) {
+ unmap(reinterpret_cast<void *>(RegionsStash[--NumberOfStashedRegions]),
+ RegionSize);
+ }
+ }
+
uptr MinRegionIndex = NumRegions, MaxRegionIndex = 0;
for (uptr I = 0; I < NumClasses; I++) {
SizeClassInfo *Sci = getSizeClassInfo(I);
+ ScopedLock L(Sci->Mutex);
if (Sci->MinRegionIndex < MinRegionIndex)
MinRegionIndex = Sci->MinRegionIndex;
if (Sci->MaxRegionIndex > MaxRegionIndex)
MaxRegionIndex = Sci->MaxRegionIndex;
*Sci = {};
}
+
+ ScopedLock L(ByteMapMutex);
for (uptr I = MinRegionIndex; I < MaxRegionIndex; I++)
if (PossibleRegions[I])
unmap(reinterpret_cast<void *>(I * RegionSize), RegionSize);
@@ -113,19 +122,24 @@
return reinterpret_cast<void *>(static_cast<uptr>(CompactPtr));
}
- uptr compactPtrGroup(CompactPtrT CompactPtr) {
- return CompactPtr >> GroupSizeLog;
+ uptr compactPtrGroupBase(CompactPtrT CompactPtr) {
+ const uptr Mask = (static_cast<uptr>(1) << GroupSizeLog) - 1;
+ return CompactPtr & ~Mask;
+ }
+
+ uptr decompactGroupBase(uptr CompactPtrGroupBase) {
+ return CompactPtrGroupBase;
}
TransferBatch *popBatch(CacheT *C, uptr ClassId) {
DCHECK_LT(ClassId, NumClasses);
SizeClassInfo *Sci = getSizeClassInfo(ClassId);
ScopedLock L(Sci->Mutex);
- TransferBatch *B = popBatchImpl(C, ClassId);
+ TransferBatch *B = popBatchImpl(C, ClassId, Sci);
if (UNLIKELY(!B)) {
if (UNLIKELY(!populateFreeList(C, ClassId, Sci)))
return nullptr;
- B = popBatchImpl(C, ClassId);
+ B = popBatchImpl(C, ClassId, Sci);
// if `populateFreeList` succeeded, we are supposed to get free blocks.
DCHECK_NE(B, nullptr);
}
@@ -149,7 +163,7 @@
// the blocks.
if (Size == 1 && !populateFreeList(C, ClassId, Sci))
return;
- pushBlocksImpl(C, ClassId, Array, Size);
+ pushBlocksImpl(C, ClassId, Sci, Array, Size);
Sci->Stats.PushedBlocks += Size;
return;
}
@@ -161,11 +175,12 @@
// together.
bool SameGroup = true;
for (u32 I = 1; I < Size; ++I) {
- if (compactPtrGroup(Array[I - 1]) != compactPtrGroup(Array[I]))
+ if (compactPtrGroupBase(Array[I - 1]) != compactPtrGroupBase(Array[I]))
SameGroup = false;
CompactPtrT Cur = Array[I];
u32 J = I;
- while (J > 0 && compactPtrGroup(Cur) < compactPtrGroup(Array[J - 1])) {
+ while (J > 0 &&
+ compactPtrGroupBase(Cur) < compactPtrGroupBase(Array[J - 1])) {
Array[J] = Array[J - 1];
--J;
}
@@ -173,14 +188,14 @@
}
ScopedLock L(Sci->Mutex);
- pushBlocksImpl(C, ClassId, Array, Size, SameGroup);
+ pushBlocksImpl(C, ClassId, Sci, Array, Size, SameGroup);
Sci->Stats.PushedBlocks += Size;
if (ClassId != SizeClassMap::BatchClassId)
releaseToOSMaybe(Sci, ClassId);
}
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
// The BatchClassId must be locked last since other classes can use it.
for (sptr I = static_cast<sptr>(NumClasses) - 1; I >= 0; I--) {
if (static_cast<uptr>(I) == SizeClassMap::BatchClassId)
@@ -189,11 +204,11 @@
}
getSizeClassInfo(SizeClassMap::BatchClassId)->Mutex.lock();
RegionsStashMutex.lock();
- PossibleRegions.disable();
+ ByteMapMutex.lock();
}
- void enable() {
- PossibleRegions.enable();
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
+ ByteMapMutex.unlock();
RegionsStashMutex.unlock();
getSizeClassInfo(SizeClassMap::BatchClassId)->Mutex.unlock();
for (uptr I = 0; I < NumClasses; I++) {
@@ -207,12 +222,20 @@
uptr MinRegionIndex = NumRegions, MaxRegionIndex = 0;
for (uptr I = 0; I < NumClasses; I++) {
SizeClassInfo *Sci = getSizeClassInfo(I);
+ // TODO: The call of `iterateOverBlocks` requires disabling
+ // SizeClassAllocator32. We may consider locking each region on demand
+ // only.
+ Sci->Mutex.assertHeld();
if (Sci->MinRegionIndex < MinRegionIndex)
MinRegionIndex = Sci->MinRegionIndex;
if (Sci->MaxRegionIndex > MaxRegionIndex)
MaxRegionIndex = Sci->MaxRegionIndex;
}
- for (uptr I = MinRegionIndex; I <= MaxRegionIndex; I++)
+
+ // SizeClassAllocator32 is disabled, i.e., ByteMapMutex is held.
+ ByteMapMutex.assertHeld();
+
+ for (uptr I = MinRegionIndex; I <= MaxRegionIndex; I++) {
if (PossibleRegions[I] &&
(PossibleRegions[I] - 1U) != SizeClassMap::BatchClassId) {
const uptr BlockSize = getSizeByClassId(PossibleRegions[I] - 1U);
@@ -221,6 +244,7 @@
for (uptr Block = From; Block < To; Block += BlockSize)
Callback(Block);
}
+ }
}
void getStats(ScopedString *Str) {
@@ -230,6 +254,7 @@
uptr PushedBlocks = 0;
for (uptr I = 0; I < NumClasses; I++) {
SizeClassInfo *Sci = getSizeClassInfo(I);
+ ScopedLock L(Sci->Mutex);
TotalMapped += Sci->AllocatedUser;
PoppedBlocks += Sci->Stats.PoppedBlocks;
PushedBlocks += Sci->Stats.PushedBlocks;
@@ -237,8 +262,11 @@
Str->append("Stats: SizeClassAllocator32: %zuM mapped in %zu allocations; "
"remains %zu\n",
TotalMapped >> 20, PoppedBlocks, PoppedBlocks - PushedBlocks);
- for (uptr I = 0; I < NumClasses; I++)
- getStats(Str, I, 0);
+ for (uptr I = 0; I < NumClasses; I++) {
+ SizeClassInfo *Sci = getSizeClassInfo(I);
+ ScopedLock L(Sci->Mutex);
+ getStats(Str, I, Sci, 0);
+ }
}
bool setOption(Option O, sptr Value) {
@@ -253,14 +281,14 @@
return true;
}
- uptr releaseToOS() {
+ uptr releaseToOS(ReleaseToOS ReleaseType) {
uptr TotalReleasedBytes = 0;
for (uptr I = 0; I < NumClasses; I++) {
if (I == SizeClassMap::BatchClassId)
continue;
SizeClassInfo *Sci = getSizeClassInfo(I);
ScopedLock L(Sci->Mutex);
- TotalReleasedBytes += releaseToOSMaybe(Sci, I, /*Force=*/true);
+ TotalReleasedBytes += releaseToOSMaybe(Sci, I, ReleaseType);
}
return TotalReleasedBytes;
}
@@ -289,7 +317,7 @@
};
struct ReleaseToOsInfo {
- uptr PushedBlocksAtLastRelease;
+ uptr BytesInFreeListAtLastCheckpoint;
uptr RangesReleased;
uptr LastReleasedBytes;
u64 LastReleaseAtNs;
@@ -297,17 +325,17 @@
struct alignas(SCUDO_CACHE_LINE_SIZE) SizeClassInfo {
HybridMutex Mutex;
- SinglyLinkedList<BatchGroup> FreeList;
- uptr CurrentRegion;
- uptr CurrentRegionAllocated;
- SizeClassStats Stats;
+ SinglyLinkedList<BatchGroup> FreeList GUARDED_BY(Mutex);
+ uptr CurrentRegion GUARDED_BY(Mutex);
+ uptr CurrentRegionAllocated GUARDED_BY(Mutex);
+ SizeClassStats Stats GUARDED_BY(Mutex);
u32 RandState;
- uptr AllocatedUser;
+ uptr AllocatedUser GUARDED_BY(Mutex);
// Lowest & highest region index allocated for this size class, to avoid
// looping through the whole NumRegions.
- uptr MinRegionIndex;
- uptr MaxRegionIndex;
- ReleaseToOsInfo ReleaseInfo;
+ uptr MinRegionIndex GUARDED_BY(Mutex);
+ uptr MaxRegionIndex GUARDED_BY(Mutex);
+ ReleaseToOsInfo ReleaseInfo GUARDED_BY(Mutex);
};
static_assert(sizeof(SizeClassInfo) % SCUDO_CACHE_LINE_SIZE == 0, "");
@@ -332,17 +360,22 @@
else
MapSize = RegionSize;
} else {
- Region = roundUpTo(MapBase, RegionSize);
+ Region = roundUp(MapBase, RegionSize);
unmap(reinterpret_cast<void *>(MapBase), Region - MapBase);
MapSize = RegionSize;
}
const uptr End = Region + MapSize;
if (End != MapEnd)
unmap(reinterpret_cast<void *>(End), MapEnd - End);
+
+ DCHECK_EQ(Region % RegionSize, 0U);
+ static_assert(Config::PrimaryRegionSizeLog == GroupSizeLog,
+ "Memory group should be the same size as Region");
+
return Region;
}
- uptr allocateRegion(SizeClassInfo *Sci, uptr ClassId) {
+ uptr allocateRegion(SizeClassInfo *Sci, uptr ClassId) REQUIRES(Sci->Mutex) {
DCHECK_LT(ClassId, NumClasses);
uptr Region = 0;
{
@@ -359,6 +392,7 @@
Sci->MinRegionIndex = RegionIndex;
if (RegionIndex > Sci->MaxRegionIndex)
Sci->MaxRegionIndex = RegionIndex;
+ ScopedLock L(ByteMapMutex);
PossibleRegions.set(RegionIndex, static_cast<u8>(ClassId + 1U));
}
return Region;
@@ -386,25 +420,51 @@
// Use `SameGroup=true` to indicate that all blocks in the array are from the
// same group then we will skip checking the group id of each block.
//
- // Note that this aims to have a better management of dirty pages, i.e., the
- // RSS usage won't grow indefinitely. There's an exception that we may not put
- // a block to its associated group. While populating new blocks, we may have
- // blocks cross different groups. However, most cases will fall into same
- // group and they are supposed to be popped soon. In that case, it's not worth
- // sorting the array with the almost-sorted property. Therefore, we use
- // `SameGroup=true` instead.
- //
// The region mutex needs to be held while calling this method.
- void pushBlocksImpl(CacheT *C, uptr ClassId, CompactPtrT *Array, u32 Size,
- bool SameGroup = false) {
+ void pushBlocksImpl(CacheT *C, uptr ClassId, SizeClassInfo *Sci,
+ CompactPtrT *Array, u32 Size, bool SameGroup = false)
+ REQUIRES(Sci->Mutex) {
DCHECK_GT(Size, 0U);
- SizeClassInfo *Sci = getSizeClassInfo(ClassId);
- auto CreateGroup = [&](uptr GroupId) {
+ auto CreateGroup = [&](uptr CompactPtrGroupBase) {
BatchGroup *BG = nullptr;
TransferBatch *TB = nullptr;
if (ClassId == SizeClassMap::BatchClassId) {
DCHECK_GE(Size, 2U);
+
+ // Free blocks are recorded by TransferBatch in freelist, blocks of
+ // BatchClassId are included. In order not to use additional memory to
+ // record blocks of BatchClassId, they are self-contained. I.e., A
+ // TransferBatch may record the block address of itself. See the figure
+ // below:
+ //
+ // TransferBatch at 0xABCD
+ // +----------------------------+
+ // | Free blocks' addr |
+ // | +------+------+------+ |
+ // | |0xABCD|... |... | |
+ // | +------+------+------+ |
+ // +----------------------------+
+ //
+ // The safeness of manipulating TransferBatch is kept by the invariant,
+ //
+ // The unit of each pop-block request is a TransferBatch. Return
+ // part of the blocks in a TransferBatch is not allowed.
+ //
+ // This ensures that TransferBatch won't leak the address itself while
+ // it's still holding other valid data.
+ //
+ // Besides, BatchGroup uses the same size-class as TransferBatch does
+ // and its address is recorded in the TransferBatch too. To maintain the
+ // safeness, the invariant to keep is,
+ //
+ // The address of itself is always recorded in the last TransferBatch
+ // of the freelist (also imply that the freelist should only be
+ // updated with push_front). Once the last TransferBatch is popped,
+ // the BatchGroup becomes invalid.
+ //
+ // As a result, the blocks used by BatchGroup and TransferBatch are
+ // reusable and don't need additional space for them.
BG = reinterpret_cast<BatchGroup *>(
decompactPtr(ClassId, Array[Size - 1]));
BG->Batches.clear();
@@ -412,6 +472,11 @@
TB = reinterpret_cast<TransferBatch *>(
decompactPtr(ClassId, Array[Size - 2]));
TB->clear();
+
+ // Append the blocks used by BatchGroup and TransferBatch immediately so
+ // that we ensure that they are in the last TransBatch.
+ TB->appendFromArray(Array + Size - 2, 2);
+ Size -= 2;
} else {
BG = C->createGroup();
BG->Batches.clear();
@@ -420,10 +485,11 @@
TB->clear();
}
- BG->GroupId = GroupId;
+ BG->CompactPtrGroupBase = CompactPtrGroupBase;
+ // TODO(chiahungduan): Avoid the use of push_back() in `Batches`.
BG->Batches.push_front(TB);
BG->PushedBlocks = 0;
- BG->PushedBlocksAtLastCheckpoint = 0;
+ BG->BytesInBGAtLastCheckpoint = 0;
BG->MaxCachedPerBatch =
TransferBatch::getMaxCached(getSizeByClassId(ClassId));
@@ -461,7 +527,7 @@
if (ClassId == SizeClassMap::BatchClassId) {
if (Cur == nullptr) {
// Don't need to classify BatchClassId.
- Cur = CreateGroup(/*GroupId=*/0);
+ Cur = CreateGroup(/*CompactPtrGroupBase=*/0);
Sci->FreeList.push_front(Cur);
}
InsertBlocks(Cur, Array, Size);
@@ -472,13 +538,15 @@
// will be pushed next. `Prev` is the element right before `Cur`.
BatchGroup *Prev = nullptr;
- while (Cur != nullptr && compactPtrGroup(Array[0]) > Cur->GroupId) {
+ while (Cur != nullptr &&
+ compactPtrGroupBase(Array[0]) > Cur->CompactPtrGroupBase) {
Prev = Cur;
Cur = Cur->Next;
}
- if (Cur == nullptr || compactPtrGroup(Array[0]) != Cur->GroupId) {
- Cur = CreateGroup(compactPtrGroup(Array[0]));
+ if (Cur == nullptr ||
+ compactPtrGroupBase(Array[0]) != Cur->CompactPtrGroupBase) {
+ Cur = CreateGroup(compactPtrGroupBase(Array[0]));
if (Prev == nullptr)
Sci->FreeList.push_front(Cur);
else
@@ -488,6 +556,9 @@
// All the blocks are from the same group, just push without checking group
// id.
if (SameGroup) {
+ for (u32 I = 0; I < Size; ++I)
+ DCHECK_EQ(compactPtrGroupBase(Array[I]), Cur->CompactPtrGroupBase);
+
InsertBlocks(Cur, Array, Size);
return;
}
@@ -496,17 +567,19 @@
// push them to their group together.
u32 Count = 1;
for (u32 I = 1; I < Size; ++I) {
- if (compactPtrGroup(Array[I - 1]) != compactPtrGroup(Array[I])) {
- DCHECK_EQ(compactPtrGroup(Array[I - 1]), Cur->GroupId);
+ if (compactPtrGroupBase(Array[I - 1]) != compactPtrGroupBase(Array[I])) {
+ DCHECK_EQ(compactPtrGroupBase(Array[I - 1]), Cur->CompactPtrGroupBase);
InsertBlocks(Cur, Array + I - Count, Count);
- while (Cur != nullptr && compactPtrGroup(Array[I]) > Cur->GroupId) {
+ while (Cur != nullptr &&
+ compactPtrGroupBase(Array[I]) > Cur->CompactPtrGroupBase) {
Prev = Cur;
Cur = Cur->Next;
}
- if (Cur == nullptr || compactPtrGroup(Array[I]) != Cur->GroupId) {
- Cur = CreateGroup(compactPtrGroup(Array[I]));
+ if (Cur == nullptr ||
+ compactPtrGroupBase(Array[I]) != Cur->CompactPtrGroupBase) {
+ Cur = CreateGroup(compactPtrGroupBase(Array[I]));
DCHECK_NE(Prev, nullptr);
Sci->FreeList.insert(Prev, Cur);
}
@@ -524,8 +597,8 @@
// group id will be considered first.
//
// The region mutex needs to be held while calling this method.
- TransferBatch *popBatchImpl(CacheT *C, uptr ClassId) {
- SizeClassInfo *Sci = getSizeClassInfo(ClassId);
+ TransferBatch *popBatchImpl(CacheT *C, uptr ClassId, SizeClassInfo *Sci)
+ REQUIRES(Sci->Mutex) {
if (Sci->FreeList.empty())
return nullptr;
@@ -553,7 +626,8 @@
return B;
}
- NOINLINE bool populateFreeList(CacheT *C, uptr ClassId, SizeClassInfo *Sci) {
+ NOINLINE bool populateFreeList(CacheT *C, uptr ClassId, SizeClassInfo *Sci)
+ REQUIRES(Sci->Mutex) {
uptr Region;
uptr Offset;
// If the size-class currently has a region associated to it, use it. The
@@ -598,18 +672,28 @@
uptr P = Region + Offset;
for (u32 I = 0; I < NumberOfBlocks; I++, P += Size)
ShuffleArray[I] = reinterpret_cast<CompactPtrT>(P);
- // No need to shuffle the batches size class.
- if (ClassId != SizeClassMap::BatchClassId)
- shuffle(ShuffleArray, NumberOfBlocks, &Sci->RandState);
- for (u32 I = 0; I < NumberOfBlocks;) {
- // `MaxCount` is u16 so the result will also fit in u16.
- const u16 N = static_cast<u16>(Min<u32>(MaxCount, NumberOfBlocks - I));
- // Note that the N blocks here may have different group ids. Given that
- // it only happens when it crosses the group size boundary. Instead of
- // sorting them, treat them as same group here to avoid sorting the
- // almost-sorted blocks.
- pushBlocksImpl(C, ClassId, &ShuffleArray[I], N, /*SameGroup=*/true);
- I += N;
+
+ if (ClassId != SizeClassMap::BatchClassId) {
+ u32 N = 1;
+ uptr CurGroup = compactPtrGroupBase(ShuffleArray[0]);
+ for (u32 I = 1; I < NumberOfBlocks; I++) {
+ if (UNLIKELY(compactPtrGroupBase(ShuffleArray[I]) != CurGroup)) {
+ shuffle(ShuffleArray + I - N, N, &Sci->RandState);
+ pushBlocksImpl(C, ClassId, Sci, ShuffleArray + I - N, N,
+ /*SameGroup=*/true);
+ N = 1;
+ CurGroup = compactPtrGroupBase(ShuffleArray[I]);
+ } else {
+ ++N;
+ }
+ }
+
+ shuffle(ShuffleArray + NumberOfBlocks - N, N, &Sci->RandState);
+ pushBlocksImpl(C, ClassId, Sci, &ShuffleArray[NumberOfBlocks - N], N,
+ /*SameGroup=*/true);
+ } else {
+ pushBlocksImpl(C, ClassId, Sci, ShuffleArray, NumberOfBlocks,
+ /*SameGroup=*/true);
}
const uptr AllocatedUser = Size * NumberOfBlocks;
@@ -629,8 +713,8 @@
return true;
}
- void getStats(ScopedString *Str, uptr ClassId, uptr Rss) {
- SizeClassInfo *Sci = getSizeClassInfo(ClassId);
+ void getStats(ScopedString *Str, uptr ClassId, SizeClassInfo *Sci, uptr Rss)
+ REQUIRES(Sci->Mutex) {
if (Sci->AllocatedUser == 0)
return;
const uptr InUse = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks;
@@ -643,7 +727,8 @@
}
NOINLINE uptr releaseToOSMaybe(SizeClassInfo *Sci, uptr ClassId,
- bool Force = false) {
+ ReleaseToOS ReleaseType = ReleaseToOS::Normal)
+ REQUIRES(Sci->Mutex) {
const uptr BlockSize = getSizeByClassId(ClassId);
const uptr PageSize = getPageSizeCached();
@@ -651,30 +736,57 @@
const uptr BytesInFreeList =
Sci->AllocatedUser -
(Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks) * BlockSize;
- if (BytesInFreeList < PageSize)
- return 0; // No chance to release anything.
- const uptr BytesPushed =
- (Sci->Stats.PushedBlocks - Sci->ReleaseInfo.PushedBlocksAtLastRelease) *
- BlockSize;
- if (BytesPushed < PageSize)
- return 0; // Nothing new to release.
- const bool CheckDensity = BlockSize < PageSize / 16U;
+ bool MaySkip = false;
+
+ if (BytesInFreeList <= Sci->ReleaseInfo.BytesInFreeListAtLastCheckpoint) {
+ Sci->ReleaseInfo.BytesInFreeListAtLastCheckpoint = BytesInFreeList;
+ MaySkip = true;
+ }
+
+ // Always update `BytesInFreeListAtLastCheckpoint` with the smallest value
+ // so that we won't underestimate the releasable pages. For example, the
+ // following is the region usage,
+ //
+ // BytesInFreeListAtLastCheckpoint AllocatedUser
+ // v v
+ // |--------------------------------------->
+ // ^ ^
+ // BytesInFreeList ReleaseThreshold
+ //
+ // In general, if we have collected enough bytes and the amount of free
+ // bytes meets the ReleaseThreshold, we will try to do page release. If we
+ // don't update `BytesInFreeListAtLastCheckpoint` when the current
+ // `BytesInFreeList` is smaller, we may take longer time to wait for enough
+ // freed blocks because we miss the bytes between
+ // (BytesInFreeListAtLastCheckpoint - BytesInFreeList).
+ const uptr PushedBytesDelta =
+ BytesInFreeList - Sci->ReleaseInfo.BytesInFreeListAtLastCheckpoint;
+ if (PushedBytesDelta < PageSize)
+ MaySkip = true;
+
+ const bool CheckDensity =
+ BlockSize < PageSize / 16U && ReleaseType != ReleaseToOS::ForceAll;
// Releasing smaller blocks is expensive, so we want to make sure that a
// significant amount of bytes are free, and that there has been a good
// amount of batches pushed to the freelist before attempting to release.
if (CheckDensity) {
- if (!Force && BytesPushed < Sci->AllocatedUser / 16U)
- return 0;
+ if (ReleaseType == ReleaseToOS::Normal &&
+ PushedBytesDelta < Sci->AllocatedUser / 16U) {
+ MaySkip = true;
+ }
}
- if (!Force) {
+ if (MaySkip && ReleaseType != ReleaseToOS::ForceAll)
+ return 0;
+
+ if (ReleaseType == ReleaseToOS::Normal) {
const s32 IntervalMs = atomic_load_relaxed(&ReleaseToOsIntervalMs);
if (IntervalMs < 0)
return 0;
if (Sci->ReleaseInfo.LastReleaseAtNs +
static_cast<u64>(IntervalMs) * 1000000 >
- getMonotonicTime()) {
+ getMonotonicTimeFast()) {
return 0; // Memory was returned recently.
}
}
@@ -687,24 +799,24 @@
const uptr Base = First * RegionSize;
const uptr NumberOfRegions = Last - First + 1U;
const uptr GroupSize = (1U << GroupSizeLog);
- const uptr CurRegionGroupId =
- compactPtrGroup(compactPtr(ClassId, Sci->CurrentRegion));
+ const uptr CurGroupBase =
+ compactPtrGroupBase(compactPtr(ClassId, Sci->CurrentRegion));
ReleaseRecorder Recorder(Base);
- PageReleaseContext Context(BlockSize, RegionSize, NumberOfRegions);
+ PageReleaseContext Context(BlockSize, NumberOfRegions,
+ /*ReleaseSize=*/RegionSize);
auto DecompactPtr = [](CompactPtrT CompactPtr) {
return reinterpret_cast<uptr>(CompactPtr);
};
for (BatchGroup &BG : Sci->FreeList) {
- const uptr PushedBytesDelta =
- BG.PushedBlocks - BG.PushedBlocksAtLastCheckpoint;
- if (PushedBytesDelta * BlockSize < PageSize)
- continue;
-
- uptr AllocatedGroupSize = BG.GroupId == CurRegionGroupId
+ const uptr GroupBase = decompactGroupBase(BG.CompactPtrGroupBase);
+ // The `GroupSize` may not be divided by `BlockSize`, which means there is
+ // an unused space at the end of Region. Exclude that space to avoid
+ // unused page map entry.
+ uptr AllocatedGroupSize = GroupBase == CurGroupBase
? Sci->CurrentRegionAllocated
- : GroupSize;
+ : roundDownSlow(GroupSize, BlockSize);
if (AllocatedGroupSize == 0)
continue;
@@ -713,6 +825,16 @@
const uptr NumBlocks = (BG.Batches.size() - 1) * BG.MaxCachedPerBatch +
BG.Batches.front()->getCount();
const uptr BytesInBG = NumBlocks * BlockSize;
+
+ if (ReleaseType != ReleaseToOS::ForceAll &&
+ BytesInBG <= BG.BytesInBGAtLastCheckpoint) {
+ BG.BytesInBGAtLastCheckpoint = BytesInBG;
+ continue;
+ }
+ const uptr PushedBytesDelta = BytesInBG - BG.BytesInBGAtLastCheckpoint;
+ if (PushedBytesDelta < PageSize)
+ continue;
+
// Given the randomness property, we try to release the pages only if the
// bytes used by free blocks exceed certain proportion of allocated
// spaces.
@@ -721,42 +843,65 @@
continue;
}
- BG.PushedBlocksAtLastCheckpoint = BG.PushedBlocks;
- // Note that we don't always visit blocks in each BatchGroup so that we
- // may miss the chance of releasing certain pages that cross BatchGroups.
- Context.markFreeBlocks(BG.Batches, DecompactPtr, Base);
+ // TODO: Consider updating this after page release if `ReleaseRecorder`
+ // can tell the releasd bytes in each group.
+ BG.BytesInBGAtLastCheckpoint = BytesInBG;
+
+ const uptr MaxContainedBlocks = AllocatedGroupSize / BlockSize;
+ const uptr RegionIndex = (GroupBase - Base) / RegionSize;
+
+ if (NumBlocks == MaxContainedBlocks) {
+ for (const auto &It : BG.Batches)
+ for (u16 I = 0; I < It.getCount(); ++I)
+ DCHECK_EQ(compactPtrGroupBase(It.get(I)), BG.CompactPtrGroupBase);
+
+ const uptr To = GroupBase + AllocatedGroupSize;
+ Context.markRangeAsAllCounted(GroupBase, To, GroupBase, RegionIndex,
+ AllocatedGroupSize);
+ } else {
+ DCHECK_LT(NumBlocks, MaxContainedBlocks);
+
+ // Note that we don't always visit blocks in each BatchGroup so that we
+ // may miss the chance of releasing certain pages that cross
+ // BatchGroups.
+ Context.markFreeBlocksInRegion(BG.Batches, DecompactPtr, GroupBase,
+ RegionIndex, AllocatedGroupSize,
+ /*MayContainLastBlockInRegion=*/true);
+ }
}
if (!Context.hasBlockMarked())
return 0;
auto SkipRegion = [this, First, ClassId](uptr RegionIndex) {
+ ScopedLock L(ByteMapMutex);
return (PossibleRegions[First + RegionIndex] - 1U) != ClassId;
};
releaseFreeMemoryToOS(Context, Recorder, SkipRegion);
if (Recorder.getReleasedRangesCount() > 0) {
- Sci->ReleaseInfo.PushedBlocksAtLastRelease = Sci->Stats.PushedBlocks;
+ Sci->ReleaseInfo.BytesInFreeListAtLastCheckpoint = BytesInFreeList;
Sci->ReleaseInfo.RangesReleased += Recorder.getReleasedRangesCount();
Sci->ReleaseInfo.LastReleasedBytes = Recorder.getReleasedBytes();
TotalReleasedBytes += Sci->ReleaseInfo.LastReleasedBytes;
}
- Sci->ReleaseInfo.LastReleaseAtNs = getMonotonicTime();
+ Sci->ReleaseInfo.LastReleaseAtNs = getMonotonicTimeFast();
return TotalReleasedBytes;
}
SizeClassInfo SizeClassInfoArray[NumClasses] = {};
+ HybridMutex ByteMapMutex;
// Track the regions in use, 0 is unused, otherwise store ClassId + 1.
- ByteMap PossibleRegions = {};
+ ByteMap PossibleRegions GUARDED_BY(ByteMapMutex) = {};
atomic_s32 ReleaseToOsIntervalMs = {};
// Unless several threads request regions simultaneously from different size
// classes, the stash rarely contains more than 1 entry.
static constexpr uptr MaxStashedRegions = 4;
HybridMutex RegionsStashMutex;
- uptr NumberOfStashedRegions = 0;
- uptr RegionsStash[MaxStashedRegions] = {};
+ uptr NumberOfStashedRegions GUARDED_BY(RegionsStashMutex) = 0;
+ uptr RegionsStash[MaxStashedRegions] GUARDED_BY(RegionsStashMutex) = {};
};
} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary64.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary64.h
index b653bc8..4ea1ba3 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary64.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/primary64.h
@@ -13,11 +13,13 @@
#include "common.h"
#include "list.h"
#include "local_cache.h"
+#include "mem_map.h"
#include "memtag.h"
#include "options.h"
#include "release.h"
#include "stats.h"
#include "string_utils.h"
+#include "thread_annotations.h"
namespace scudo {
@@ -46,6 +48,7 @@
typedef typename Config::PrimaryCompactPtrT CompactPtrT;
static const uptr CompactPtrScale = Config::PrimaryCompactPtrScale;
static const uptr GroupSizeLog = Config::PrimaryGroupSizeLog;
+ static const uptr GroupScale = GroupSizeLog - CompactPtrScale;
typedef typename Config::SizeClassMap SizeClassMap;
typedef SizeClassAllocator64<Config> ThisT;
typedef SizeClassAllocatorLocalCache<ThisT> CacheT;
@@ -54,63 +57,132 @@
static uptr getSizeByClassId(uptr ClassId) {
return (ClassId == SizeClassMap::BatchClassId)
- ? roundUpTo(sizeof(TransferBatch), 1U << CompactPtrScale)
+ ? roundUp(sizeof(TransferBatch), 1U << CompactPtrScale)
: SizeClassMap::getSizeByClassId(ClassId);
}
static bool canAllocate(uptr Size) { return Size <= SizeClassMap::MaxSize; }
- void init(s32 ReleaseToOsInterval) {
+ void init(s32 ReleaseToOsInterval) NO_THREAD_SAFETY_ANALYSIS {
DCHECK(isAligned(reinterpret_cast<uptr>(this), alignof(ThisT)));
- DCHECK_EQ(PrimaryBase, 0U);
+
+ const uptr PageSize = getPageSizeCached();
+ const uptr GroupSize = (1U << GroupSizeLog);
+ const uptr PagesInGroup = GroupSize / PageSize;
+ const uptr MinSizeClass = getSizeByClassId(1);
+ // When trying to release pages back to memory, visiting smaller size
+ // classes is expensive. Therefore, we only try to release smaller size
+ // classes when the amount of free blocks goes over a certain threshold (See
+ // the comment in releaseToOSMaybe() for more details). For example, for
+ // size class 32, we only do the release when the size of free blocks is
+ // greater than 97% of pages in a group. However, this may introduce another
+ // issue that if the number of free blocks is bouncing between 97% ~ 100%.
+ // Which means we may try many page releases but only release very few of
+ // them (less than 3% in a group). Even though we have
+ // `&ReleaseToOsIntervalMs` which slightly reduce the frequency of these
+ // calls but it will be better to have another guard to mitigate this issue.
+ //
+ // Here we add another constraint on the minimum size requirement. The
+ // constraint is determined by the size of in-use blocks in the minimal size
+ // class. Take size class 32 as an example,
+ //
+ // +- one memory group -+
+ // +----------------------+------+
+ // | 97% of free blocks | |
+ // +----------------------+------+
+ // \ /
+ // 3% in-use blocks
+ //
+ // * The release size threshold is 97%.
+ //
+ // The 3% size in a group is about 7 pages. For two consecutive
+ // releaseToOSMaybe(), we require the difference between `PushedBlocks`
+ // should be greater than 7 pages. This mitigates the page releasing
+ // thrashing which is caused by memory usage bouncing around the threshold.
+ // The smallest size class takes longest time to do the page release so we
+ // use its size of in-use blocks as a heuristic.
+ SmallerBlockReleasePageDelta =
+ PagesInGroup * (1 + MinSizeClass / 16U) / 100;
+
// Reserve the space required for the Primary.
- PrimaryBase = reinterpret_cast<uptr>(
- map(nullptr, PrimarySize, nullptr, MAP_NOACCESS, &Data));
+ CHECK(ReservedMemory.create(/*Addr=*/0U, PrimarySize,
+ "scudo:primary_reserve"));
+ PrimaryBase = ReservedMemory.getBase();
+ DCHECK_NE(PrimaryBase, 0U);
u32 Seed;
- const u64 Time = getMonotonicTime();
+ const u64 Time = getMonotonicTimeFast();
if (!getRandom(reinterpret_cast<void *>(&Seed), sizeof(Seed)))
Seed = static_cast<u32>(Time ^ (PrimaryBase >> 12));
- const uptr PageSize = getPageSizeCached();
+
for (uptr I = 0; I < NumClasses; I++) {
RegionInfo *Region = getRegionInfo(I);
// The actual start of a region is offset by a random number of pages
// when PrimaryEnableRandomOffset is set.
- Region->RegionBeg = getRegionBaseByClassId(I) +
+ Region->RegionBeg = (PrimaryBase + (I << Config::PrimaryRegionSizeLog)) +
(Config::PrimaryEnableRandomOffset
? ((getRandomModN(&Seed, 16) + 1) * PageSize)
: 0);
Region->RandState = getRandomU32(&Seed);
+ // Releasing small blocks is expensive, set a higher threshold to avoid
+ // frequent page releases.
+ if (isSmallBlock(getSizeByClassId(I)))
+ Region->TryReleaseThreshold = PageSize * SmallerBlockReleasePageDelta;
+ else
+ Region->TryReleaseThreshold = PageSize;
Region->ReleaseInfo.LastReleaseAtNs = Time;
}
+ shuffle(RegionInfoArray, NumClasses, &Seed);
+
setOption(Option::ReleaseInterval, static_cast<sptr>(ReleaseToOsInterval));
}
- void unmapTestOnly() {
+ void unmapTestOnly() NO_THREAD_SAFETY_ANALYSIS {
for (uptr I = 0; I < NumClasses; I++) {
RegionInfo *Region = getRegionInfo(I);
*Region = {};
}
if (PrimaryBase)
- unmap(reinterpret_cast<void *>(PrimaryBase), PrimarySize, UNMAP_ALL,
- &Data);
+ ReservedMemory.release();
PrimaryBase = 0U;
}
TransferBatch *popBatch(CacheT *C, uptr ClassId) {
DCHECK_LT(ClassId, NumClasses);
RegionInfo *Region = getRegionInfo(ClassId);
- ScopedLock L(Region->Mutex);
- TransferBatch *B = popBatchImpl(C, ClassId);
- if (UNLIKELY(!B)) {
- if (UNLIKELY(!populateFreeList(C, ClassId, Region)))
- return nullptr;
- B = popBatchImpl(C, ClassId);
- // if `populateFreeList` succeeded, we are supposed to get free blocks.
- DCHECK_NE(B, nullptr);
+ bool PrintStats = false;
+ {
+ ScopedLock L(Region->Mutex);
+ TransferBatch *B = popBatchImpl(C, ClassId, Region);
+ if (LIKELY(B)) {
+ Region->Stats.PoppedBlocks += B->getCount();
+ return B;
+ }
+
+ const bool RegionIsExhausted = Region->Exhausted;
+ if (UNLIKELY(RegionIsExhausted ||
+ !populateFreeList(C, ClassId, Region))) {
+ PrintStats = !RegionIsExhausted && Region->Exhausted;
+ } else {
+ B = popBatchImpl(C, ClassId, Region);
+ // if `populateFreeList` succeeded, we are supposed to get free blocks.
+ DCHECK_NE(B, nullptr);
+ Region->Stats.PoppedBlocks += B->getCount();
+ return B;
+ }
}
- Region->Stats.PoppedBlocks += B->getCount();
- return B;
+
+ // Note that `getStats()` requires locking each region so we can't call it
+ // while locking the Region->Mutex in the above.
+ if (UNLIKELY(PrintStats)) {
+ ScopedString Str;
+ getStats(&Str);
+ Str.append(
+ "Scudo OOM: The process has exhausted %zuM for size class %zu.\n",
+ RegionSize >> 20, getSizeByClassId(ClassId));
+ Str.output();
+ }
+ return nullptr;
}
// Push the array of free blocks to the designated batch group.
@@ -120,17 +192,41 @@
RegionInfo *Region = getRegionInfo(ClassId);
if (ClassId == SizeClassMap::BatchClassId) {
- ScopedLock L(Region->Mutex);
- // Constructing a batch group in the free list will use two blocks in
- // BatchClassId. If we are pushing BatchClassId blocks, we will use the
- // blocks in the array directly (can't delegate local cache which will
- // cause a recursive allocation). However, The number of free blocks may
- // be less than two. Therefore, populate the free list before inserting
- // the blocks.
- if (Size == 1 && UNLIKELY(!populateFreeList(C, ClassId, Region)))
- return;
- pushBlocksImpl(C, ClassId, Array, Size);
- Region->Stats.PushedBlocks += Size;
+ bool PrintStats = false;
+ {
+ ScopedLock L(Region->Mutex);
+ // Constructing a batch group in the free list will use two blocks in
+ // BatchClassId. If we are pushing BatchClassId blocks, we will use the
+ // blocks in the array directly (can't delegate local cache which will
+ // cause a recursive allocation). However, The number of free blocks may
+ // be less than two. Therefore, populate the free list before inserting
+ // the blocks.
+ if (Size >= 2U) {
+ pushBlocksImpl(C, SizeClassMap::BatchClassId, Region, Array, Size);
+ Region->Stats.PushedBlocks += Size;
+ } else {
+ const bool RegionIsExhausted = Region->Exhausted;
+ if (UNLIKELY(
+ RegionIsExhausted ||
+ !populateFreeList(C, SizeClassMap::BatchClassId, Region))) {
+ PrintStats = !RegionIsExhausted && Region->Exhausted;
+ }
+ }
+ }
+
+ // Note that `getStats()` requires the lock of each region so we can't
+ // call it while locking the Region->Mutex in the above.
+ if (UNLIKELY(PrintStats)) {
+ ScopedString Str;
+ getStats(&Str);
+ Str.append(
+ "Scudo OOM: The process has exhausted %zuM for size class %zu.\n",
+ RegionSize >> 20, getSizeByClassId(ClassId));
+ Str.output();
+ // Theoretically, BatchClass shouldn't be used up. Abort immediately
+ // when it happens.
+ reportOutOfBatchClass();
+ }
return;
}
@@ -153,14 +249,14 @@
}
ScopedLock L(Region->Mutex);
- pushBlocksImpl(C, ClassId, Array, Size, SameGroup);
+ pushBlocksImpl(C, ClassId, Region, Array, Size, SameGroup);
Region->Stats.PushedBlocks += Size;
if (ClassId != SizeClassMap::BatchClassId)
releaseToOSMaybe(Region, ClassId);
}
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
// The BatchClassId must be locked last since other classes can use it.
for (sptr I = static_cast<sptr>(NumClasses) - 1; I >= 0; I--) {
if (static_cast<uptr>(I) == SizeClassMap::BatchClassId)
@@ -170,7 +266,7 @@
getRegionInfo(SizeClassMap::BatchClassId)->Mutex.lock();
}
- void enable() {
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
getRegionInfo(SizeClassMap::BatchClassId)->Mutex.unlock();
for (uptr I = 0; I < NumClasses; I++) {
if (I == SizeClassMap::BatchClassId)
@@ -183,7 +279,11 @@
for (uptr I = 0; I < NumClasses; I++) {
if (I == SizeClassMap::BatchClassId)
continue;
- const RegionInfo *Region = getRegionInfo(I);
+ RegionInfo *Region = getRegionInfo(I);
+ // TODO: The call of `iterateOverBlocks` requires disabling
+ // SizeClassAllocator64. We may consider locking each region on demand
+ // only.
+ Region->Mutex.assertHeld();
const uptr BlockSize = getSizeByClassId(I);
const uptr From = Region->RegionBeg;
const uptr To = From + Region->AllocatedUser;
@@ -199,6 +299,7 @@
uptr PushedBlocks = 0;
for (uptr I = 0; I < NumClasses; I++) {
RegionInfo *Region = getRegionInfo(I);
+ ScopedLock L(Region->Mutex);
if (Region->MappedUser)
TotalMapped += Region->MappedUser;
PoppedBlocks += Region->Stats.PoppedBlocks;
@@ -209,8 +310,11 @@
TotalMapped >> 20, 0U, PoppedBlocks,
PoppedBlocks - PushedBlocks);
- for (uptr I = 0; I < NumClasses; I++)
- getStats(Str, I, 0);
+ for (uptr I = 0; I < NumClasses; I++) {
+ RegionInfo *Region = getRegionInfo(I);
+ ScopedLock L(Region->Mutex);
+ getStats(Str, I, Region, 0);
+ }
}
bool setOption(Option O, sptr Value) {
@@ -225,14 +329,14 @@
return true;
}
- uptr releaseToOS() {
+ uptr releaseToOS(ReleaseToOS ReleaseType) {
uptr TotalReleasedBytes = 0;
for (uptr I = 0; I < NumClasses; I++) {
if (I == SizeClassMap::BatchClassId)
continue;
RegionInfo *Region = getRegionInfo(I);
ScopedLock L(Region->Mutex);
- TotalReleasedBytes += releaseToOSMaybe(Region, I, /*Force=*/true);
+ TotalReleasedBytes += releaseToOSMaybe(Region, I, ReleaseType);
}
return TotalReleasedBytes;
}
@@ -244,9 +348,6 @@
static uptr getRegionInfoArraySize() { return sizeof(RegionInfoArray); }
uptr getCompactPtrBaseByClassId(uptr ClassId) {
- // If we are not compacting pointers, base everything off of 0.
- if (sizeof(CompactPtrT) == sizeof(uptr) && CompactPtrScale == 0)
- return 0;
return getRegionInfo(ClassId)->RegionBeg;
}
@@ -261,15 +362,23 @@
decompactPtrInternal(getCompactPtrBaseByClassId(ClassId), CompactPtr));
}
- static BlockInfo findNearestBlock(const char *RegionInfoData, uptr Ptr) {
+ static BlockInfo findNearestBlock(const char *RegionInfoData,
+ uptr Ptr) NO_THREAD_SAFETY_ANALYSIS {
const RegionInfo *RegionInfoArray =
reinterpret_cast<const RegionInfo *>(RegionInfoData);
+
uptr ClassId;
uptr MinDistance = -1UL;
for (uptr I = 0; I != NumClasses; ++I) {
if (I == SizeClassMap::BatchClassId)
continue;
uptr Begin = RegionInfoArray[I].RegionBeg;
+ // TODO(chiahungduan): In fact, We need to lock the RegionInfo::Mutex.
+ // However, the RegionInfoData is passed with const qualifier and lock the
+ // mutex requires modifying RegionInfoData, which means we need to remove
+ // the const qualifier. This may lead to another undefined behavior (The
+ // first one is accessing `AllocatedUser` without locking. It's better to
+ // pass `RegionInfoData` as `void *` then we can lock the mutex properly.
uptr End = Begin + RegionInfoArray[I].AllocatedUser;
if (Begin > End || End - Begin < SizeClassMap::getSizeByClassId(I))
continue;
@@ -322,7 +431,7 @@
};
struct ReleaseToOsInfo {
- uptr PushedBlocksAtLastRelease;
+ uptr BytesInFreeListAtLastCheckpoint;
uptr RangesReleased;
uptr LastReleasedBytes;
u64 LastReleaseAtNs;
@@ -330,15 +439,20 @@
struct UnpaddedRegionInfo {
HybridMutex Mutex;
- SinglyLinkedList<BatchGroup> FreeList;
+ SinglyLinkedList<BatchGroup> FreeList GUARDED_BY(Mutex);
+ // This is initialized before thread creation.
uptr RegionBeg = 0;
- RegionStats Stats = {};
- u32 RandState = 0;
- uptr MappedUser = 0; // Bytes mapped for user memory.
- uptr AllocatedUser = 0; // Bytes allocated for user memory.
- MapPlatformData Data = {};
- ReleaseToOsInfo ReleaseInfo = {};
- bool Exhausted = false;
+ RegionStats Stats GUARDED_BY(Mutex) = {};
+ u32 RandState GUARDED_BY(Mutex) = 0;
+ // Bytes mapped for user memory.
+ uptr MappedUser GUARDED_BY(Mutex) = 0;
+ // Bytes allocated for user memory.
+ uptr AllocatedUser GUARDED_BY(Mutex) = 0;
+ // The minimum size of pushed blocks to trigger page release.
+ uptr TryReleaseThreshold GUARDED_BY(Mutex) = 0;
+ MemMapT MemMap = {};
+ ReleaseToOsInfo ReleaseInfo GUARDED_BY(Mutex) = {};
+ bool Exhausted GUARDED_BY(Mutex) = false;
};
struct RegionInfo : UnpaddedRegionInfo {
char Padding[SCUDO_CACHE_LINE_SIZE -
@@ -346,8 +460,13 @@
};
static_assert(sizeof(RegionInfo) % SCUDO_CACHE_LINE_SIZE == 0, "");
+ // TODO: `PrimaryBase` can be obtained from ReservedMemory. This needs to be
+ // deprecated.
uptr PrimaryBase = 0;
- MapPlatformData Data = {};
+ ReservedMemoryT ReservedMemory = {};
+ // The minimum size of pushed blocks that we will try to release the pages in
+ // that size class.
+ uptr SmallerBlockReleasePageDelta = 0;
atomic_s32 ReleaseToOsIntervalMs = {};
alignas(SCUDO_CACHE_LINE_SIZE) RegionInfo RegionInfoArray[NumClasses];
@@ -356,8 +475,10 @@
return &RegionInfoArray[ClassId];
}
- uptr getRegionBaseByClassId(uptr ClassId) const {
- return PrimaryBase + (ClassId << Config::PrimaryRegionSizeLog);
+ uptr getRegionBaseByClassId(uptr ClassId) {
+ return roundDown(getRegionInfo(ClassId)->RegionBeg - PrimaryBase,
+ RegionSize) +
+ PrimaryBase;
}
static CompactPtrT compactPtrInternal(uptr Base, uptr Ptr) {
@@ -369,10 +490,17 @@
}
static uptr compactPtrGroup(CompactPtrT CompactPtr) {
- return static_cast<uptr>(CompactPtr) >> (GroupSizeLog - CompactPtrScale);
+ const uptr Mask = (static_cast<uptr>(1) << GroupScale) - 1;
+ return static_cast<uptr>(CompactPtr) & ~Mask;
}
- static uptr batchGroupBase(uptr Base, uptr GroupId) {
- return (GroupId << GroupSizeLog) + Base;
+ static uptr decompactGroupBase(uptr Base, uptr CompactPtrGroupBase) {
+ DCHECK_EQ(CompactPtrGroupBase % (static_cast<uptr>(1) << (GroupScale)), 0U);
+ return Base + (CompactPtrGroupBase << CompactPtrScale);
+ }
+
+ ALWAYS_INLINE static bool isSmallBlock(uptr BlockSize) {
+ const uptr PageSize = getPageSizeCached();
+ return BlockSize < PageSize / 16U;
}
// Push the blocks to their batch group. The layout will be like,
@@ -392,25 +520,51 @@
// Use `SameGroup=true` to indicate that all blocks in the array are from the
// same group then we will skip checking the group id of each block.
//
- // Note that this aims to have a better management of dirty pages, i.e., the
- // RSS usage won't grow indefinitely. There's an exception that we may not put
- // a block to its associated group. While populating new blocks, we may have
- // blocks cross different groups. However, most cases will fall into same
- // group and they are supposed to be popped soon. In that case, it's not worth
- // sorting the array with the almost-sorted property. Therefore, we use
- // `SameGroup=true` instead.
- //
// The region mutex needs to be held while calling this method.
- void pushBlocksImpl(CacheT *C, uptr ClassId, CompactPtrT *Array, u32 Size,
- bool SameGroup = false) {
+ void pushBlocksImpl(CacheT *C, uptr ClassId, RegionInfo *Region,
+ CompactPtrT *Array, u32 Size, bool SameGroup = false)
+ REQUIRES(Region->Mutex) {
DCHECK_GT(Size, 0U);
- RegionInfo *Region = getRegionInfo(ClassId);
- auto CreateGroup = [&](uptr GroupId) {
+ auto CreateGroup = [&](uptr CompactPtrGroupBase) {
BatchGroup *BG = nullptr;
TransferBatch *TB = nullptr;
if (ClassId == SizeClassMap::BatchClassId) {
DCHECK_GE(Size, 2U);
+
+ // Free blocks are recorded by TransferBatch in freelist, blocks of
+ // BatchClassId are included. In order not to use additional memory to
+ // record blocks of BatchClassId, they are self-contained. I.e., A
+ // TransferBatch may record the block address of itself. See the figure
+ // below:
+ //
+ // TransferBatch at 0xABCD
+ // +----------------------------+
+ // | Free blocks' addr |
+ // | +------+------+------+ |
+ // | |0xABCD|... |... | |
+ // | +------+------+------+ |
+ // +----------------------------+
+ //
+ // The safeness of manipulating TransferBatch is kept by the invariant,
+ //
+ // The unit of each pop-block request is a TransferBatch. Return
+ // part of the blocks in a TransferBatch is not allowed.
+ //
+ // This ensures that TransferBatch won't leak the address itself while
+ // it's still holding other valid data.
+ //
+ // Besides, BatchGroup uses the same size-class as TransferBatch does
+ // and its address is recorded in the TransferBatch too. To maintain the
+ // safeness, the invariant to keep is,
+ //
+ // The address of itself is always recorded in the last TransferBatch
+ // of the freelist (also imply that the freelist should only be
+ // updated with push_front). Once the last TransferBatch is popped,
+ // the BatchGroup becomes invalid.
+ //
+ // As a result, the blocks used by BatchGroup and TransferBatch are
+ // reusable and don't need additional space for them.
BG = reinterpret_cast<BatchGroup *>(
decompactPtr(ClassId, Array[Size - 1]));
BG->Batches.clear();
@@ -418,6 +572,11 @@
TB = reinterpret_cast<TransferBatch *>(
decompactPtr(ClassId, Array[Size - 2]));
TB->clear();
+
+ // Append the blocks used by BatchGroup and TransferBatch immediately so
+ // that we ensure that they are in the last TransBatch.
+ TB->appendFromArray(Array + Size - 2, 2);
+ Size -= 2;
} else {
BG = C->createGroup();
BG->Batches.clear();
@@ -426,10 +585,11 @@
TB->clear();
}
- BG->GroupId = GroupId;
+ BG->CompactPtrGroupBase = CompactPtrGroupBase;
+ // TODO(chiahungduan): Avoid the use of push_back() in `Batches`.
BG->Batches.push_front(TB);
BG->PushedBlocks = 0;
- BG->PushedBlocksAtLastCheckpoint = 0;
+ BG->BytesInBGAtLastCheckpoint = 0;
BG->MaxCachedPerBatch =
TransferBatch::getMaxCached(getSizeByClassId(ClassId));
@@ -467,7 +627,7 @@
if (ClassId == SizeClassMap::BatchClassId) {
if (Cur == nullptr) {
// Don't need to classify BatchClassId.
- Cur = CreateGroup(/*GroupId=*/0);
+ Cur = CreateGroup(/*CompactPtrGroupBase=*/0);
Region->FreeList.push_front(Cur);
}
InsertBlocks(Cur, Array, Size);
@@ -478,12 +638,14 @@
// will be pushed next. `Prev` is the element right before `Cur`.
BatchGroup *Prev = nullptr;
- while (Cur != nullptr && compactPtrGroup(Array[0]) > Cur->GroupId) {
+ while (Cur != nullptr &&
+ compactPtrGroup(Array[0]) > Cur->CompactPtrGroupBase) {
Prev = Cur;
Cur = Cur->Next;
}
- if (Cur == nullptr || compactPtrGroup(Array[0]) != Cur->GroupId) {
+ if (Cur == nullptr ||
+ compactPtrGroup(Array[0]) != Cur->CompactPtrGroupBase) {
Cur = CreateGroup(compactPtrGroup(Array[0]));
if (Prev == nullptr)
Region->FreeList.push_front(Cur);
@@ -494,6 +656,9 @@
// All the blocks are from the same group, just push without checking group
// id.
if (SameGroup) {
+ for (u32 I = 0; I < Size; ++I)
+ DCHECK_EQ(compactPtrGroup(Array[I]), Cur->CompactPtrGroupBase);
+
InsertBlocks(Cur, Array, Size);
return;
}
@@ -503,15 +668,17 @@
u32 Count = 1;
for (u32 I = 1; I < Size; ++I) {
if (compactPtrGroup(Array[I - 1]) != compactPtrGroup(Array[I])) {
- DCHECK_EQ(compactPtrGroup(Array[I - 1]), Cur->GroupId);
+ DCHECK_EQ(compactPtrGroup(Array[I - 1]), Cur->CompactPtrGroupBase);
InsertBlocks(Cur, Array + I - Count, Count);
- while (Cur != nullptr && compactPtrGroup(Array[I]) > Cur->GroupId) {
+ while (Cur != nullptr &&
+ compactPtrGroup(Array[I]) > Cur->CompactPtrGroupBase) {
Prev = Cur;
Cur = Cur->Next;
}
- if (Cur == nullptr || compactPtrGroup(Array[I]) != Cur->GroupId) {
+ if (Cur == nullptr ||
+ compactPtrGroup(Array[I]) != Cur->CompactPtrGroupBase) {
Cur = CreateGroup(compactPtrGroup(Array[I]));
DCHECK_NE(Prev, nullptr);
Region->FreeList.insert(Prev, Cur);
@@ -530,8 +697,8 @@
// group id will be considered first.
//
// The region mutex needs to be held while calling this method.
- TransferBatch *popBatchImpl(CacheT *C, uptr ClassId) {
- RegionInfo *Region = getRegionInfo(ClassId);
+ TransferBatch *popBatchImpl(CacheT *C, uptr ClassId, RegionInfo *Region)
+ REQUIRES(Region->Mutex) {
if (Region->FreeList.empty())
return nullptr;
@@ -560,7 +727,8 @@
return B;
}
- NOINLINE bool populateFreeList(CacheT *C, uptr ClassId, RegionInfo *Region) {
+ NOINLINE bool populateFreeList(CacheT *C, uptr ClassId, RegionInfo *Region)
+ REQUIRES(Region->Mutex) {
const uptr Size = getSizeByClassId(ClassId);
const u16 MaxCount = TransferBatch::getMaxCached(Size);
@@ -571,28 +739,30 @@
if (TotalUserBytes > MappedUser) {
// Do the mmap for the user memory.
const uptr MapSize =
- roundUpTo(TotalUserBytes - MappedUser, MapSizeIncrement);
+ roundUp(TotalUserBytes - MappedUser, MapSizeIncrement);
const uptr RegionBase = RegionBeg - getRegionBaseByClassId(ClassId);
if (UNLIKELY(RegionBase + MappedUser + MapSize > RegionSize)) {
- if (!Region->Exhausted) {
- Region->Exhausted = true;
- ScopedString Str;
- getStats(&Str);
- Str.append(
- "Scudo OOM: The process has exhausted %zuM for size class %zu.\n",
- RegionSize >> 20, Size);
- Str.output();
- }
+ Region->Exhausted = true;
return false;
}
- if (MappedUser == 0)
- Region->Data = Data;
- if (UNLIKELY(!map(
- reinterpret_cast<void *>(RegionBeg + MappedUser), MapSize,
- "scudo:primary",
+ // TODO: Consider allocating MemMap in init().
+ if (!Region->MemMap.isAllocated()) {
+ // TODO: Ideally, a region should reserve RegionSize because the memory
+ // between `RegionBeg` and region base is still belong to a region and
+ // it's just not used. In order to make it work on every platform (some
+ // of them don't support `remap()` across the unused range), dispatch
+ // from `RegionBeg` for now.
+ const uptr ReserveSize =
+ RegionSize - (RegionBeg - getRegionBaseByClassId(ClassId));
+ Region->MemMap = ReservedMemory.dispatch(RegionBeg, ReserveSize);
+ }
+ DCHECK(Region->MemMap.isAllocated());
+
+ if (UNLIKELY(!Region->MemMap.remap(
+ RegionBeg + MappedUser, MapSize, "scudo:primary",
MAP_ALLOWNOMEM | MAP_RESIZABLE |
- (useMemoryTagging<Config>(Options.load()) ? MAP_MEMTAG : 0),
- &Region->Data))) {
+ (useMemoryTagging<Config>(Options.load()) ? MAP_MEMTAG
+ : 0)))) {
return false;
}
Region->MappedUser += MapSize;
@@ -613,18 +783,28 @@
uptr P = RegionBeg + Region->AllocatedUser;
for (u32 I = 0; I < NumberOfBlocks; I++, P += Size)
ShuffleArray[I] = compactPtrInternal(CompactPtrBase, P);
- // No need to shuffle the batches size class.
- if (ClassId != SizeClassMap::BatchClassId)
- shuffle(ShuffleArray, NumberOfBlocks, &Region->RandState);
- for (u32 I = 0; I < NumberOfBlocks;) {
- // `MaxCount` is u16 so the result will also fit in u16.
- const u16 N = static_cast<u16>(Min<u32>(MaxCount, NumberOfBlocks - I));
- // Note that the N blocks here may have different group ids. Given that
- // it only happens when it crosses the group size boundary. Instead of
- // sorting them, treat them as same group here to avoid sorting the
- // almost-sorted blocks.
- pushBlocksImpl(C, ClassId, &ShuffleArray[I], N, /*SameGroup=*/true);
- I += N;
+
+ if (ClassId != SizeClassMap::BatchClassId) {
+ u32 N = 1;
+ uptr CurGroup = compactPtrGroup(ShuffleArray[0]);
+ for (u32 I = 1; I < NumberOfBlocks; I++) {
+ if (UNLIKELY(compactPtrGroup(ShuffleArray[I]) != CurGroup)) {
+ shuffle(ShuffleArray + I - N, N, &Region->RandState);
+ pushBlocksImpl(C, ClassId, Region, ShuffleArray + I - N, N,
+ /*SameGroup=*/true);
+ N = 1;
+ CurGroup = compactPtrGroup(ShuffleArray[I]);
+ } else {
+ ++N;
+ }
+ }
+
+ shuffle(ShuffleArray + NumberOfBlocks - N, N, &Region->RandState);
+ pushBlocksImpl(C, ClassId, Region, &ShuffleArray[NumberOfBlocks - N], N,
+ /*SameGroup=*/true);
+ } else {
+ pushBlocksImpl(C, ClassId, Region, ShuffleArray, NumberOfBlocks,
+ /*SameGroup=*/true);
}
const uptr AllocatedUser = Size * NumberOfBlocks;
@@ -634,8 +814,8 @@
return true;
}
- void getStats(ScopedString *Str, uptr ClassId, uptr Rss) {
- RegionInfo *Region = getRegionInfo(ClassId);
+ void getStats(ScopedString *Str, uptr ClassId, RegionInfo *Region, uptr Rss)
+ REQUIRES(Region->Mutex) {
if (Region->MappedUser == 0)
return;
const uptr InUse = Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks;
@@ -652,7 +832,8 @@
}
NOINLINE uptr releaseToOSMaybe(RegionInfo *Region, uptr ClassId,
- bool Force = false) {
+ ReleaseToOS ReleaseType = ReleaseToOS::Normal)
+ REQUIRES(Region->Mutex) {
const uptr BlockSize = getSizeByClassId(ClassId);
const uptr PageSize = getPageSizeCached();
@@ -660,121 +841,366 @@
const uptr BytesInFreeList =
Region->AllocatedUser -
(Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
- if (BytesInFreeList < PageSize)
- return 0; // No chance to release anything.
- const uptr BytesPushed = (Region->Stats.PushedBlocks -
- Region->ReleaseInfo.PushedBlocksAtLastRelease) *
- BlockSize;
- if (BytesPushed < PageSize)
- return 0; // Nothing new to release.
- bool CheckDensity = BlockSize < PageSize / 16U;
+ bool MaySkip = false;
+
+ // Always update `BytesInFreeListAtLastCheckpoint` with the smallest value
+ // so that we won't underestimate the releasable pages. For example, the
+ // following is the region usage,
+ //
+ // BytesInFreeListAtLastCheckpoint AllocatedUser
+ // v v
+ // |--------------------------------------->
+ // ^ ^
+ // BytesInFreeList ReleaseThreshold
+ //
+ // In general, if we have collected enough bytes and the amount of free
+ // bytes meets the ReleaseThreshold, we will try to do page release. If we
+ // don't update `BytesInFreeListAtLastCheckpoint` when the current
+ // `BytesInFreeList` is smaller, we may take longer time to wait for enough
+ // freed blocks because we miss the bytes between
+ // (BytesInFreeListAtLastCheckpoint - BytesInFreeList).
+ if (BytesInFreeList <=
+ Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint) {
+ Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint = BytesInFreeList;
+ MaySkip = true;
+ }
+
+ const uptr RegionPushedBytesDelta =
+ BytesInFreeList - Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint;
+ if (RegionPushedBytesDelta < PageSize)
+ MaySkip = true;
+
+ const bool CheckDensity = isSmallBlock(BlockSize);
// Releasing smaller blocks is expensive, so we want to make sure that a
// significant amount of bytes are free, and that there has been a good
// amount of batches pushed to the freelist before attempting to release.
if (CheckDensity) {
- if (!Force && BytesPushed < Region->AllocatedUser / 16U)
- return 0;
+ if (ReleaseType == ReleaseToOS::Normal &&
+ RegionPushedBytesDelta < Region->TryReleaseThreshold) {
+ MaySkip = true;
+ }
}
- if (!Force) {
+ if (MaySkip && ReleaseType != ReleaseToOS::ForceAll)
+ return 0;
+
+ if (ReleaseType == ReleaseToOS::Normal) {
const s32 IntervalMs = atomic_load_relaxed(&ReleaseToOsIntervalMs);
if (IntervalMs < 0)
return 0;
if (Region->ReleaseInfo.LastReleaseAtNs +
static_cast<u64>(IntervalMs) * 1000000 >
- getMonotonicTime()) {
+ getMonotonicTimeFast()) {
return 0; // Memory was returned recently.
}
}
const uptr GroupSize = (1U << GroupSizeLog);
const uptr AllocatedUserEnd = Region->AllocatedUser + Region->RegionBeg;
- ReleaseRecorder Recorder(Region->RegionBeg, &Region->Data);
- PageReleaseContext Context(BlockSize, Region->AllocatedUser,
- /*NumberOfRegions=*/1U);
-
const uptr CompactPtrBase = getCompactPtrBaseByClassId(ClassId);
auto DecompactPtr = [CompactPtrBase](CompactPtrT CompactPtr) {
return decompactPtrInternal(CompactPtrBase, CompactPtr);
};
- for (BatchGroup &BG : Region->FreeList) {
- const uptr PushedBytesDelta =
- BG.PushedBlocks - BG.PushedBlocksAtLastCheckpoint;
- if (PushedBytesDelta * BlockSize < PageSize)
- continue;
- // Group boundary does not necessarily have the same alignment as Region.
- // It may sit across a Region boundary. Which means that we may have the
- // following two cases,
+ // Instead of always preparing PageMap for the entire region, we only do it
+ // for the range of releasing groups. To do that, the free-block marking
+ // process includes visiting BlockGroups twice.
+
+ // The first visit is to determine the range of BatchGroups we are going to
+ // release. And we will extract those BatchGroups out and push into
+ // `GroupToRelease`.
+ SinglyLinkedList<BatchGroup> GroupToRelease;
+ GroupToRelease.clear();
+
+ // This is only used for debugging to ensure the consistency of the number
+ // of groups.
+ uptr NumberOfBatchGroups = Region->FreeList.size();
+
+ // We are examining each group and will take the minimum distance to the
+ // release threshold as the next Region::TryReleaseThreshold(). Note that if
+ // the size of free blocks has reached the release threshold, the distance
+ // to the next release will be PageSize * SmallerBlockReleasePageDelta. See
+ // the comment on `SmallerBlockReleasePageDelta` for more details.
+ uptr MinDistToThreshold = GroupSize;
+
+ for (BatchGroup *BG = Region->FreeList.front(), *Prev = nullptr;
+ BG != nullptr;) {
+ // Group boundary is always GroupSize-aligned from CompactPtr base. The
+ // layout of memory groups is like,
//
- // 1. Group boundary sits before RegionBeg.
+ // (CompactPtrBase)
+ // #1 CompactPtrGroupBase #2 CompactPtrGroupBase ...
+ // | | |
+ // v v v
+ // +-----------------------+-----------------------+
+ // \ / \ /
+ // --- GroupSize --- --- GroupSize ---
//
- // (BatchGroupBeg)
- // batchGroupBase RegionBeg BatchGroupEnd
- // | | |
- // v v v
- // +------------+----------------+
- // \ /
- // ------ GroupSize ------
- //
- // 2. Group boundary sits after RegionBeg.
- //
- // (BatchGroupBeg)
- // RegionBeg batchGroupBase BatchGroupEnd
- // | | |
- // v v v
- // +-----------+-----------------------------+
- // \ /
- // ------ GroupSize ------
- //
- // Note that in the first case, the group range before RegionBeg is never
- // used. Therefore, while calculating the used group size, we should
- // exclude that part to get the correct size.
- const uptr BatchGroupBeg =
- Max(batchGroupBase(CompactPtrBase, BG.GroupId), Region->RegionBeg);
- DCHECK_GE(AllocatedUserEnd, BatchGroupBeg);
- const uptr BatchGroupEnd =
- batchGroupBase(CompactPtrBase, BG.GroupId) + GroupSize;
+ // After decompacting the CompactPtrGroupBase, we expect the alignment
+ // property is held as well.
+ const uptr BatchGroupBase =
+ decompactGroupBase(CompactPtrBase, BG->CompactPtrGroupBase);
+ DCHECK_LE(Region->RegionBeg, BatchGroupBase);
+ DCHECK_GE(AllocatedUserEnd, BatchGroupBase);
+ DCHECK_EQ((Region->RegionBeg - BatchGroupBase) % GroupSize, 0U);
+ const uptr BatchGroupEnd = BatchGroupBase + GroupSize;
const uptr AllocatedGroupSize = AllocatedUserEnd >= BatchGroupEnd
- ? BatchGroupEnd - BatchGroupBeg
- : AllocatedUserEnd - BatchGroupBeg;
- if (AllocatedGroupSize == 0)
+ ? GroupSize
+ : AllocatedUserEnd - BatchGroupBase;
+ if (AllocatedGroupSize == 0) {
+ Prev = BG;
+ BG = BG->Next;
continue;
+ }
// TransferBatches are pushed in front of BG.Batches. The first one may
// not have all caches used.
- const uptr NumBlocks = (BG.Batches.size() - 1) * BG.MaxCachedPerBatch +
- BG.Batches.front()->getCount();
+ const uptr NumBlocks = (BG->Batches.size() - 1) * BG->MaxCachedPerBatch +
+ BG->Batches.front()->getCount();
const uptr BytesInBG = NumBlocks * BlockSize;
+
+ if (ReleaseType != ReleaseToOS::ForceAll &&
+ BytesInBG <= BG->BytesInBGAtLastCheckpoint) {
+ BG->BytesInBGAtLastCheckpoint = BytesInBG;
+ Prev = BG;
+ BG = BG->Next;
+ continue;
+ }
+
+ const uptr PushedBytesDelta = BG->BytesInBGAtLastCheckpoint - BytesInBG;
+
// Given the randomness property, we try to release the pages only if the
// bytes used by free blocks exceed certain proportion of group size. Note
// that this heuristic only applies when all the spaces in a BatchGroup
// are allocated.
- if (CheckDensity && (BytesInBG * 100U) / AllocatedGroupSize <
- (100U - 1U - BlockSize / 16U)) {
- continue;
+ if (CheckDensity) {
+ const uptr ReleaseThreshold =
+ (AllocatedGroupSize * (100 - 1U - BlockSize / 16U)) / 100U;
+ const bool HighDensity = BytesInBG >= ReleaseThreshold;
+ const bool MayHaveReleasedAll = NumBlocks >= (GroupSize / BlockSize);
+ // If all blocks in the group are released, we will do range marking
+ // which is fast. Otherwise, we will wait until we have accumulated
+ // a certain amount of free memory.
+ const bool ReachReleaseDelta =
+ MayHaveReleasedAll
+ ? true
+ : PushedBytesDelta >= PageSize * SmallerBlockReleasePageDelta;
+
+ if (!HighDensity) {
+ DCHECK_LE(BytesInBG, ReleaseThreshold);
+ // The following is the usage of a memroy group,
+ //
+ // BytesInBG ReleaseThreshold
+ // / \ v
+ // +---+---------------------------+-----+
+ // | | | | |
+ // +---+---------------------------+-----+
+ // \ / ^
+ // PushedBytesDelta GroupEnd
+ MinDistToThreshold =
+ Min(MinDistToThreshold,
+ ReleaseThreshold - BytesInBG + PushedBytesDelta);
+ } else {
+ // If it reaches high density at this round, the next time we will try
+ // to release is based on SmallerBlockReleasePageDelta
+ MinDistToThreshold =
+ Min(MinDistToThreshold, PageSize * SmallerBlockReleasePageDelta);
+ }
+
+ if (!HighDensity || !ReachReleaseDelta) {
+ Prev = BG;
+ BG = BG->Next;
+ continue;
+ }
}
- BG.PushedBlocksAtLastCheckpoint = BG.PushedBlocks;
- // Note that we don't always visit blocks in each BatchGroup so that we
- // may miss the chance of releasing certain pages that cross BatchGroups.
- Context.markFreeBlocks(BG.Batches, DecompactPtr, Region->RegionBeg);
+ // If `BG` is the first BatchGroup in the list, we only need to advance
+ // `BG` and call FreeList::pop_front(). No update is needed for `Prev`.
+ //
+ // (BG) (BG->Next)
+ // Prev Cur BG
+ // | | |
+ // v v v
+ // nil +--+ +--+
+ // |X | -> | | -> ...
+ // +--+ +--+
+ //
+ // Otherwise, `Prev` will be used to extract the `Cur` from the
+ // `FreeList`.
+ //
+ // (BG) (BG->Next)
+ // Prev Cur BG
+ // | | |
+ // v v v
+ // +--+ +--+ +--+
+ // | | -> |X | -> | | -> ...
+ // +--+ +--+ +--+
+ //
+ // After FreeList::extract(),
+ //
+ // Prev Cur BG
+ // | | |
+ // v v v
+ // +--+ +--+ +--+
+ // | |-+ |X | +->| | -> ...
+ // +--+ | +--+ | +--+
+ // +--------+
+ //
+ // Note that we need to advance before pushing this BatchGroup to
+ // GroupToRelease because it's a destructive operation.
+
+ BatchGroup *Cur = BG;
+ BG = BG->Next;
+
+ // Ideally, we may want to update this only after successful release.
+ // However, for smaller blocks, each block marking is a costly operation.
+ // Therefore, we update it earlier.
+ // TODO: Consider updating this after page release if `ReleaseRecorder`
+ // can tell the releasd bytes in each group.
+ Cur->BytesInBGAtLastCheckpoint = BytesInBG;
+
+ if (Prev != nullptr)
+ Region->FreeList.extract(Prev, Cur);
+ else
+ Region->FreeList.pop_front();
+ GroupToRelease.push_back(Cur);
}
- if (!Context.hasBlockMarked())
+ // Only small blocks have the adaptive `TryReleaseThreshold`.
+ if (isSmallBlock(BlockSize)) {
+ // If the MinDistToThreshold is not updated, that means each memory group
+ // may have only pushed less than a page size. In that case, just set it
+ // back to normal.
+ if (MinDistToThreshold == GroupSize)
+ MinDistToThreshold = PageSize * SmallerBlockReleasePageDelta;
+ Region->TryReleaseThreshold = MinDistToThreshold;
+ }
+
+ if (GroupToRelease.empty())
return 0;
+ const uptr ReleaseBase = decompactGroupBase(
+ CompactPtrBase, GroupToRelease.front()->CompactPtrGroupBase);
+ const uptr LastGroupEnd =
+ Min(decompactGroupBase(CompactPtrBase,
+ GroupToRelease.back()->CompactPtrGroupBase) +
+ GroupSize,
+ AllocatedUserEnd);
+ // The last block may straddle the group boundary. Rounding up to BlockSize
+ // to get the exact range.
+ const uptr ReleaseEnd =
+ roundUpSlow(LastGroupEnd - Region->RegionBeg, BlockSize) +
+ Region->RegionBeg;
+ const uptr ReleaseRangeSize = ReleaseEnd - ReleaseBase;
+ const uptr ReleaseOffset = ReleaseBase - Region->RegionBeg;
+
+ RegionReleaseRecorder<MemMapT> Recorder(&Region->MemMap, Region->RegionBeg,
+ ReleaseOffset);
+ PageReleaseContext Context(BlockSize, /*NumberOfRegions=*/1U,
+ ReleaseRangeSize, ReleaseOffset);
+
+ for (BatchGroup &BG : GroupToRelease) {
+ const uptr BatchGroupBase =
+ decompactGroupBase(CompactPtrBase, BG.CompactPtrGroupBase);
+ const uptr BatchGroupEnd = BatchGroupBase + GroupSize;
+ const uptr AllocatedGroupSize = AllocatedUserEnd >= BatchGroupEnd
+ ? GroupSize
+ : AllocatedUserEnd - BatchGroupBase;
+ const uptr BatchGroupUsedEnd = BatchGroupBase + AllocatedGroupSize;
+ const bool MayContainLastBlockInRegion =
+ BatchGroupUsedEnd == AllocatedUserEnd;
+ const bool BlockAlignedWithUsedEnd =
+ (BatchGroupUsedEnd - Region->RegionBeg) % BlockSize == 0;
+
+ uptr MaxContainedBlocks = AllocatedGroupSize / BlockSize;
+ if (!BlockAlignedWithUsedEnd)
+ ++MaxContainedBlocks;
+
+ const uptr NumBlocks = (BG.Batches.size() - 1) * BG.MaxCachedPerBatch +
+ BG.Batches.front()->getCount();
+
+ if (NumBlocks == MaxContainedBlocks) {
+ for (const auto &It : BG.Batches)
+ for (u16 I = 0; I < It.getCount(); ++I)
+ DCHECK_EQ(compactPtrGroup(It.get(I)), BG.CompactPtrGroupBase);
+
+ Context.markRangeAsAllCounted(BatchGroupBase, BatchGroupUsedEnd,
+ Region->RegionBeg, /*RegionIndex=*/0,
+ Region->AllocatedUser);
+ } else {
+ DCHECK_LT(NumBlocks, MaxContainedBlocks);
+ // Note that we don't always visit blocks in each BatchGroup so that we
+ // may miss the chance of releasing certain pages that cross
+ // BatchGroups.
+ Context.markFreeBlocksInRegion(
+ BG.Batches, DecompactPtr, Region->RegionBeg, /*RegionIndex=*/0,
+ Region->AllocatedUser, MayContainLastBlockInRegion);
+ }
+ }
+
+ DCHECK(Context.hasBlockMarked());
+
auto SkipRegion = [](UNUSED uptr RegionIndex) { return false; };
releaseFreeMemoryToOS(Context, Recorder, SkipRegion);
if (Recorder.getReleasedRangesCount() > 0) {
- Region->ReleaseInfo.PushedBlocksAtLastRelease =
- Region->Stats.PushedBlocks;
+ Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint = BytesInFreeList;
Region->ReleaseInfo.RangesReleased += Recorder.getReleasedRangesCount();
Region->ReleaseInfo.LastReleasedBytes = Recorder.getReleasedBytes();
}
- Region->ReleaseInfo.LastReleaseAtNs = getMonotonicTime();
+ Region->ReleaseInfo.LastReleaseAtNs = getMonotonicTimeFast();
+
+ // Merge GroupToRelease back to the Region::FreeList. Note that both
+ // `Region->FreeList` and `GroupToRelease` are sorted.
+ for (BatchGroup *BG = Region->FreeList.front(), *Prev = nullptr;;) {
+ if (BG == nullptr || GroupToRelease.empty()) {
+ if (!GroupToRelease.empty())
+ Region->FreeList.append_back(&GroupToRelease);
+ break;
+ }
+
+ DCHECK_NE(BG->CompactPtrGroupBase,
+ GroupToRelease.front()->CompactPtrGroupBase);
+
+ if (BG->CompactPtrGroupBase <
+ GroupToRelease.front()->CompactPtrGroupBase) {
+ Prev = BG;
+ BG = BG->Next;
+ continue;
+ }
+
+ // At here, the `BG` is the first BatchGroup with CompactPtrGroupBase
+ // larger than the first element in `GroupToRelease`. We need to insert
+ // `GroupToRelease::front()` (which is `Cur` below) before `BG`.
+ //
+ // 1. If `Prev` is nullptr, we simply push `Cur` to the front of
+ // FreeList.
+ // 2. Otherwise, use `insert()` which inserts an element next to `Prev`.
+ //
+ // Afterwards, we don't need to advance `BG` because the order between
+ // `BG` and the new `GroupToRelease::front()` hasn't been checked.
+ BatchGroup *Cur = GroupToRelease.front();
+ GroupToRelease.pop_front();
+ if (Prev == nullptr)
+ Region->FreeList.push_front(Cur);
+ else
+ Region->FreeList.insert(Prev, Cur);
+ DCHECK_EQ(Cur->Next, BG);
+ Prev = Cur;
+ }
+
+ DCHECK_EQ(Region->FreeList.size(), NumberOfBatchGroups);
+ (void)NumberOfBatchGroups;
+
+ if (SCUDO_DEBUG) {
+ BatchGroup *Prev = Region->FreeList.front();
+ for (BatchGroup *Cur = Prev->Next; Cur != nullptr;
+ Prev = Cur, Cur = Cur->Next) {
+ CHECK_LT(Prev->CompactPtrGroupBase, Cur->CompactPtrGroupBase);
+ }
+ }
+
return Recorder.getReleasedBytes();
}
};
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/quarantine.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/quarantine.h
index 2d231c3..e65a733 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/quarantine.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/quarantine.h
@@ -12,6 +12,7 @@
#include "list.h"
#include "mutex.h"
#include "string_utils.h"
+#include "thread_annotations.h"
namespace scudo {
@@ -172,7 +173,7 @@
typedef QuarantineCache<Callback> CacheT;
using ThisT = GlobalQuarantine<Callback, Node>;
- void init(uptr Size, uptr CacheSize) {
+ void init(uptr Size, uptr CacheSize) NO_THREAD_SAFETY_ANALYSIS {
DCHECK(isAligned(reinterpret_cast<uptr>(this), alignof(ThisT)));
DCHECK_EQ(atomic_load_relaxed(&MaxSize), 0U);
DCHECK_EQ(atomic_load_relaxed(&MinSize), 0U);
@@ -197,16 +198,19 @@
drain(C, Cb);
}
- void NOINLINE drain(CacheT *C, Callback Cb) {
+ void NOINLINE drain(CacheT *C, Callback Cb) EXCLUDES(CacheMutex) {
+ bool needRecycle = false;
{
ScopedLock L(CacheMutex);
Cache.transfer(C);
+ needRecycle = Cache.getSize() > getMaxSize();
}
- if (Cache.getSize() > getMaxSize() && RecycleMutex.tryLock())
+
+ if (needRecycle && RecycleMutex.tryLock())
recycle(atomic_load_relaxed(&MinSize), Cb);
}
- void NOINLINE drainAndRecycle(CacheT *C, Callback Cb) {
+ void NOINLINE drainAndRecycle(CacheT *C, Callback Cb) EXCLUDES(CacheMutex) {
{
ScopedLock L(CacheMutex);
Cache.transfer(C);
@@ -215,20 +219,21 @@
recycle(0, Cb);
}
- void getStats(ScopedString *Str) const {
+ void getStats(ScopedString *Str) EXCLUDES(CacheMutex) {
+ ScopedLock L(CacheMutex);
// It assumes that the world is stopped, just as the allocator's printStats.
Cache.getStats(Str);
Str->append("Quarantine limits: global: %zuK; thread local: %zuK\n",
getMaxSize() >> 10, getCacheSize() >> 10);
}
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
// RecycleMutex must be locked 1st since we grab CacheMutex within recycle.
RecycleMutex.lock();
CacheMutex.lock();
}
- void enable() {
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
CacheMutex.unlock();
RecycleMutex.unlock();
}
@@ -236,13 +241,14 @@
private:
// Read-only data.
alignas(SCUDO_CACHE_LINE_SIZE) HybridMutex CacheMutex;
- CacheT Cache;
+ CacheT Cache GUARDED_BY(CacheMutex);
alignas(SCUDO_CACHE_LINE_SIZE) HybridMutex RecycleMutex;
atomic_uptr MinSize = {};
atomic_uptr MaxSize = {};
alignas(SCUDO_CACHE_LINE_SIZE) atomic_uptr MaxCacheSize = {};
- void NOINLINE recycle(uptr MinSize, Callback Cb) {
+ void NOINLINE recycle(uptr MinSize, Callback Cb) RELEASE(RecycleMutex)
+ EXCLUDES(CacheMutex) {
CacheT Tmp;
Tmp.init();
{
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.cpp
index 3f40dbe..938bb41 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.cpp
@@ -10,7 +10,7 @@
namespace scudo {
-HybridMutex RegionPageMap::Mutex = {};
-uptr RegionPageMap::StaticBuffer[RegionPageMap::StaticBufferCount];
+BufferPool<RegionPageMap::StaticBufferCount, RegionPageMap::StaticBufferSize>
+ RegionPageMap::Buffers;
} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.h
index 6de3b15..b7a0131 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/release.h
@@ -11,14 +11,46 @@
#include "common.h"
#include "list.h"
+#include "mem_map.h"
#include "mutex.h"
+#include "thread_annotations.h"
namespace scudo {
+template <typename MemMapT> class RegionReleaseRecorder {
+public:
+ RegionReleaseRecorder(MemMapT *RegionMemMap, uptr Base, uptr Offset = 0)
+ : RegionMemMap(RegionMemMap), Base(Base), Offset(Offset) {}
+
+ uptr getReleasedRangesCount() const { return ReleasedRangesCount; }
+
+ uptr getReleasedBytes() const { return ReleasedBytes; }
+
+ uptr getBase() const { return Base; }
+
+ // Releases [From, To) range of pages back to OS. Note that `From` and `To`
+ // are offseted from `Base` + Offset.
+ void releasePageRangeToOS(uptr From, uptr To) {
+ const uptr Size = To - From;
+ RegionMemMap->releasePagesToOS(getBase() + Offset + From, Size);
+ ReleasedRangesCount++;
+ ReleasedBytes += Size;
+ }
+
+private:
+ uptr ReleasedRangesCount = 0;
+ uptr ReleasedBytes = 0;
+ MemMapT *RegionMemMap = nullptr;
+ uptr Base = 0;
+ // The release offset from Base. This is used when we know a given range after
+ // Base will not be released.
+ uptr Offset = 0;
+};
+
class ReleaseRecorder {
public:
- ReleaseRecorder(uptr Base, MapPlatformData *Data = nullptr)
- : Base(Base), Data(Data) {}
+ ReleaseRecorder(uptr Base, uptr Offset = 0, MapPlatformData *Data = nullptr)
+ : Base(Base), Offset(Offset), Data(Data) {}
uptr getReleasedRangesCount() const { return ReleasedRangesCount; }
@@ -29,7 +61,7 @@
// Releases [From, To) range of pages back to OS.
void releasePageRangeToOS(uptr From, uptr To) {
const uptr Size = To - From;
- releasePagesToOS(Base, From, Size, Data);
+ releasePagesToOS(Base, From + Offset, Size, Data);
ReleasedRangesCount++;
ReleasedBytes += Size;
}
@@ -37,10 +69,110 @@
private:
uptr ReleasedRangesCount = 0;
uptr ReleasedBytes = 0;
+ // The starting address to release. Note that we may want to combine (Base +
+ // Offset) as a new Base. However, the Base is retrieved from
+ // `MapPlatformData` on Fuchsia, which means the offset won't be aware.
+ // Therefore, store them separately to make it work on all the platforms.
uptr Base = 0;
+ // The release offset from Base. This is used when we know a given range after
+ // Base will not be released.
+ uptr Offset = 0;
MapPlatformData *Data = nullptr;
};
+// A buffer pool which holds a fixed number of static buffers for fast buffer
+// allocation. If the request size is greater than `StaticBufferSize`, it'll
+// delegate the allocation to map().
+template <uptr StaticBufferCount, uptr StaticBufferSize> class BufferPool {
+public:
+ // Preserve 1 bit in the `Mask` so that we don't need to do zero-check while
+ // extracting the least significant bit from the `Mask`.
+ static_assert(StaticBufferCount < SCUDO_WORDSIZE, "");
+ static_assert(isAligned(StaticBufferSize, SCUDO_CACHE_LINE_SIZE), "");
+
+ // Return a buffer which is at least `BufferSize`.
+ uptr *getBuffer(const uptr BufferSize) {
+ if (UNLIKELY(BufferSize > StaticBufferSize))
+ return getDynamicBuffer(BufferSize);
+
+ uptr index;
+ {
+ // TODO: In general, we expect this operation should be fast so the
+ // waiting thread won't be put into sleep. The HybridMutex does implement
+ // the busy-waiting but we may want to review the performance and see if
+ // we need an explict spin lock here.
+ ScopedLock L(Mutex);
+ index = getLeastSignificantSetBitIndex(Mask);
+ if (index < StaticBufferCount)
+ Mask ^= static_cast<uptr>(1) << index;
+ }
+
+ if (index >= StaticBufferCount)
+ return getDynamicBuffer(BufferSize);
+
+ const uptr Offset = index * StaticBufferSize;
+ memset(&RawBuffer[Offset], 0, StaticBufferSize);
+ return &RawBuffer[Offset];
+ }
+
+ void releaseBuffer(uptr *Buffer, const uptr BufferSize) {
+ const uptr index = getStaticBufferIndex(Buffer, BufferSize);
+ if (index < StaticBufferCount) {
+ ScopedLock L(Mutex);
+ DCHECK_EQ((Mask & (static_cast<uptr>(1) << index)), 0U);
+ Mask |= static_cast<uptr>(1) << index;
+ } else {
+ unmap(reinterpret_cast<void *>(Buffer),
+ roundUp(BufferSize, getPageSizeCached()));
+ }
+ }
+
+ bool isStaticBufferTestOnly(uptr *Buffer, uptr BufferSize) {
+ return getStaticBufferIndex(Buffer, BufferSize) < StaticBufferCount;
+ }
+
+private:
+ uptr getStaticBufferIndex(uptr *Buffer, uptr BufferSize) {
+ if (UNLIKELY(BufferSize > StaticBufferSize))
+ return StaticBufferCount;
+
+ const uptr BufferBase = reinterpret_cast<uptr>(Buffer);
+ const uptr RawBufferBase = reinterpret_cast<uptr>(RawBuffer);
+
+ if (BufferBase < RawBufferBase ||
+ BufferBase >= RawBufferBase + sizeof(RawBuffer)) {
+ return StaticBufferCount;
+ }
+
+ DCHECK_LE(BufferSize, StaticBufferSize);
+ DCHECK_LE(BufferBase + BufferSize, RawBufferBase + sizeof(RawBuffer));
+ DCHECK_EQ((BufferBase - RawBufferBase) % StaticBufferSize, 0U);
+
+ const uptr index =
+ (BufferBase - RawBufferBase) / (StaticBufferSize * sizeof(uptr));
+ DCHECK_LT(index, StaticBufferCount);
+ return index;
+ }
+
+ uptr *getDynamicBuffer(const uptr BufferSize) {
+ // When using a heap-based buffer, precommit the pages backing the
+ // Vmar by passing |MAP_PRECOMMIT| flag. This allows an optimization
+ // where page fault exceptions are skipped as the allocated memory
+ // is accessed. So far, this is only enabled on Fuchsia. It hasn't proven a
+ // performance benefit on other platforms.
+ const uptr MmapFlags = MAP_ALLOWNOMEM | (SCUDO_FUCHSIA ? MAP_PRECOMMIT : 0);
+ return reinterpret_cast<uptr *>(
+ map(nullptr, roundUp(BufferSize, getPageSizeCached()), "scudo:counters",
+ MmapFlags, &MapData));
+ }
+
+ HybridMutex Mutex;
+ // '1' means that buffer index is not used. '0' means the buffer is in use.
+ uptr Mask GUARDED_BY(Mutex) = ~static_cast<uptr>(0);
+ uptr RawBuffer[StaticBufferCount * StaticBufferSize] GUARDED_BY(Mutex);
+ [[no_unique_address]] MapPlatformData MapData = {};
+};
+
// A Region page map is used to record the usage of pages in the regions. It
// implements a packed array of Counters. Each counter occupies 2^N bits, enough
// to store counter's MaxValue. Ctor will try to use a static buffer first, and
@@ -68,14 +200,14 @@
~RegionPageMap() {
if (!isAllocated())
return;
- if (Buffer == &StaticBuffer[0])
- Mutex.unlock();
- else
- unmap(reinterpret_cast<void *>(Buffer),
- roundUpTo(BufferSize, getPageSizeCached()));
+ Buffers.releaseBuffer(Buffer, BufferSize);
Buffer = nullptr;
}
+ // Lock of `StaticBuffer` is acquired conditionally and there's no easy way to
+ // specify the thread-safety attribute properly in current code structure.
+ // Besides, it's the only place we may want to check thread safety. Therefore,
+ // it's fine to bypass the thread-safety analysis now.
void reset(uptr NumberOfRegion, uptr CountersPerRegion, uptr MaxValue) {
DCHECK_GT(NumberOfRegion, 0);
DCHECK_GT(CountersPerRegion, 0);
@@ -88,7 +220,7 @@
// Rounding counter storage size up to the power of two allows for using
// bit shifts calculating particular counter's Index and offset.
const uptr CounterSizeBits =
- roundUpToPowerOfTwo(getMostSignificantSetBitIndex(MaxValue) + 1);
+ roundUpPowerOfTwo(getMostSignificantSetBitIndex(MaxValue) + 1);
DCHECK_LE(CounterSizeBits, MaxCounterBits);
CounterSizeBitsLog = getLog2(CounterSizeBits);
CounterMask = ~(static_cast<uptr>(0)) >> (MaxCounterBits - CounterSizeBits);
@@ -99,24 +231,11 @@
BitOffsetMask = PackingRatio - 1;
SizePerRegion =
- roundUpTo(NumCounters, static_cast<uptr>(1U) << PackingRatioLog) >>
+ roundUp(NumCounters, static_cast<uptr>(1U) << PackingRatioLog) >>
PackingRatioLog;
BufferSize = SizePerRegion * sizeof(*Buffer) * Regions;
- if (BufferSize <= (StaticBufferCount * sizeof(Buffer[0])) &&
- Mutex.tryLock()) {
- Buffer = &StaticBuffer[0];
- memset(Buffer, 0, BufferSize);
- } else {
- // When using a heap-based buffer, precommit the pages backing the
- // Vmar by passing |MAP_PRECOMMIT| flag. This allows an optimization
- // where page fault exceptions are skipped as the allocated memory
- // is accessed.
- const uptr MmapFlags =
- MAP_ALLOWNOMEM | (SCUDO_FUCHSIA ? MAP_PRECOMMIT : 0);
- Buffer = reinterpret_cast<uptr *>(
- map(nullptr, roundUpTo(BufferSize, getPageSizeCached()),
- "scudo:counters", MmapFlags, &MapData));
- }
+ Buffer = Buffers.getBuffer(BufferSize);
+ DCHECK_NE(Buffer, nullptr);
}
bool isAllocated() const { return !!Buffer; }
@@ -141,6 +260,17 @@
<< BitOffset;
}
+ void incN(uptr Region, uptr I, uptr N) const {
+ DCHECK_GT(N, 0U);
+ DCHECK_LE(N, CounterMask);
+ DCHECK_LE(get(Region, I), CounterMask - N);
+ const uptr Index = I >> PackingRatioLog;
+ const uptr BitOffset = (I & BitOffsetMask) << CounterSizeBitsLog;
+ DCHECK_LT(BitOffset, SCUDO_WORDSIZE);
+ DCHECK_EQ(isAllCounted(Region, I), false);
+ Buffer[Region * SizePerRegion + Index] += N << BitOffset;
+ }
+
void incRange(uptr Region, uptr From, uptr To) const {
DCHECK_LE(From, To);
const uptr Top = Min(To + 1, NumCounters);
@@ -159,14 +289,29 @@
DCHECK_LT(BitOffset, SCUDO_WORDSIZE);
Buffer[Region * SizePerRegion + Index] |= CounterMask << BitOffset;
}
+ void setAsAllCountedRange(uptr Region, uptr From, uptr To) const {
+ DCHECK_LE(From, To);
+ const uptr Top = Min(To + 1, NumCounters);
+ for (uptr I = From; I < Top; I++)
+ setAsAllCounted(Region, I);
+ }
+
+ bool updateAsAllCountedIf(uptr Region, uptr I, uptr MaxCount) {
+ const uptr Count = get(Region, I);
+ if (Count == CounterMask)
+ return true;
+ if (Count == MaxCount) {
+ setAsAllCounted(Region, I);
+ return true;
+ }
+ return false;
+ }
bool isAllCounted(uptr Region, uptr I) const {
return get(Region, I) == CounterMask;
}
uptr getBufferSize() const { return BufferSize; }
- static const uptr StaticBufferCount = 2048U;
-
private:
uptr Regions;
uptr NumCounters;
@@ -178,10 +323,12 @@
uptr SizePerRegion;
uptr BufferSize;
uptr *Buffer;
- [[no_unique_address]] MapPlatformData MapData = {};
- static HybridMutex Mutex;
- static uptr StaticBuffer[StaticBufferCount];
+ // We may consider making this configurable if there are cases which may
+ // benefit from this.
+ static const uptr StaticBufferCount = 2U;
+ static const uptr StaticBufferSize = 512U;
+ static BufferPool<StaticBufferCount, StaticBufferSize> Buffers;
};
template <class ReleaseRecorderT> class FreePagesRangeTracker {
@@ -225,10 +372,9 @@
};
struct PageReleaseContext {
- PageReleaseContext(uptr BlockSize, uptr RegionSize, uptr NumberOfRegions) :
- BlockSize(BlockSize),
- RegionSize(RegionSize),
- NumberOfRegions(NumberOfRegions) {
+ PageReleaseContext(uptr BlockSize, uptr NumberOfRegions, uptr ReleaseSize,
+ uptr ReleaseOffset = 0)
+ : BlockSize(BlockSize), NumberOfRegions(NumberOfRegions) {
PageSize = getPageSizeCached();
if (BlockSize <= PageSize) {
if (PageSize % BlockSize == 0) {
@@ -260,10 +406,16 @@
}
}
- PagesCount = roundUpTo(RegionSize, PageSize) / PageSize;
+ // TODO: For multiple regions, it's more complicated to support partial
+ // region marking (which includes the complexity of how to handle the last
+ // block in a region). We may consider this after markFreeBlocks() accepts
+ // only free blocks from the same region.
+ if (NumberOfRegions != 1)
+ DCHECK_EQ(ReleaseOffset, 0U);
+
+ PagesCount = roundUp(ReleaseSize, PageSize) / PageSize;
PageSizeLog = getLog2(PageSize);
- RoundedRegionSize = PagesCount << PageSizeLog;
- RoundedSize = NumberOfRegions * RoundedRegionSize;
+ ReleasePageOffset = ReleaseOffset >> PageSizeLog;
}
// PageMap is lazily allocated when markFreeBlocks() is invoked.
@@ -278,62 +430,164 @@
DCHECK(PageMap.isAllocated());
}
- template<class TransferBatchT, typename DecompactPtrT>
- void markFreeBlocks(const IntrusiveList<TransferBatchT> &FreeList,
- DecompactPtrT DecompactPtr, uptr Base) {
+ // Mark all the blocks in the given range [From, to). Instead of visiting all
+ // the blocks, we will just mark the page as all counted. Note the `From` and
+ // `To` has to be page aligned but with one exception, if `To` is equal to the
+ // RegionSize, it's not necessary to be aligned with page size.
+ void markRangeAsAllCounted(uptr From, uptr To, uptr Base,
+ const uptr RegionIndex, const uptr RegionSize) {
+ DCHECK_LT(From, To);
+ DCHECK_LE(To, Base + RegionSize);
+ DCHECK_EQ(From % PageSize, 0U);
+ DCHECK_LE(To - From, RegionSize);
+
ensurePageMapAllocated();
+ uptr FromInRegion = From - Base;
+ uptr ToInRegion = To - Base;
+ uptr FirstBlockInRange = roundUpSlow(FromInRegion, BlockSize);
+
+ // The straddling block sits across entire range.
+ if (FirstBlockInRange >= ToInRegion)
+ return;
+
+ // First block may not sit at the first pape in the range, move
+ // `FromInRegion` to the first block page.
+ FromInRegion = roundDown(FirstBlockInRange, PageSize);
+
+ // When The first block is not aligned to the range boundary, which means
+ // there is a block sitting acorss `From`, that looks like,
+ //
+ // From To
+ // V V
+ // +-----------------------------------------------+
+ // +-----+-----+-----+-----+
+ // | | | | | ...
+ // +-----+-----+-----+-----+
+ // |- first page -||- second page -||- ...
+ //
+ // Therefore, we can't just mark the first page as all counted. Instead, we
+ // increment the number of blocks in the first page in the page map and
+ // then round up the `From` to the next page.
+ if (FirstBlockInRange != FromInRegion) {
+ DCHECK_GT(FromInRegion + PageSize, FirstBlockInRange);
+ uptr NumBlocksInFirstPage =
+ (FromInRegion + PageSize - FirstBlockInRange + BlockSize - 1) /
+ BlockSize;
+ PageMap.incN(RegionIndex, getPageIndex(FromInRegion),
+ NumBlocksInFirstPage);
+ FromInRegion = roundUp(FromInRegion + 1, PageSize);
+ }
+
+ uptr LastBlockInRange = roundDownSlow(ToInRegion - 1, BlockSize);
+ if (LastBlockInRange < FromInRegion)
+ return;
+
+ // When the last block sits across `To`, we can't just mark the pages
+ // occupied by the last block as all counted. Instead, we increment the
+ // counters of those pages by 1. The exception is that if it's the last
+ // block in the region, it's fine to mark those pages as all counted.
+ if (LastBlockInRange + BlockSize != RegionSize) {
+ DCHECK_EQ(ToInRegion % PageSize, 0U);
+ // The case below is like,
+ //
+ // From To
+ // V V
+ // +----------------------------------------+
+ // +-----+-----+-----+-----+
+ // | | | | | ...
+ // +-----+-----+-----+-----+
+ // ... -||- last page -||- next page -|
+ //
+ // The last block is not aligned to `To`, we need to increment the
+ // counter of `next page` by 1.
+ if (LastBlockInRange + BlockSize != ToInRegion) {
+ PageMap.incRange(RegionIndex, getPageIndex(ToInRegion),
+ getPageIndex(LastBlockInRange + BlockSize - 1));
+ }
+ } else {
+ ToInRegion = RegionSize;
+ }
+
+ // After handling the first page and the last block, it's safe to mark any
+ // page in between the range [From, To).
+ if (FromInRegion < ToInRegion) {
+ PageMap.setAsAllCountedRange(RegionIndex, getPageIndex(FromInRegion),
+ getPageIndex(ToInRegion - 1));
+ }
+ }
+
+ template <class TransferBatchT, typename DecompactPtrT>
+ void markFreeBlocksInRegion(const IntrusiveList<TransferBatchT> &FreeList,
+ DecompactPtrT DecompactPtr, const uptr Base,
+ const uptr RegionIndex, const uptr RegionSize,
+ bool MayContainLastBlockInRegion) {
+ ensurePageMapAllocated();
+
+ if (MayContainLastBlockInRegion) {
+ const uptr LastBlockInRegion =
+ ((RegionSize / BlockSize) - 1U) * BlockSize;
+ // The last block in a region may not use the entire page, we mark the
+ // following "pretend" memory block(s) as free in advance.
+ //
+ // Region Boundary
+ // v
+ // -----+-----------------------+
+ // | Last Page | <- Rounded Region Boundary
+ // -----+-----------------------+
+ // |-----||- trailing blocks -|
+ // ^
+ // last block
+ const uptr RoundedRegionSize = roundUp(RegionSize, PageSize);
+ const uptr TrailingBlockBase = LastBlockInRegion + BlockSize;
+ // Only the last page touched by the last block needs to mark the trailing
+ // blocks. If the difference between `RoundedRegionSize` and
+ // `TrailingBlockBase` is larger than a page, that implies the reported
+ // `RegionSize` may not be accurate.
+ DCHECK_LT(RoundedRegionSize - TrailingBlockBase, PageSize);
+ uptr NumTrailingBlocks =
+ roundUpSlow(RoundedRegionSize - TrailingBlockBase, BlockSize) /
+ BlockSize;
+ if (NumTrailingBlocks > 0) {
+ PageMap.incN(RegionIndex, getPageIndex(TrailingBlockBase),
+ NumTrailingBlocks);
+ }
+ }
+
// Iterate over free chunks and count how many free chunks affect each
// allocated page.
if (BlockSize <= PageSize && PageSize % BlockSize == 0) {
// Each chunk affects one page only.
for (const auto &It : FreeList) {
for (u16 I = 0; I < It.getCount(); I++) {
- const uptr P = DecompactPtr(It.get(I)) - Base;
- if (P >= RoundedSize)
- continue;
- const uptr RegionIndex = NumberOfRegions == 1U ? 0 : P / RegionSize;
- const uptr PInRegion = P - RegionIndex * RegionSize;
- PageMap.inc(RegionIndex, PInRegion >> PageSizeLog);
+ const uptr PInRegion = DecompactPtr(It.get(I)) - Base;
+ DCHECK_LT(PInRegion, RegionSize);
+ PageMap.inc(RegionIndex, getPageIndex(PInRegion));
}
}
} else {
// In all other cases chunks might affect more than one page.
DCHECK_GE(RegionSize, BlockSize);
- const uptr LastBlockInRegion =
- ((RegionSize / BlockSize) - 1U) * BlockSize;
for (const auto &It : FreeList) {
for (u16 I = 0; I < It.getCount(); I++) {
- const uptr P = DecompactPtr(It.get(I)) - Base;
- if (P >= RoundedSize)
- continue;
- const uptr RegionIndex = NumberOfRegions == 1U ? 0 : P / RegionSize;
- uptr PInRegion = P - RegionIndex * RegionSize;
- PageMap.incRange(RegionIndex, PInRegion >> PageSizeLog,
- (PInRegion + BlockSize - 1) >> PageSizeLog);
- // The last block in a region might straddle a page, so if it's
- // free, we mark the following "pretend" memory block(s) as free.
- if (PInRegion == LastBlockInRegion) {
- PInRegion += BlockSize;
- while (PInRegion < RoundedRegionSize) {
- PageMap.incRange(RegionIndex, PInRegion >> PageSizeLog,
- (PInRegion + BlockSize - 1) >> PageSizeLog);
- PInRegion += BlockSize;
- }
- }
+ const uptr PInRegion = DecompactPtr(It.get(I)) - Base;
+ PageMap.incRange(RegionIndex, getPageIndex(PInRegion),
+ getPageIndex(PInRegion + BlockSize - 1));
}
}
}
}
+ uptr getPageIndex(uptr P) { return (P >> PageSizeLog) - ReleasePageOffset; }
+
uptr BlockSize;
- uptr RegionSize;
uptr NumberOfRegions;
+ // For partial region marking, some pages in front are not needed to be
+ // counted.
+ uptr ReleasePageOffset;
uptr PageSize;
uptr PagesCount;
uptr PageSizeLog;
- uptr RoundedRegionSize;
- uptr RoundedSize;
uptr FullPagesBlockCountMax;
bool SameBlockCountPerPage;
RegionPageMap PageMap;
@@ -350,6 +604,7 @@
const uptr BlockSize = Context.BlockSize;
const uptr PagesCount = Context.PagesCount;
const uptr NumberOfRegions = Context.NumberOfRegions;
+ const uptr ReleasePageOffset = Context.ReleasePageOffset;
const uptr FullPagesBlockCountMax = Context.FullPagesBlockCountMax;
const bool SameBlockCountPerPage = Context.SameBlockCountPerPage;
RegionPageMap &PageMap = Context.PageMap;
@@ -365,9 +620,8 @@
continue;
}
for (uptr J = 0; J < PagesCount; J++) {
- const bool CanRelease = PageMap.get(I, J) == FullPagesBlockCountMax;
- if (CanRelease)
- PageMap.setAsAllCounted(I, J);
+ const bool CanRelease =
+ PageMap.updateAsAllCountedIf(I, J, FullPagesBlockCountMax);
RangeTracker.processNextPage(CanRelease);
}
}
@@ -388,6 +642,10 @@
}
uptr PrevPageBoundary = 0;
uptr CurrentBoundary = 0;
+ if (ReleasePageOffset > 0) {
+ PrevPageBoundary = ReleasePageOffset * PageSize;
+ CurrentBoundary = roundUpSlow(PrevPageBoundary, BlockSize);
+ }
for (uptr J = 0; J < PagesCount; J++) {
const uptr PageBoundary = PrevPageBoundary + PageSize;
uptr BlocksPerPage = Pn;
@@ -401,9 +659,8 @@
}
}
PrevPageBoundary = PageBoundary;
- const bool CanRelease = PageMap.get(I, J) == BlocksPerPage;
- if (CanRelease)
- PageMap.setAsAllCounted(I, J);
+ const bool CanRelease =
+ PageMap.updateAsAllCountedIf(I, J, BlocksPerPage);
RangeTracker.processNextPage(CanRelease);
}
}
@@ -411,20 +668,6 @@
RangeTracker.finish();
}
-// An overload releaseFreeMemoryToOS which doesn't require the page usage
-// information after releasing.
-template <class TransferBatchT, class ReleaseRecorderT, typename DecompactPtrT,
- typename SkipRegionT>
-NOINLINE void
-releaseFreeMemoryToOS(const IntrusiveList<TransferBatchT> &FreeList,
- uptr RegionSize, uptr NumberOfRegions, uptr BlockSize,
- ReleaseRecorderT &Recorder, DecompactPtrT DecompactPtr,
- SkipRegionT SkipRegion) {
- PageReleaseContext Context(BlockSize, RegionSize, NumberOfRegions);
- Context.markFreeBlocks(FreeList, DecompactPtr, Recorder.getBase());
- releaseFreeMemoryToOS(Context, Recorder, SkipRegion);
-}
-
} // namespace scudo
#endif // SCUDO_RELEASE_H_
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.cpp
index a37faac..16eae8c 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.cpp
@@ -112,6 +112,11 @@
UserSize, TotalSize, MaxSize);
}
+void NORETURN reportOutOfBatchClass() {
+ ScopedErrorReport Report;
+ Report.append("BatchClass region is used up, can't hold any free block\n");
+}
+
void NORETURN reportOutOfMemory(uptr RequestedSize) {
ScopedErrorReport Report;
Report.append("out of memory trying to allocate %zu bytes\n", RequestedSize);
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.h
index d38451d..3a78ab6 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/report.h
@@ -32,6 +32,7 @@
void NORETURN reportAlignmentTooBig(uptr Alignment, uptr MaxAlignment);
void NORETURN reportAllocationSizeTooBig(uptr UserSize, uptr TotalSize,
uptr MaxSize);
+void NORETURN reportOutOfBatchClass();
void NORETURN reportOutOfMemory(uptr RequestedSize);
void NORETURN reportSoftRSSLimit(uptr RssLimitMb);
void NORETURN reportHardRSSLimit(uptr RssLimitMb);
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/secondary.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/secondary.h
index 2d17757..935b489 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/secondary.h
@@ -12,11 +12,13 @@
#include "chunk.h"
#include "common.h"
#include "list.h"
+#include "mem_map.h"
#include "memtag.h"
#include "mutex.h"
#include "options.h"
#include "stats.h"
#include "string_utils.h"
+#include "thread_annotations.h"
namespace scudo {
@@ -36,9 +38,7 @@
LargeBlock::Header *Next;
uptr CommitBase;
uptr CommitSize;
- uptr MapBase;
- uptr MapSize;
- [[no_unique_address]] MapPlatformData Data;
+ MemMapT MemMap;
};
static_assert(sizeof(Header) % (1U << SCUDO_MIN_ALIGNMENT_LOG) == 0, "");
@@ -65,8 +65,11 @@
} // namespace LargeBlock
static void unmap(LargeBlock::Header *H) {
- MapPlatformData Data = H->Data;
- unmap(reinterpret_cast<void *>(H->MapBase), H->MapSize, UNMAP_ALL, &Data);
+ // Note that the `H->MapMap` is stored on the pages managed by itself. Take
+ // over the ownership before unmap() so that any operation along with unmap()
+ // won't touch inaccessible pages.
+ MemMapT MemMap = H->MemMap;
+ MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
}
class MapAllocatorNoCache {
@@ -96,20 +99,19 @@
template <typename Config>
void mapSecondary(Options Options, uptr CommitBase, uptr CommitSize,
- uptr AllocPos, uptr Flags, MapPlatformData *Data) {
+ uptr AllocPos, uptr Flags, MemMapT &MemMap) {
const uptr MaxUnusedCacheBytes = MaxUnusedCachePages * getPageSizeCached();
if (useMemoryTagging<Config>(Options) && CommitSize > MaxUnusedCacheBytes) {
const uptr UntaggedPos = Max(AllocPos, CommitBase + MaxUnusedCacheBytes);
- map(reinterpret_cast<void *>(CommitBase), UntaggedPos - CommitBase,
- "scudo:secondary", MAP_RESIZABLE | MAP_MEMTAG | Flags, Data);
- map(reinterpret_cast<void *>(UntaggedPos),
- CommitBase + CommitSize - UntaggedPos, "scudo:secondary",
- MAP_RESIZABLE | Flags, Data);
+ MemMap.remap(CommitBase, UntaggedPos - CommitBase, "scudo:secondary",
+ MAP_RESIZABLE | MAP_MEMTAG | Flags);
+ MemMap.remap(UntaggedPos, CommitBase + CommitSize - UntaggedPos,
+ "scudo:secondary", MAP_RESIZABLE | Flags);
} else {
- map(reinterpret_cast<void *>(CommitBase), CommitSize, "scudo:secondary",
+ const uptr RemapFlags =
MAP_RESIZABLE | (useMemoryTagging<Config>(Options) ? MAP_MEMTAG : 0) |
- Flags,
- Data);
+ Flags;
+ MemMap.remap(CommitBase, CommitSize, "scudo:secondary", RemapFlags);
}
}
@@ -133,7 +135,7 @@
Config::SecondaryCacheEntriesArraySize,
"");
- void init(s32 ReleaseToOsInterval) {
+ void init(s32 ReleaseToOsInterval) NO_THREAD_SAFETY_ANALYSIS {
DCHECK_EQ(EntriesCount, 0U);
setOption(Option::MaxCacheEntriesCount,
static_cast<sptr>(Config::SecondaryCacheDefaultMaxEntriesCount));
@@ -142,7 +144,7 @@
setOption(Option::ReleaseInterval, static_cast<sptr>(ReleaseToOsInterval));
}
- void store(Options Options, LargeBlock::Header *H) {
+ void store(Options Options, LargeBlock::Header *H) EXCLUDES(Mutex) {
if (!canCache(H->CommitSize))
return unmap(H);
@@ -154,10 +156,8 @@
CachedBlock Entry;
Entry.CommitBase = H->CommitBase;
Entry.CommitSize = H->CommitSize;
- Entry.MapBase = H->MapBase;
- Entry.MapSize = H->MapSize;
Entry.BlockBegin = reinterpret_cast<uptr>(H + 1);
- Entry.Data = H->Data;
+ Entry.MemMap = H->MemMap;
Entry.Time = Time;
if (useMemoryTagging<Config>(Options)) {
if (Interval == 0 && !SCUDO_FUCHSIA) {
@@ -167,13 +167,13 @@
// on top so we just do the two syscalls there.
Entry.Time = 0;
mapSecondary<Config>(Options, Entry.CommitBase, Entry.CommitSize,
- Entry.CommitBase, MAP_NOACCESS, &Entry.Data);
+ Entry.CommitBase, MAP_NOACCESS, Entry.MemMap);
} else {
- setMemoryPermission(Entry.CommitBase, Entry.CommitSize, MAP_NOACCESS,
- &Entry.Data);
+ Entry.MemMap.setMemoryPermission(Entry.CommitBase, Entry.CommitSize,
+ MAP_NOACCESS);
}
} else if (Interval == 0) {
- releasePagesToOS(Entry.CommitBase, 0, Entry.CommitSize, &Entry.Data);
+ Entry.MemMap.releasePagesToOS(Entry.CommitBase, Entry.CommitSize);
Entry.Time = 0;
}
do {
@@ -222,12 +222,11 @@
else if (Interval >= 0)
releaseOlderThan(Time - static_cast<u64>(Interval) * 1000000);
if (!EntryCached)
- unmap(reinterpret_cast<void *>(Entry.MapBase), Entry.MapSize, UNMAP_ALL,
- &Entry.Data);
+ Entry.MemMap.unmap(Entry.MemMap.getBase(), Entry.MemMap.getCapacity());
}
bool retrieve(Options Options, uptr Size, uptr Alignment,
- LargeBlock::Header **H, bool *Zeroed) {
+ LargeBlock::Header **H, bool *Zeroed) EXCLUDES(Mutex) {
const uptr PageSize = getPageSizeCached();
const u32 MaxCount = atomic_load_relaxed(&MaxEntriesCount);
bool Found = false;
@@ -243,45 +242,46 @@
continue;
const uptr CommitSize = Entries[I].CommitSize;
const uptr AllocPos =
- roundDownTo(CommitBase + CommitSize - Size, Alignment);
+ roundDown(CommitBase + CommitSize - Size, Alignment);
HeaderPos =
AllocPos - Chunk::getHeaderSize() - LargeBlock::getHeaderSize();
if (HeaderPos > CommitBase + CommitSize)
continue;
if (HeaderPos < CommitBase ||
- AllocPos > CommitBase + PageSize * MaxUnusedCachePages)
+ AllocPos > CommitBase + PageSize * MaxUnusedCachePages) {
continue;
+ }
Found = true;
Entry = Entries[I];
Entries[I].CommitBase = 0;
+ EntriesCount--;
break;
}
}
- if (Found) {
- *H = reinterpret_cast<LargeBlock::Header *>(
- LargeBlock::addHeaderTag<Config>(HeaderPos));
- *Zeroed = Entry.Time == 0;
- if (useMemoryTagging<Config>(Options))
- setMemoryPermission(Entry.CommitBase, Entry.CommitSize, 0, &Entry.Data);
- uptr NewBlockBegin = reinterpret_cast<uptr>(*H + 1);
- if (useMemoryTagging<Config>(Options)) {
- if (*Zeroed)
- storeTags(LargeBlock::addHeaderTag<Config>(Entry.CommitBase),
- NewBlockBegin);
- else if (Entry.BlockBegin < NewBlockBegin)
- storeTags(Entry.BlockBegin, NewBlockBegin);
- else
- storeTags(untagPointer(NewBlockBegin),
- untagPointer(Entry.BlockBegin));
+ if (!Found)
+ return false;
+
+ *H = reinterpret_cast<LargeBlock::Header *>(
+ LargeBlock::addHeaderTag<Config>(HeaderPos));
+ *Zeroed = Entry.Time == 0;
+ if (useMemoryTagging<Config>(Options))
+ Entry.MemMap.setMemoryPermission(Entry.CommitBase, Entry.CommitSize, 0);
+ uptr NewBlockBegin = reinterpret_cast<uptr>(*H + 1);
+ if (useMemoryTagging<Config>(Options)) {
+ if (*Zeroed) {
+ storeTags(LargeBlock::addHeaderTag<Config>(Entry.CommitBase),
+ NewBlockBegin);
+ } else if (Entry.BlockBegin < NewBlockBegin) {
+ storeTags(Entry.BlockBegin, NewBlockBegin);
+ } else {
+ storeTags(untagPointer(NewBlockBegin),
+ untagPointer(Entry.BlockBegin));
}
- (*H)->CommitBase = Entry.CommitBase;
- (*H)->CommitSize = Entry.CommitSize;
- (*H)->MapBase = Entry.MapBase;
- (*H)->MapSize = Entry.MapSize;
- (*H)->Data = Entry.Data;
- EntriesCount--;
}
- return Found;
+ (*H)->CommitBase = Entry.CommitBase;
+ (*H)->CommitSize = Entry.CommitSize;
+ (*H)->MemMap = Entry.MemMap;
+ return true;
}
bool canCache(uptr Size) {
@@ -315,67 +315,62 @@
void releaseToOS() { releaseOlderThan(UINT64_MAX); }
- void disableMemoryTagging() {
+ void disableMemoryTagging() EXCLUDES(Mutex) {
ScopedLock L(Mutex);
for (u32 I = 0; I != Config::SecondaryCacheQuarantineSize; ++I) {
if (Quarantine[I].CommitBase) {
- unmap(reinterpret_cast<void *>(Quarantine[I].MapBase),
- Quarantine[I].MapSize, UNMAP_ALL, &Quarantine[I].Data);
+ MemMapT &MemMap = Quarantine[I].MemMap;
+ MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
Quarantine[I].CommitBase = 0;
}
}
const u32 MaxCount = atomic_load_relaxed(&MaxEntriesCount);
- for (u32 I = 0; I < MaxCount; I++)
- if (Entries[I].CommitBase)
- setMemoryPermission(Entries[I].CommitBase, Entries[I].CommitSize, 0,
- &Entries[I].Data);
+ for (u32 I = 0; I < MaxCount; I++) {
+ if (Entries[I].CommitBase) {
+ Entries[I].MemMap.setMemoryPermission(Entries[I].CommitBase,
+ Entries[I].CommitSize, 0);
+ }
+ }
QuarantinePos = -1U;
}
- void disable() { Mutex.lock(); }
+ void disable() NO_THREAD_SAFETY_ANALYSIS { Mutex.lock(); }
- void enable() { Mutex.unlock(); }
+ void enable() NO_THREAD_SAFETY_ANALYSIS { Mutex.unlock(); }
void unmapTestOnly() { empty(); }
private:
void empty() {
- struct {
- void *MapBase;
- uptr MapSize;
- MapPlatformData Data;
- } MapInfo[Config::SecondaryCacheEntriesArraySize];
+ MemMapT MapInfo[Config::SecondaryCacheEntriesArraySize];
uptr N = 0;
{
ScopedLock L(Mutex);
for (uptr I = 0; I < Config::SecondaryCacheEntriesArraySize; I++) {
if (!Entries[I].CommitBase)
continue;
- MapInfo[N].MapBase = reinterpret_cast<void *>(Entries[I].MapBase);
- MapInfo[N].MapSize = Entries[I].MapSize;
- MapInfo[N].Data = Entries[I].Data;
+ MapInfo[N] = Entries[I].MemMap;
Entries[I].CommitBase = 0;
N++;
}
EntriesCount = 0;
IsFullEvents = 0;
}
- for (uptr I = 0; I < N; I++)
- unmap(MapInfo[I].MapBase, MapInfo[I].MapSize, UNMAP_ALL,
- &MapInfo[I].Data);
+ for (uptr I = 0; I < N; I++) {
+ MemMapT &MemMap = MapInfo[I];
+ MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
+ }
}
struct CachedBlock {
- uptr CommitBase;
- uptr CommitSize;
- uptr MapBase;
- uptr MapSize;
- uptr BlockBegin;
- [[no_unique_address]] MapPlatformData Data;
- u64 Time;
+ uptr CommitBase = 0;
+ uptr CommitSize = 0;
+ uptr BlockBegin = 0;
+ MemMapT MemMap = {};
+ u64 Time = 0;
};
- void releaseIfOlderThan(CachedBlock &Entry, u64 Time) {
+ void releaseIfOlderThan(CachedBlock &Entry, u64 Time) REQUIRES(Mutex) {
if (!Entry.CommitBase || !Entry.Time)
return;
if (Entry.Time > Time) {
@@ -383,11 +378,11 @@
OldestTime = Entry.Time;
return;
}
- releasePagesToOS(Entry.CommitBase, 0, Entry.CommitSize, &Entry.Data);
+ Entry.MemMap.releasePagesToOS(Entry.CommitBase, Entry.CommitSize);
Entry.Time = 0;
}
- void releaseOlderThan(u64 Time) {
+ void releaseOlderThan(u64 Time) EXCLUDES(Mutex) {
ScopedLock L(Mutex);
if (!EntriesCount || OldestTime == 0 || OldestTime > Time)
return;
@@ -399,22 +394,24 @@
}
HybridMutex Mutex;
- u32 EntriesCount = 0;
- u32 QuarantinePos = 0;
+ u32 EntriesCount GUARDED_BY(Mutex) = 0;
+ u32 QuarantinePos GUARDED_BY(Mutex) = 0;
atomic_u32 MaxEntriesCount = {};
atomic_uptr MaxEntrySize = {};
- u64 OldestTime = 0;
- u32 IsFullEvents = 0;
+ u64 OldestTime GUARDED_BY(Mutex) = 0;
+ u32 IsFullEvents GUARDED_BY(Mutex) = 0;
atomic_s32 ReleaseToOsIntervalMs = {};
- CachedBlock Entries[Config::SecondaryCacheEntriesArraySize] = {};
+ CachedBlock
+ Entries[Config::SecondaryCacheEntriesArraySize] GUARDED_BY(Mutex) = {};
NonZeroLengthArray<CachedBlock, Config::SecondaryCacheQuarantineSize>
- Quarantine = {};
+ Quarantine GUARDED_BY(Mutex) = {};
};
template <typename Config> class MapAllocator {
public:
- void init(GlobalStats *S, s32 ReleaseToOsInterval = -1) {
+ void init(GlobalStats *S,
+ s32 ReleaseToOsInterval = -1) NO_THREAD_SAFETY_ANALYSIS {
DCHECK_EQ(AllocatedBytes, 0U);
DCHECK_EQ(FreedBytes, 0U);
Cache.init(ReleaseToOsInterval);
@@ -438,19 +435,21 @@
return getBlockEnd(Ptr) - reinterpret_cast<uptr>(Ptr);
}
- void getStats(ScopedString *Str) const;
+ void getStats(ScopedString *Str);
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
Mutex.lock();
Cache.disable();
}
- void enable() {
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
Cache.enable();
Mutex.unlock();
}
template <typename F> void iterateOverBlocks(F Callback) const {
+ Mutex.assertHeld();
+
for (const auto &H : InUseBlocks) {
uptr Ptr = reinterpret_cast<uptr>(&H) + LargeBlock::getHeaderSize();
if (allocatorSupportsMemoryTagging<Config>())
@@ -472,14 +471,14 @@
private:
typename Config::SecondaryCache Cache;
- HybridMutex Mutex;
- DoublyLinkedList<LargeBlock::Header> InUseBlocks;
- uptr AllocatedBytes = 0;
- uptr FreedBytes = 0;
- uptr LargestSize = 0;
- u32 NumberOfAllocs = 0;
- u32 NumberOfFrees = 0;
- LocalStats Stats;
+ mutable HybridMutex Mutex;
+ DoublyLinkedList<LargeBlock::Header> InUseBlocks GUARDED_BY(Mutex);
+ uptr AllocatedBytes GUARDED_BY(Mutex) = 0;
+ uptr FreedBytes GUARDED_BY(Mutex) = 0;
+ uptr LargestSize GUARDED_BY(Mutex) = 0;
+ u32 NumberOfAllocs GUARDED_BY(Mutex) = 0;
+ u32 NumberOfFrees GUARDED_BY(Mutex) = 0;
+ LocalStats Stats GUARDED_BY(Mutex);
};
// As with the Primary, the size passed to this function includes any desired
@@ -502,9 +501,9 @@
Alignment = Max(Alignment, uptr(1U) << SCUDO_MIN_ALIGNMENT_LOG);
const uptr PageSize = getPageSizeCached();
uptr RoundedSize =
- roundUpTo(roundUpTo(Size, Alignment) + LargeBlock::getHeaderSize() +
- Chunk::getHeaderSize(),
- PageSize);
+ roundUp(roundUp(Size, Alignment) + LargeBlock::getHeaderSize() +
+ Chunk::getHeaderSize(),
+ PageSize);
if (Alignment > PageSize)
RoundedSize += Alignment - PageSize;
@@ -530,16 +529,20 @@
AllocatedBytes += BlockSize;
NumberOfAllocs++;
Stats.add(StatAllocated, BlockSize);
- Stats.add(StatMapped, H->MapSize);
+ Stats.add(StatMapped, H->MemMap.getCapacity());
}
return Ptr;
}
}
- MapPlatformData Data = {};
+ ReservedMemoryT ReservedMemory;
const uptr MapSize = RoundedSize + 2 * PageSize;
- uptr MapBase = reinterpret_cast<uptr>(
- map(nullptr, MapSize, nullptr, MAP_NOACCESS | MAP_ALLOWNOMEM, &Data));
+ ReservedMemory.create(/*Addr=*/0U, MapSize, nullptr, MAP_ALLOWNOMEM);
+
+ // Take the entire ownership of reserved region.
+ MemMapT MemMap = ReservedMemory.dispatch(ReservedMemory.getBase(),
+ ReservedMemory.getCapacity());
+ uptr MapBase = MemMap.getBase();
if (UNLIKELY(!MapBase))
return nullptr;
uptr CommitBase = MapBase + PageSize;
@@ -551,27 +554,27 @@
// For alignments greater than or equal to a page, the user pointer (eg: the
// pointer that is returned by the C or C++ allocation APIs) ends up on a
// page boundary , and our headers will live in the preceding page.
- CommitBase = roundUpTo(MapBase + PageSize + 1, Alignment) - PageSize;
+ CommitBase = roundUp(MapBase + PageSize + 1, Alignment) - PageSize;
const uptr NewMapBase = CommitBase - PageSize;
DCHECK_GE(NewMapBase, MapBase);
// We only trim the extra memory on 32-bit platforms: 64-bit platforms
// are less constrained memory wise, and that saves us two syscalls.
if (SCUDO_WORDSIZE == 32U && NewMapBase != MapBase) {
- unmap(reinterpret_cast<void *>(MapBase), NewMapBase - MapBase, 0, &Data);
+ MemMap.unmap(MapBase, NewMapBase - MapBase);
MapBase = NewMapBase;
}
const uptr NewMapEnd =
- CommitBase + PageSize + roundUpTo(Size, PageSize) + PageSize;
+ CommitBase + PageSize + roundUp(Size, PageSize) + PageSize;
DCHECK_LE(NewMapEnd, MapEnd);
if (SCUDO_WORDSIZE == 32U && NewMapEnd != MapEnd) {
- unmap(reinterpret_cast<void *>(NewMapEnd), MapEnd - NewMapEnd, 0, &Data);
+ MemMap.unmap(NewMapEnd, MapEnd - NewMapEnd);
MapEnd = NewMapEnd;
}
}
const uptr CommitSize = MapEnd - PageSize - CommitBase;
- const uptr AllocPos = roundDownTo(CommitBase + CommitSize - Size, Alignment);
- mapSecondary<Config>(Options, CommitBase, CommitSize, AllocPos, 0, &Data);
+ const uptr AllocPos = roundDown(CommitBase + CommitSize - Size, Alignment);
+ mapSecondary<Config>(Options, CommitBase, CommitSize, AllocPos, 0, MemMap);
const uptr HeaderPos =
AllocPos - Chunk::getHeaderSize() - LargeBlock::getHeaderSize();
LargeBlock::Header *H = reinterpret_cast<LargeBlock::Header *>(
@@ -579,11 +582,9 @@
if (useMemoryTagging<Config>(Options))
storeTags(LargeBlock::addHeaderTag<Config>(CommitBase),
reinterpret_cast<uptr>(H + 1));
- H->MapBase = MapBase;
- H->MapSize = MapEnd - MapBase;
H->CommitBase = CommitBase;
H->CommitSize = CommitSize;
- H->Data = Data;
+ H->MemMap = MemMap;
if (BlockEndPtr)
*BlockEndPtr = CommitBase + CommitSize;
{
@@ -594,13 +595,14 @@
LargestSize = CommitSize;
NumberOfAllocs++;
Stats.add(StatAllocated, CommitSize);
- Stats.add(StatMapped, H->MapSize);
+ Stats.add(StatMapped, H->MemMap.getCapacity());
}
return reinterpret_cast<void *>(HeaderPos + LargeBlock::getHeaderSize());
}
template <typename Config>
-void MapAllocator<Config>::deallocate(Options Options, void *Ptr) {
+void MapAllocator<Config>::deallocate(Options Options, void *Ptr)
+ EXCLUDES(Mutex) {
LargeBlock::Header *H = LargeBlock::getHeader<Config>(Ptr);
const uptr CommitSize = H->CommitSize;
{
@@ -609,13 +611,14 @@
FreedBytes += CommitSize;
NumberOfFrees++;
Stats.sub(StatAllocated, CommitSize);
- Stats.sub(StatMapped, H->MapSize);
+ Stats.sub(StatMapped, H->MemMap.getCapacity());
}
Cache.store(Options, H);
}
template <typename Config>
-void MapAllocator<Config>::getStats(ScopedString *Str) const {
+void MapAllocator<Config>::getStats(ScopedString *Str) EXCLUDES(Mutex) {
+ ScopedLock L(Mutex);
Str->append("Stats: MapAllocator: allocated %u times (%zuK), freed %u times "
"(%zuK), remains %u (%zuK) max %zuM\n",
NumberOfAllocs, AllocatedBytes >> 10, NumberOfFrees,
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/stats.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/stats.h
index be5bf2d..658b758 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/stats.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/stats.h
@@ -12,6 +12,7 @@
#include "atomic_helpers.h"
#include "list.h"
#include "mutex.h"
+#include "thread_annotations.h"
#include <string.h>
@@ -60,19 +61,19 @@
public:
void init() { LocalStats::init(); }
- void link(LocalStats *S) {
+ void link(LocalStats *S) EXCLUDES(Mutex) {
ScopedLock L(Mutex);
StatsList.push_back(S);
}
- void unlink(LocalStats *S) {
+ void unlink(LocalStats *S) EXCLUDES(Mutex) {
ScopedLock L(Mutex);
StatsList.remove(S);
for (uptr I = 0; I < StatCount; I++)
add(static_cast<StatType>(I), S->get(static_cast<StatType>(I)));
}
- void get(uptr *S) const {
+ void get(uptr *S) const EXCLUDES(Mutex) {
ScopedLock L(Mutex);
for (uptr I = 0; I < StatCount; I++)
S[I] = LocalStats::get(static_cast<StatType>(I));
@@ -85,15 +86,15 @@
S[I] = static_cast<sptr>(S[I]) >= 0 ? S[I] : 0;
}
- void lock() { Mutex.lock(); }
- void unlock() { Mutex.unlock(); }
+ void lock() ACQUIRE(Mutex) { Mutex.lock(); }
+ void unlock() RELEASE(Mutex) { Mutex.unlock(); }
- void disable() { lock(); }
- void enable() { unlock(); }
+ void disable() ACQUIRE(Mutex) { lock(); }
+ void enable() RELEASE(Mutex) { unlock(); }
private:
mutable HybridMutex Mutex;
- DoublyLinkedList<LocalStats> StatsList;
+ DoublyLinkedList<LocalStats> StatsList GUARDED_BY(Mutex);
};
} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/string_utils.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/string_utils.cpp
index 13fdb9c..7e516f9 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/string_utils.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/string_utils.cpp
@@ -195,6 +195,28 @@
appendChar(&Buffer, BufferEnd, static_cast<char>(va_arg(Args, int)));
break;
}
+ // In Scudo, `s64`/`u64` are supposed to use `lld` and `llu` respectively.
+ // However, `-Wformat` doesn't know we have a different parser for those
+ // placeholders and it keeps complaining the type mismatch on 64-bit
+ // platform which uses `ld`/`lu` for `s64`/`u64`. Therefore, in order to
+ // silence the warning, we turn to use `PRId64`/`PRIu64` for printing
+ // `s64`/`u64` and handle the `ld`/`lu` here.
+ case 'l': {
+ ++Cur;
+ RAW_CHECK(*Cur == 'd' || *Cur == 'u');
+
+ if (*Cur == 'd') {
+ DVal = va_arg(Args, s64);
+ Res +=
+ appendSignedDecimal(&Buffer, BufferEnd, DVal, Width, PadWithZero);
+ } else {
+ UVal = va_arg(Args, u64);
+ Res += appendUnsigned(&Buffer, BufferEnd, UVal, 10, Width, PadWithZero,
+ false);
+ }
+
+ break;
+ }
case '%': {
RAW_CHECK_MSG(!HaveFlags, PrintfFormatsHelp);
Res += appendChar(&Buffer, BufferEnd, '%');
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
index 8200cd2..335e4b7 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
@@ -31,6 +31,9 @@
-mno-omit-leaf-frame-pointer)
endif()
+append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG -Werror=thread-safety
+ SCUDO_UNITTEST_CFLAGS)
+
set(SCUDO_TEST_ARCH ${SCUDO_STANDALONE_SUPPORTED_ARCH})
# gtests requires c++
@@ -102,6 +105,7 @@
size_class_map_test.cpp
stats_test.cpp
strings_test.cpp
+ timing_test.cpp
tsd_test.cpp
vector_test.cpp
scudo_unit_test_main.cpp
@@ -127,3 +131,11 @@
add_scudo_unittest(ScudoCxxUnitTest
SOURCES ${SCUDO_CXX_UNIT_TEST_SOURCES}
ADDITIONAL_RTOBJECTS RTScudoStandaloneCWrappers RTScudoStandaloneCxxWrappers)
+
+set(SCUDO_HOOKS_UNIT_TEST_SOURCES
+ scudo_hooks_test.cpp
+ scudo_unit_test_main.cpp
+ )
+
+add_scudo_unittest(ScudoHooksUnitTest
+ SOURCES ${SCUDO_HOOKS_UNIT_TEST_SOURCES})
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
index 16032fc..7bf580e 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
@@ -12,6 +12,7 @@
#include "allocator_config.h"
#include "chunk.h"
#include "combined.h"
+#include "mem_map.h"
#include <condition_variable>
#include <memory>
@@ -39,7 +40,7 @@
if (Alignment < MinAlignment)
Alignment = MinAlignment;
const scudo::uptr NeededSize =
- scudo::roundUpTo(Size, MinAlignment) +
+ scudo::roundUp(Size, MinAlignment) +
((Alignment > MinAlignment) ? Alignment : scudo::Chunk::getHeaderSize());
return AllocatorT::PrimaryT::canAllocate(NeededSize);
}
@@ -48,7 +49,7 @@
void checkMemoryTaggingMaybe(AllocatorT *Allocator, void *P, scudo::uptr Size,
scudo::uptr Alignment) {
const scudo::uptr MinAlignment = 1UL << SCUDO_MIN_ALIGNMENT_LOG;
- Size = scudo::roundUpTo(Size, MinAlignment);
+ Size = scudo::roundUp(Size, MinAlignment);
if (Allocator->useMemoryTaggingTestOnly())
EXPECT_DEATH(
{
@@ -92,7 +93,7 @@
Allocator = std::make_unique<AllocatorT>();
}
~ScudoCombinedTest() {
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
UseQuarantine = true;
}
@@ -412,7 +413,7 @@
reinterpret_cast<char *>(P)[2048] = 0xaa;
Allocator->deallocate(P, Origin);
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
}
}
@@ -435,7 +436,7 @@
EXPECT_NE(Stats.find("Stats: Quarantine"), std::string::npos);
}
-SCUDO_TYPED_TEST(ScudoCombinedTest, CacheDrain) {
+SCUDO_TYPED_TEST(ScudoCombinedTest, CacheDrain) NO_THREAD_SAFETY_ANALYSIS {
auto *Allocator = this->Allocator.get();
std::vector<void *> V;
@@ -447,9 +448,9 @@
bool UnlockRequired;
auto *TSD = Allocator->getTSDRegistry()->getTSDAndLock(&UnlockRequired);
- EXPECT_TRUE(!TSD->Cache.isEmpty());
- TSD->Cache.drain();
- EXPECT_TRUE(TSD->Cache.isEmpty());
+ EXPECT_TRUE(!TSD->getCache().isEmpty());
+ TSD->getCache().drain();
+ EXPECT_TRUE(TSD->getCache().isEmpty());
if (UnlockRequired)
TSD->unlock();
}
@@ -488,18 +489,19 @@
}
for (auto &T : Threads)
T.join();
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
}
// Test that multiple instantiations of the allocator have not messed up the
// process's signal handlers (GWP-ASan used to do this).
TEST(ScudoCombinedDeathTest, SKIP_ON_FUCHSIA(testSEGV)) {
const scudo::uptr Size = 4 * scudo::getPageSizeCached();
- scudo::MapPlatformData Data = {};
- void *P = scudo::map(nullptr, Size, "testSEGV", MAP_NOACCESS, &Data);
- EXPECT_NE(P, nullptr);
+ scudo::ReservedMemoryT ReservedMemory;
+ ASSERT_TRUE(ReservedMemory.create(/*Addr=*/0U, Size, "testSEGV"));
+ void *P = reinterpret_cast<void *>(ReservedMemory.getBase());
+ ASSERT_NE(P, nullptr);
EXPECT_DEATH(memset(P, 0xaa, Size), "");
- scudo::unmap(P, Size, UNMAP_ALL, &Data);
+ ReservedMemory.release();
}
struct DeathSizeClassConfig {
@@ -601,7 +603,7 @@
// operation without issue.
SCUDO_TYPED_TEST(ScudoCombinedTest, ReleaseToOS) {
auto *Allocator = this->Allocator.get();
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
}
SCUDO_TYPED_TEST(ScudoCombinedTest, OddEven) {
@@ -705,8 +707,8 @@
SCUDO_TYPED_TEST(ScudoCombinedTest, RingBufferSize) {
auto *Allocator = this->Allocator.get();
auto Size = Allocator->getRingBufferSize();
- ASSERT_GT(Size, 0u);
- EXPECT_EQ(Allocator->getRingBufferAddress()[Size - 1], '\0');
+ if (Size > 0)
+ EXPECT_EQ(Allocator->getRingBufferAddress()[Size - 1], '\0');
}
SCUDO_TYPED_TEST(ScudoCombinedTest, RingBufferAddress) {
@@ -738,9 +740,9 @@
bool UnlockRequired;
auto *TSD = Allocator->getTSDRegistry()->getTSDAndLock(&UnlockRequired);
- TSD->Cache.drain();
+ TSD->getCache().drain();
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
}
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/common_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/common_test.cpp
index c53b6af..b1e55e8 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/common_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/common_test.cpp
@@ -10,6 +10,7 @@
#include "tests/scudo_unit_test.h"
#include "common.h"
+#include "mem_map.h"
#include <algorithm>
#include <fstream>
@@ -34,42 +35,48 @@
const uptr Size = 1ull << 30;
const uptr Threshold = Size >> 3;
- MapPlatformData Data = {};
- void *P = map(nullptr, Size, "ResidentMemorySize", 0, &Data);
- ASSERT_NE(nullptr, P);
+ MemMapT MemMap;
+ ASSERT_TRUE(MemMap.map(/*Addr=*/0U, Size, "ResidentMemorySize"));
+ ASSERT_NE(MemMap.getBase(), 0U);
+ void *P = reinterpret_cast<void *>(MemMap.getBase());
EXPECT_LT(getResidentMemorySize(), OnStart + Threshold);
memset(P, 1, Size);
EXPECT_GT(getResidentMemorySize(), OnStart + Size - Threshold);
- releasePagesToOS((uptr)P, 0, Size, &Data);
+ MemMap.releasePagesToOS(MemMap.getBase(), Size);
EXPECT_LT(getResidentMemorySize(), OnStart + Threshold);
memset(P, 1, Size);
EXPECT_GT(getResidentMemorySize(), OnStart + Size - Threshold);
- unmap(P, Size, 0, &Data);
+ MemMap.unmap(MemMap.getBase(), Size);
}
TEST(ScudoCommonTest, Zeros) {
const uptr Size = 1ull << 20;
- MapPlatformData Data = {};
- uptr *P = reinterpret_cast<uptr *>(map(nullptr, Size, "Zeros", 0, &Data));
- const ptrdiff_t N = Size / sizeof(*P);
- ASSERT_NE(nullptr, P);
+ MemMapT MemMap;
+ ASSERT_TRUE(MemMap.map(/*Addr=*/0U, Size, "Zeros"));
+ ASSERT_NE(MemMap.getBase(), 0U);
+ uptr *P = reinterpret_cast<uptr *>(MemMap.getBase());
+ const ptrdiff_t N = Size / sizeof(uptr);
EXPECT_EQ(std::count(P, P + N, 0), N);
memset(P, 1, Size);
EXPECT_EQ(std::count(P, P + N, 0), 0);
- releasePagesToOS((uptr)P, 0, Size, &Data);
+ MemMap.releasePagesToOS(MemMap.getBase(), Size);
EXPECT_EQ(std::count(P, P + N, 0), N);
- unmap(P, Size, 0, &Data);
+ MemMap.unmap(MemMap.getBase(), Size);
}
-#if SCUDO_LINUX
+#if 0
+// This test is temorarily disabled because it may not work as expected. E.g.,
+// it doesn't dirty the pages so the pages may not be commited and it may only
+// work on the single thread environment. As a result, this test is flaky and is
+// impacting many test scenarios.
TEST(ScudoCommonTest, GetRssFromBuffer) {
constexpr int64_t AllocSize = 10000000;
constexpr int64_t Error = 3000000;
@@ -86,6 +93,6 @@
EXPECT_LE(std::abs(Rss - AllocSize - Prev), Error);
}
}
-#endif // SCUDO_LINUX
+#endif
} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/map_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/map_test.cpp
index ff05258..06a56f8 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/map_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/map_test.cpp
@@ -9,6 +9,7 @@
#include "tests/scudo_unit_test.h"
#include "common.h"
+#include "mem_map.h"
#include <string.h>
#include <unistd.h>
@@ -22,11 +23,15 @@
TEST(ScudoMapDeathTest, MapNoAccessUnmap) {
const scudo::uptr Size = 4 * scudo::getPageSizeCached();
- scudo::MapPlatformData Data = {};
- void *P = scudo::map(nullptr, Size, MappingName, MAP_NOACCESS, &Data);
- EXPECT_NE(P, nullptr);
- EXPECT_DEATH(memset(P, 0xaa, Size), "");
- scudo::unmap(P, Size, UNMAP_ALL, &Data);
+ scudo::ReservedMemoryT ReservedMemory;
+
+ ASSERT_TRUE(ReservedMemory.create(/*Addr=*/0U, Size, MappingName));
+ EXPECT_NE(ReservedMemory.getBase(), 0U);
+ EXPECT_DEATH(
+ memset(reinterpret_cast<void *>(ReservedMemory.getBase()), 0xaa, Size),
+ "");
+
+ ReservedMemory.release();
}
TEST(ScudoMapDeathTest, MapUnmap) {
@@ -36,11 +41,13 @@
// Repeat few time to avoid missing crash if it's mmaped by unrelated
// code.
for (int i = 0; i < 10; ++i) {
- void *P = scudo::map(nullptr, Size, MappingName, 0, nullptr);
- if (!P)
+ scudo::MemMapT MemMap;
+ MemMap.map(/*Addr=*/0U, Size, MappingName);
+ scudo::uptr P = MemMap.getBase();
+ if (P == 0U)
continue;
- scudo::unmap(P, Size, 0, nullptr);
- memset(P, 0xbb, Size);
+ MemMap.unmap(MemMap.getBase(), Size);
+ memset(reinterpret_cast<void *>(P), 0xbb, Size);
}
},
"");
@@ -49,30 +56,36 @@
TEST(ScudoMapDeathTest, MapWithGuardUnmap) {
const scudo::uptr PageSize = scudo::getPageSizeCached();
const scudo::uptr Size = 4 * PageSize;
- scudo::MapPlatformData Data = {};
- void *P = scudo::map(nullptr, Size + 2 * PageSize, MappingName, MAP_NOACCESS,
- &Data);
- EXPECT_NE(P, nullptr);
- void *Q =
- reinterpret_cast<void *>(reinterpret_cast<scudo::uptr>(P) + PageSize);
- EXPECT_EQ(scudo::map(Q, Size, MappingName, 0, &Data), Q);
- memset(Q, 0xaa, Size);
- EXPECT_DEATH(memset(Q, 0xaa, Size + 1), "");
- scudo::unmap(P, Size + 2 * PageSize, UNMAP_ALL, &Data);
+ scudo::ReservedMemoryT ReservedMemory;
+ ASSERT_TRUE(
+ ReservedMemory.create(/*Addr=*/0U, Size + 2 * PageSize, MappingName));
+ ASSERT_NE(ReservedMemory.getBase(), 0U);
+
+ scudo::MemMapT MemMap =
+ ReservedMemory.dispatch(ReservedMemory.getBase(), Size + 2 * PageSize);
+ ASSERT_TRUE(MemMap.isAllocated());
+ scudo::uptr Q = MemMap.getBase() + PageSize;
+ ASSERT_TRUE(MemMap.remap(Q, Size, MappingName));
+ memset(reinterpret_cast<void *>(Q), 0xaa, Size);
+ EXPECT_DEATH(memset(reinterpret_cast<void *>(Q), 0xaa, Size + 1), "");
+ MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
}
TEST(ScudoMapTest, MapGrowUnmap) {
const scudo::uptr PageSize = scudo::getPageSizeCached();
const scudo::uptr Size = 4 * PageSize;
- scudo::MapPlatformData Data = {};
- void *P = scudo::map(nullptr, Size, MappingName, MAP_NOACCESS, &Data);
- EXPECT_NE(P, nullptr);
- void *Q =
- reinterpret_cast<void *>(reinterpret_cast<scudo::uptr>(P) + PageSize);
- EXPECT_EQ(scudo::map(Q, PageSize, MappingName, 0, &Data), Q);
- memset(Q, 0xaa, PageSize);
- Q = reinterpret_cast<void *>(reinterpret_cast<scudo::uptr>(Q) + PageSize);
- EXPECT_EQ(scudo::map(Q, PageSize, MappingName, 0, &Data), Q);
- memset(Q, 0xbb, PageSize);
- scudo::unmap(P, Size, UNMAP_ALL, &Data);
+ scudo::ReservedMemoryT ReservedMemory;
+ ReservedMemory.create(/*Addr=*/0U, Size, MappingName);
+ ASSERT_TRUE(ReservedMemory.isCreated());
+
+ scudo::MemMapT MemMap =
+ ReservedMemory.dispatch(ReservedMemory.getBase(), Size);
+ ASSERT_TRUE(MemMap.isAllocated());
+ scudo::uptr Q = MemMap.getBase() + PageSize;
+ ASSERT_TRUE(MemMap.remap(Q, PageSize, MappingName));
+ memset(reinterpret_cast<void *>(Q), 0xaa, PageSize);
+ Q += PageSize;
+ ASSERT_TRUE(MemMap.remap(Q, PageSize, MappingName));
+ memset(reinterpret_cast<void *>(Q), 0xbb, PageSize);
+ MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
index 283edaa..d4c39aa 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "common.h"
+#include "mem_map.h"
#include "memtag.h"
#include "platform.h"
#include "tests/scudo_unit_test.h"
@@ -45,20 +46,24 @@
GTEST_SKIP() << "Memory tagging is not supported";
BufferSize = getPageSizeCached();
- Buffer = reinterpret_cast<u8 *>(
- map(nullptr, BufferSize, "MemtagTest", MAP_MEMTAG, &Data));
- Addr = reinterpret_cast<uptr>(Buffer);
+ ASSERT_FALSE(MemMap.isAllocated());
+ ASSERT_TRUE(MemMap.map(/*Addr=*/0U, BufferSize, "MemtagTest", MAP_MEMTAG));
+ ASSERT_NE(MemMap.getBase(), 0U);
+ Addr = MemMap.getBase();
+ Buffer = reinterpret_cast<u8 *>(Addr);
EXPECT_TRUE(isAligned(Addr, archMemoryTagGranuleSize()));
EXPECT_EQ(Addr, untagPointer(Addr));
}
void TearDown() override {
- if (Buffer)
- unmap(Buffer, BufferSize, 0, &Data);
+ if (Buffer) {
+ ASSERT_TRUE(MemMap.isAllocated());
+ MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
+ }
}
uptr BufferSize = 0;
- MapPlatformData Data = {};
+ scudo::MemMapT MemMap = {};
u8 *Buffer = nullptr;
uptr Addr = 0;
};
@@ -163,7 +168,7 @@
uptr TaggedBegin = addFixedTag(NoTagBegin, Tag);
uptr TaggedEnd = addFixedTag(NoTagEnd, Tag);
- EXPECT_EQ(roundUpTo(TaggedEnd, archMemoryTagGranuleSize()),
+ EXPECT_EQ(roundUp(TaggedEnd, archMemoryTagGranuleSize()),
storeTags(TaggedBegin, TaggedEnd));
uptr LoadPtr = Addr;
@@ -179,7 +184,7 @@
EXPECT_EQ(LoadPtr, loadTag(LoadPtr));
// Reset tags without using StoreTags.
- releasePagesToOS(Addr, 0, BufferSize, &Data);
+ MemMap.releasePagesToOS(Addr, BufferSize);
}
}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
index d3242a3..c3efeab 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
@@ -99,3 +99,10 @@
for (scudo::u32 I = 0; I < NumberOfThreads; I++)
pthread_join(Threads[I], 0);
}
+
+TEST(ScudoMutexTest, MutexAssertHeld) {
+ scudo::HybridMutex M;
+ M.lock();
+ M.assertHeld();
+ M.unlock();
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
index c7ebcc3..51a7038 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
@@ -161,7 +161,7 @@
Cache.deallocate(ClassId, Pointers[J]);
}
Cache.destroy(nullptr);
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
scudo::ScopedString Str;
Allocator->getStats(&Str);
Str.output();
@@ -215,7 +215,7 @@
Cache.deallocate(Primary::SizeClassMap::BatchClassId, B);
}
Cache.destroy(nullptr);
- Allocator.releaseToOS();
+ Allocator.releaseToOS(scudo::ReleaseToOS::Force);
scudo::ScopedString Str;
Allocator.getStats(&Str);
Str.output();
@@ -253,7 +253,7 @@
V.pop_back();
}
Cache.destroy(nullptr);
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
scudo::ScopedString Str;
Allocator->getStats(&Str);
Str.output();
@@ -300,7 +300,7 @@
}
for (auto &T : Threads)
T.join();
- Allocator->releaseToOS();
+ Allocator->releaseToOS(scudo::ReleaseToOS::Force);
scudo::ScopedString Str;
Allocator->getStats(&Str);
Str.output();
@@ -322,7 +322,7 @@
EXPECT_NE(P, nullptr);
Cache.deallocate(ClassId, P);
Cache.destroy(nullptr);
- EXPECT_GT(Allocator->releaseToOS(), 0U);
+ EXPECT_GT(Allocator->releaseToOS(scudo::ReleaseToOS::Force), 0U);
}
SCUDO_TYPED_TEST(ScudoPrimaryTest, MemoryGroup) {
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/release_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/release_test.cpp
index 8625e7f..1fc4284 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/release_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/release_test.cpp
@@ -29,7 +29,7 @@
// Verify the packing ratio, the counter is Expected to be packed into the
// closest power of 2 bits.
scudo::RegionPageMap PageMap(1U, SCUDO_WORDSIZE, 1UL << I);
- EXPECT_EQ(sizeof(scudo::uptr) * scudo::roundUpToPowerOfTwo(I + 1),
+ EXPECT_EQ(sizeof(scudo::uptr) * scudo::roundUpPowerOfTwo(I + 1),
PageMap.getBufferSize());
}
@@ -54,6 +54,27 @@
EXPECT_EQ(2UL, PageMap.get(0U, C));
}
}
+
+ // Similar to the above except that we are using incN().
+ for (scudo::uptr I = 0; (SCUDO_WORDSIZE >> I) != 0; I++) {
+ // Make sure counters request one memory page for the buffer.
+ const scudo::uptr NumCounters =
+ (scudo::getPageSizeCached() / 8) * (SCUDO_WORDSIZE >> I);
+ scudo::uptr MaxValue = 1UL << ((1UL << I) - 1);
+ if (MaxValue <= 1U)
+ continue;
+
+ scudo::RegionPageMap PageMap(1U, NumCounters, MaxValue);
+
+ scudo::uptr N = MaxValue / 2;
+ PageMap.incN(0U, 0, N);
+ for (scudo::uptr C = 1; C < NumCounters; C++) {
+ EXPECT_EQ(0UL, PageMap.get(0U, C));
+ PageMap.incN(0U, C, N);
+ EXPECT_EQ(N, PageMap.get(0U, C - 1));
+ }
+ EXPECT_EQ(N, PageMap.get(0U, NumCounters - 1));
+ }
}
class StringRangeRecorder {
@@ -117,15 +138,18 @@
class ReleasedPagesRecorder {
public:
+ ReleasedPagesRecorder() = default;
+ explicit ReleasedPagesRecorder(scudo::uptr Base) : Base(Base) {}
std::set<scudo::uptr> ReportedPages;
void releasePageRangeToOS(scudo::uptr From, scudo::uptr To) {
const scudo::uptr PageSize = scudo::getPageSizeCached();
for (scudo::uptr I = From; I < To; I += PageSize)
- ReportedPages.insert(I);
+ ReportedPages.insert(I + getBase());
}
- scudo::uptr getBase() const { return 0; }
+ scudo::uptr getBase() const { return Base; }
+ scudo::uptr Base = 0;
};
// Simplified version of a TransferBatch.
@@ -196,11 +220,12 @@
auto SkipRegion = [](UNUSED scudo::uptr RegionIndex) { return false; };
auto DecompactPtr = [](scudo::uptr P) { return P; };
ReleasedPagesRecorder Recorder;
- scudo::PageReleaseContext Context(BlockSize,
- /*RegionSize=*/MaxBlocks * BlockSize,
- /*NumberOfRegions=*/1U);
+ scudo::PageReleaseContext Context(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/MaxBlocks * BlockSize);
ASSERT_FALSE(Context.hasBlockMarked());
- Context.markFreeBlocks(FreeList, DecompactPtr, Recorder.getBase());
+ Context.markFreeBlocksInRegion(FreeList, DecompactPtr, Recorder.getBase(),
+ /*RegionIndex=*/0, MaxBlocks * BlockSize,
+ /*MayContainLastBlockInRegion=*/true);
ASSERT_TRUE(Context.hasBlockMarked());
releaseFreeMemoryToOS(Context, Recorder, SkipRegion);
scudo::RegionPageMap &PageMap = Context.PageMap;
@@ -238,7 +263,7 @@
InFreeRange = false;
// Verify that all entire memory pages covered by this range of free
// chunks were released.
- scudo::uptr P = scudo::roundUpTo(CurrentFreeRangeStart, PageSize);
+ scudo::uptr P = scudo::roundUp(CurrentFreeRangeStart, PageSize);
while (P + PageSize <= CurrentBlock) {
const bool PageReleased =
Recorder.ReportedPages.find(P) != Recorder.ReportedPages.end();
@@ -254,9 +279,9 @@
}
if (InFreeRange) {
- scudo::uptr P = scudo::roundUpTo(CurrentFreeRangeStart, PageSize);
+ scudo::uptr P = scudo::roundUp(CurrentFreeRangeStart, PageSize);
const scudo::uptr EndPage =
- scudo::roundUpTo(MaxBlocks * BlockSize, PageSize);
+ scudo::roundUp(MaxBlocks * BlockSize, PageSize);
while (P + PageSize <= EndPage) {
const bool PageReleased =
Recorder.ReportedPages.find(P) != Recorder.ReportedPages.end();
@@ -277,6 +302,241 @@
}
}
+template <class SizeClassMap> void testPageMapMarkRange() {
+ const scudo::uptr PageSize = scudo::getPageSizeCached();
+
+ for (scudo::uptr I = 1; I <= SizeClassMap::LargestClassId; I++) {
+ const scudo::uptr BlockSize = SizeClassMap::getSizeByClassId(I);
+
+ const scudo::uptr GroupNum = 2;
+ const scudo::uptr GroupSize = scudo::roundUp(BlockSize, PageSize) * 2;
+ const scudo::uptr RegionSize =
+ scudo::roundUpSlow(GroupSize * GroupNum, BlockSize);
+ const scudo::uptr RoundedRegionSize = scudo::roundUp(RegionSize, PageSize);
+
+ std::vector<scudo::uptr> Pages(RoundedRegionSize / PageSize, 0);
+ for (scudo::uptr Block = 0; Block + BlockSize <= RoundedRegionSize;
+ Block += BlockSize) {
+ for (scudo::uptr page = Block / PageSize;
+ page <= (Block + BlockSize - 1) / PageSize; ++page) {
+ ASSERT_LT(page, Pages.size());
+ ++Pages[page];
+ }
+ }
+
+ for (scudo::uptr GroupId = 0; GroupId < GroupNum; ++GroupId) {
+ const scudo::uptr GroupBeg = GroupId * GroupSize;
+ const scudo::uptr GroupEnd = GroupBeg + GroupSize;
+
+ scudo::PageReleaseContext Context(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/RegionSize);
+ Context.markRangeAsAllCounted(GroupBeg, GroupEnd, /*Base=*/0U,
+ /*RegionIndex=*/0, RegionSize);
+
+ scudo::uptr FirstBlock =
+ ((GroupBeg + BlockSize - 1) / BlockSize) * BlockSize;
+
+ // All the pages before first block page are not supposed to be marked.
+ if (FirstBlock / PageSize > 0) {
+ for (scudo::uptr Page = 0; Page <= FirstBlock / PageSize - 1; ++Page)
+ EXPECT_EQ(Context.PageMap.get(/*Region=*/0, Page), 0U);
+ }
+
+ // Verify the pages used by the blocks in the group except that if the
+ // end of the last block is not aligned with `GroupEnd`, it'll be verified
+ // later.
+ scudo::uptr Block;
+ for (Block = FirstBlock; Block + BlockSize <= GroupEnd;
+ Block += BlockSize) {
+ for (scudo::uptr Page = Block / PageSize;
+ Page <= (Block + BlockSize - 1) / PageSize; ++Page) {
+ // First used page in the group has two cases, which are w/ and w/o
+ // block sitting across the boundary.
+ if (Page == FirstBlock / PageSize) {
+ if (FirstBlock % PageSize == 0) {
+ EXPECT_TRUE(Context.PageMap.isAllCounted(/*Region=*/0U, Page));
+ } else {
+ // There's a block straddling `GroupBeg`, it's supposed to only
+ // increment the counter and we expect it should be 1 less
+ // (exclude the straddling one) than the total blocks on the page.
+ EXPECT_EQ(Context.PageMap.get(/*Region=*/0U, Page),
+ Pages[Page] - 1);
+ }
+ } else {
+ EXPECT_TRUE(Context.PageMap.isAllCounted(/*Region=*/0, Page));
+ }
+ }
+ }
+
+ if (Block == GroupEnd)
+ continue;
+
+ // Examine the last block which sits across the group boundary.
+ if (Block + BlockSize == RegionSize) {
+ // This is the last block in the region, it's supposed to mark all the
+ // pages as all counted.
+ for (scudo::uptr Page = Block / PageSize;
+ Page <= (Block + BlockSize - 1) / PageSize; ++Page) {
+ EXPECT_TRUE(Context.PageMap.isAllCounted(/*Region=*/0, Page));
+ }
+ } else {
+ for (scudo::uptr Page = Block / PageSize;
+ Page <= (Block + BlockSize - 1) / PageSize; ++Page) {
+ if (Page <= (GroupEnd - 1) / PageSize)
+ EXPECT_TRUE(Context.PageMap.isAllCounted(/*Region=*/0, Page));
+ else
+ EXPECT_EQ(Context.PageMap.get(/*Region=*/0U, Page), 1U);
+ }
+ }
+
+ const scudo::uptr FirstUncountedPage =
+ scudo::roundUp(Block + BlockSize, PageSize);
+ for (scudo::uptr Page = FirstUncountedPage;
+ Page <= RoundedRegionSize / PageSize; ++Page) {
+ EXPECT_EQ(Context.PageMap.get(/*Region=*/0U, Page), 0U);
+ }
+ } // Iterate each Group
+
+ // Release the entire region. This is to ensure the last page is counted.
+ scudo::PageReleaseContext Context(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/RegionSize);
+ Context.markRangeAsAllCounted(/*From=*/0U, /*To=*/RegionSize, /*Base=*/0,
+ /*RegionIndex=*/0, RegionSize);
+ for (scudo::uptr Page = 0; Page < RoundedRegionSize / PageSize; ++Page)
+ EXPECT_TRUE(Context.PageMap.isAllCounted(/*Region=*/0, Page));
+ } // Iterate each size class
+}
+
+template <class SizeClassMap> void testReleasePartialRegion() {
+ typedef FreeBatch<SizeClassMap> Batch;
+ const scudo::uptr PageSize = scudo::getPageSizeCached();
+ const scudo::uptr ReleaseBase = PageSize;
+ const scudo::uptr BasePageOffset = ReleaseBase / PageSize;
+
+ for (scudo::uptr I = 1; I <= SizeClassMap::LargestClassId; I++) {
+ // In the following, we want to ensure the region includes at least 2 pages
+ // and we will release all the pages except the first one. The handling of
+ // the last block is tricky, so we always test the case that includes the
+ // last block.
+ const scudo::uptr BlockSize = SizeClassMap::getSizeByClassId(I);
+ const scudo::uptr RegionSize =
+ scudo::roundUpSlow(scudo::roundUp(BlockSize, PageSize) * 2, BlockSize) +
+ BlockSize;
+ const scudo::uptr RoundedRegionSize = scudo::roundUp(RegionSize, PageSize);
+
+ scudo::SinglyLinkedList<Batch> FreeList;
+ FreeList.clear();
+
+ // Skip the blocks in the first page and add the remaining.
+ std::vector<scudo::uptr> Pages(RoundedRegionSize / PageSize, 0);
+ for (scudo::uptr Block = scudo::roundUpSlow(PageSize, BlockSize);
+ Block + BlockSize <= RoundedRegionSize; Block += BlockSize) {
+ for (scudo::uptr Page = Block / PageSize;
+ Page <= (Block + BlockSize - 1) / PageSize; ++Page) {
+ ASSERT_LT(Page, Pages.size());
+ ++Pages[Page];
+ }
+ }
+
+ // This follows the logic how we count the last page. It should be
+ // consistent with how markFreeBlocksInRegion() handles the last block.
+ if (RoundedRegionSize % BlockSize != 0)
+ ++Pages.back();
+
+ Batch *CurrentBatch = nullptr;
+ for (scudo::uptr Block = scudo::roundUpSlow(PageSize, BlockSize);
+ Block < RegionSize; Block += BlockSize) {
+ if (CurrentBatch == nullptr ||
+ CurrentBatch->getCount() == Batch::MaxCount) {
+ CurrentBatch = new Batch;
+ CurrentBatch->clear();
+ FreeList.push_back(CurrentBatch);
+ }
+ CurrentBatch->add(Block);
+ }
+
+ auto VerifyReleaseToOs = [&](scudo::PageReleaseContext &Context) {
+ auto SkipRegion = [](UNUSED scudo::uptr RegionIndex) { return false; };
+ ReleasedPagesRecorder Recorder(ReleaseBase);
+ releaseFreeMemoryToOS(Context, Recorder, SkipRegion);
+ const scudo::uptr FirstBlock = scudo::roundUpSlow(PageSize, BlockSize);
+
+ for (scudo::uptr P = 0; P < RoundedRegionSize; P += PageSize) {
+ if (P < FirstBlock) {
+ // If FirstBlock is not aligned with page boundary, the first touched
+ // page will not be released either.
+ EXPECT_TRUE(Recorder.ReportedPages.find(P) ==
+ Recorder.ReportedPages.end());
+ } else {
+ EXPECT_TRUE(Recorder.ReportedPages.find(P) !=
+ Recorder.ReportedPages.end());
+ }
+ }
+ };
+
+ // Test marking by visiting each block.
+ {
+ auto DecompactPtr = [](scudo::uptr P) { return P; };
+ scudo::PageReleaseContext Context(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/RegionSize - PageSize,
+ ReleaseBase);
+ Context.markFreeBlocksInRegion(FreeList, DecompactPtr, /*Base=*/0U,
+ /*RegionIndex=*/0, RegionSize,
+ /*MayContainLastBlockInRegion=*/true);
+ for (const Batch &It : FreeList) {
+ for (scudo::u16 I = 0; I < It.getCount(); I++) {
+ scudo::uptr Block = It.get(I);
+ for (scudo::uptr Page = Block / PageSize;
+ Page <= (Block + BlockSize - 1) / PageSize; ++Page) {
+ EXPECT_EQ(Pages[Page], Context.PageMap.get(/*Region=*/0U,
+ Page - BasePageOffset));
+ }
+ }
+ }
+
+ VerifyReleaseToOs(Context);
+ }
+
+ // Test range marking.
+ {
+ scudo::PageReleaseContext Context(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/RegionSize - PageSize,
+ ReleaseBase);
+ Context.markRangeAsAllCounted(ReleaseBase, RegionSize, /*Base=*/0U,
+ /*RegionIndex=*/0, RegionSize);
+ for (scudo::uptr Page = ReleaseBase / PageSize;
+ Page < RoundedRegionSize / PageSize; ++Page) {
+ if (Context.PageMap.get(/*Region=*/0, Page - BasePageOffset) !=
+ Pages[Page]) {
+ EXPECT_TRUE(Context.PageMap.isAllCounted(/*Region=*/0,
+ Page - BasePageOffset));
+ }
+ }
+
+ VerifyReleaseToOs(Context);
+ }
+
+ // Check the buffer size of PageMap.
+ {
+ scudo::PageReleaseContext Full(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/RegionSize);
+ Full.ensurePageMapAllocated();
+ scudo::PageReleaseContext Partial(BlockSize, /*NumberOfRegions=*/1U,
+ /*ReleaseSize=*/RegionSize - PageSize,
+ ReleaseBase);
+ Partial.ensurePageMapAllocated();
+
+ EXPECT_GE(Full.PageMap.getBufferSize(), Partial.PageMap.getBufferSize());
+ }
+
+ while (!FreeList.empty()) {
+ CurrentBatch = FreeList.front();
+ FreeList.pop_front();
+ delete CurrentBatch;
+ }
+ } // Iterate each size class
+}
+
TEST(ScudoReleaseTest, ReleaseFreeMemoryToOSDefault) {
testReleaseFreeMemoryToOS<scudo::DefaultSizeClassMap>();
}
@@ -288,3 +548,43 @@
TEST(ScudoReleaseTest, ReleaseFreeMemoryToOSSvelte) {
testReleaseFreeMemoryToOS<scudo::SvelteSizeClassMap>();
}
+
+TEST(ScudoReleaseTest, PageMapMarkRange) {
+ testPageMapMarkRange<scudo::DefaultSizeClassMap>();
+ testPageMapMarkRange<scudo::AndroidSizeClassMap>();
+ testPageMapMarkRange<scudo::FuchsiaSizeClassMap>();
+ testPageMapMarkRange<scudo::SvelteSizeClassMap>();
+}
+
+TEST(ScudoReleaseTest, ReleasePartialRegion) {
+ testReleasePartialRegion<scudo::DefaultSizeClassMap>();
+ testReleasePartialRegion<scudo::AndroidSizeClassMap>();
+ testReleasePartialRegion<scudo::FuchsiaSizeClassMap>();
+ testReleasePartialRegion<scudo::SvelteSizeClassMap>();
+}
+
+TEST(ScudoReleaseTest, BufferPool) {
+ constexpr scudo::uptr StaticBufferCount = SCUDO_WORDSIZE - 1;
+ constexpr scudo::uptr StaticBufferSize = 512U;
+
+ // Allocate the buffer pool on the heap because it is quite large (slightly
+ // more than StaticBufferCount * StaticBufferSize * sizeof(uptr)) and it may
+ // not fit in the stack on some platforms.
+ using BufferPool = scudo::BufferPool<StaticBufferCount, StaticBufferSize>;
+ std::unique_ptr<BufferPool> Pool(new BufferPool());
+
+ std::vector<std::pair<scudo::uptr *, scudo::uptr>> Buffers;
+ for (scudo::uptr I = 0; I < StaticBufferCount; ++I) {
+ scudo::uptr *P = Pool->getBuffer(StaticBufferSize);
+ EXPECT_TRUE(Pool->isStaticBufferTestOnly(P, StaticBufferSize));
+ Buffers.emplace_back(P, StaticBufferSize);
+ }
+
+ // The static buffer is supposed to be used up.
+ scudo::uptr *P = Pool->getBuffer(StaticBufferSize);
+ EXPECT_FALSE(Pool->isStaticBufferTestOnly(P, StaticBufferSize));
+
+ Pool->releaseBuffer(P, StaticBufferSize);
+ for (auto &Buffer : Buffers)
+ Pool->releaseBuffer(Buffer.first, Buffer.second);
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/scudo_hooks_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/scudo_hooks_test.cpp
new file mode 100644
index 0000000..7184ec1
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/scudo_hooks_test.cpp
@@ -0,0 +1,114 @@
+//===-- scudo_hooks_test.cpp ------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "tests/scudo_unit_test.h"
+
+#include "allocator_config.h"
+#include "combined.h"
+
+namespace {
+void *LastAllocatedPtr = nullptr;
+size_t LastRequestSize = 0;
+void *LastDeallocatedPtr = nullptr;
+} // namespace
+
+// Scudo defines weak symbols that can be defined by a client binary
+// to register callbacks at key points in the allocation timeline. In
+// order to enforce those invariants, we provide definitions that
+// update some global state every time they are called, so that tests
+// can inspect their effects. An unfortunate side effect of this
+// setup is that because those symbols are part of the binary, they
+// can't be selectively enabled; that means that they will get called
+// on unrelated tests in the same compilation unit. To mitigate this
+// issue, we insulate those tests in a separate compilation unit.
+extern "C" {
+__attribute__((visibility("default"))) void __scudo_allocate_hook(void *Ptr,
+ size_t Size) {
+ LastAllocatedPtr = Ptr;
+ LastRequestSize = Size;
+}
+__attribute__((visibility("default"))) void __scudo_deallocate_hook(void *Ptr) {
+ LastDeallocatedPtr = Ptr;
+}
+}
+
+// Simple check that allocation callbacks, when registered, are called:
+// 1) __scudo_allocate_hook is called when allocating.
+// 2) __scudo_deallocate_hook is called when deallocating.
+// 3) Both hooks are called when reallocating.
+// 4) Neither are called for a no-op reallocation.
+TEST(ScudoHooksTest, AllocateHooks) {
+ scudo::Allocator<scudo::DefaultConfig> Allocator;
+ constexpr scudo::uptr DefaultSize = 16U;
+ constexpr scudo::Chunk::Origin Origin = scudo::Chunk::Origin::Malloc;
+
+ // Simple allocation and deallocation.
+ {
+ LastAllocatedPtr = nullptr;
+ LastRequestSize = 0;
+
+ void *Ptr = Allocator.allocate(DefaultSize, Origin);
+
+ EXPECT_EQ(Ptr, LastAllocatedPtr);
+ EXPECT_EQ(DefaultSize, LastRequestSize);
+
+ LastDeallocatedPtr = nullptr;
+
+ Allocator.deallocate(Ptr, Origin);
+
+ EXPECT_EQ(Ptr, LastDeallocatedPtr);
+ }
+
+ // Simple no-op, same size reallocation.
+ {
+ void *Ptr = Allocator.allocate(DefaultSize, Origin);
+
+ LastAllocatedPtr = nullptr;
+ LastRequestSize = 0;
+ LastDeallocatedPtr = nullptr;
+
+ void *NewPtr = Allocator.reallocate(Ptr, DefaultSize);
+
+ EXPECT_EQ(Ptr, NewPtr);
+ EXPECT_EQ(nullptr, LastAllocatedPtr);
+ EXPECT_EQ(0U, LastRequestSize);
+ EXPECT_EQ(nullptr, LastDeallocatedPtr);
+ }
+
+ // Reallocation in increasing size classes. This ensures that at
+ // least one of the reallocations will be meaningful.
+ {
+ void *Ptr = Allocator.allocate(0, Origin);
+
+ for (scudo::uptr ClassId = 1U;
+ ClassId <= scudo::DefaultConfig::Primary::SizeClassMap::LargestClassId;
+ ++ClassId) {
+ const scudo::uptr Size =
+ scudo::DefaultConfig::Primary::SizeClassMap::getSizeByClassId(
+ ClassId);
+
+ LastAllocatedPtr = nullptr;
+ LastRequestSize = 0;
+ LastDeallocatedPtr = nullptr;
+
+ void *NewPtr = Allocator.reallocate(Ptr, Size);
+
+ if (NewPtr != Ptr) {
+ EXPECT_EQ(NewPtr, LastAllocatedPtr);
+ EXPECT_EQ(Size, LastRequestSize);
+ EXPECT_EQ(Ptr, LastDeallocatedPtr);
+ } else {
+ EXPECT_EQ(nullptr, LastAllocatedPtr);
+ EXPECT_EQ(0U, LastRequestSize);
+ EXPECT_EQ(nullptr, LastDeallocatedPtr);
+ }
+
+ Ptr = NewPtr;
+ }
+ }
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
index e656466..b031901 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
@@ -64,7 +64,7 @@
P = L->allocate(Options, Size + Align, Align);
EXPECT_NE(P, nullptr);
void *AlignedP = reinterpret_cast<void *>(
- scudo::roundUpTo(reinterpret_cast<scudo::uptr>(P), Align));
+ scudo::roundUp(reinterpret_cast<scudo::uptr>(P), Align));
memset(AlignedP, 'A', Size);
L->deallocate(Options, P);
@@ -122,7 +122,7 @@
// combined allocator.
TEST_F(MapAllocatorTest, SecondaryCombinations) {
constexpr scudo::uptr MinAlign = FIRST_32_SECOND_64(8, 16);
- constexpr scudo::uptr HeaderSize = scudo::roundUpTo(8, MinAlign);
+ constexpr scudo::uptr HeaderSize = scudo::roundUp(8, MinAlign);
for (scudo::uptr SizeLog = 0; SizeLog <= 20; SizeLog++) {
for (scudo::uptr AlignLog = FIRST_32_SECOND_64(3, 4); AlignLog <= 16;
AlignLog++) {
@@ -131,13 +131,13 @@
if (static_cast<scudo::sptr>(1U << SizeLog) + Delta <= 0)
continue;
const scudo::uptr UserSize =
- scudo::roundUpTo((1U << SizeLog) + Delta, MinAlign);
+ scudo::roundUp((1U << SizeLog) + Delta, MinAlign);
const scudo::uptr Size =
HeaderSize + UserSize + (Align > MinAlign ? Align - HeaderSize : 0);
void *P = Allocator->allocate(Options, Size, Align);
EXPECT_NE(P, nullptr);
void *AlignedP = reinterpret_cast<void *>(
- scudo::roundUpTo(reinterpret_cast<scudo::uptr>(P), Align));
+ scudo::roundUp(reinterpret_cast<scudo::uptr>(P), Align));
memset(AlignedP, 0xff, UserSize);
Allocator->deallocate(Options, P);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/timing_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/timing_test.cpp
new file mode 100644
index 0000000..09a6c31
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/timing_test.cpp
@@ -0,0 +1,86 @@
+//===-- timing_test.cpp -----------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "tests/scudo_unit_test.h"
+
+#include "timing.h"
+
+#include <string>
+
+class ScudoTimingTest : public Test {
+public:
+ void testFunc1() { scudo::ScopedTimer ST(Manager, __func__); }
+
+ void testFunc2() {
+ scudo::ScopedTimer ST(Manager, __func__);
+ testFunc1();
+ }
+
+ void testChainedCalls() {
+ scudo::ScopedTimer ST(Manager, __func__);
+ testFunc2();
+ }
+
+ void testIgnoredTimer() {
+ scudo::ScopedTimer ST(Manager, __func__);
+ ST.ignore();
+ }
+
+ void printAllTimersStats() { Manager.printAll(); }
+
+ scudo::TimingManager &getTimingManager() { return Manager; }
+
+private:
+ scudo::TimingManager Manager;
+};
+
+// Given that the output of statistics of timers are dumped through
+// `scudo::Printf` which is platform dependent, so we don't have a reliable way
+// to catch the output and verify the details. Now we only verify the number of
+// invocations on linux.
+TEST_F(ScudoTimingTest, SimpleTimer) {
+#if SCUDO_LINUX
+ testing::internal::LogToStderr();
+ testing::internal::CaptureStderr();
+#endif
+
+ testIgnoredTimer();
+ testChainedCalls();
+ printAllTimersStats();
+
+#if SCUDO_LINUX
+ std::string output = testing::internal::GetCapturedStderr();
+ EXPECT_TRUE(output.find("testIgnoredTimer (1)") == std::string::npos);
+ EXPECT_TRUE(output.find("testChainedCalls (1)") != std::string::npos);
+ EXPECT_TRUE(output.find("testFunc2 (1)") != std::string::npos);
+ EXPECT_TRUE(output.find("testFunc1 (1)") != std::string::npos);
+#endif
+}
+
+TEST_F(ScudoTimingTest, NestedTimer) {
+#if SCUDO_LINUX
+ testing::internal::LogToStderr();
+ testing::internal::CaptureStderr();
+#endif
+
+ {
+ scudo::ScopedTimer Outer(getTimingManager(), "Outer");
+ {
+ scudo::ScopedTimer Inner1(getTimingManager(), Outer, "Inner1");
+ { scudo::ScopedTimer Inner2(getTimingManager(), Inner1, "Inner2"); }
+ }
+ }
+ printAllTimersStats();
+
+#if SCUDO_LINUX
+ std::string output = testing::internal::GetCapturedStderr();
+ EXPECT_TRUE(output.find("Outer (1)") != std::string::npos);
+ EXPECT_TRUE(output.find("Inner1 (1)") != std::string::npos);
+ EXPECT_TRUE(output.find("Inner2 (1)") != std::string::npos);
+#endif
+}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
index 6c0c86d..a092fdd 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
@@ -82,7 +82,7 @@
EXPECT_FALSE(Allocator->isInitialized());
auto Registry = Allocator->getTSDRegistry();
- Registry->init(Allocator.get());
+ Registry->initOnceMaybe(Allocator.get());
EXPECT_TRUE(Allocator->isInitialized());
}
@@ -102,15 +102,15 @@
bool UnlockRequired;
auto TSD = Registry->getTSDAndLock(&UnlockRequired);
EXPECT_NE(TSD, nullptr);
- EXPECT_EQ(TSD->Cache.Canary, 0U);
+ EXPECT_EQ(TSD->getCache().Canary, 0U);
if (UnlockRequired)
TSD->unlock();
Registry->initThreadMaybe(Allocator.get(), /*MinimalInit=*/false);
TSD = Registry->getTSDAndLock(&UnlockRequired);
EXPECT_NE(TSD, nullptr);
- EXPECT_EQ(TSD->Cache.Canary, 0U);
- memset(&TSD->Cache, 0x42, sizeof(TSD->Cache));
+ EXPECT_EQ(TSD->getCache().Canary, 0U);
+ memset(&TSD->getCache(), 0x42, sizeof(TSD->getCache()));
if (UnlockRequired)
TSD->unlock();
}
@@ -141,14 +141,14 @@
// For an exclusive TSD, the cache should be empty. We cannot guarantee the
// same for a shared TSD.
if (!UnlockRequired)
- EXPECT_EQ(TSD->Cache.Canary, 0U);
+ EXPECT_EQ(TSD->getCache().Canary, 0U);
// Transform the thread id to a uptr to use it as canary.
const scudo::uptr Canary = static_cast<scudo::uptr>(
std::hash<std::thread::id>{}(std::this_thread::get_id()));
- TSD->Cache.Canary = Canary;
+ TSD->getCache().Canary = Canary;
// Loop a few times to make sure that a concurrent thread isn't modifying it.
for (scudo::uptr I = 0; I < 4096U; I++)
- EXPECT_EQ(TSD->Cache.Canary, Canary);
+ EXPECT_EQ(TSD->getCache().Canary, Canary);
if (UnlockRequired)
TSD->unlock();
}
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/thread_annotations.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/thread_annotations.h
new file mode 100644
index 0000000..68a1087
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/thread_annotations.h
@@ -0,0 +1,70 @@
+//===-- thread_annotations.h ------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_THREAD_ANNOTATIONS_
+#define SCUDO_THREAD_ANNOTATIONS_
+
+// Enable thread safety attributes only with clang.
+// The attributes can be safely ignored when compiling with other compilers.
+#if defined(__clang__)
+#define THREAD_ANNOTATION_ATTRIBUTE_(x) __attribute__((x))
+#else
+#define THREAD_ANNOTATION_ATTRIBUTE_(x) // no-op
+#endif
+
+#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(capability(x))
+
+#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE_(scoped_lockable)
+
+#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE_(guarded_by(x))
+
+#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE_(pt_guarded_by(x))
+
+#define ACQUIRED_BEFORE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(acquired_before(__VA_ARGS__))
+
+#define ACQUIRED_AFTER(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(acquired_after(__VA_ARGS__))
+
+#define REQUIRES(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(requires_capability(__VA_ARGS__))
+
+#define REQUIRES_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(requires_shared_capability(__VA_ARGS__))
+
+#define ACQUIRE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(acquire_capability(__VA_ARGS__))
+
+#define ACQUIRE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(acquire_shared_capability(__VA_ARGS__))
+
+#define RELEASE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(release_capability(__VA_ARGS__))
+
+#define RELEASE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(release_shared_capability(__VA_ARGS__))
+
+#define TRY_ACQUIRE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(try_acquire_capability(__VA_ARGS__))
+
+#define TRY_ACQUIRE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE_(try_acquire_shared_capability(__VA_ARGS__))
+
+#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE_(locks_excluded(__VA_ARGS__))
+
+#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(assert_capability(x))
+
+#define ASSERT_SHARED_CAPABILITY(x) \
+ THREAD_ANNOTATION_ATTRIBUTE_(assert_shared_capability(x))
+
+#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(lock_returned(x))
+
+#define NO_THREAD_SAFETY_ANALYSIS \
+ THREAD_ANNOTATION_ATTRIBUTE_(no_thread_safety_analysis)
+
+#endif // SCUDO_THREAD_ANNOTATIONS_
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/timing.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/timing.cpp
new file mode 100644
index 0000000..59ae21d
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/timing.cpp
@@ -0,0 +1,29 @@
+//===-- timing.cpp ----------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "timing.h"
+
+namespace scudo {
+
+Timer::~Timer() {
+ if (Manager)
+ Manager->report(*this);
+}
+
+ScopedTimer::ScopedTimer(TimingManager &Manager, const char *Name)
+ : Timer(Manager.getOrCreateTimer(Name)) {
+ start();
+}
+
+ScopedTimer::ScopedTimer(TimingManager &Manager, const Timer &Nest,
+ const char *Name)
+ : Timer(Manager.nest(Nest, Name)) {
+ start();
+}
+
+} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/timing.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/timing.h
new file mode 100644
index 0000000..84caa79
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/timing.h
@@ -0,0 +1,221 @@
+//===-- timing.h ------------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_TIMING_H_
+#define SCUDO_TIMING_H_
+
+#include "common.h"
+#include "mutex.h"
+#include "string_utils.h"
+#include "thread_annotations.h"
+
+#include <inttypes.h>
+#include <string.h>
+
+namespace scudo {
+
+class TimingManager;
+
+// A simple timer for evaluating execution time of code snippets. It can be used
+// along with TimingManager or standalone.
+class Timer {
+public:
+ // The use of Timer without binding to a TimingManager is supposed to do the
+ // timer logging manually. Otherwise, TimingManager will do the logging stuff
+ // for you.
+ Timer() = default;
+ Timer(Timer &&Other)
+ : StartTime(0), AccTime(Other.AccTime), Manager(Other.Manager),
+ HandleId(Other.HandleId) {
+ Other.Manager = nullptr;
+ }
+
+ Timer(const Timer &) = delete;
+
+ ~Timer();
+
+ void start() {
+ CHECK_EQ(StartTime, 0U);
+ StartTime = getMonotonicTime();
+ }
+ void stop() {
+ AccTime += getMonotonicTime() - StartTime;
+ StartTime = 0;
+ }
+ u64 getAccumulatedTime() const { return AccTime; }
+
+ // Unset the bound TimingManager so that we don't report the data back. This
+ // is useful if we only want to track subset of certain scope events.
+ void ignore() {
+ StartTime = 0;
+ AccTime = 0;
+ Manager = nullptr;
+ }
+
+protected:
+ friend class TimingManager;
+ Timer(TimingManager &Manager, u32 HandleId)
+ : Manager(&Manager), HandleId(HandleId) {}
+
+ u64 StartTime = 0;
+ u64 AccTime = 0;
+ TimingManager *Manager = nullptr;
+ u32 HandleId;
+};
+
+// A RAII-style wrapper for easy scope execution measurement. Note that in order
+// not to take additional space for the message like `Name`. It only works with
+// TimingManager.
+class ScopedTimer : public Timer {
+public:
+ ScopedTimer(TimingManager &Manager, const char *Name);
+ ScopedTimer(TimingManager &Manager, const Timer &Nest, const char *Name);
+ ~ScopedTimer() { stop(); }
+};
+
+// In Scudo, the execution time of single run of code snippets may not be
+// useful, we are more interested in the average time from several runs.
+// TimingManager lets the registered timer report their data and reports the
+// average execution time for each timer periodically.
+class TimingManager {
+public:
+ TimingManager(u32 PrintingInterval = DefaultPrintingInterval)
+ : PrintingInterval(PrintingInterval) {}
+ ~TimingManager() {
+ if (NumAllocatedTimers != 0)
+ printAll();
+ }
+
+ Timer getOrCreateTimer(const char *Name) EXCLUDES(Mutex) {
+ ScopedLock L(Mutex);
+
+ CHECK_LT(strlen(Name), MaxLenOfTimerName);
+ for (u32 I = 0; I < NumAllocatedTimers; ++I) {
+ if (strncmp(Name, Timers[I].Name, MaxLenOfTimerName) == 0)
+ return Timer(*this, I);
+ }
+
+ CHECK_LT(NumAllocatedTimers, MaxNumberOfTimers);
+ strncpy(Timers[NumAllocatedTimers].Name, Name, MaxLenOfTimerName);
+ TimerRecords[NumAllocatedTimers].AccumulatedTime = 0;
+ TimerRecords[NumAllocatedTimers].Occurrence = 0;
+ return Timer(*this, NumAllocatedTimers++);
+ }
+
+ // Add a sub-Timer associated with another Timer. This is used when we want to
+ // detail the execution time in the scope of a Timer.
+ // For example,
+ // void Foo() {
+ // // T1 records the time spent in both first and second tasks.
+ // ScopedTimer T1(getTimingManager(), "Task1");
+ // {
+ // // T2 records the time spent in first task
+ // ScopedTimer T2(getTimingManager, T1, "Task2");
+ // // Do first task.
+ // }
+ // // Do second task.
+ // }
+ //
+ // The report will show proper indents to indicate the nested relation like,
+ // -- Average Operation Time -- -- Name (# of Calls) --
+ // 10.0(ns) Task1 (1)
+ // 5.0(ns) Task2 (1)
+ Timer nest(const Timer &T, const char *Name) EXCLUDES(Mutex) {
+ CHECK_EQ(T.Manager, this);
+ Timer Nesting = getOrCreateTimer(Name);
+
+ ScopedLock L(Mutex);
+ CHECK_NE(Nesting.HandleId, T.HandleId);
+ Timers[Nesting.HandleId].Nesting = T.HandleId;
+ return Nesting;
+ }
+
+ void report(const Timer &T) EXCLUDES(Mutex) {
+ ScopedLock L(Mutex);
+
+ const u32 HandleId = T.HandleId;
+ CHECK_LT(HandleId, MaxNumberOfTimers);
+ TimerRecords[HandleId].AccumulatedTime += T.getAccumulatedTime();
+ ++TimerRecords[HandleId].Occurrence;
+ ++NumEventsReported;
+ if (NumEventsReported % PrintingInterval == 0)
+ printAllImpl();
+ }
+
+ void printAll() EXCLUDES(Mutex) {
+ ScopedLock L(Mutex);
+ printAllImpl();
+ }
+
+private:
+ void printAllImpl() REQUIRES(Mutex) {
+ static char NameHeader[] = "-- Name (# of Calls) --";
+ static char AvgHeader[] = "-- Average Operation Time --";
+ ScopedString Str;
+ Str.append("%-15s %-15s\n", AvgHeader, NameHeader);
+
+ for (u32 I = 0; I < NumAllocatedTimers; ++I) {
+ if (Timers[I].Nesting != MaxNumberOfTimers)
+ continue;
+ printImpl(Str, I);
+ }
+
+ Str.output();
+ }
+
+ void printImpl(ScopedString &Str, const u32 HandleId,
+ const u32 ExtraIndent = 0) REQUIRES(Mutex) {
+ const u64 AccumulatedTime = TimerRecords[HandleId].AccumulatedTime;
+ const u64 Occurrence = TimerRecords[HandleId].Occurrence;
+ const u64 Integral = Occurrence == 0 ? 0 : AccumulatedTime / Occurrence;
+ // Only keep single digit of fraction is enough and it enables easier layout
+ // maintenance.
+ const u64 Fraction =
+ Occurrence == 0 ? 0
+ : ((AccumulatedTime % Occurrence) * 10) / Occurrence;
+
+ Str.append("%14" PRId64 ".%" PRId64 "(ns) %-11s", Integral, Fraction, " ");
+
+ for (u32 I = 0; I < ExtraIndent; ++I)
+ Str.append("%s", " ");
+ Str.append("%s (%" PRId64 ")\n", Timers[HandleId].Name, Occurrence);
+
+ for (u32 I = 0; I < NumAllocatedTimers; ++I)
+ if (Timers[I].Nesting == HandleId)
+ printImpl(Str, I, ExtraIndent + 1);
+ }
+
+ // Instead of maintaining pages for timer registration, a static buffer is
+ // sufficient for most use cases in Scudo.
+ static constexpr u32 MaxNumberOfTimers = 50;
+ static constexpr u32 MaxLenOfTimerName = 50;
+ static constexpr u32 DefaultPrintingInterval = 100;
+
+ struct Record {
+ u64 AccumulatedTime = 0;
+ u64 Occurrence = 0;
+ };
+
+ struct TimerInfo {
+ char Name[MaxLenOfTimerName + 1];
+ u32 Nesting = MaxNumberOfTimers;
+ };
+
+ HybridMutex Mutex;
+ // The frequency of proactively dumping the timer statistics. For example, the
+ // default setting is to dump the statistics every 100 reported events.
+ u32 PrintingInterval GUARDED_BY(Mutex);
+ u64 NumEventsReported GUARDED_BY(Mutex) = 0;
+ u32 NumAllocatedTimers GUARDED_BY(Mutex) = 0;
+ TimerInfo Timers[MaxNumberOfTimers] GUARDED_BY(Mutex);
+ Record TimerRecords[MaxNumberOfTimers] GUARDED_BY(Mutex);
+};
+
+} // namespace scudo
+
+#endif // SCUDO_TIMING_H_
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/trusty.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/trusty.cpp
index 81d6bc5..c08a4e6 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/trusty.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/trusty.cpp
@@ -37,7 +37,7 @@
uptr Start;
uptr End;
- Start = roundUpTo(ProgramBreak, SBRK_ALIGN);
+ Start = roundUp(ProgramBreak, SBRK_ALIGN);
// Don't actually extend the heap if MAP_NOACCESS flag is set since this is
// the case where Scudo tries to reserve a memory region without mapping
// physical pages.
@@ -45,7 +45,7 @@
return reinterpret_cast<void *>(Start);
// Attempt to extend the heap by Size bytes using _trusty_brk.
- End = roundUpTo(Start + Size, SBRK_ALIGN);
+ End = roundUp(Start + Size, SBRK_ALIGN);
ProgramBreak =
reinterpret_cast<uptr>(_trusty_brk(reinterpret_cast<void *>(End)));
if (ProgramBreak < End) {
@@ -76,6 +76,8 @@
void HybridMutex::unlock() {}
+void HybridMutex::assertHeldImpl() {}
+
u64 getMonotonicTime() {
timespec TS;
clock_gettime(CLOCK_MONOTONIC, &TS);
@@ -83,6 +85,17 @@
static_cast<u64>(TS.tv_nsec);
}
+u64 getMonotonicTimeFast() {
+#if defined(CLOCK_MONOTONIC_COARSE)
+ timespec TS;
+ clock_gettime(CLOCK_MONOTONIC_COARSE, &TS);
+ return static_cast<u64>(TS.tv_sec) * (1000ULL * 1000 * 1000) +
+ static_cast<u64>(TS.tv_nsec);
+#else
+ return getMonotonicTime();
+#endif
+}
+
u32 getNumberOfCPUs() { return 0; }
u32 getThreadID() { return 0; }
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd.h
index b400a3b..c5ed6dd 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd.h
@@ -12,6 +12,7 @@
#include "atomic_helpers.h"
#include "common.h"
#include "mutex.h"
+#include "thread_annotations.h"
#include <limits.h> // for PTHREAD_DESTRUCTOR_ITERATIONS
#include <pthread.h>
@@ -24,21 +25,17 @@
namespace scudo {
template <class Allocator> struct alignas(SCUDO_CACHE_LINE_SIZE) TSD {
- typename Allocator::CacheT Cache;
- typename Allocator::QuarantineCacheT QuarantineCache;
using ThisT = TSD<Allocator>;
u8 DestructorIterations = 0;
- void init(Allocator *Instance) {
+ void init(Allocator *Instance) NO_THREAD_SAFETY_ANALYSIS {
DCHECK_EQ(DestructorIterations, 0U);
DCHECK(isAligned(reinterpret_cast<uptr>(this), alignof(ThisT)));
Instance->initCache(&Cache);
DestructorIterations = PTHREAD_DESTRUCTOR_ITERATIONS;
}
- void commitBack(Allocator *Instance) { Instance->commitBack(this); }
-
- inline bool tryLock() {
+ inline bool tryLock() NO_THREAD_SAFETY_ANALYSIS {
if (Mutex.tryLock()) {
atomic_store_relaxed(&Precedence, 0);
return true;
@@ -49,16 +46,40 @@
static_cast<uptr>(getMonotonicTime() >> FIRST_32_SECOND_64(16, 0)));
return false;
}
- inline void lock() {
+ inline void lock() NO_THREAD_SAFETY_ANALYSIS {
atomic_store_relaxed(&Precedence, 0);
Mutex.lock();
}
- inline void unlock() { Mutex.unlock(); }
+ inline void unlock() NO_THREAD_SAFETY_ANALYSIS { Mutex.unlock(); }
inline uptr getPrecedence() { return atomic_load_relaxed(&Precedence); }
+ void commitBack(Allocator *Instance) ASSERT_CAPABILITY(Mutex) {
+ Instance->commitBack(this);
+ }
+
+ // Ideally, we may want to assert that all the operations on
+ // Cache/QuarantineCache always have the `Mutex` acquired. However, the
+ // current architecture of accessing TSD is not easy to cooperate with the
+ // thread-safety analysis because of pointer aliasing. So now we just add the
+ // assertion on the getters of Cache/QuarantineCache.
+ //
+ // TODO(chiahungduan): Ideally, we want to do `Mutex.assertHeld` but acquiring
+ // TSD doesn't always require holding the lock. Add this assertion while the
+ // lock is always acquired.
+ typename Allocator::CacheT &getCache() ASSERT_CAPABILITY(Mutex) {
+ return Cache;
+ }
+ typename Allocator::QuarantineCacheT &getQuarantineCache()
+ ASSERT_CAPABILITY(Mutex) {
+ return QuarantineCache;
+ }
+
private:
HybridMutex Mutex;
atomic_uptr Precedence = {};
+
+ typename Allocator::CacheT Cache GUARDED_BY(Mutex);
+ typename Allocator::QuarantineCacheT QuarantineCache GUARDED_BY(Mutex);
};
} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_exclusive.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_exclusive.h
index d49427b..62da8ae 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_exclusive.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_exclusive.h
@@ -25,7 +25,7 @@
template <class Allocator> void teardownThread(void *Ptr);
template <class Allocator> struct TSDRegistryExT {
- void init(Allocator *Instance) {
+ void init(Allocator *Instance) REQUIRES(Mutex) {
DCHECK(!Initialized);
Instance->init();
CHECK_EQ(pthread_key_create(&PThreadKey, teardownThread<Allocator>), 0);
@@ -33,14 +33,14 @@
Initialized = true;
}
- void initOnceMaybe(Allocator *Instance) {
+ void initOnceMaybe(Allocator *Instance) EXCLUDES(Mutex) {
ScopedLock L(Mutex);
if (LIKELY(Initialized))
return;
init(Instance); // Sets Initialized.
}
- void unmapTestOnly(Allocator *Instance) {
+ void unmapTestOnly(Allocator *Instance) EXCLUDES(Mutex) {
DCHECK(Instance);
if (reinterpret_cast<Allocator *>(pthread_getspecific(PThreadKey))) {
DCHECK_EQ(reinterpret_cast<Allocator *>(pthread_getspecific(PThreadKey)),
@@ -53,6 +53,7 @@
FallbackTSD.commitBack(Instance);
FallbackTSD = {};
State = {};
+ ScopedLock L(Mutex);
Initialized = false;
}
@@ -62,7 +63,13 @@
initThread(Instance, MinimalInit);
}
- ALWAYS_INLINE TSD<Allocator> *getTSDAndLock(bool *UnlockRequired) {
+ // TODO(chiahungduan): Consider removing the argument `UnlockRequired` by
+ // embedding the logic into TSD or always locking the TSD. It will enable us
+ // to properly mark thread annotation here and adding proper runtime
+ // assertions in the member functions of TSD. For example, assert the lock is
+ // acquired before calling TSD::commitBack().
+ ALWAYS_INLINE TSD<Allocator> *
+ getTSDAndLock(bool *UnlockRequired) NO_THREAD_SAFETY_ANALYSIS {
if (LIKELY(State.InitState == ThreadState::Initialized &&
!atomic_load(&Disabled, memory_order_acquire))) {
*UnlockRequired = false;
@@ -75,13 +82,13 @@
// To disable the exclusive TSD registry, we effectively lock the fallback TSD
// and force all threads to attempt to use it instead of their local one.
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
Mutex.lock();
FallbackTSD.lock();
atomic_store(&Disabled, 1U, memory_order_release);
}
- void enable() {
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
atomic_store(&Disabled, 0U, memory_order_release);
FallbackTSD.unlock();
Mutex.unlock();
@@ -113,7 +120,7 @@
}
pthread_key_t PThreadKey = {};
- bool Initialized = false;
+ bool Initialized GUARDED_BY(Mutex) = false;
atomic_u8 Disabled = {};
TSD<Allocator> FallbackTSD;
HybridMutex Mutex;
@@ -128,7 +135,8 @@
template <class Allocator>
thread_local ThreadState TSDRegistryExT<Allocator>::State;
-template <class Allocator> void teardownThread(void *Ptr) {
+template <class Allocator>
+void teardownThread(void *Ptr) NO_THREAD_SAFETY_ANALYSIS {
typedef TSDRegistryExT<Allocator> TSDRegistryT;
Allocator *Instance = reinterpret_cast<Allocator *>(Ptr);
// The glibc POSIX thread-local-storage deallocation routine calls user
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_shared.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_shared.h
index 1c2a880..64b3bd8 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_shared.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/tsd_shared.h
@@ -24,7 +24,7 @@
template <class Allocator, u32 TSDsArraySize, u32 DefaultTSDCount>
struct TSDRegistrySharedT {
- void init(Allocator *Instance) {
+ void init(Allocator *Instance) REQUIRES(Mutex) {
DCHECK(!Initialized);
Instance->init();
for (u32 I = 0; I < TSDsArraySize; I++)
@@ -35,19 +35,20 @@
Initialized = true;
}
- void initOnceMaybe(Allocator *Instance) {
+ void initOnceMaybe(Allocator *Instance) EXCLUDES(Mutex) {
ScopedLock L(Mutex);
if (LIKELY(Initialized))
return;
init(Instance); // Sets Initialized.
}
- void unmapTestOnly(Allocator *Instance) {
+ void unmapTestOnly(Allocator *Instance) EXCLUDES(Mutex) {
for (u32 I = 0; I < TSDsArraySize; I++) {
TSDs[I].commitBack(Instance);
TSDs[I] = {};
}
setCurrentTSD(nullptr);
+ ScopedLock L(Mutex);
Initialized = false;
}
@@ -58,7 +59,10 @@
initThread(Instance);
}
- ALWAYS_INLINE TSD<Allocator> *getTSDAndLock(bool *UnlockRequired) {
+ // TSDs is an array of locks and which is not supported for marking
+ // thread-safety capability.
+ ALWAYS_INLINE TSD<Allocator> *
+ getTSDAndLock(bool *UnlockRequired) NO_THREAD_SAFETY_ANALYSIS {
TSD<Allocator> *TSD = getCurrentTSD();
DCHECK(TSD);
*UnlockRequired = true;
@@ -75,13 +79,13 @@
return getTSDAndLockSlow(TSD);
}
- void disable() {
+ void disable() NO_THREAD_SAFETY_ANALYSIS {
Mutex.lock();
for (u32 I = 0; I < TSDsArraySize; I++)
TSDs[I].lock();
}
- void enable() {
+ void enable() NO_THREAD_SAFETY_ANALYSIS {
for (s32 I = static_cast<s32>(TSDsArraySize - 1); I >= 0; I--)
TSDs[I].unlock();
Mutex.unlock();
@@ -119,7 +123,7 @@
return reinterpret_cast<TSD<Allocator> *>(*getTlsPtr() & ~1ULL);
}
- bool setNumberOfTSDs(u32 N) {
+ bool setNumberOfTSDs(u32 N) EXCLUDES(MutexTSDs) {
ScopedLock L(MutexTSDs);
if (N < NumberOfTSDs)
return false;
@@ -150,7 +154,7 @@
*getTlsPtr() |= B;
}
- NOINLINE void initThread(Allocator *Instance) {
+ NOINLINE void initThread(Allocator *Instance) NO_THREAD_SAFETY_ANALYSIS {
initOnceMaybe(Instance);
// Initial context assignment is done in a plain round-robin fashion.
const u32 Index = atomic_fetch_add(&CurrentIndex, 1U, memory_order_relaxed);
@@ -158,7 +162,10 @@
Instance->callPostInitCallback();
}
- NOINLINE TSD<Allocator> *getTSDAndLockSlow(TSD<Allocator> *CurrentTSD) {
+ // TSDs is an array of locks which is not supported for marking thread-safety
+ // capability.
+ NOINLINE TSD<Allocator> *getTSDAndLockSlow(TSD<Allocator> *CurrentTSD)
+ EXCLUDES(MutexTSDs) {
// Use the Precedence of the current TSD as our random seed. Since we are
// in the slow path, it means that tryLock failed, and as a result it's
// very likely that said Precedence is non-zero.
@@ -202,10 +209,10 @@
}
atomic_u32 CurrentIndex = {};
- u32 NumberOfTSDs = 0;
- u32 NumberOfCoPrimes = 0;
- u32 CoPrimes[TSDsArraySize] = {};
- bool Initialized = false;
+ u32 NumberOfTSDs GUARDED_BY(MutexTSDs) = 0;
+ u32 NumberOfCoPrimes GUARDED_BY(MutexTSDs) = 0;
+ u32 CoPrimes[TSDsArraySize] GUARDED_BY(MutexTSDs) = {};
+ bool Initialized GUARDED_BY(Mutex) = false;
HybridMutex Mutex;
HybridMutex MutexTSDs;
TSD<Allocator> TSDs[TSDsArraySize];
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/vector.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/vector.h
index d43205a..9f2c200 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/vector.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/vector.h
@@ -40,7 +40,7 @@
void push_back(const T &Element) {
DCHECK_LE(Size, capacity());
if (Size == capacity()) {
- const uptr NewCapacity = roundUpToPowerOfTwo(Size + 1);
+ const uptr NewCapacity = roundUpPowerOfTwo(Size + 1);
reallocate(NewCapacity);
}
memcpy(&Data[Size++], &Element, sizeof(T));
@@ -82,7 +82,7 @@
void reallocate(uptr NewCapacity) {
DCHECK_GT(NewCapacity, 0);
DCHECK_LE(Size, NewCapacity);
- NewCapacity = roundUpTo(NewCapacity * sizeof(T), getPageSizeCached());
+ NewCapacity = roundUp(NewCapacity * sizeof(T), getPageSizeCached());
T *NewData = reinterpret_cast<T *>(
map(nullptr, NewCapacity, "scudo:vector", 0, &MapData));
memcpy(NewData, Data, Size * sizeof(T));
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.inc b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.inc
index bbe3617..3e495ea 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.inc
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.inc
@@ -54,6 +54,8 @@
return Info;
}
+// On Android, mallinfo2 is an alias of mallinfo, so don't define both.
+#if !SCUDO_ANDROID
INTERFACE WEAK struct __scudo_mallinfo2 SCUDO_PREFIX(mallinfo2)(void) {
struct __scudo_mallinfo2 Info = {};
scudo::StatCounters Stats;
@@ -70,6 +72,7 @@
Info.fordblks = Info.fsmblks;
return Info;
}
+#endif
INTERFACE WEAK void *SCUDO_PREFIX(malloc)(size_t size) {
return scudo::setErrnoOnNull(SCUDO_ALLOCATOR.allocate(
@@ -91,7 +94,7 @@
alignment = 1U;
} else {
if (UNLIKELY(!scudo::isPowerOfTwo(alignment)))
- alignment = scudo::roundUpToPowerOfTwo(alignment);
+ alignment = scudo::roundUpPowerOfTwo(alignment);
}
} else {
if (UNLIKELY(!scudo::isPowerOfTwo(alignment))) {
@@ -131,9 +134,9 @@
scudo::reportPvallocOverflow(size);
}
// pvalloc(0) should allocate one page.
- return scudo::setErrnoOnNull(SCUDO_ALLOCATOR.allocate(
- size ? scudo::roundUpTo(size, PageSize) : PageSize,
- scudo::Chunk::Origin::Memalign, PageSize));
+ return scudo::setErrnoOnNull(
+ SCUDO_ALLOCATOR.allocate(size ? scudo::roundUp(size, PageSize) : PageSize,
+ scudo::Chunk::Origin::Memalign, PageSize));
}
INTERFACE WEAK void *SCUDO_PREFIX(realloc)(void *ptr, size_t size) {
@@ -188,7 +191,10 @@
static_cast<scudo::sptr>(value));
return 1;
} else if (param == M_PURGE) {
- SCUDO_ALLOCATOR.releaseToOS();
+ SCUDO_ALLOCATOR.releaseToOS(scudo::ReleaseToOS::Force);
+ return 1;
+ } else if (param == M_PURGE_ALL) {
+ SCUDO_ALLOCATOR.releaseToOS(scudo::ReleaseToOS::ForceAll);
return 1;
} else {
scudo::Option option;
@@ -238,7 +244,10 @@
if (size < max_size)
sizes[size]++;
};
+
+ SCUDO_ALLOCATOR.disable();
SCUDO_ALLOCATOR.iterateOverChunks(0, -1ul, callback, sizes);
+ SCUDO_ALLOCATOR.enable();
fputs("<malloc version=\"scudo-1\">\n", stream);
for (scudo::uptr i = 0; i != max_size; ++i)
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp
index 18c3bf2..1b9fe67 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp
@@ -32,21 +32,6 @@
#undef SCUDO_ALLOCATOR
#undef SCUDO_PREFIX
-// Svelte MallocDispatch definitions.
-#define SCUDO_PREFIX(name) CONCATENATE(scudo_svelte_, name)
-#define SCUDO_ALLOCATOR SvelteAllocator
-
-extern "C" void SCUDO_PREFIX(malloc_postinit)();
-SCUDO_REQUIRE_CONSTANT_INITIALIZATION
-static scudo::Allocator<scudo::AndroidSvelteConfig,
- SCUDO_PREFIX(malloc_postinit)>
- SCUDO_ALLOCATOR;
-
-#include "wrappers_c.inc"
-
-#undef SCUDO_ALLOCATOR
-#undef SCUDO_PREFIX
-
// TODO(kostyak): support both allocators.
INTERFACE void __scudo_print_stats(void) { Allocator.printStats(); }
diff --git a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_checks.h b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_checks.h
index 815d400..9cd48e8 100644
--- a/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_checks.h
+++ b/third_party/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c_checks.h
@@ -64,7 +64,7 @@
// Returns true if the size passed to pvalloc overflows when rounded to the next
// multiple of PageSize.
inline bool checkForPvallocOverflow(uptr Size, uptr PageSize) {
- return roundUpTo(Size, PageSize) < Size;
+ return roundUp(Size, PageSize) < Size;
}
} // namespace scudo
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/CMakeLists.txt b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/CMakeLists.txt
index d6c547b..7ad91b3 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/CMakeLists.txt
@@ -271,6 +271,7 @@
$<TARGET_OBJECTS:RTUbsan.${arch}>
ADDITIONAL_HEADERS ${TSAN_HEADERS}
CFLAGS ${TSAN_RTL_DYNAMIC_CFLAGS}
+ DEFS SANITIZER_SHARED
LINK_LIBS ${TSAN_DYNAMIC_LINK_LIBS}
LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS}
PARENT_TARGET tsan)
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_external.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_external.cpp
index 19ae174..98abff5 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_external.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_external.cpp
@@ -46,10 +46,6 @@
return tag_data ? tag_data->header : nullptr;
}
-void InsertShadowStackFrameForTag(ThreadState *thr, uptr tag) {
- FuncEntry(thr, (uptr)®istered_tags[tag]);
-}
-
uptr TagFromShadowStackFrame(uptr pc) {
uptr tag_count = atomic_load(&used_tags, memory_order_relaxed);
void *pc_ptr = (void *)pc;
@@ -60,15 +56,26 @@
#if !SANITIZER_GO
-void ExternalAccess(void *addr, uptr caller_pc, void *tag, AccessType typ) {
+// We need to track tags for individual memory accesses, but there is no space
+// in the shadow cells for them. Instead we push/pop them onto the thread
+// traces and ignore the extra tag frames when printing reports.
+static void PushTag(ThreadState *thr, uptr tag) {
+ FuncEntry(thr, (uptr)®istered_tags[tag]);
+}
+static void PopTag(ThreadState *thr) { FuncExit(thr); }
+
+static void ExternalAccess(void *addr, uptr caller_pc, uptr tsan_caller_pc,
+ void *tag, AccessType typ) {
CHECK_LT(tag, atomic_load(&used_tags, memory_order_relaxed));
+ bool in_ignored_lib;
+ if (caller_pc && libignore()->IsIgnored(caller_pc, &in_ignored_lib))
+ return;
+
ThreadState *thr = cur_thread();
if (caller_pc) FuncEntry(thr, caller_pc);
- InsertShadowStackFrameForTag(thr, (uptr)tag);
- bool in_ignored_lib;
- if (!caller_pc || !libignore()->IsIgnored(caller_pc, &in_ignored_lib))
- MemoryAccess(thr, CALLERPC, (uptr)addr, 1, typ);
- FuncExit(thr);
+ PushTag(thr, (uptr)tag);
+ MemoryAccess(thr, tsan_caller_pc, (uptr)addr, 1, typ);
+ PopTag(thr);
if (caller_pc) FuncExit(thr);
}
@@ -112,12 +119,12 @@
SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_external_read(void *addr, void *caller_pc, void *tag) {
- ExternalAccess(addr, STRIP_PAC_PC(caller_pc), tag, kAccessRead);
+ ExternalAccess(addr, STRIP_PAC_PC(caller_pc), CALLERPC, tag, kAccessRead);
}
SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_external_write(void *addr, void *caller_pc, void *tag) {
- ExternalAccess(addr, STRIP_PAC_PC(caller_pc), tag, kAccessWrite);
+ ExternalAccess(addr, STRIP_PAC_PC(caller_pc), CALLERPC, tag, kAccessWrite);
}
} // extern "C"
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_flags.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_flags.cpp
index ee78f25..3fd58f4 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_flags.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_flags.cpp
@@ -10,19 +10,21 @@
//
//===----------------------------------------------------------------------===//
-#include "sanitizer_common/sanitizer_flags.h"
-#include "sanitizer_common/sanitizer_flag_parser.h"
-#include "sanitizer_common/sanitizer_libc.h"
#include "tsan_flags.h"
-#include "tsan_rtl.h"
+
+#include "sanitizer_common/sanitizer_flag_parser.h"
+#include "sanitizer_common/sanitizer_flags.h"
+#include "sanitizer_common/sanitizer_libc.h"
+#include "tsan_interface.h"
#include "tsan_mman.h"
+#include "tsan_rtl.h"
#include "ubsan/ubsan_flags.h"
namespace __tsan {
// Can be overriden in frontend.
#ifdef TSAN_EXTERNAL_HOOKS
-extern "C" const char* __tsan_default_options();
+extern "C" const char *__tsan_default_options();
#else
SANITIZER_WEAK_DEFAULT_IMPL
const char *__tsan_default_options() {
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
index 1ee47bc..e4f9e29 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
@@ -18,6 +18,7 @@
#include "tsan_interceptors.h"
#include "tsan_interface.h"
#include "tsan_interface_ann.h"
+#include "tsan_spinlock_defs_mac.h"
#include "sanitizer_common/sanitizer_addrhashmap.h"
#include <errno.h>
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index becaba4..6ac6ac6 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -128,6 +128,7 @@
const int SIGBUS = 7;
const int SIGSYS = 31;
#endif
+const int SI_TIMER = -2;
void *const MAP_FAILED = (void*)-1;
#if SANITIZER_NETBSD
const int PTHREAD_BARRIER_SERIAL_THREAD = 1234567;
@@ -2165,11 +2166,19 @@
} // namespace __tsan
-static bool is_sync_signal(ThreadSignalContext *sctx, int sig) {
+static bool is_sync_signal(ThreadSignalContext *sctx, int sig,
+ __sanitizer_siginfo *info) {
+ // If we are sending signal to ourselves, we must process it now.
+ if (sctx && sig == sctx->int_signal_send)
+ return true;
+#if SANITIZER_HAS_SIGINFO
+ // POSIX timers can be configured to send any kind of signal; however, it
+ // doesn't make any sense to consider a timer signal as synchronous!
+ if (info->si_code == SI_TIMER)
+ return false;
+#endif
return sig == SIGSEGV || sig == SIGBUS || sig == SIGILL || sig == SIGTRAP ||
- sig == SIGABRT || sig == SIGFPE || sig == SIGPIPE || sig == SIGSYS ||
- // If we are sending signal to ourselves, we must process it now.
- (sctx && sig == sctx->int_signal_send);
+ sig == SIGABRT || sig == SIGFPE || sig == SIGPIPE || sig == SIGSYS;
}
void sighandler(int sig, __sanitizer_siginfo *info, void *ctx) {
@@ -2180,7 +2189,7 @@
return;
}
// Don't mess with synchronous signals.
- const bool sync = is_sync_signal(sctx, sig);
+ const bool sync = is_sync_signal(sctx, sig, info);
if (sync ||
// If we are in blocking function, we can safely process it now
// (but check if we are in a recursive interceptor,
@@ -2488,11 +2497,21 @@
res; \
})
+// Ignore interceptors in OnLibraryLoaded()/Unloaded(). These hooks use code
+// (ListOfModules::init, MemoryMappingLayout::DumpListOfModules) that make
+// intercepted calls, which can cause deadlockes with ReportRace() which also
+// uses this code.
#define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \
- libignore()->OnLibraryLoaded(filename)
+ ({ \
+ ScopedIgnoreInterceptors ignore_interceptors; \
+ libignore()->OnLibraryLoaded(filename); \
+ })
-#define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() \
- libignore()->OnLibraryUnloaded()
+#define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() \
+ ({ \
+ ScopedIgnoreInterceptors ignore_interceptors; \
+ libignore()->OnLibraryUnloaded(); \
+ })
#define COMMON_INTERCEPTOR_ACQUIRE(ctx, u) \
Acquire(((TsanInterceptorContext *) ctx)->thr, pc, u)
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface.h b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface.h
index 5b9d664..d53c1e3 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface.h
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface.h
@@ -32,6 +32,9 @@
// before any instrumented code is executed and before any call to malloc.
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_init();
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *
+__tsan_default_options();
+
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_flush_memory();
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read1(void *addr);
@@ -85,6 +88,8 @@
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_begin();
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_end();
+SANITIZER_INTERFACE_ATTRIBUTE void __tsan_on_thread_idle();
+
SANITIZER_INTERFACE_ATTRIBUTE
void *__tsan_external_register_tag(const char *object_type);
SANITIZER_INTERFACE_ATTRIBUTE
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_mman.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
index 0937e52..e5271cf 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
@@ -15,6 +15,7 @@
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_errno.h"
#include "sanitizer_common/sanitizer_placement_new.h"
+#include "tsan_interface.h"
#include "tsan_mman.h"
#include "tsan_rtl.h"
#include "tsan_report.h"
@@ -351,6 +352,20 @@
return SetErrnoOnNull(user_alloc_internal(thr, pc, sz, PageSize));
}
+static const void *user_alloc_begin(const void *p) {
+ if (p == nullptr || !IsAppMem((uptr)p))
+ return nullptr;
+ void *beg = allocator()->GetBlockBegin(p);
+ if (!beg)
+ return nullptr;
+
+ MBlock *b = ctx->metamap.GetBlock((uptr)beg);
+ if (!b)
+ return nullptr; // Not a valid pointer.
+
+ return (const void *)beg;
+}
+
uptr user_alloc_usable_size(const void *p) {
if (p == 0 || !IsAppMem((uptr)p))
return 0;
@@ -429,6 +444,10 @@
return allocator()->GetBlockBegin(p) != 0;
}
+const void *__sanitizer_get_allocated_begin(const void *p) {
+ return user_alloc_begin(p);
+}
+
uptr __sanitizer_get_allocated_size(const void *p) {
return user_alloc_usable_size(p);
}
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
index 9094469..384a443 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
@@ -66,7 +66,8 @@
void *__libc_stack_end = 0;
#endif
-#if SANITIZER_LINUX && defined(__aarch64__) && !SANITIZER_GO
+#if SANITIZER_LINUX && (defined(__aarch64__) || defined(__loongarch_lp64)) && \
+ !SANITIZER_GO
# define INIT_LONGJMP_XOR_KEY 1
#else
# define INIT_LONGJMP_XOR_KEY 0
@@ -314,7 +315,7 @@
}
#endif
-#if SANITIZER_LINUX && defined(__aarch64__)
+#if SANITIZER_LINUX && (defined(__aarch64__) || defined(__loongarch_lp64))
// Initialize the xor key used in {sig}{set,long}jump.
InitializeLongjmpXorKey();
#endif
@@ -387,8 +388,8 @@
# else
return mangled_sp;
# endif
-#elif defined(__loongarch__)
- return mangled_sp;
+#elif defined(__loongarch_lp64)
+ return mangled_sp ^ longjmp_xor_key;
#elif defined(__powerpc64__)
// Reverse of:
// ld r4, -28696(r13)
@@ -452,7 +453,11 @@
// 2. Retrieve vanilla/mangled SP.
uptr sp;
+#ifdef __loongarch__
+ asm("move %0, $sp" : "=r" (sp));
+#else
asm("mov %0, sp" : "=r" (sp));
+#endif
uptr mangled_sp = ((uptr *)&env)[LONG_JMP_SP_ENV_SLOT];
// 3. xor SPs to obtain key.
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h
index 7f5de6b..a5606db 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h
@@ -680,8 +680,9 @@
void LazyInitialize(ThreadState *thr) {
// If we can use .preinit_array, assume that __tsan_init
// called from .preinit_array initializes runtime before
- // any instrumented code except ANDROID.
-#if (!SANITIZER_CAN_USE_PREINIT_ARRAY || defined(__ANDROID__))
+ // any instrumented code except when tsan is used as a
+ // shared library.
+#if (!SANITIZER_CAN_USE_PREINIT_ARRAY || defined(SANITIZER_SHARED))
if (UNLIKELY(!is_initialized))
Initialize(thr);
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
index e0b4c71..c616265 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
@@ -3,28 +3,6 @@
#include "sanitizer_common/sanitizer_asm.h"
-#if defined(__APPLE__)
-.align 2
-
-.section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
-.long _setjmp$non_lazy_ptr
-_setjmp$non_lazy_ptr:
-.indirect_symbol _setjmp
-.long 0
-
-.section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
-.long __setjmp$non_lazy_ptr
-__setjmp$non_lazy_ptr:
-.indirect_symbol __setjmp
-.long 0
-
-.section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
-.long _sigsetjmp$non_lazy_ptr
-_sigsetjmp$non_lazy_ptr:
-.indirect_symbol _sigsetjmp
-.long 0
-#endif
-
#if !defined(__APPLE__)
.section .text
#else
@@ -75,9 +53,8 @@
ldr x1, [x1, #:got_lo12:_ZN14__interception11real_setjmpE]
ldr x1, [x1]
#else
- adrp x1, _setjmp$non_lazy_ptr@page
- add x1, x1, _setjmp$non_lazy_ptr@pageoff
- ldr x1, [x1]
+ adrp x1, _setjmp@GOTPAGE
+ ldr x1, [x1, _setjmp@GOTPAGEOFF]
#endif
br x1
@@ -126,9 +103,8 @@
ldr x1, [x1, #:got_lo12:_ZN14__interception12real__setjmpE]
ldr x1, [x1]
#else
- adrp x1, __setjmp$non_lazy_ptr@page
- add x1, x1, __setjmp$non_lazy_ptr@pageoff
- ldr x1, [x1]
+ adrp x1, __setjmp@GOTPAGE
+ ldr x1, [x1, __setjmp@GOTPAGEOFF]
#endif
br x1
@@ -179,9 +155,8 @@
ldr x2, [x2, #:got_lo12:_ZN14__interception14real_sigsetjmpE]
ldr x2, [x2]
#else
- adrp x2, _sigsetjmp$non_lazy_ptr@page
- add x2, x2, _sigsetjmp$non_lazy_ptr@pageoff
- ldr x2, [x2]
+ adrp x2, _sigsetjmp@GOTPAGE
+ ldr x2, [x2, _sigsetjmp@GOTPAGEOFF]
#endif
br x2
CFI_ENDPROC
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
index c2cff60..0311df5 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
@@ -10,20 +10,20 @@
//
//===----------------------------------------------------------------------===//
+#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_libc.h"
#include "sanitizer_common/sanitizer_placement_new.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
-#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_stacktrace.h"
+#include "tsan_fd.h"
+#include "tsan_flags.h"
+#include "tsan_mman.h"
#include "tsan_platform.h"
+#include "tsan_report.h"
#include "tsan_rtl.h"
#include "tsan_suppressions.h"
#include "tsan_symbolize.h"
-#include "tsan_report.h"
#include "tsan_sync.h"
-#include "tsan_mman.h"
-#include "tsan_flags.h"
-#include "tsan_fd.h"
namespace __tsan {
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_spinlock_defs_mac.h b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_spinlock_defs_mac.h
new file mode 100644
index 0000000..1a99a81
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_spinlock_defs_mac.h
@@ -0,0 +1,45 @@
+//===-- tsan_spinlock_defs_mac.h -------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of ThreadSanitizer (TSan), a race detector.
+//
+// Mac-specific forward-declared function defintions that may be
+// deprecated in later versions of the OS.
+// These are needed for interceptors.
+//
+//===----------------------------------------------------------------------===//
+
+#if SANITIZER_APPLE
+
+#ifndef TSAN_SPINLOCK_DEFS_MAC_H
+#define TSAN_SPINLOCK_DEFS_MAC_H
+
+#include <stdint.h>
+
+extern "C" {
+
+/*
+Provides forward declarations related to OSSpinLocks on Darwin. These functions are
+deprecated on macOS version 10.12 and later,
+and are no longer included in the system headers.
+
+However, the symbols are still available on the system, so we provide these forward
+declarations to prevent compilation errors in tsan_interceptors_mac.cpp, which
+references these functions when defining TSAN interceptor functions.
+*/
+
+typedef int32_t OSSpinLock;
+
+void OSSpinLockLock(volatile OSSpinLock *__lock);
+void OSSpinLockUnlock(volatile OSSpinLock *__lock);
+bool OSSpinLockTry(volatile OSSpinLock *__lock);
+
+}
+
+#endif //TSAN_SPINLOCK_DEFS_MAC_H
+#endif // SANITIZER_APPLE
diff --git a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp
index a1c1bf8..9cdfa32 100644
--- a/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/tsan/rtl/tsan_suppressions.cpp
@@ -10,15 +10,16 @@
//
//===----------------------------------------------------------------------===//
+#include "tsan_suppressions.h"
+
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_libc.h"
#include "sanitizer_common/sanitizer_placement_new.h"
#include "sanitizer_common/sanitizer_suppressions.h"
-#include "tsan_suppressions.h"
-#include "tsan_rtl.h"
#include "tsan_flags.h"
#include "tsan_mman.h"
#include "tsan_platform.h"
+#include "tsan_rtl.h"
#if !SANITIZER_GO
// Suppressions for true/false positives in standard libraries.
diff --git a/third_party/llvm-project/compiler-rt/lib/ubsan/ubsan_diag.cpp b/third_party/llvm-project/compiler-rt/lib/ubsan/ubsan_diag.cpp
index 3673e66..dd99613 100644
--- a/third_party/llvm-project/compiler-rt/lib/ubsan/ubsan_diag.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/ubsan/ubsan_diag.cpp
@@ -214,7 +214,12 @@
// printf, and stop using snprintf here.
char FloatBuffer[32];
#if SANITIZER_WINDOWS
- sprintf_s(FloatBuffer, sizeof(FloatBuffer), "%Lg", (long double)A.Float);
+ // On MSVC platforms, long doubles are equal to regular doubles.
+ // In MinGW environments on x86, long doubles are 80 bit, but here,
+ // we're calling an MS CRT provided printf function which considers
+ // long doubles to be 64 bit. Just cast the float value to a regular
+ // double to avoid the potential ambiguity in MinGW mode.
+ sprintf_s(FloatBuffer, sizeof(FloatBuffer), "%g", (double)A.Float);
#else
snprintf(FloatBuffer, sizeof(FloatBuffer), "%Lg", (long double)A.Float);
#endif
diff --git a/third_party/llvm-project/compiler-rt/lib/xray/xray_profiling.cpp b/third_party/llvm-project/compiler-rt/lib/xray/xray_profiling.cpp
index 81c33fa..259ec65 100644
--- a/third_party/llvm-project/compiler-rt/lib/xray/xray_profiling.cpp
+++ b/third_party/llvm-project/compiler-rt/lib/xray/xray_profiling.cpp
@@ -253,8 +253,8 @@
reinterpret_cast<const char *>(B.Data) + B.Size);
B = profileCollectorService::nextBuffer(B);
}
+ LogWriter::Close(LW);
}
- LogWriter::Close(LW);
}
}
diff --git a/third_party/llvm-project/compiler-rt/test/CMakeLists.txt b/third_party/llvm-project/compiler-rt/test/CMakeLists.txt
index 04ff819..69e17af 100644
--- a/third_party/llvm-project/compiler-rt/test/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/test/CMakeLists.txt
@@ -32,7 +32,7 @@
# Use LLVM utils and Clang from the same build tree.
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS
clang clang-resource-headers FileCheck count not llvm-config llvm-nm llvm-objdump
- llvm-readelf llvm-readobj llvm-size llvm-symbolizer compiler-rt-headers sancov)
+ llvm-readelf llvm-readobj llvm-size llvm-symbolizer compiler-rt-headers sancov split-file)
if (WIN32)
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS KillTheDoctor)
endif()
@@ -43,9 +43,7 @@
endif()
endif()
-if(COMPILER_RT_STANDALONE_BUILD)
- umbrella_lit_testsuite_begin(check-compiler-rt)
-endif()
+umbrella_lit_testsuite_begin(check-compiler-rt)
function(compiler_rt_test_runtime runtime)
string(TOUPPER ${runtime} runtime_uppercase)
@@ -78,6 +76,9 @@
# OpenBSD not supporting asan, cannot run the tests
if(COMPILER_RT_BUILD_LIBFUZZER AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" AND NOT ANDROID)
compiler_rt_test_runtime(fuzzer)
+
+ # These tests don't need an additional runtime but use asan runtime.
+ add_subdirectory(metadata)
endif()
foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD})
@@ -105,16 +106,14 @@
# ShadowCallStack does not yet provide a runtime with compiler-rt, the tests
# include their own minimal runtime
add_subdirectory(shadowcallstack)
- # These tests are self-contained and don't need an additional runtime.
- add_subdirectory(metadata)
endif()
-if(COMPILER_RT_STANDALONE_BUILD)
- # Now that we've traversed all the directories and know all the lit testsuites,
- # introduce a rule to run to run all of them.
- add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_COMPILER_RT_LIT_DEPENDS})
- umbrella_lit_testsuite_end(check-compiler-rt)
+# Now that we've traversed all the directories and know all the lit testsuites,
+# introduce a rule to run to run all of them.
+add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_COMPILER_RT_LIT_DEPENDS})
+umbrella_lit_testsuite_end(check-compiler-rt)
+if(COMPILER_RT_STANDALONE_BUILD)
if(NOT TARGET check-all)
add_custom_target(check-all)
endif()
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
index 102e62f..d9381bd 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
@@ -1,9 +1,9 @@
// Check that ASan plays well with easy cases of makecontext/swapcontext.
-// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -o %t && %run %t
+// RUN: %clangxx_asan -O3 %s -o %t && %run %t
+// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O0 %s -o %t && %run %t
+// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O3 %s -o %t && %run %t
//
// This test is too sublte to try on non-x86 arch for now.
// Android and musl do not support swapcontext.
@@ -20,25 +20,23 @@
const int kStackSize = 1 << 20;
-__attribute__((noinline))
-void Throw() {
- throw 1;
-}
+__attribute__((noinline)) void Throw() { throw 1; }
-__attribute__((noinline))
-void ThrowAndCatch() {
+__attribute__((noinline)) void ThrowAndCatch() {
try {
Throw();
- } catch(int a) {
+ } catch (int a) {
printf("ThrowAndCatch: %d\n", a);
}
}
-void Child(int mode) {
- assert(orig_context.uc_stack.ss_size == 0);
- char x[32] = {0}; // Stack gets poisoned.
- printf("Child: %p\n", x);
- ThrowAndCatch(); // Simulate __asan_handle_no_return().
+void Child(int mode, int a, int b, int c) {
+ char x[32] = {0}; // Stack gets poisoned.
+ printf("Child: %d\n", x);
+ assert(a == 'a');
+ assert(b == 'b');
+ assert(c == 'c');
+ ThrowAndCatch(); // Simulate __asan_handle_no_return().
// (a) Do nothing, just return to parent function.
// (b) Jump into the original function. Stack remains poisoned unless we do
// something.
@@ -53,16 +51,13 @@
int Run(int arg, int mode, char *child_stack) {
printf("Child stack: %p\n", child_stack);
// Setup child context.
- memset(&child_context, 0xff, sizeof(child_context));
getcontext(&child_context);
- assert(child_context.uc_stack.ss_size == 0);
child_context.uc_stack.ss_sp = child_stack;
child_context.uc_stack.ss_size = kStackSize / 2;
if (mode == 0) {
child_context.uc_link = &orig_context;
}
- makecontext(&child_context, (void (*)())Child, 1, mode);
- memset(&orig_context, 0xff, sizeof(orig_context));
+ makecontext(&child_context, (void (*)())Child, 4, mode, 'a', 'b', 'c');
if (swapcontext(&orig_context, &child_context) < 0) {
perror("swapcontext");
return 0;
@@ -74,24 +69,57 @@
return child_stack[arg];
}
+ucontext_t poll_context;
+ucontext_t poller_context;
+
+void Poll() {
+ swapcontext(&poll_context, &poller_context);
+
+ {
+ char x = 0;
+ printf("POLL: %p\n", &x);
+ }
+
+ swapcontext(&poll_context, &poller_context);
+}
+
+void DoRunPoll(char *poll_stack) {
+ getcontext(&poll_context);
+ poll_context.uc_stack.ss_sp = poll_stack;
+ poll_context.uc_stack.ss_size = kStackSize / 2;
+ makecontext(&poll_context, Poll, 0);
+
+ getcontext(&poller_context);
+
+ swapcontext(&poller_context, &poll_context);
+ swapcontext(&poller_context, &poll_context);
+
+ // Touch poll's stack to make sure it's unpoisoned.
+ for (int i = 0; i < kStackSize; i++) {
+ poll_stack[i] = i;
+ }
+}
+
+void RunPoll() {
+ char *poll_stack = new char[kStackSize];
+
+ for (size_t i = 0; i < 2; ++i) {
+ DoRunPoll(poll_stack);
+ }
+
+ delete[] poll_stack;
+}
+
int main(int argc, char **argv) {
char stack[kStackSize + 1];
- // CHECK: WARNING: ASan doesn't fully support makecontext/swapcontext
int ret = 0;
ret += Run(argc - 1, 0, stack);
- printf("Test1 passed\n");
- // CHECK: Test1 passed
ret += Run(argc - 1, 1, stack);
- printf("Test2 passed\n");
- // CHECK: Test2 passed
char *heap = new char[kStackSize + 1];
ret += Run(argc - 1, 0, heap);
- printf("Test3 passed\n");
- // CHECK: Test3 passed
ret += Run(argc - 1, 1, heap);
- printf("Test4 passed\n");
- // CHECK: Test4 passed
- delete [] heap;
+ RunPoll();
+ delete[] heap;
return ret;
}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cpp
index 48bb221..cb36fbb 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cpp
index 2738b4e..e39b7fb 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/beginthreadex.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/beginthreadex.cpp
index 05d72a5..eda43d3 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/beginthreadex.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/beginthreadex.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield.cpp
index 174c92d..02922f6 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cpp
index 9095b80..cc9a8df 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/breakpoint.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/breakpoint.cpp
index 1c9e8c4..1ff8d02 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/breakpoint.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/breakpoint.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
index b83d635..4a8c6b6 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
index 504b673..7baf3e1 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cpp
index 54577f0..facc059 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp
index 163247e..71291e8 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp
@@ -4,6 +4,7 @@
// RUN: %env_asan_opts=coverage=1 %run ./test.exe
//
// RUN: %sancov print *.sancov | FileCheck %s
+
#include <stdio.h>
void foo() { fputs("FOO", stderr); }
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
index f2bfaad..2a880ba 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the
// __local_stdio_printf_options function isn't instrumented for coverage.
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/crt_initializers.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/crt_initializers.cpp
index f33c163..a37d47a 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/crt_initializers.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/crt_initializers.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp
index 33981bd..0cad545 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Build an executable with ASan, then extract the DLLs that it depends on.
// RUN: %clang_cl_asan %s -Fe%t.exe
// RUN: llvm-readobj --coff-imports %t.exe | grep Name: | sed -e 's/ *Name: *//' > %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/demangled_names.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/demangled_names.cpp
index f6325f3..d457d4d 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/demangled_names.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/demangled_names.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
//
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp
index a6a1a3b..c180950 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %run %t %t.dll | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp
index 9e0543c..8e4e71b 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %run %t %t.dll | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
index 96fae6b..0346ecf 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Just make sure we can link an implib into another DLL
// This used to fail between r212699 and r212814.
// RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
index 1e09678..ff84090 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
index e302763..f5127e7 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -O2 %s -Fe%t.dll
// RUNX: %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_global_dead_strip.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_global_dead_strip.c
index e5716be..1871c00 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_global_dead_strip.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_global_dead_strip.c
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
//
// RUN: %clang_cl_asan /Gw -LD -Od %s -Fe%t.dll
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_heap_allocation.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_heap_allocation.cpp
index b4df9d4..40e4833 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_heap_allocation.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_heap_allocation.cpp
@@ -1,3 +1,4 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
// RUN: %clang_cl -LD %s -Fe%t.dll -DHEAP_LIBRARY -MD
// RUN: %clang_cl %s %t.lib -Fe%t -fsanitize=address -MT
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_host.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_host.cpp
index 8032201..0757af9 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_host.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_host.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// This is a host program for DLL tests.
//
// Just make sure we can compile this.
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp
index 093134f..3db8943 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
index 7b4fbb6..6ab61ae 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -Wno-fortify-source -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp
index f2b8cdb..849c660 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cpp
index 789a199..222c143 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -Wno-fortify-source -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp
index e15dec1..1bad2f8 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
index 788488d..c047a52 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure we can link a DLL with large functions which would mean
// functions such as __asan_loadN and __asan_storeN will be called
// from the DLL. We simulate the large function with
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
index 194f31f..f2216ce 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp
index 290541f..bbf6f38 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp
index 8b8e4d1..d502575 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp
index 0c826a0..a3242c9 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
index b5e980a..34c29b0 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
index 5e34071..bdf3fe3 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp
index 6a23da7..f20c5b1 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cpp
index 0a8e3d8..c9fc166 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -LD -Od -DDLL %s -Fe%t.dll
// RUN: %clang_cl_asan -Od -DEXE %s %t.lib -Fe%te.exe
// RUN: %env_asan_opts=report_globals=2 %run %te.exe 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
index 3651463..009351d 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
//
// Check both -GS and -GS- builds:
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
index e2c295d..6aa9721 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp
index c25da90..da2a911 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp
index 055567a..23a6544 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/dll_unload.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <windows.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_free.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_free.cpp
index 6843746..59a2641 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_free.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_free.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cpp
index 168e531..55304e2 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string.cpp
index 546419d..10437a6 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
index adc9b24..3e5bd1d 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_dead_strip.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_dead_strip.c
index a13447d..32d4a18 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_dead_strip.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/global_dead_strip.c
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan /Gw /Od %s /Fe%t.exe
// RUN: %env_asan_opts=report_globals=2 %t.exe 2>&1 | FileCheck %s --check-prefix=NOSTRIP
// RUN: %clang_cl_asan /Gw /O2 %s /Fe%t.exe -link -opt:ref
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp
index cb07b8f..3deaa64 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// UNSUPPORTED: asan-64-bits
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp
index 496289a..8391719 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <windows.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp
index 79b30f4..a34b702 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <windows.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp
index 3394a92..7f7b51a 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp
index e040fd5..d126c75 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t 2>&1 | FileCheck %s
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp
index 3a6ce78..8514be3 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=allocator_may_return_null=true %run %t
// RUN: %env_asan_opts=allocator_may_return_null=true:windows_hook_rtl_allocators=true %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp
index a36e594..c65ece7 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include "sanitizer\allocator_interface.h"
#include <cassert>
#include <stdio.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cpp
index a2ee686..434de5c 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp
index 497d36b..fa9f937 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include "sanitizer\allocator_interface.h"
#include <cassert>
#include <stdio.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp
index e0f1f86..34f3015 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp
index 40396ed..f1345f6 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan /Od -o %t %s
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s
// RUN: %env_asan_opts=windows_hook_rtl_allocators=false %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp
index add644c..0073ce0 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp
index 7b1272e..1595729 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan /Od /MT -o %t %s
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp
index 96bc9b9..cc1f1f0 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/heaprealloc_zero_size.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan /Od -o %t %s
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s
// RUN: %env_asan_opts=windows_hook_rtl_allocators=false %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/hello_world.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/hello_world.cpp
index 0caeb35..546c37e 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/hello_world.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/hello_world.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/illegal_instruction.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/illegal_instruction.cpp
index 2b6b05c..eb6c64a 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/illegal_instruction.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/illegal_instruction.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/integer_divide_by_zero.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/integer_divide_by_zero.cpp
index 9a0f97a..d7728e3 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/integer_divide_by_zero.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/integer_divide_by_zero.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=handle_sigfpe=1 not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cpp
index db8de07..401fc12 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
index 0e4bd13..8e860f2 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cpp
index 0cedf9f..6853d12 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
index 58808d4..1803911 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Check that the interface exported by asan static lib matches the list of
// functions mentioned in sanitizer_interface.inc.
//
@@ -40,7 +42,6 @@
// IMPORT: __asan_set_seh_filter
// IMPORT: __asan_unhandled_exception_filter
// IMPORT: __asan_test_only_reported_buggy_pointer
-// IMPORT: __sancov_lowest_stack
// IMPORT: __ubsan_vptr_type_cache
//
// RUN: cat %t.imports1 %t.imports2 %t.imports3 | sort | uniq > %t.imports-sorted
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
index 8c7570f..eea38b8 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// First, check this works with the default ignorelist:
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: echo "42" | %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
index 4b92e11..0a97e66 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
index 890503c..cbdf998 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cpp
index 8cecc68..a64fdb7 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cpp
index 09a572e..04f8b92 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure everything works even if the main module doesn't have any stack
// variables, thus doesn't explicitly reference any symbol exported by the
// runtime thunk.
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/oom.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/oom.cpp
index bf19aa0..52872c1 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/oom.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/oom.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-32-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
index d06bcb2..f8ffc69 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
index c60a351..b84e657 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cpp
index 552ca9d..367162e 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
index 4290408..30fc1c7 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cpp
index d889185..8830fae 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
index f339496..c9eceff 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
index 8e76790..85e4de8 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cpp
index fe8fc90..bf91b6c 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cpp
index aa618cb..2c18090 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
index 709f8ea..3adc6e6 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
index 5ae7eee..de83936 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cpp
index 7454d5a..6593e42 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp
index a94c823..9ed3ed6 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/recalloc_sanity.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Workaround for "LINK : fatal error LNK1318: Unexpected PDB error"
// RUN: rm -f %t.pdb
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
index c406152..10e5663 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
@@ -1,5 +1,10 @@
-// RUN: %clangxx_asan -O0 %s -o %t
-// RUN: %env_asan_opts=external_symbolizer_path=asdf not %run %t 2>&1 | FileCheck %s
+// This test works on both MSVC and MinGW targets, but they require different
+// build commands. By default we use DWARF debug info on MinGW and dbghelp does
+// not support it, so we need to specify extra flags to get the compiler to
+// generate PDB debug info.
+
+// RUN: %clangxx_asan %if target={{.*-windows-gnu}} %{ -gcodeview -gcolumn-info -Wl,--pdb= -ldbghelp %} -O0 %s -o %t
+// RUN: %env_asan_opts=external_symbolizer_path=non-existent\\\\asdf not %run %t 2>&1 | FileCheck %s
#include <windows.h>
#include <dbghelp.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp
index eb6d4bc..2965122 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure we can handle reloading the same DLL multiple times.
// RUN: %clang_cl_asan -LD -Od -DDLL %s -Fe%t.dll
// RUN: %clang_cl_asan -Od -DEXE %s -Fe%te.exe
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp
index 9619aff..2b6aedb 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -LD -Od -DDLL %s -Fe%t.dll
// RUN: %clang_cl_asan -Od -DEXE %s -Fe%te.exe
// RUN: %env_asan_opts=report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp
index 6ef1caa..8df1b51 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t /MD
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp
index 0781145..7ab075c 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll
// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp
index a2758ca..3bf1784 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -LD /Od -DDLL %s -Fe%t.dll
// RUN: %clang_cl /Od -DEXE %s -Fe%te.exe
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %te.exe %t.dll 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp
index d7e81ac..177de65 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t /MD
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp
index 92d2940..b110143 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t /MD
// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: asan-64-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp
index e3c7bfe..474f029 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sanitizer_purge.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <Windows.h>
#include <stdio.h>
#include <sanitizer/allocator_interface.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/seh.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/seh.cpp
index 4cb0c55..a6cb048 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/seh.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/seh.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure that ASan works with SEH in both Clang and MSVC. MSVC uses a
// different EH personality depending on the -GS setting, so test both -GS+ and
// -GS-.
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_conflict_32.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_conflict_32.cpp
index 9e144be..c08fcc3 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_conflict_32.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_conflict_32.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Load this DLL at the default 32-bit ASan shadow base, and test how we dump
// the process memory layout.
// REQUIRES: asan-32-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_mapping_failure.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_mapping_failure.cpp
index c774689..b3ee3df 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_mapping_failure.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/shadow_mapping_failure.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-32-bits
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sse_misalignment.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sse_misalignment.cpp
index 9f7e230..ce9bd63 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sse_misalignment.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/sse_misalignment.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=handle_sigfpe=1 not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_left_oob.cpp
index ff36185..abda435 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_right_oob.cpp
index 20270ff..78b3800 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_sanity.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_sanity.cpp
index 156e9f8..0f0b545 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_sanity.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_array_sanity.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
index c180bc9..ae16bbd 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
// RUN: %clang_cl_asan -Od %s -Fe%t -fsanitize-address-use-after-return=always
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
index 812ccf2..3681ff1 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure symbolization works even if the path to the .exe file changes.
// RUN: mkdir %t || true
// RUN: %clang_cl_asan -Od %s -Fe%t/symbols_path.exe
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_simple.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_simple.cpp
index fd9ac4c..1cfc2ef 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_simple.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_simple.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_left_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_left_oob.cpp
index 2b99bc7..06bd43b 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_left_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_left_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_right_oob.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_right_oob.cpp
index eaae869..60505a3 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_right_oob.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_right_oob.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_reuse.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_reuse.cpp
index e7b12ca..07635df 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_reuse.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stack_reuse.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stress.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stress.cpp
index e25cc6a..a4f75fe 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stress.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_stress.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_suspended.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_suspended.cpp
index b30cf14..00fc7f8 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_suspended.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/thread_suspended.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/tls_init.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
index a8569f8..5cf0768 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan %s -Fe%t.exe /MD
// RUN: %run %t.exe | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_realloc.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_realloc.cpp
index ce116f9..e26af57 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_realloc.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_realloc.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp
index 48c5065..8f92a14 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp
@@ -1,5 +1,9 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// Make sure LIBCMT doesn't accidentally get added to the list of DEFAULTLIB
-// directives. REQUIRES: asan-dynamic-runtime
+// directives.
+
+// REQUIRES: asan-dynamic-runtime
// RUN: %clang_cl_asan -LD %s | FileCheck %s
// CHECK: Creating library
// CHECK-NOT: LIBCMT
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp
index ba14a8b..5265e05 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/user-exception.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER
// RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/windows_h.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/windows_h.cpp
index f20edec..b3aacb9 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/windows_h.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/windows_h.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
index ec5a92d..6c8a649 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_stack.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_stack.cpp
index 267775e..78c7f49 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_stack.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_stack.cpp
@@ -1,3 +1,5 @@
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp
index 0b49424..a451e87 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp
@@ -3,10 +3,11 @@
//
#include <assert.h>
+#include <stdint.h>
__attribute__((noinline)) void foo(int index, int len) {
volatile char str[len] __attribute__((aligned(128)));
- assert(!(reinterpret_cast<long>(str) & 127L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 127L));
str[index] = '1'; // BOOM
// CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp
index 271359b..8b207aa 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cpp
@@ -3,6 +3,7 @@
//
#include <assert.h>
+#include <stdint.h>
struct A {
char a[3];
@@ -11,7 +12,7 @@
__attribute__((noinline)) void foo(int index, int len) {
volatile struct A str[len] __attribute__((aligned(32)));
- assert(!(reinterpret_cast<long>(str) & 31L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index].a[0] = '1'; // BOOM
// CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp
index 5bf6f80..912c8b0 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp
@@ -5,10 +5,11 @@
#include "sanitizer/asan_interface.h"
#include <assert.h>
+#include <stdint.h>
__attribute__((noinline)) void foo(int index, int len) {
volatile char str[len] __attribute__((aligned(32)));
- assert(!(reinterpret_cast<long>(str) & 31L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
char *q = (char *)__asan_region_is_poisoned((char *)str, 64);
assert(q && ((q - str) == index));
}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_partial.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_partial.cpp
index afac40c..25c6d75 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_partial.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_partial.cpp
@@ -3,10 +3,11 @@
//
#include <assert.h>
+#include <stdint.h>
__attribute__((noinline)) void foo(int index, int len) {
volatile char str[len] __attribute__((aligned(32)));
- assert(!(reinterpret_cast<long>(str) & 31L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index] = '1'; // BOOM
// CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_right.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_right.cpp
index 615dd14..7ec4b86 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_right.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_overflow_right.cpp
@@ -3,10 +3,11 @@
//
#include <assert.h>
+#include <stdint.h>
__attribute__((noinline)) void foo(int index, int len) {
volatile char str[len] __attribute__((aligned(32)));
- assert(!(reinterpret_cast<long>(str) & 31L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index] = '1'; // BOOM
// CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_safe_access.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_safe_access.cpp
index 1cd0dad..98e3176 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_safe_access.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_safe_access.cpp
@@ -3,10 +3,11 @@
//
#include <assert.h>
+#include <stdint.h>
__attribute__((noinline)) void foo(int index, int len) {
volatile char str[len] __attribute__((aligned(32)));
- assert(!(reinterpret_cast<long>(str) & 31L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index] = '1';
}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_underflow_left.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_underflow_left.cpp
index 8720e8c..52cd781 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_underflow_left.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/alloca_underflow_left.cpp
@@ -3,10 +3,11 @@
//
#include <assert.h>
+#include <stdint.h>
__attribute__((noinline)) void foo(int index, int len) {
volatile char str[len] __attribute__((aligned(32)));
- assert(!(reinterpret_cast<long>(str) & 31L));
+ assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index] = '1'; // BOOM
// CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/atoll_strict.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/atoll_strict.c
index f0cf0c6..431ec6b 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/atoll_strict.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/atoll_strict.c
@@ -11,7 +11,7 @@
// RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
// FIXME: Needs Windows interceptor.
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#include <assert.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/frexpl_interceptor.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/frexpl_interceptor.cpp
index 46bb6a2..721eecc 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/frexpl_interceptor.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/frexpl_interceptor.cpp
@@ -2,6 +2,10 @@
// Test the frexpl() interceptor.
+// FIXME: MinGW-w64 implements `frexpl()` as a static import, so the dynamic
+// interceptor seems to not work.
+// XFAIL: target={{.*-windows-gnu}}
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
index b498394..edbff7c 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
@@ -2,7 +2,7 @@
/// allow this test to also run on Windows (which can't be done for the
/// debuginfo variant).
-// RUN: %clangxx_asan -O2 %S/global-location.cpp -o %t -Wl,-S
+// RUN: %clangxx_asan -O2 %S/global-location.cpp -o %t %if target={{.*-windows-msvc.*}} %{ -Wl,/DEBUG:NONE %} %else %{ -Wl,-S %}
// RUN: not %run %t g 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=GLOB-NO-G
// RUN: not %run %t c 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CLASS_STATIC-NO-G
// RUN: not %run %t f 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=FUNC_STATIC-NO-G
@@ -11,12 +11,9 @@
/// Solaris ld -S has different semantics.
// XFAIL: target={{.*solaris.*}}
-/// MSVC linker doesn't support `-S`.
-// UNSUPPORTED: target={{.*windows.*}}
-
// CHECK: AddressSanitizer: global-buffer-overflow
// CLASS_STATIC-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}C::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
// GLOB-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}global{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
-// FUNC_STATIC-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}main::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
+// FUNC_STATIC-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}main{{.*}}::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
// LITERAL-NO-G: 0x{{.*}} is located 0 bytes after global variable {{.*}} defined in '{{.*}}global-location.cpp' {{.*}} of size 11
// CHECK: SUMMARY: AddressSanitizer: global-buffer-overflow
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location.cpp
index b0e996a..7aa6941 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/global-location.cpp
@@ -7,6 +7,9 @@
// COFF doesn't support debuginfo for globals. For the non-debuginfo tests, see global-location-nodebug.cpp.
// XFAIL: target={{.*windows-msvc.*}}
+// FIXME: Investigate failure on MinGW
+// XFAIL: target={{.*-windows-gnu}}
+
// atos doesn't show source line numbers for global variables.
// UNSUPPORTED: darwin
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
index f1bd0f0..6618672 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
@@ -1,8 +1,11 @@
-// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// XFAIL: target={{.*windows-msvc.*}}
+// Most Windows linkers set stack size default to 1 MB. Bump it up to 8 MB.
+// DEFINE: %{stack} = %if target={{.*-windows-gnu}} %{ -Wl,--stack,8388608 %} \
+// DEFINE: %if target={{.*-windows-msvc.*}} %{ -Wl,/STACK:8388608 %}
+
+// RUN: %clangxx_asan %{stack} -O0 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan %{stack} -O2 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan %{stack} -O0 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan %{stack} -O2 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
// FIXME: Fix this test under GCC.
// REQUIRES: Clang
@@ -15,6 +18,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#ifdef _WIN32
+# include <windows.h>
+#endif
__attribute__((noinline))
char *pretend_to_do_something(char *x) {
@@ -40,10 +46,10 @@
}
int main(int argc, char **argv) {
-#ifdef _MSC_VER
- // FIXME: This test crashes on Windows and raises a dialog. Avoid running it
- // in addition to XFAILing it.
- return 42;
+#ifdef _WIN32
+ // Prevent the crash dialog from showing in case something bad like a stack
+ // overflow happens.
+ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#endif
int n_iter = argc >= 2 ? atoi(argv[1]) : 1000;
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/init-order-atexit.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/init-order-atexit.cpp
index 57bddd4..6877076 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/init-order-atexit.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/init-order-atexit.cpp
@@ -7,6 +7,9 @@
// RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cpp -o %t
// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s
+// FIXME: Investigate failure on MinGW
+// XFAIL: target={{.*-windows-gnu}}
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/lsan_annotations.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/lsan_annotations.cpp
deleted file mode 100644
index 158c2fd..0000000
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/lsan_annotations.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Check that LSan annotations work fine.
-// RUN: %clangxx_asan -O0 %s -o %t && %run %t
-// RUN: %clangxx_asan -O3 %s -o %t && %run %t
-
-#include <sanitizer/lsan_interface.h>
-#include <stdlib.h>
-
-int *x, *y;
-
-int main() {
- x = new int;
- __lsan_ignore_object(x);
-
- {
- __lsan::ScopedDisabler disabler;
- y = new int;
- }
-
- x = y = nullptr;
- return 0;
-}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-2.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-2.c
index 7fcf430..3ea263d 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-2.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-2.c
@@ -6,7 +6,7 @@
// RUN: %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: printf is not intercepted on Windows yet.
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#include <stdio.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-3.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-3.c
index 805210c..a8ce02e 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-3.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-3.c
@@ -4,7 +4,7 @@
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: printf is not intercepted on Windows yet.
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
// New Bionic rejects %n
// https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-5.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-5.c
index 564de39..eef5223 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-5.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/printf-5.c
@@ -5,7 +5,7 @@
// RUN: %env_asan_opts=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: printf is not intercepted on Windows yet.
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#include <stdio.h>
#include <string.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete_shared.cpp
similarity index 83%
rename from third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
rename to third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete_shared.cpp
index 677a571..6a78ebb 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete_shared.cpp
@@ -1,4 +1,4 @@
-// Ensure that operator new/delete are still replaceable.
+// Ensure that operator new/delete are still replaceable using shared-libsan.
// FIXME: Weak symbols aren't supported on Windows, although some code in
// compiler-rt already exists to solve this problem. We should probably define
@@ -6,7 +6,6 @@
// UNSUPPORTED: target={{.*windows.*}}
// RUN: %clangxx %s -o %t -fsanitize=address -shared-libsan && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx %s -o %t -fsanitize=address -static-libsan && not %run %t 2>&1 | FileCheck %s
#include <cstdio>
#include <cstdlib>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete_static.cpp
similarity index 83%
copy from third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
copy to third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete_static.cpp
index 677a571..98fe610 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/replaceable_new_delete_static.cpp
@@ -1,11 +1,13 @@
-// Ensure that operator new/delete are still replaceable.
+// Ensure that operator new/delete are still replaceable using static-libsan.
// FIXME: Weak symbols aren't supported on Windows, although some code in
// compiler-rt already exists to solve this problem. We should probably define
// the new/delete interceptors as "weak" using those workarounds as well.
// UNSUPPORTED: target={{.*windows.*}}
-// RUN: %clangxx %s -o %t -fsanitize=address -shared-libsan && not %run %t 2>&1 | FileCheck %s
+// darwin only supports `shared-libsan`.
+// REQUIRES: asan-static-runtime
+
// RUN: %clangxx %s -o %t -fsanitize=address -static-libsan && not %run %t 2>&1 | FileCheck %s
#include <cstdio>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/report_error_summary.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/report_error_summary.cpp
new file mode 100644
index 0000000..d565d2a
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/report_error_summary.cpp
@@ -0,0 +1,23 @@
+// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
+
+// FIXME: Doesn't work with DLLs
+// XFAIL: win32-dynamic-asan
+
+#include <stdio.h>
+
+// Required for ld64 macOS 12.0+
+__attribute__((weak)) extern "C" void foo() {}
+
+extern "C" void __sanitizer_report_error_summary(const char *summary) {
+ fprintf(stderr, "test_report_error_summary\n");
+ // CHECK: test_report_error_summary
+ fflush(stderr);
+}
+
+char *x;
+
+int main() {
+ x = new char[20];
+ delete[] x;
+ return x[0];
+}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-1.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-1.c
index 8be4b75..9fa4a2b 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-1.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-1.c
@@ -6,7 +6,7 @@
// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1
// There's no interceptor for strcasestr on Windows
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#define _GNU_SOURCE
#include <assert.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-2.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-2.c
index eabe402..920d11e 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-2.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr-2.c
@@ -6,7 +6,7 @@
// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false:intercept_strlen=false %run %t 2>&1
// There's no interceptor for strcasestr on Windows
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#define _GNU_SOURCE
#include <assert.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr_strict.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr_strict.c
index a6d1087..16efae7 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr_strict.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strcasestr_strict.c
@@ -4,7 +4,7 @@
// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
// There's no interceptor for strcasestr on Windows
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#define _GNU_SOURCE
#include <assert.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strncasecmp_strict.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strncasecmp_strict.c
index 24261be..a0bd338 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strncasecmp_strict.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strncasecmp_strict.c
@@ -14,7 +14,7 @@
// RUN: %env_asan_opts=strict_string_checks=false %run %t i 2>&1
// RUN: %env_asan_opts=strict_string_checks=true not %run %t i 2>&1 | FileCheck %s
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#include <assert.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strtoll_strict.c b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strtoll_strict.c
index 88e6651..097412e 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/strtoll_strict.c
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/strtoll_strict.c
@@ -24,7 +24,7 @@
// FIXME: Enable strtoll interceptor.
// REQUIRES: shadow-scale-3
-// XFAIL: target={{.*windows-msvc.*}}
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#include <assert.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/time_interceptor.cpp b/third_party/llvm-project/compiler-rt/test/asan/TestCases/time_interceptor.cpp
index 47acdd5..0c5e3fe 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/time_interceptor.cpp
+++ b/third_party/llvm-project/compiler-rt/test/asan/TestCases/time_interceptor.cpp
@@ -2,8 +2,8 @@
// Test the time() interceptor.
-// There's no interceptor for time() on Windows yet.
-// XFAIL: target={{.*windows-msvc.*}}
+// FIXME: There's no interceptor for time() on Windows yet.
+// XFAIL: target={{.*windows-(msvc.*|gnu)}}
#include <stdio.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/asan/lit.cfg.py b/third_party/llvm-project/compiler-rt/test/asan/lit.cfg.py
index 9f42e20..10fe576 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/lit.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/asan/lit.cfg.py
@@ -99,11 +99,13 @@
clang_asan_static_cflags.append("-mbackchain")
clang_asan_static_cxxflags = config.cxx_mode_flags + clang_asan_static_cflags
+target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple))
+
asan_dynamic_flags = []
if config.asan_dynamic:
asan_dynamic_flags = ["-shared-libasan"]
- if platform.system() == 'Windows':
- # On Windows, we need to simulate "clang-cl /MD" on the clang driver side.
+ if platform.system() == 'Windows' and target_is_msvc:
+ # On MSVC target, we need to simulate "clang-cl /MD" on the clang driver side.
asan_dynamic_flags += ["-D_MT", "-D_DLL", "-Wl,-nodefaultlib:libcmt,-defaultlib:msvcrt,-defaultlib:oldnames"]
elif platform.system() == 'FreeBSD':
# On FreeBSD, we need to add -pthread to ensure pthread functions are available.
@@ -144,8 +146,8 @@
config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) )
-# Windows-specific tests might also use the clang-cl.exe driver.
-if platform.system() == 'Windows':
+# MSVC-specific tests might also use the clang-cl.exe driver.
+if platform.system() == 'Windows' and target_is_msvc:
clang_cl_cxxflags = ["-Wno-deprecated-declarations",
"-WX",
"-D_HAS_EXCEPTIONS=0",
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/CMakeLists.txt b/third_party/llvm-project/compiler-rt/test/builtins/CMakeLists.txt
index ceacbd8..57117f6 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/test/builtins/CMakeLists.txt
@@ -39,7 +39,7 @@
string(REPLACE ";" " " BUILTINS_TEST_TARGET_CFLAGS "${BUILTINS_TEST_TARGET_CFLAGS}")
endif()
- if (${arch} STREQUAL "riscv32")
+ if (COMPILER_RT_ENABLE_SOFTWARE_INT128 OR ${arch} STREQUAL "riscv32")
list(APPEND BUILTINS_TEST_TARGET_CFLAGS -fforce-enable-int128)
string(REPLACE ";" " " BUILTINS_TEST_TARGET_CFLAGS "${BUILTINS_TEST_TARGET_CFLAGS}")
endif()
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashlti3_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashlti3_test.c
index 2e81009..3dfa411 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashlti3_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashlti3_test.c
@@ -11,27 +11,25 @@
// Precondition: 0 <= b < bits_in_tword
-COMPILER_RT_ABI ti_int __ashlti3(ti_int a, si_int b);
+COMPILER_RT_ABI ti_int __ashlti3(ti_int a, int b);
-int test__ashlti3(ti_int a, si_int b, ti_int expected)
-{
- ti_int x = __ashlti3(a, b);
- if (x != expected)
- {
- twords at;
- at.all = a;
- twords bt;
- bt.all = b;
- twords xt;
- xt.all = x;
- twords expectedt;
- expectedt.all = expected;
- printf("error in __ashlti3: 0x%llX%.16llX << %d = 0x%llX%.16llX,"
- " expected 0x%llX%.16llX\n",
- at.s.high, at.s.low, b, xt.s.high, xt.s.low,
- expectedt.s.high, expectedt.s.low);
- }
- return x != expected;
+int test__ashlti3(ti_int a, int b, ti_int expected) {
+ ti_int x = __ashlti3(a, b);
+ if (x != expected) {
+ twords at;
+ at.all = a;
+ twords bt;
+ bt.all = b;
+ twords xt;
+ xt.all = x;
+ twords expectedt;
+ expectedt.all = expected;
+ printf("error in __ashlti3: 0x%llX%.16llX << %d = 0x%llX%.16llX,"
+ " expected 0x%llX%.16llX\n",
+ at.s.high, at.s.low, b, xt.s.high, xt.s.low, expectedt.s.high,
+ expectedt.s.low);
+ }
+ return x != expected;
}
char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0};
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashrti3_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashrti3_test.c
index 7ea3ccd..c17143b 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashrti3_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/ashrti3_test.c
@@ -11,25 +11,23 @@
// Precondition: 0 <= b < bits_in_tword
-COMPILER_RT_ABI ti_int __ashrti3(ti_int a, si_int b);
+COMPILER_RT_ABI ti_int __ashrti3(ti_int a, int b);
-int test__ashrti3(ti_int a, si_int b, ti_int expected)
-{
- ti_int x = __ashrti3(a, b);
- if (x != expected)
- {
- twords at;
- at.all = a;
- twords xt;
- xt.all = x;
- twords expectedt;
- expectedt.all = expected;
- printf("error in __ashrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX,"
- " expected 0x%llX%.16llX\n",
- at.s.high, at.s.low, b, xt.s.high, xt.s.low,
- expectedt.s.high, expectedt.s.low);
- }
- return x != expected;
+int test__ashrti3(ti_int a, int b, ti_int expected) {
+ ti_int x = __ashrti3(a, b);
+ if (x != expected) {
+ twords at;
+ at.all = a;
+ twords xt;
+ xt.all = x;
+ twords expectedt;
+ expectedt.all = expected;
+ printf("error in __ashrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX,"
+ " expected 0x%llX%.16llX\n",
+ at.s.high, at.s.low, b, xt.s.high, xt.s.low, expectedt.s.high,
+ expectedt.s.low);
+ }
+ return x != expected;
}
char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0};
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/divmodti4_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/divmodti4_test.c
index 26b3c16..51b1a0d 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/divmodti4_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/divmodti4_test.c
@@ -1,4 +1,3 @@
-// XFAIL: target=aarch64-pc-windows-{{.*}}
// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_divmodti4
// REQUIRES: int128
@@ -55,22 +54,22 @@
tu_int tests[][4] =
{
-{ (ti_int) 0, (ti_int) 1, (ti_int) 0, (ti_int) 0 },
-{ (ti_int) 0, (ti_int)-1, (ti_int) 0, (ti_int) 0 },
-{ (ti_int) 2, (ti_int) 1, (ti_int) 2, (ti_int) 0 },
-{ (ti_int) 2, (ti_int)-1, (ti_int)-2, (ti_int) 0 },
-{ (ti_int)-2, (ti_int) 1, (ti_int)-2, (ti_int) 0 },
-{ (ti_int)-2, (ti_int)-1, (ti_int) 2, (ti_int) 0 },
-{ (ti_int) 5, (ti_int) 3, (ti_int) 1, (ti_int) 2 },
-{ (ti_int) 5, (ti_int)-3, (ti_int)-1, (ti_int) 2 },
-{ (ti_int)-5, (ti_int) 3, (ti_int)-1, (ti_int)-2 },
-{ (ti_int)-5, (ti_int)-3, (ti_int) 1, (ti_int)-2 },
-{ (ti_int)0x8000000000000000LL << 64 | 0, (ti_int) 1, (ti_int)0x8000000000000000LL << 64 | 0, (ti_int)0x0LL },
-{ (ti_int)0x8000000000000000LL << 64 | 0, (ti_int)-1, (ti_int)0x8000000000000000LL << 64 | 0, (ti_int)0x0LL },
-{ (ti_int)0x8000000000000000LL << 64 | 0, (ti_int)-2, (ti_int)0x4000000000000000LL << 64 | 0, (ti_int)0x0LL },
-{ (ti_int)0x8000000000000000LL << 64 | 0, (ti_int) 2, (ti_int)0xC000000000000000LL << 64 | 0, (ti_int)0x0LL },
-{ (ti_int)0x8000000000000000LL << 64 | 0, (ti_int)-3, (ti_int)0x2AAAAAAAAAAAAAAALL << 64 | 0xAAAAAAAAAAAAAAAALL, (ti_int)-2 },
-{ (ti_int)0x8000000000000000LL << 64 | 0, (ti_int) 3, (ti_int)0xD555555555555555LL << 64 | 0x5555555555555556LL, (ti_int)-2 },
+{ (ti_int) 0, (ti_int) 1, (ti_int) 0, (ti_int) 0 },
+{ (ti_int) 0, (ti_int)-1, (ti_int) 0, (ti_int) 0 },
+{ (ti_int) 2, (ti_int) 1, (ti_int) 2, (ti_int) 0 },
+{ (ti_int) 2, (ti_int)-1, (ti_int)-2, (ti_int) 0 },
+{ (ti_int)-2, (ti_int) 1, (ti_int)-2, (ti_int) 0 },
+{ (ti_int)-2, (ti_int)-1, (ti_int) 2, (ti_int) 0 },
+{ (ti_int) 5, (ti_int) 3, (ti_int) 1, (ti_int) 2 },
+{ (ti_int) 5, (ti_int)-3, (ti_int)-1, (ti_int) 2 },
+{ (ti_int)-5, (ti_int) 3, (ti_int)-1, (ti_int)-2 },
+{ (ti_int)-5, (ti_int)-3, (ti_int) 1, (ti_int)-2 },
+{ (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int) 1, (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int)0x0LL },
+{ (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int)-1, (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int)0x0LL },
+{ (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int)-2, (ti_int)0x4000000000000000ULL << 64 | 0, (ti_int)0x0LL },
+{ (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int) 2, (ti_int)0xC000000000000000ULL << 64 | 0, (ti_int)0x0LL },
+{ (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int)-3, (ti_int)0x2AAAAAAAAAAAAAAAULL << 64 | 0xAAAAAAAAAAAAAAAAULL, (ti_int)-2 },
+{ (ti_int)0x8000000000000000ULL << 64 | 0, (ti_int) 3, (ti_int)0xD555555555555555ULL << 64 | 0x5555555555555556ULL, (ti_int)-2 },
};
#endif
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/fixunstfdi_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
index 4dfea4f..d9f02bf 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
@@ -1,4 +1,4 @@
-// XFAIL: target=aarch64-pc-windows-{{.*}}
+// XFAIL: target=aarch64-{{.*}}-windows-{{.*}}
// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_fixunstfdi
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/lit.cfg.py b/third_party/llvm-project/compiler-rt/test/builtins/Unit/lit.cfg.py
index fa6dc86..e3602a9 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/lit.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/lit.cfg.py
@@ -43,6 +43,13 @@
elif config.host_os == 'Darwin':
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.osx.a ")
config.substitutions.append( ("%librt ", base_lib + ' -lSystem ') )
+elif config.host_os == 'Windows':
+ base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
+ % config.target_suffix)
+ if sys.platform in ['win32'] and execute_external:
+ # Don't pass dosish path separator to msys bash.exe.
+ base_lib = base_lib.replace('\\', '/')
+ config.substitutions.append( ("%librt ", base_lib + ' -lmingw32 -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 ') )
else:
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
% config.target_suffix)
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/lshrti3_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/lshrti3_test.c
index e6e441b..625726f 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/lshrti3_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/lshrti3_test.c
@@ -11,25 +11,23 @@
// Precondition: 0 <= b < bits_in_dword
-COMPILER_RT_ABI ti_int __lshrti3(ti_int a, si_int b);
+COMPILER_RT_ABI ti_int __lshrti3(ti_int a, int b);
-int test__lshrti3(ti_int a, si_int b, ti_int expected)
-{
- ti_int x = __lshrti3(a, b);
- if (x != expected)
- {
- twords at;
- at.all = a;
- twords xt;
- xt.all = x;
- twords expectedt;
- expectedt.all = expected;
- printf("error in __lshrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX,"
- " expected 0x%llX%.16llX\n",
- at.s.high, at.s.low, b, xt.s.high, xt.s.low,
- expectedt.s.high, expectedt.s.low);
- }
- return x != expected;
+int test__lshrti3(ti_int a, int b, ti_int expected) {
+ ti_int x = __lshrti3(a, b);
+ if (x != expected) {
+ twords at;
+ at.all = a;
+ twords xt;
+ xt.all = x;
+ twords expectedt;
+ expectedt.all = expected;
+ printf("error in __lshrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX,"
+ " expected 0x%llX%.16llX\n",
+ at.s.high, at.s.low, b, xt.s.high, xt.s.low, expectedt.s.high,
+ expectedt.s.low);
+ }
+ return x != expected;
}
char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0};
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/multc3_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/multc3_test.c
index b436753..06f55a6 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/multc3_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/multc3_test.c
@@ -1,4 +1,4 @@
-// XFAIL: target=aarch64-pc-windows-{{.*}}
+// XFAIL: target=aarch64-{{.*}}-windows-{{.*}}
// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_multc3
diff --git a/third_party/llvm-project/compiler-rt/test/builtins/Unit/trampoline_setup_test.c b/third_party/llvm-project/compiler-rt/test/builtins/Unit/trampoline_setup_test.c
index b5702b1..4834109 100644
--- a/third_party/llvm-project/compiler-rt/test/builtins/Unit/trampoline_setup_test.c
+++ b/third_party/llvm-project/compiler-rt/test/builtins/Unit/trampoline_setup_test.c
@@ -1,4 +1,3 @@
-// XFAIL: target=aarch64-pc-windows-{{.*}}
// RUN: %clang_builtins %s %librt -fnested-functions -o %t && %run %t
// REQUIRES: librt_has_trampoline_setup
diff --git a/third_party/llvm-project/compiler-rt/test/fuzzer/BigFileCopy.cpp b/third_party/llvm-project/compiler-rt/test/fuzzer/BigFileCopy.cpp
new file mode 100644
index 0000000..5515365
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/fuzzer/BigFileCopy.cpp
@@ -0,0 +1,31 @@
+// 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
+
+#include <cstddef>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include "FuzzerIO.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+ const char *FileName = "big-file.txt";
+ FILE *f = fopen(FileName, "w");
+
+ // This is the biggest file possible unless CopyFileToErr() uses Puts()
+ fprintf(f, "%2147483646s", "2Gb-2");
+
+ // This makes the file too big if CopyFileToErr() uses fprintf("%s", <file>)
+ fprintf(f, "THIS LINE RESPONSIBLE FOR EXCEEDING 2Gb FILE SIZE\n");
+ fclose(f);
+
+ // Should now because CopyFileToErr() now uses Puts()
+ fuzzer::CopyFileToErr(FileName);
+
+ // File is >2Gb so clean up
+ remove(FileName);
+
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/fuzzer/big-file-copy.test b/third_party/llvm-project/compiler-rt/test/fuzzer/big-file-copy.test
new file mode 100644
index 0000000..766c90d
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/fuzzer/big-file-copy.test
@@ -0,0 +1,6 @@
+REQUIRES: darwin
+UNSUPPORTED: tvos || watchos
+RUN: %cpp_compiler %S/BigFileCopy.cpp -o %t
+RUN: %run %t -runs=1 -rss_limit_mb=4096 2>big-file-out.txt; result=$?
+RUN: %run rm -f big-file.txt big-file-out.txt
+RUN: (exit $result)
diff --git a/third_party/llvm-project/compiler-rt/test/fuzzer/dataflow.test b/third_party/llvm-project/compiler-rt/test/fuzzer/dataflow.test
index c7d703d..9f35374 100644
--- a/third_party/llvm-project/compiler-rt/test/fuzzer/dataflow.test
+++ b/third_party/llvm-project/compiler-rt/test/fuzzer/dataflow.test
@@ -97,6 +97,11 @@
L20_FUZZM-NEXT: F2 00000000000000000001{{$}}
L20_FUZZM-NOT: F
+# Don't crash with missing data_flow args.
+RUN: rm -rf %t-DFT
+RUN: %t-ThreeFunctionsTest -collect_data_flow=%t-ThreeFunctionsTestDF
+RUN: %t-ThreeFunctionsTest -data_flow_trace=%t-DFT %t/IN/FUZZMU
+
# Test libFuzzer's built in DFT collection.
RUN: rm -rf %t-DFT
RUN: %t-ThreeFunctionsTest -collect_data_flow=%t-ThreeFunctionsTestDF -data_flow_trace=%t-DFT %t/IN/FUZZMU
diff --git a/third_party/llvm-project/compiler-rt/test/fuzzer/merge-control-file.test b/third_party/llvm-project/compiler-rt/test/fuzzer/merge-control-file.test
index ebd2cf5..c7d666e 100644
--- a/third_party/llvm-project/compiler-rt/test/fuzzer/merge-control-file.test
+++ b/third_party/llvm-project/compiler-rt/test/fuzzer/merge-control-file.test
@@ -50,3 +50,17 @@
RUN: echo FT 2 13 >> %t/MCF
RUN: %run %t/T.exe -merge=1 %t/T1 %t/T2 -merge_control_file=%t/MCF 2>&1 | FileCheck %s --check-prefix=OK_3
OK_3: MERGE-OUTER: nothing to do, merge has been completed before
+
+# Test for invalid COV file_id
+RUN: rm -f %t/T1/*; cp %t/T0/* %t/T1
+RUN: echo 3 > %t/MCF; echo 0 >> %t/MCF; echo %t/T1/1 >> %t/MCF; echo %t/T1/2 >> %t/MCF; echo %t/T1/3 >> %t/MCF
+RUN: echo STARTED 0 1 >> %t/MCF
+RUN: echo FT 0 11 >> %t/MCF
+RUN: echo STARTED 1 2 >> %t/MCF
+RUN: echo FT 1 12 >> %t/MCF
+RUN: echo STARTED 2 2 >> %t/MCF
+RUN: echo FT 2 13 >> %t/MCF
+# Invalid file-id 21 here
+RUN: echo COV 21 13 >> %t/MCF
+RUN: %run %t/T.exe -merge=1 %t/T1 %t/T2 -merge_control_file=%t/MCF 2>&1 | FileCheck %s --check-prefix=COV_INVALID
+COV_INVALID: MERGE-OUTER: bad control file, will overwrite it
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c
index 5a92088..1c4e2e7 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c
@@ -48,8 +48,11 @@
int main(void) {
pthread_t t;
void * volatile res = malloc(100);
- void * volatile res2 = malloc(100000);
+ void * volatile res2 = malloc(1000000);
pthread_create(&t, 0, ThreadFn, 0);
pthread_join(t, 0);
- return (int)(size_t)res;
+ int ret_val = (int)(size_t)res;
+ free(res);
+ free(res2);
+ return ret_val;
}
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/double-free.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/double-free.c
index 6d177fd..ec15dc3 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/double-free.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/double-free.c
@@ -18,7 +18,7 @@
// of the fault. With TCO the free frame can be replaced with the interceptor.
// CHECK: in {{.*}}free
// CHECK: freed by thread {{.*}} here:
- // CHECK: previously allocated here:
+ // CHECK: previously allocated by thread {{.*}} here:
// CHECK: Memory tags around the buggy address (one tag corresponds to 16 bytes):
// CHECK: =>{{.*}}[[MEM_TAG]]
fprintf(stderr, "DONE\n");
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan-print-shadow.cpp b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan-print-shadow.cpp
index 2be0a05..ecf1d9b 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan-print-shadow.cpp
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan-print-shadow.cpp
@@ -18,9 +18,7 @@
alloc[79] = 0xee;
alloc[95] = 0xff;
- // __hwasan_tag_memory expects untagged pointers.
- char *p = (char *)__hwasan_tag_pointer(alloc, 0);
- assert(p);
+ char *p = alloc;
// Write tags to shadow.
__hwasan_tag_memory(p, 1, 32);
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp
index abd8bc4..2cb807c 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp
@@ -18,7 +18,7 @@
// LINKIFY: <a href="http://test.invalid/hwasan_symbolize.cpp:[[@LINE-1]]">
// CHECK: hwasan_symbolize.cpp:[[@LINE-2]]
// CHECK: Cause: heap-buffer-overflow
- // CHECK: allocated here:
+ // CHECK: allocated by thread {{.*}} here:
// LINKIFY: <a href="http://test.invalid/hwasan_symbolize.cpp:[[@LINE-6]]">
// CHECK: hwasan_symbolize.cpp:[[@LINE-7]]
return 0;
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/malloc-test.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/malloc-test.c
index 199464b..24fdfaa 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/malloc-test.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/malloc-test.c
@@ -11,6 +11,6 @@
__hwasan_enable_allocator_tagging();
char *a1 = (char*)malloc(0);
assert(a1 != 0);
- assert(__sanitizer_get_allocated_size(a1) == 0);
+ assert(__sanitizer_get_allocated_size(a1) == 1);
free(a1);
}
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/new-test.cpp b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/new-test.cpp
index 7fd20f8..5e22412 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/new-test.cpp
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/new-test.cpp
@@ -1,5 +1,5 @@
// Test basic new functionality.
-// RUN: %clangxx_hwasan -std=c++17 %s -o %t
+// RUN: %clangxx_hwasan -std=c++17 %s -o %t -fsized-deallocation
// RUN: %run %t
#include <cassert>
@@ -9,15 +9,119 @@
#include <sanitizer/allocator_interface.h>
#include <sanitizer/hwasan_interface.h>
+void operator_new_delete(size_t size) {
+ void *alloc = operator new(size);
+ assert(alloc != nullptr);
+ assert(__sanitizer_get_allocated_size(alloc) == size);
+ operator delete(alloc);
+
+ alloc = operator new(size);
+ assert(alloc != nullptr);
+ assert(__sanitizer_get_allocated_size(alloc) == size);
+ operator delete(alloc, size);
+}
+
+void operator_new_delete_array(size_t size) {
+ void *alloc = operator new[](size);
+ assert(alloc != nullptr);
+ assert(__sanitizer_get_allocated_size(alloc) == size);
+ operator delete[](alloc);
+
+ alloc = operator new[](size);
+ assert(alloc != nullptr);
+ assert(__sanitizer_get_allocated_size(alloc) == size);
+ operator delete[](alloc, size);
+}
+
+void operator_new_delete(size_t size, std::align_val_t align) {
+ void *alloc = operator new(size, align);
+ assert(alloc != nullptr);
+ assert(reinterpret_cast<uintptr_t>(alloc) % static_cast<uintptr_t>(align) == 0);
+ assert(__sanitizer_get_allocated_size(alloc) >= size);
+ operator delete(alloc, align);
+
+ alloc = operator new(size, align);
+ assert(alloc != nullptr);
+ assert(reinterpret_cast<uintptr_t>(alloc) % static_cast<uintptr_t>(align) == 0);
+ assert(__sanitizer_get_allocated_size(alloc) >= size);
+ operator delete(alloc, size, align);
+}
+
+void operator_new_delete_array(size_t size, std::align_val_t align) {
+ void *alloc = operator new[](size, align);
+ assert(alloc != nullptr);
+ assert(reinterpret_cast<uintptr_t>(alloc) % static_cast<uintptr_t>(align) == 0);
+ assert(__sanitizer_get_allocated_size(alloc) >= size);
+ operator delete[](alloc, align);
+
+ alloc = operator new[](size, align);
+ assert(alloc != nullptr);
+ assert(reinterpret_cast<uintptr_t>(alloc) % static_cast<uintptr_t>(align) == 0);
+ assert(__sanitizer_get_allocated_size(alloc) >= size);
+ operator delete[](alloc, size, align);
+}
+
+void operator_new_delete(size_t size, const std::nothrow_t &tag) {
+ void *alloc = operator new(size, tag);
+ assert(alloc != nullptr);
+ assert(__sanitizer_get_allocated_size(alloc) == size);
+ operator delete(alloc, tag);
+}
+
+void operator_new_delete_array(size_t size, const std::nothrow_t &tag) {
+ void *alloc = operator new[](size, tag);
+ assert(alloc != nullptr);
+ assert(__sanitizer_get_allocated_size(alloc) == size);
+ operator delete[](alloc, tag);
+}
+
+void operator_new_delete(size_t size, std::align_val_t align, const std::nothrow_t &tag) {
+ void *alloc = operator new(size, align, tag);
+ assert(alloc != nullptr);
+ assert(reinterpret_cast<uintptr_t>(alloc) % static_cast<uintptr_t>(align) == 0);
+ assert(__sanitizer_get_allocated_size(alloc) >= size);
+ operator delete(alloc, align, tag);
+}
+
+void operator_new_delete_array(size_t size, std::align_val_t align, const std::nothrow_t &tag) {
+ void *alloc = operator new[](size, align, tag);
+ assert(alloc != nullptr);
+ assert(reinterpret_cast<uintptr_t>(alloc) % static_cast<uintptr_t>(align) == 0);
+ assert(__sanitizer_get_allocated_size(alloc) >= size);
+ operator delete[](alloc, align, tag);
+}
+
+void operator_new_delete(size_t size, void *ptr) {
+ void *alloc = operator new(size, ptr);
+ assert(alloc == ptr);
+ operator delete(alloc, ptr);
+}
+
+void operator_new_delete_array(size_t size, void *ptr) {
+ void *alloc = operator new[](size, ptr);
+ assert(alloc == ptr);
+ operator delete[](alloc, ptr);
+}
+
int main() {
__hwasan_enable_allocator_tagging();
size_t volatile n = 0;
char *a1 = new char[n];
assert(a1 != nullptr);
- assert(__sanitizer_get_allocated_size(a1) == 0);
+ assert(__sanitizer_get_allocated_size(a1) == 1);
delete[] a1;
+ constexpr size_t kSize = 8;
+ operator_new_delete(kSize);
+ operator_new_delete_array(kSize);
+ operator_new_delete(kSize, std::nothrow);
+ operator_new_delete_array(kSize, std::nothrow);
+
+ char buffer[kSize];
+ operator_new_delete(kSize, buffer);
+ operator_new_delete_array(kSize, buffer);
+
#if defined(__cpp_aligned_new) && \
(!defined(__GLIBCXX__) || \
(defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7))
@@ -28,5 +132,14 @@
assert(reinterpret_cast<uintptr_t>(a2) % static_cast<uintptr_t>(kAlign) == 0);
assert(__sanitizer_get_allocated_size(a2) >= 4);
::operator delete(a2, kAlign);
+
+ operator_new_delete(kSize, std::align_val_t{kSize});
+ operator_new_delete_array(kSize, std::align_val_t{kSize});
+ operator_new_delete(kSize, std::align_val_t{kSize * 2});
+ operator_new_delete_array(kSize, std::align_val_t{kSize * 2});
+ operator_new_delete(kSize, std::align_val_t{kSize}, std::nothrow);
+ operator_new_delete_array(kSize, std::align_val_t{kSize}, std::nothrow);
+ operator_new_delete(kSize, std::align_val_t{kSize * 2}, std::nothrow);
+ operator_new_delete_array(kSize, std::align_val_t{kSize * 2}, std::nothrow);
#endif
}
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/print-memory-usage.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
index df9d534..534166f 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
@@ -23,9 +23,10 @@
}
void *T1(void *arg) {
-
- for (int i = 1; i <= (1 << 20); i *= 2)
+ for (int i = 1; i <= (1 << 20); i *= 2) {
sink = malloc_and_use(i);
+ free(sink);
+ }
__sync_fetch_and_add(&state, 1);
while (__sync_fetch_and_add(&state, 0) != 4) {}
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-after-free.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-after-free.c
index c4bc48c..393048c 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-after-free.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-after-free.c
@@ -16,12 +16,12 @@
char * volatile x = (char*)malloc(40);
free(x);
x = realloc(x, realloc_size);
-// CHECK: ERROR: HWAddressSanitizer: invalid-free on address
-// CHECK: tags: [[PTR_TAG:..]]/[[MEM_TAG:..]] (ptr/mem)
-// CHECK: freed by thread {{.*}} here:
-// CHECK: previously allocated here:
-// CHECK: Memory tags around the buggy address (one tag corresponds to 16 bytes):
-// CHECK: =>{{.*}}[[MEM_TAG]]
+ // CHECK: ERROR: HWAddressSanitizer: invalid-free on address
+ // CHECK: tags: [[PTR_TAG:..]]/[[MEM_TAG:..]] (ptr/mem)
+ // CHECK: freed by thread {{.*}} here:
+ // CHECK: previously allocated by thread {{.*}} here:
+ // CHECK: Memory tags around the buggy address (one tag corresponds to 16 bytes):
+ // CHECK: =>{{.*}}[[MEM_TAG]]
fprintf(stderr, "DONE\n");
__hwasan_disable_allocator_tagging();
// CHECK-NOT: DONE
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-test.cpp b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-test.cpp
index 136346f..e103b60 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-test.cpp
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/realloc-test.cpp
@@ -4,12 +4,12 @@
#include <assert.h>
#include <sanitizer/hwasan_interface.h>
+#include <stdlib.h>
#ifdef REALLOCARRAY
extern "C" void *reallocarray(void *, size_t nmemb, size_t size);
#define REALLOC(p, s) reallocarray(p, 1, s)
#else
-#include <stdlib.h>
#define REALLOC(p, s) realloc(p, s)
#endif
@@ -41,4 +41,5 @@
assert(x4 != x3);
assert(x4[0] == 10 && x4[1] == 20 && x4[2] == 30 && x4[3] == 40 &&
x4[4] == 50);
+ free(x4);
}
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/set-error-report-callback.cpp b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/set-error-report-callback.cpp
index c2a20be..42a5736 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/set-error-report-callback.cpp
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/set-error-report-callback.cpp
@@ -17,13 +17,13 @@
free(p);
// CHECK: ERROR: HWAddressSanitizer:
// CHECK: WRITE of size 1 at
- // CHECK: allocated here:
+ // CHECK: allocated by thread {{.*}} here:
// CHECK: Memory tags around the buggy address
// CHECK: == error start
// CHECK: ERROR: HWAddressSanitizer:
// CHECK: WRITE of size 1 at
- // CHECK: allocated here:
+ // CHECK: allocated by thread {{.*}} here:
// CHECK: Memory tags around the buggy address
// CHECK: == error end
}
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/tag_in_free.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/tag_in_free.c
index 5c8dd65..fba96dd 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/tag_in_free.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/tag_in_free.c
@@ -33,7 +33,7 @@
#ifdef MALLOC
// MALLOC: READ of size 1 at
// MALLOC: is located 6 bytes after a 10-byte region
- // MALLOC: allocated here:
+ // MALLOC: allocated by thread T0 here:
char volatile x = p[16];
#endif
free(p);
@@ -41,7 +41,7 @@
// FREE: READ of size 1 at
// FREE: is located 0 bytes inside a 10-byte region
// FREE: freed by thread T0 here:
- // FREE: previously allocated here:
+ // FREE: previously allocated by thread T0 here:
char volatile y = p[0];
#endif
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/thread-uaf.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/thread-uaf.c
index c368882..478c1c9 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/thread-uaf.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/thread-uaf.c
@@ -33,7 +33,7 @@
// CHECK: Cause: use-after-free
// CHECK: freed by thread T2 here
// CHECK: in Deallocate
- // CHECK: previously allocated here:
+ // CHECK: previously allocated by thread T1 here:
// CHECK: in Allocate
// CHECK-DAG: Thread: T2 0x
// CHECK-DAG: Thread: T3 0x
diff --git a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/use-after-free.c b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/use-after-free.c
index bd09bbf..266e934 100644
--- a/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/use-after-free.c
+++ b/third_party/llvm-project/compiler-rt/test/hwasan/TestCases/use-after-free.c
@@ -27,7 +27,7 @@
// of the fault.
// CHECK: in main {{.*}}use-after-free.c:[[@LINE-6]]
// Offset is 5 or 11 depending on left/right alignment.
- // CHECK: is a small unallocated heap chunk; size: 32 offset: {{5|11}}
+ // CHECK: is a small unallocated heap chunk; size: {{16|32}} offset: {{5|11}}
// CHECK: Cause: use-after-free
// CHECK: is located 5 bytes inside a 10-byte region
//
@@ -35,7 +35,7 @@
// CHECK: #0 {{.*}} in {{.*}}free{{.*}} {{.*}}hwasan_allocation_functions.cpp
// CHECK: #1 {{.*}} in main {{.*}}use-after-free.c:[[@LINE-19]]
- // CHECK: previously allocated here:
+ // CHECK: previously allocated by thread {{.*}} here:
// CHECK: #0 {{.*}} in {{.*}}malloc{{.*}} {{.*}}hwasan_allocation_functions.cpp
// CHECK: #1 {{.*}} in main {{.*}}use-after-free.c:[[@LINE-24]]
// CHECK: Memory tags around the buggy address (one tag corresponds to 16 bytes):
diff --git a/third_party/llvm-project/compiler-rt/test/lit.common.cfg.py b/third_party/llvm-project/compiler-rt/test/lit.common.cfg.py
index a391a25..6ea6c19 100644
--- a/third_party/llvm-project/compiler-rt/test/lit.common.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/lit.common.cfg.py
@@ -102,17 +102,19 @@
if execute_external:
config.available_features.add('shell')
+target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple))
+
compiler_id = getattr(config, 'compiler_id', None)
if compiler_id == "Clang":
- if platform.system() != 'Windows':
+ if not (platform.system() == 'Windows' and target_is_msvc):
config.cxx_mode_flags = ["--driver-mode=g++"]
else:
config.cxx_mode_flags = []
# We assume that sanitizers should provide good enough error
# reports and stack traces even with minimal debug info.
config.debug_info_flags = ["-gline-tables-only"]
- if platform.system() == 'Windows':
- # On Windows, use CodeView with column info instead of DWARF. Both VS and
+ if platform.system() == 'Windows' and target_is_msvc:
+ # On MSVC, use CodeView with column info instead of DWARF. Both VS and
# windbg do not behave well when column info is enabled, but users have
# requested it because it makes ASan reports more precise.
config.debug_info_flags.append("-gcodeview")
@@ -185,8 +187,8 @@
'LIBCLANG_RESOURCE_USAGE',
'LIBCLANG_CODE_COMPLETION_LOGGING',
'XRAY_OPTIONS']
-# Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it.
-if platform.system() != 'Windows':
+# Clang/MSVC may refer to %INCLUDE%. vsvarsall.bat sets it.
+if not (platform.system() == 'Windows' and target_is_msvc):
possibly_dangerous_env_vars.append('INCLUDE')
for name in possibly_dangerous_env_vars:
if name in config.environment:
@@ -200,7 +202,7 @@
# Help MSVS link.exe find the standard libraries.
# Make sure we only try to use it when targetting Windows.
-if platform.system() == 'Windows' and '-win' in config.target_triple:
+if platform.system() == 'Windows' and target_is_msvc:
config.environment['LIB'] = os.environ['LIB']
config.available_features.add(config.host_os.lower())
@@ -401,8 +403,8 @@
if osx_version >= (10, 11):
config.available_features.add('osx-autointerception')
config.available_features.add('osx-ld64-live_support')
- if osx_version >= (10, 15):
- config.available_features.add('osx-swift-runtime')
+ if osx_version >= (13, 1):
+ config.available_features.add('jit-compatible-osx-swift-runtime')
except subprocess.CalledProcessError:
pass
@@ -550,6 +552,8 @@
return True
def is_windows_lto_supported():
+ if not target_is_msvc:
+ return True
return os.path.exists(os.path.join(config.llvm_tools_dir, 'lld-link.exe'))
if config.host_os == 'Darwin' and is_darwin_lto_supported():
@@ -733,3 +737,10 @@
sh_quote(get_ios_commands_dir())
))
)
+
+# It is not realistically possible to account for all options that could
+# possibly be present in system and user configuration files, so disable
+# default configs for the test runs. In particular, anything hardening
+# related is likely to cause issues with sanitizer tests, because it may
+# preempt something we're looking to trap (e.g. _FORTIFY_SOURCE vs our ASAN).
+config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1"
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/CMakeLists.txt b/third_party/llvm-project/compiler-rt/test/lsan/CMakeLists.txt
index b309995..5b4fee7 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/test/lsan/CMakeLists.txt
@@ -1,7 +1,7 @@
set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LSAN_TESTSUITES)
-
+
set(LSAN_TEST_ARCH ${LSAN_SUPPORTED_ARCH})
if(APPLE)
darwin_filter_host_archs(LSAN_SUPPORTED_ARCH LSAN_TEST_ARCH)
@@ -12,26 +12,40 @@
string(TOLOWER "-${arch}" LSAN_TEST_CONFIG_SUFFIX)
get_test_cc_for_arch(${arch} LSAN_TEST_TARGET_CC LSAN_TEST_TARGET_CFLAGS)
string(TOUPPER ${arch} ARCH_UPPER_CASE)
+
set(LSAN_LIT_TEST_MODE "Standalone")
set(CONFIG_NAME ${ARCH_UPPER_CASE}LsanConfig)
-
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
- set(CONFIG_NAME ${ARCH_UPPER_CASE}AsanConfig)
- set(LSAN_LIT_TEST_MODE "AddressSanitizer")
+ list(FIND ASAN_SUPPORTED_ARCH ${arch} _found)
+ if(NOT _found EQUAL -1)
+ set(CONFIG_NAME ${ARCH_UPPER_CASE}AsanConfig)
+ set(LSAN_LIT_TEST_MODE "AddressSanitizer")
+ configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
+ list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
+ endif()
- configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
- list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
+ list(FIND HWASAN_SUPPORTED_ARCH ${arch} _found)
+ if(NOT _found EQUAL -1)
+ set(CONFIG_NAME ${ARCH_UPPER_CASE}HWAsanConfig)
+ set(LSAN_LIT_TEST_MODE "HWAddressSanitizer")
+ configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
+ list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
+ endif()
endforeach()
set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
- list(APPEND LSAN_TEST_DEPS lsan asan)
+ list(APPEND LSAN_TEST_DEPS lsan)
+ append_list_if(COMPILER_RT_HAS_ASAN asan LSAN_TEST_DEPS)
+ append_list_if(COMPILER_RT_HAS_HWASAN hwasan LSAN_TEST_DEPS)
endif()
add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
${LSAN_TESTSUITES}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/leak_check_segv.cpp
similarity index 87%
rename from third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cpp
rename to third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/leak_check_segv.cpp
index 2a2010f..88fb217 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/leak_check_segv.cpp
@@ -1,6 +1,6 @@
// Test that SIGSEGV during leak checking does not crash the process.
-// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// REQUIRES: leak-detection
+// RUN: %clangxx_lsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: ppc
#include <stdlib.h>
#include <stdio.h>
#include <sys/mman.h>
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp
index e2f59ea..2f824a1 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp
@@ -27,4 +27,4 @@
// CHECK-ERROR: LeakSanitizer: detected memory leaks
// CHECK-ERROR: Direct leak of 1337 byte(s) in 1 object(s) allocated from
-// CHECK-ERROR: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK-ERROR: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/signal_during_stop_the_world.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/signal_during_stop_the_world.cpp
similarity index 95%
rename from third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/signal_during_stop_the_world.cpp
rename to third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/signal_during_stop_the_world.cpp
index b1a41fe..35019c9 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/Linux/signal_during_stop_the_world.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/signal_during_stop_the_world.cpp
@@ -2,7 +2,7 @@
// Historically StopTheWorld crashed because did not handle EINTR properly.
// The test is somewhat convoluted, but that's what caused crashes previously.
-// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_lsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
index d9e2925..f50a59d 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp
@@ -50,7 +50,7 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
#else // BUILD_DSO
// A loadable module with a large thread local section, which would require
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
index e75fde2..812fc33 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp
@@ -37,4 +37,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
index 20000a5..66ce58e 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp
@@ -31,4 +31,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
index 0722b88..905d2c3 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp
@@ -18,4 +18,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/default_options.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/default_options.cpp
index b5361c0..3a2942d 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/default_options.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/default_options.cpp
@@ -2,7 +2,7 @@
extern "C"
const char *__lsan_default_options() {
- // CHECK: Available flags for {{Leak|Address}}Sanitizer:
+ // CHECK: Available flags for {{Leak|Address|HWAddress}}Sanitizer:
return "verbosity=1 help=1";
}
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/disabler.c b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/disabler.c
index b50b572..3d785f4 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/disabler.c
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/disabler.c
@@ -23,4 +23,4 @@
fprintf(stderr, "Test alloc: %p.\n", q);
return 0;
}
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
index 840842a..dcb293b 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp
@@ -34,5 +34,5 @@
return 0;
}
-// CHECK-strict: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s)
-// CHECK-normal: SUMMARY: {{(Leak|Address)}}Sanitizer: 666 byte(s) leaked in 1 allocation(s)
+// CHECK-strict: SUMMARY: {{.*}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s)
+// CHECK-normal: SUMMARY: {{.*}}Sanitizer: 666 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/ignore_object.c b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/ignore_object.c
index bd329ad..25061f8 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/ignore_object.c
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/ignore_object.c
@@ -22,4 +22,4 @@
return 0;
}
// CHECK: Test alloc: [[ADDR:.*]].
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
index 53a7fa2..bd192ab 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp
@@ -19,4 +19,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (33554432 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
index e95040b..ae33b41 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp
@@ -16,5 +16,5 @@
return 0;
}
-// CHECK-do: SUMMARY: {{(Leak|Address)}}Sanitizer:
-// CHECK-dont-NOT: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK-do: SUMMARY: {{.*}}Sanitizer:
+// CHECK-dont-NOT: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cpp
index 94084dc..68eea93 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cpp
@@ -2,6 +2,10 @@
// This test relies on timing between threads, so any failures will be flaky.
// RUN: %clangxx_lsan %s -o %t
// RUN: %env_lsan_opts="log_pointers=1:log_threads=1" %run %t
+
+// Fixme: remove once test passes with hwasan
+// UNSUPPORTED: hwasan
+
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/link_turned_off.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/link_turned_off.cpp
index d700d7a..4dcc902 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/link_turned_off.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/link_turned_off.cpp
@@ -22,4 +22,4 @@
return 0;
}
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{(.*)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/lsan_annotations.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/lsan_annotations.cpp
new file mode 100644
index 0000000..40d7bb0
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/lsan_annotations.cpp
@@ -0,0 +1,24 @@
+// Check that LSan annotations work fine.
+// RUN: %clangxx_lsan -O0 %s -o %t && %run %t
+// RUN: %clangxx_lsan -O3 %s -o %t && %run %t
+
+#include <sanitizer/lsan_interface.h>
+#include <stdlib.h>
+
+int *x, *y, *z;
+
+int main() {
+ x = new int;
+ __lsan_ignore_object(x);
+
+ z = new int[1000000]; // Large enough for the secondary allocator.
+ __lsan_ignore_object(z);
+
+ {
+ __lsan::ScopedDisabler disabler;
+ y = new int;
+ }
+
+ x = y = z = nullptr;
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/asan/TestCases/lsan_crash.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/lsan_crash.cpp
similarity index 89%
rename from third_party/llvm-project/compiler-rt/test/asan/TestCases/lsan_crash.cpp
rename to third_party/llvm-project/compiler-rt/test/lsan/TestCases/lsan_crash.cpp
index 8ea9e74..14f9d87 100644
--- a/third_party/llvm-project/compiler-rt/test/asan/TestCases/lsan_crash.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/lsan_crash.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_asan -O2 %s --std=c++14 -o %t && %run %t
+// RUN: %clangxx_lsan -O2 %s --std=c++14 -o %t && %run %t
#include <atomic>
#include <memory>
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
index 37b5f03..b67550f 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp
@@ -74,4 +74,4 @@
}
// CHECK: LeakSanitizer: detected memory leaks
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
index 70f54c0..f0deb44 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp
@@ -57,4 +57,4 @@
}
// CHECK: LeakSanitizer: detected memory leaks
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
index efb1fd8..7404af4 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp
@@ -15,4 +15,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/realloc_too_big.c b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/realloc_too_big.c
index bb13160..1a6569b 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/realloc_too_big.c
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/realloc_too_big.c
@@ -8,10 +8,10 @@
#include <stdio.h>
#include <stdlib.h>
-// CHECK: {{Leak|Address}}Sanitizer failed to allocate 0x100001 bytes
+// CHECK: {{.*}}Sanitizer failed to allocate 0x100001 bytes
-// CHECK: {{Leak|Address}}Sanitizer: detected memory leaks
-// CHECK: {{Leak|Address}}Sanitizer: 9 byte(s) leaked in 1 allocation(s).
+// CHECK: {{.*}}Sanitizer: detected memory leaks
+// CHECK: {{.*}}Sanitizer: 9 byte(s) leaked in 1 allocation(s).
int main() {
char *p = malloc(9);
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
index b375062..718ffb1 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp
@@ -2,7 +2,7 @@
// RUN: %clangxx_lsan %s -o %t
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t foo 2>&1 | FileCheck %s
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t 2>&1 | FileCheck %s
-//
+
// UNSUPPORTED: darwin
#include <assert.h>
@@ -22,12 +22,12 @@
// CHECK: Test alloc:
assert(__lsan_do_recoverable_leak_check() == 1);
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte
// Test that we correctly reset chunk tags.
p = 0;
assert(__lsan_do_recoverable_leak_check() == 1);
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1360 byte
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1360 byte
_exit(0);
}
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/register_root_region.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/register_root_region.cpp
index 52b8078..40e99d7 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/register_root_region.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/register_root_region.cpp
@@ -28,4 +28,4 @@
return 0;
}
// CHECK: Test alloc: [[ADDR:.*]].
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
index dafc9e9..da11a58 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp
@@ -45,6 +45,7 @@
// Otherwise, we need a different method.
__attribute__((destructor))
__attribute__((no_sanitize_address))
+__attribute__((no_sanitize("hwaddress")))
void ConfirmPointerHasSurvived() {
print_address("Value after LSan: ", 1, *pp);
}
@@ -52,5 +53,5 @@
// CHECK-sanity: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
// CHECK-sanity: Value after LSan: [[ADDR]]
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_default.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_default.cpp
index 533b3a0..0aa10f0 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_default.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_default.cpp
@@ -24,4 +24,4 @@
}
// CHECK: Suppressions used:
// CHECK: 1 666 *LSanTestLeakingFunc*
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_file.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_file.cpp
index d74bb47..2b1ccd8 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_file.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/suppressions_file.cpp
@@ -36,6 +36,6 @@
}
// CHECK: Suppressions used:
// CHECK: 1 666 *LSanTestLeakingFunc*
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
-// NOSUPP: SUMMARY: {{(Leak|Address)}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s).
+// NOSUPP: SUMMARY: {{.*}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s).
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/swapcontext.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/swapcontext.cpp
index b67f53e..567cde7 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/swapcontext.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/swapcontext.cpp
@@ -41,4 +41,4 @@
return 0;
}
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s)
+// CHECK: SUMMARY: {{.*}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s)
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_after_return.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_after_return.cpp
index b0adb9e..6112edd 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_after_return.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_after_return.cpp
@@ -23,4 +23,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
index fe58a2f..de88c65 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp
@@ -18,4 +18,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
index 389ef3b..2948d57 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp
@@ -18,4 +18,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers.cpp
index ebea5f0..a4fbf27 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers.cpp
@@ -77,4 +77,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
index 9308ee9..0a423df 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp
@@ -57,4 +57,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks.cpp
index f11d7de..c9e89a4 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks.cpp
@@ -17,4 +17,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
index 7ddba88..f1ad7a1 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp
@@ -34,4 +34,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_unaligned.cpp b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_unaligned.cpp
index 48461aa..1bf6370 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_unaligned.cpp
+++ b/third_party/llvm-project/compiler-rt/test/lsan/TestCases/use_unaligned.cpp
@@ -20,4 +20,4 @@
// CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]]
// CHECK: LeakSanitizer: detected memory leaks
// CHECK: [[ADDR]] (1337 bytes)
-// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer:
+// CHECK: SUMMARY: {{.*}}Sanitizer:
diff --git a/third_party/llvm-project/compiler-rt/test/lsan/lit.common.cfg.py b/third_party/llvm-project/compiler-rt/test/lsan/lit.common.cfg.py
index 0abd7e8..c3df68f 100644
--- a/third_party/llvm-project/compiler-rt/test/lsan/lit.common.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/lsan/lit.common.cfg.py
@@ -19,8 +19,9 @@
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
-# Choose between standalone and LSan+ASan modes.
+# Choose between standalone and LSan+(ASan|HWAsan) modes.
lsan_lit_test_mode = get_required_attr(config, 'lsan_lit_test_mode')
+target_arch = getattr(config, 'target_arch', None)
if lsan_lit_test_mode == "Standalone":
config.name = "LeakSanitizer-Standalone"
@@ -31,6 +32,14 @@
config.available_features.add('asan')
if config.host_os == 'NetBSD':
config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
+elif lsan_lit_test_mode == "HWAddressSanitizer":
+ config.name = "LeakSanitizer-HWAddressSanitizer"
+ lsan_cflags = ["-fsanitize=hwaddress", "-fuse-ld=lld"]
+ if target_arch == "x86_64":
+ lsan_cflags = lsan_cflags + [ '-fsanitize-hwaddress-experimental-aliasing']
+ config.available_features.add('hwasan')
+ if config.host_os == 'NetBSD':
+ config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
else:
lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode)
config.name += config.name_suffix
@@ -72,6 +81,9 @@
config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) )
config.substitutions.append( ("%clang_lsan ", build_invocation(clang_lsan_cflags)) )
config.substitutions.append( ("%clangxx_lsan ", build_invocation(clang_lsan_cxxflags)) )
+config.substitutions.append( ("%clang_hwasan ", build_invocation(clang_lsan_cflags)) )
+config.substitutions.append( ("%clangxx_hwasan ", build_invocation(clang_lsan_cxxflags)) )
+
# LeakSanitizer tests are currently supported on
# Android{aarch64, x86, x86_64}, x86-64 Linux, PowerPC64 Linux, arm Linux, mips64 Linux, s390x Linux, loongarch64 Linux and x86_64 Darwin.
@@ -86,4 +98,9 @@
if re.search('mthumb', config.target_cflags) is not None:
config.unsupported = True
+# HWASAN tests require lld because without D65857, ld.bfd and ld.gold would
+# generate a corrupted binary. Mark them unsupported if lld is not available.
+if 'hwasan' in config.available_features and not config.has_lld:
+ config.unsupported = True
+
config.suffixes = ['.c', '.cpp', '.mm']
diff --git a/third_party/llvm-project/compiler-rt/test/memprof/TestCases/test_merge_mib.cpp b/third_party/llvm-project/compiler-rt/test/memprof/TestCases/test_merge_mib.cpp
index f9cdfc3..72928b0 100644
--- a/third_party/llvm-project/compiler-rt/test/memprof/TestCases/test_merge_mib.cpp
+++ b/third_party/llvm-project/compiler-rt/test/memprof/TestCases/test_merge_mib.cpp
@@ -12,7 +12,7 @@
// CHECK-NEXT: access_count (ave/min/max): 30.00 / 20 / 40
// Unfortunately there is not a reliable way to check the ave/min/max lifetime.
// CHECK-NEXT: lifetime (ave/min/max):
-// CHECK-NEXT: num migrated: {{[0-1]}}, num lifetime overlaps: 0, num same alloc cpu: 1, num same dealloc_cpu: 1
+// CHECK-NEXT: num migrated: {{[0-1]}}, num lifetime overlaps: 0, num same alloc cpu: {{[0-1]}}, num same dealloc_cpu: {{[0-1]}}
// CHECK: Stack for id [[STACKID]]:
// CHECK-NEXT: #0 {{.*}} in operator new
// CHECK-NEXT: #1 {{.*}} in main {{.*}}:[[@LINE+7]]
diff --git a/third_party/llvm-project/compiler-rt/test/metadata/CMakeLists.txt b/third_party/llvm-project/compiler-rt/test/metadata/CMakeLists.txt
index 3391a89..4a17b0e 100644
--- a/third_party/llvm-project/compiler-rt/test/metadata/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/test/metadata/CMakeLists.txt
@@ -4,6 +4,11 @@
set(METADATA_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(METADATA_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ set(METADATA_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
+ if (NOT COMPILER_RT_STANDALONE_BUILD)
+ list(APPEND METADATA_TEST_DEPS asan ubsan)
+ endif()
+
set(SANITIZER_COMMON_TEST_TARGET_ARCH ${X86_64})
get_test_cc_for_arch(x86_64 METADATA_TEST_TARGET_CC METADATA_TEST_TARGET_CFLAGS)
configure_lit_site_cfg(
@@ -12,6 +17,6 @@
add_lit_testsuite(check-sanmd "Running the SanitizerBinaryMetadata tests"
${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${SANITIZER_COMMON_LIT_TEST_DEPS})
+ DEPENDS ${METADATA_TEST_DEPS})
set_target_properties(check-sanmd PROPERTIES FOLDER "Compiler-RT Misc")
endif()
diff --git a/third_party/llvm-project/compiler-rt/test/metadata/common.h b/third_party/llvm-project/compiler-rt/test/metadata/common.h
index b121e87..af0e009 100644
--- a/third_party/llvm-project/compiler-rt/test/metadata/common.h
+++ b/third_party/llvm-project/compiler-rt/test/metadata/common.h
@@ -1,46 +1,71 @@
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
+#include <string.h>
int main() { printf("main\n"); }
-typedef unsigned long uptr;
-
+namespace {
#define FN(X) \
- if (pc == reinterpret_cast<uptr>(X)) \
+ if (pc == reinterpret_cast<uintptr_t>(X)) \
return #X
-const char *symbolize(uptr pc) {
+const char *symbolize(uintptr_t pc) {
FUNCTIONS;
return nullptr;
}
template <typename T> T consume(const char *&pos, const char *end) {
- T v = *reinterpret_cast<const T *>(pos);
+ T v;
+ // We need to memcpy from pos, because it's not guaranteed that every entry
+ // has the required alignment of T.
+ memcpy(&v, pos, sizeof(T));
pos += sizeof(T);
assert(pos <= end);
return v;
}
+uint64_t consume_uleb128(const char *&pos, const char *end) {
+ uint64_t val = 0;
+ int shift = 0;
+ uint8_t cur;
+ do {
+ cur = *pos++;
+ val |= uint64_t{cur & 0x7fu} << shift;
+ shift += 7;
+ } while (cur & 0x80);
+ assert(shift < 64);
+ assert(pos <= end);
+ return val;
+}
+
+constexpr uint32_t kSanitizerBinaryMetadataUARHasSize = 1 << 2;
+
uint32_t meta_version;
const char *meta_start;
const char *meta_end;
+const char *atomics_start;
+const char *atomics_end;
+}; // namespace
extern "C" {
void __sanitizer_metadata_covered_add(uint32_t version, const char *start,
const char *end) {
- printf("metadata add version %u\n", version);
+ const uint32_t version_base = version & 0xffff;
+ const bool offset_ptr_sized = version & (1 << 16);
+ assert(version_base == 2);
+ printf("metadata add version %u\n", version_base);
for (const char *pos = start; pos < end;) {
- const uptr base = reinterpret_cast<uptr>(pos);
- const long offset = (version & (1 << 16)) ? consume<long>(pos, end)
- : consume<int>(pos, end);
- const uint32_t size = consume<uint32_t>(pos, end);
- const uint32_t features = consume<uint32_t>(pos, end);
- uint32_t stack_args = 0;
- if (features & (1 << 1))
- stack_args = consume<uint32_t>(pos, end);
+ const auto base = reinterpret_cast<uintptr_t>(pos);
+ const intptr_t offset = offset_ptr_sized ? consume<intptr_t>(pos, end)
+ : consume<int32_t>(pos, end);
+ [[maybe_unused]] const uint64_t size = consume_uleb128(pos, end);
+ const uint64_t features = consume_uleb128(pos, end);
+ uint64_t stack_args = 0;
+ if (features & kSanitizerBinaryMetadataUARHasSize)
+ stack_args = consume_uleb128(pos, end);
if (const char *name = symbolize(base + offset))
- printf("%s: features=%x stack_args=%u\n", name, features, stack_args);
+ printf("%s: features=%lx stack_args=%lu\n", name, features, stack_args);
}
meta_version = version;
meta_start = start;
@@ -54,9 +79,6 @@
assert(end == meta_end);
}
-const char *atomics_start;
-const char *atomics_end;
-
void __sanitizer_metadata_atomics_add(uint32_t version, const char *start,
const char *end) {
assert(version == meta_version);
diff --git a/third_party/llvm-project/compiler-rt/test/metadata/covered.cpp b/third_party/llvm-project/compiler-rt/test/metadata/covered.cpp
index 6fb4a91..92abe4f 100644
--- a/third_party/llvm-project/compiler-rt/test/metadata/covered.cpp
+++ b/third_party/llvm-project/compiler-rt/test/metadata/covered.cpp
@@ -6,9 +6,12 @@
// RUN: %clangxx %s -o %t -fexperimental-sanitize-metadata=covered,uar && %t | FileCheck -check-prefix=CHECK-CU %s
// RUN: %clangxx %s -o %t -fexperimental-sanitize-metadata=atomics,uar && %t | FileCheck -check-prefix=CHECK-AU %s
// RUN: %clangxx %s -o %t -fexperimental-sanitize-metadata=covered,atomics,uar && %t | FileCheck -check-prefix=CHECK-CAU %s
+// RUN: %clangxx %s -o %t -mcmodel=large -fexperimental-sanitize-metadata=covered,atomics,uar && %t | FileCheck -check-prefix=CHECK-CAU %s
+
+const int const_global = 42;
__attribute__((noinline, not_tail_called)) void escape(const volatile void *p) {
- static const volatile void *sink;
+ [[maybe_unused]] static const volatile void *sink;
sink = p;
}
@@ -19,10 +22,10 @@
// CHECK-C: empty: features=0
// CHECK-A-NOT: empty:
// CHECK-U-NOT: empty:
-// CHECK-CA: empty: features=1
+// CHECK-CA: empty: features=0
// CHECK-CU: empty: features=0
// CHECK-AU-NOT: empty:
-// CHECK-CAU: empty: features=1
+// CHECK-CAU: empty: features=0
void empty() {}
// CHECK-C: normal: features=0
@@ -37,6 +40,15 @@
escape(&x);
}
+// CHECK-C: with_const_global: features=0
+// CHECK-A-NOT: with_const_global:
+// CHECK-U-NOT: with_const_global:
+// CHECK-CA: with_const_global: features=0
+// CHECK-CU: with_const_global: features=0
+// CHECK-AU-NOT: with_const_global:
+// CHECK-CAU: with_const_global: features=0
+int with_const_global() { return *((const volatile int *)&const_global); }
+
// CHECK-C: with_atomic: features=0
// CHECK-A: with_atomic: features=1
// CHECK-U-NOT: with_atomic:
@@ -58,6 +70,20 @@
return __atomic_load_n(p, __ATOMIC_RELAXED);
}
+// CHECK-C: with_atomic_escape_lots_of_args: features=0
+// CHECK-A: with_atomic_escape_lots_of_args: features=1
+// CHECK-U: with_atomic_escape_lots_of_args: features=6
+// CHECK-CA: with_atomic_escape_lots_of_args: features=1
+// CHECK-CU: with_atomic_escape_lots_of_args: features=6
+// CHECK-AU: with_atomic_escape_lots_of_args: features=7
+// CHECK-CAU: with_atomic_escape_lots_of_args: features=7
+long with_atomic_escape_lots_of_args(int *p, long a0, long a1, long a2, long a3,
+ long a4, long a5, long a6) {
+ escape(&p);
+ return a0 + a1 + a2 + a3 + a4 + a5 + a6 +
+ __atomic_load_n(p, __ATOMIC_RELAXED);
+}
+
// CHECK-C: ellipsis: features=0
// CHECK-A: ellipsis: features=1
// CHECK-U-NOT: ellipsis:
@@ -67,7 +93,7 @@
// CHECK-CAU: ellipsis: features=1
void ellipsis(int *p, ...) {
escape(&p);
- volatile int x;
+ [[maybe_unused]] volatile int x;
x = 0;
}
@@ -86,8 +112,10 @@
#define FUNCTIONS \
FN(empty); \
FN(normal); \
+ FN(with_const_global); \
FN(with_atomic); \
FN(with_atomic_escape); \
+ FN(with_atomic_escape_lots_of_args); \
FN(ellipsis); \
FN(ellipsis_with_atomic); \
/**/
diff --git a/third_party/llvm-project/compiler-rt/test/metadata/lit.site.cfg.py.in b/third_party/llvm-project/compiler-rt/test/metadata/lit.site.cfg.py.in
index 7b95b4b..8993b31 100644
--- a/third_party/llvm-project/compiler-rt/test/metadata/lit.site.cfg.py.in
+++ b/third_party/llvm-project/compiler-rt/test/metadata/lit.site.cfg.py.in
@@ -11,4 +11,5 @@
# Load tool-specific config that would do the real work.
lit_config.load_config(config, "@METADATA_LIT_SOURCE_DIR@/lit.cfg.py")
-config.substitutions.append(("%clangxx ", " " + config.clang + " " + config.target_cflags + " "))
+clangxx = [config.clang] + config.cxx_mode_flags + ["-Wall", config.target_cflags]
+config.substitutions.append(("%clangxx ", " ".join([""] + clangxx + [""])))
diff --git a/third_party/llvm-project/compiler-rt/test/metadata/nocallback.cpp b/third_party/llvm-project/compiler-rt/test/metadata/nocallback.cpp
new file mode 100644
index 0000000..b5ce5f7
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/metadata/nocallback.cpp
@@ -0,0 +1,13 @@
+// RUN: %clangxx %s -o %t -fexperimental-sanitize-metadata=all && %t | FileCheck %s
+
+// Test that the compiler emits weak declarations to the callbacks, which are
+// not called if they do not exist.
+
+#include <stdio.h>
+
+int main() {
+ printf("main\n");
+ return 0;
+}
+
+// CHECK: main
diff --git a/third_party/llvm-project/compiler-rt/test/metadata/uar.cpp b/third_party/llvm-project/compiler-rt/test/metadata/uar.cpp
index f4e6430..cbafe46 100644
--- a/third_party/llvm-project/compiler-rt/test/metadata/uar.cpp
+++ b/third_party/llvm-project/compiler-rt/test/metadata/uar.cpp
@@ -1,9 +1,11 @@
// RUN: %clangxx %s -O1 -o %t -fexperimental-sanitize-metadata=covered,uar && %t | FileCheck %s
+// RUN: %clangxx %s -O1 -o %t -fexperimental-sanitize-metadata=covered,uar -fsanitize=address,signed-integer-overflow,alignment && %t | FileCheck %s
+// RUN: %clangxx %s -O1 -o %t -mcmodel=large -fexperimental-sanitize-metadata=covered,uar -fsanitize=address,signed-integer-overflow,alignment && %t | FileCheck %s
-// CHECK: metadata add version 1
+// CHECK: metadata add version 2
__attribute__((noinline, not_tail_called)) void escape(const volatile void *p) {
- static const volatile void *sink;
+ [[maybe_unused]] static const volatile void *sink;
sink = p;
}
@@ -15,6 +17,16 @@
// CHECK: empty: features=0 stack_args=0
void empty() {}
+// CHECK: simple: features=0 stack_args=0
+int simple(int *data, int index) { return data[index + 1]; }
+
+// CHECK: builtins: features=0 stack_args=0
+int builtins() {
+ int x = 0;
+ __builtin_prefetch(&x);
+ return x;
+}
+
// CHECK: ellipsis: features=0 stack_args=0
void ellipsis(const char *fmt, ...) {
int x;
@@ -33,20 +45,20 @@
escape(&x);
}
-// CHECK: stack_args: features=2 stack_args=16
+// CHECK: stack_args: features=6 stack_args=16
void stack_args(long a0, long a1, long a2, long a3, long a4, long a5, long a6) {
int x;
escape(&x);
}
-// CHECK: more_stack_args: features=2 stack_args=32
+// CHECK: more_stack_args: features=6 stack_args=32
void more_stack_args(long a0, long a1, long a2, long a3, long a4, long a5,
long a6, long a7, long a8) {
int x;
escape(&x);
}
-// CHECK: struct_stack_args: features=2 stack_args=144
+// CHECK: struct_stack_args: features=6 stack_args=144
struct large {
char x[131];
};
@@ -60,6 +72,11 @@
// CHECK: with_tail_call: features=2
int with_tail_call(int x) { [[clang::musttail]] return tail_called(x); }
+__attribute__((noinline, noreturn)) int noreturn(int x) { __builtin_trap(); }
+
+// CHECK: with_noreturn_tail_call: features=0
+int with_noreturn_tail_call(int x) { return noreturn(x); }
+
// CHECK: local_array: features=0
void local_array(int x) {
int data[10];
@@ -81,6 +98,8 @@
#define FUNCTIONS \
FN(empty); \
+ FN(simple); \
+ FN(builtins); \
FN(ellipsis); \
FN(non_empty_function); \
FN(no_stack_args); \
@@ -88,6 +107,7 @@
FN(more_stack_args); \
FN(struct_stack_args); \
FN(with_tail_call); \
+ FN(with_noreturn_tail_call); \
FN(local_array); \
FN(local_alloca); \
FN(escaping_alloca); \
diff --git a/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/arm64/objc-category.S b/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/arm64/objc-category.S
new file mode 100644
index 0000000..9fe3b92
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/arm64/objc-category.S
@@ -0,0 +1,190 @@
+// Test that we can handle calls to methods on categories.
+// The following assembly defines an ObjC class Foo with an instance method
+// -foo, then uses a category (Bar) to add an extra instance method -bar.
+// The main function calls both -foo and -bar on an instance of Foo to check
+// that the calls behave as expected.
+//
+// RUN: %clang -c -o %t.o %s
+// RUN: %llvm_jitlink -preload libobjc.A.dylib %t.o
+
+ .section __TEXT,__text,regular,pure_instructions
+ .build_version macos, 14, 0
+ .p2align 2
+"-[Foo foo]":
+ mov w0, #1
+ ret
+
+ .p2align 2
+"-[Foo(Bar) bar]":
+ mov w0, #1
+ ret
+
+ .globl _main
+ .p2align 2
+_main:
+ stp x20, x19, [sp, #-32]!
+ stp x29, x30, [sp, #16]
+ add x29, sp, #16
+Lloh0:
+ adrp x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGE
+Lloh1:
+ ldr x0, [x8, _OBJC_CLASSLIST_REFERENCES_$_@PAGEOFF]
+ bl _objc_alloc_init
+ mov x19, x0
+Lloh2:
+ adrp x8, _OBJC_SELECTOR_REFERENCES_@PAGE
+Lloh3:
+ ldr x1, [x8, _OBJC_SELECTOR_REFERENCES_@PAGEOFF]
+ bl _objc_msgSend
+ cmp w0, #1
+ b.ne LBB2_2
+
+Lloh4:
+ adrp x8, _OBJC_SELECTOR_REFERENCES_.3@PAGE
+Lloh5:
+ ldr x1, [x8, _OBJC_SELECTOR_REFERENCES_.3@PAGEOFF]
+ mov x0, x19
+ bl _objc_msgSend
+ cmp w0, #1
+ cset w0, ne
+ ldp x29, x30, [sp, #16]
+ ldp x20, x19, [sp], #32
+ ret
+LBB2_2:
+ mov w0, #1
+ ldp x29, x30, [sp, #16]
+ ldp x20, x19, [sp], #32
+ ret
+ .loh AdrpLdr Lloh2, Lloh3
+ .loh AdrpLdr Lloh0, Lloh1
+ .loh AdrpLdr Lloh4, Lloh5
+
+ .section __TEXT,__objc_classname,cstring_literals
+l_OBJC_CLASS_NAME_:
+ .asciz "Foo"
+
+ .section __DATA,__objc_const
+ .p2align 3, 0x0
+__OBJC_METACLASS_RO_$_Foo:
+ .long 1
+ .long 40
+ .long 40
+ .space 4
+ .quad 0
+ .quad l_OBJC_CLASS_NAME_
+ .quad 0
+ .quad 0
+ .quad 0
+ .quad 0
+ .quad 0
+
+ .section __DATA,__objc_data
+ .globl _OBJC_METACLASS_$_Foo
+ .p2align 3, 0x0
+_OBJC_METACLASS_$_Foo:
+ .quad _OBJC_METACLASS_$_NSObject
+ .quad _OBJC_METACLASS_$_NSObject
+ .quad __objc_empty_cache
+ .quad 0
+ .quad __OBJC_METACLASS_RO_$_Foo
+
+ .section __TEXT,__objc_methname,cstring_literals
+l_OBJC_METH_VAR_NAME_:
+ .asciz "foo"
+
+ .section __TEXT,__objc_methtype,cstring_literals
+l_OBJC_METH_VAR_TYPE_:
+ .asciz "i16@0:8"
+
+ .section __DATA,__objc_const
+ .p2align 3, 0x0
+__OBJC_$_INSTANCE_METHODS_Foo:
+ .long 24
+ .long 1
+ .quad l_OBJC_METH_VAR_NAME_
+ .quad l_OBJC_METH_VAR_TYPE_
+ .quad "-[Foo foo]"
+
+ .p2align 3, 0x0
+__OBJC_CLASS_RO_$_Foo:
+ .long 0
+ .long 8
+ .long 8
+ .space 4
+ .quad 0
+ .quad l_OBJC_CLASS_NAME_
+ .quad __OBJC_$_INSTANCE_METHODS_Foo
+ .quad 0
+ .quad 0
+ .quad 0
+ .quad 0
+
+ .section __DATA,__objc_data
+ .globl _OBJC_CLASS_$_Foo
+ .p2align 3, 0x0
+_OBJC_CLASS_$_Foo:
+ .quad _OBJC_METACLASS_$_Foo
+ .quad _OBJC_CLASS_$_NSObject
+ .quad __objc_empty_cache
+ .quad 0
+ .quad __OBJC_CLASS_RO_$_Foo
+
+ .section __TEXT,__objc_classname,cstring_literals
+l_OBJC_CLASS_NAME_.1:
+ .asciz "Bar"
+
+ .section __TEXT,__objc_methname,cstring_literals
+l_OBJC_METH_VAR_NAME_.2:
+ .asciz "bar"
+
+ .section __DATA,__objc_const
+ .p2align 3, 0x0
+__OBJC_$_CATEGORY_INSTANCE_METHODS_Foo_$_Bar:
+ .long 24
+ .long 1
+ .quad l_OBJC_METH_VAR_NAME_.2
+ .quad l_OBJC_METH_VAR_TYPE_
+ .quad "-[Foo(Bar) bar]"
+
+ .p2align 3, 0x0
+__OBJC_$_CATEGORY_Foo_$_Bar:
+ .quad l_OBJC_CLASS_NAME_.1
+ .quad _OBJC_CLASS_$_Foo
+ .quad __OBJC_$_CATEGORY_INSTANCE_METHODS_Foo_$_Bar
+ .quad 0
+ .quad 0
+ .quad 0
+ .quad 0
+ .long 64
+ .space 4
+
+ .section __DATA,__objc_classrefs,regular,no_dead_strip
+ .p2align 3, 0x0
+_OBJC_CLASSLIST_REFERENCES_$_:
+ .quad _OBJC_CLASS_$_Foo
+
+ .section __DATA,__objc_selrefs,literal_pointers,no_dead_strip
+ .p2align 3, 0x0
+_OBJC_SELECTOR_REFERENCES_:
+ .quad l_OBJC_METH_VAR_NAME_
+
+ .p2align 3, 0x0
+_OBJC_SELECTOR_REFERENCES_.3:
+ .quad l_OBJC_METH_VAR_NAME_.2
+
+ .section __DATA,__objc_classlist,regular,no_dead_strip
+ .p2align 3, 0x0
+l_OBJC_LABEL_CLASS_$:
+ .quad _OBJC_CLASS_$_Foo
+
+ .section __DATA,__objc_catlist,regular,no_dead_strip
+ .p2align 3, 0x0
+l_OBJC_LABEL_CATEGORY_$:
+ .quad __OBJC_$_CATEGORY_Foo_$_Bar
+
+ .section __DATA,__objc_imageinfo,regular,no_dead_strip
+L_OBJC_IMAGE_INFO:
+ .long 0
+ .long 64
+
+.subsections_via_symbols
diff --git a/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/MachO_gdb_jit_debuginfo_register.S b/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/MachO_gdb_jit_debuginfo_register.S
new file mode 100644
index 0000000..a19d09b
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/MachO_gdb_jit_debuginfo_register.S
@@ -0,0 +1,28 @@
+// REQUIRES: system-darwin && asserts
+// RUN: %clang -c -o %t %s
+// RUN: %llvm_jitlink -debug-only=orc -debugger-support %t 2>&1 \
+// RUN: | FileCheck %s
+//
+// Check that presence of a "__DWARF" section triggers the
+// GDBJITDebugInfoRegistrationPlugin.
+//
+// This test requires a darwin host (despite being a noexec test) because we use
+// the input object's mangling to determine the mangling of the registration
+// function to use. Since the input is MachO, the mangling will only line up
+// properly on Darwin. (See https://llvm.org/PR52503 for a proposed longer term
+// solution).
+//
+// CHECK: Adding debug object to GDB JIT interface
+
+ .section __TEXT,__text,regular,pure_instructions
+ .globl _main
+ .p2align 4, 0x90
+_main:
+ xorl %eax, %eax
+ retq
+
+ .section __DWARF,__debug_str,regular,debug
+Linfo_string:
+ .asciz "test dwarf string"
+
+.subsections_via_symbols
diff --git a/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-swift-types-section.S b/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-swift-types-section.S
index f6bb257..c3cd767 100644
--- a/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-swift-types-section.S
+++ b/third_party/llvm-project/compiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-swift-types-section.S
@@ -1,94 +1,129 @@
# RUN: %clang -c -o %t %s
# RUN: %llvm_jitlink -preload /usr/lib/swift/libswiftCore.dylib %t
-# REQUIRES: osx-swift-runtime
+# REQUIRES: jit-compatible-osx-swift-runtime
# Check that _typeByName is able to find a type registered by metadata in
# the __swift5_types section.
- .section __TEXT,__text,regular,pure_instructions
- .globl _main
- .p2align 4, 0x90
+ .section __TEXT,__text,regular,pure_instructions
+ .build_version macos, 14, 0 sdk_version 14, 0
+ .globl _main
+ .p2align 4, 0x90
_main:
- .cfi_startproc
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset %rbp, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register %rbp
- # Constant String for "4Test3FooV"
- movabsq $8018152761824990260, %rdi
- movabsq $-1585267068834392465, %rsi
- callq _$ss11_typeByNameyypXpSgSSF
- xorl %edi, %edi
- testq %rax, %rax
- sete %dil
- callq _exit
- .cfi_endproc
+ .cfi_startproc
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ # Constant String for "4Test3FooV"
+ movabsq $8018152761824990260, %rdi
+ movabsq $-1585267068834392465, %rsi
+ callq _$ss11_typeByNameyypXpSgSSF
+ xorl %edi, %edi
+ testq %rax, %rax
+ sete %dil
+ callq _exit
+ .cfi_endproc
- .private_extern _$s4Test3FooVMa
- .globl _$s4Test3FooVMa
- .p2align 4, 0x90
+ .private_extern _$s4Test3FooVACycfC
+ .globl _$s4Test3FooVACycfC
+ .p2align 4, 0x90
+_$s4Test3FooVACycfC:
+ pushq %rbp
+ movq %rsp, %rbp
+ popq %rbp
+ retq
+
+ .private_extern _$s4Test3FooVMa
+ .globl _$s4Test3FooVMa
+ .p2align 4, 0x90
_$s4Test3FooVMa:
- leaq _$s4Test3FooVMf+8(%rip), %rax
- xorl %edx, %edx
- retq
+ leaq _$s4Test3FooVMf+8(%rip), %rax
+ xorl %edx, %edx
+ retq
- .section __TEXT,__const
-l___unnamed_1:
- .asciz "Test"
+ .section __TEXT,__swift5_entry,regular,no_dead_strip
+ .p2align 2
+l_entry_point:
+ .long _main-l_entry_point
+ .long 0
- .private_extern _$s4TestMXM
- .globl _$s4TestMXM
- .weak_definition _$s4TestMXM
- .p2align 2
+ .section __TEXT,__const
+l_.str.4.Test:
+ .asciz "Test"
+
+ .private_extern _$s4TestMXM
+ .globl _$s4TestMXM
+ .weak_definition _$s4TestMXM
+ .p2align 2
_$s4TestMXM:
- .long 0
- .long 0
- .long (l___unnamed_1-_$s4TestMXM)-8
+ .long 0
+ .long 0
+ .long (l_.str.4.Test-_$s4TestMXM)-8
-l___unnamed_2:
- .asciz "Foo"
+l_.str.3.Foo:
+ .asciz "Foo"
- .private_extern _$s4Test3FooVMn
- .globl _$s4Test3FooVMn
- .p2align 2
+ .private_extern _$s4Test3FooVMn
+ .globl _$s4Test3FooVMn
+ .p2align 2
_$s4Test3FooVMn:
- .long 81
- .long (_$s4TestMXM-_$s4Test3FooVMn)-4
- .long (l___unnamed_2-_$s4Test3FooVMn)-8
- .long (_$s4Test3FooVMa-_$s4Test3FooVMn)-12
- .long (_$s4Test3FooVMF-_$s4Test3FooVMn)-16
- .long 0
- .long 2
+ .long 81
+ .long (_$s4TestMXM-_$s4Test3FooVMn)-4
+ .long (l_.str.3.Foo-_$s4Test3FooVMn)-8
+ .long (_$s4Test3FooVMa-_$s4Test3FooVMn)-12
+ .long (_$s4Test3FooVMF-_$s4Test3FooVMn)-16
+ .long 0
+ .long 2
- .section __DATA,__const
- .p2align 3
+ .section __DATA,__const
+ .p2align 3
_$s4Test3FooVMf:
- .quad _$sytWV
- .quad 512
- .quad _$s4Test3FooVMn
+ .quad _$sytWV
+ .quad 512
+ .quad _$s4Test3FooVMn
- .private_extern "_symbolic _____ 4Test3FooV"
- .section __TEXT,__swift5_typeref,regular,no_dead_strip
- .globl "_symbolic _____ 4Test3FooV"
- .weak_definition "_symbolic _____ 4Test3FooV"
- .p2align 1
+ .private_extern "_symbolic _____ 4Test3FooV"
+ .section __TEXT,__swift5_typeref
+ .globl "_symbolic _____ 4Test3FooV"
+ .weak_definition "_symbolic _____ 4Test3FooV"
+ .p2align 1
"_symbolic _____ 4Test3FooV":
- .byte 1
- .long (_$s4Test3FooVMn-"_symbolic _____ 4Test3FooV")-1
- .byte 0
+ .byte 1
+ .long (_$s4Test3FooVMn-"_symbolic _____ 4Test3FooV")-1
+ .byte 0
- .section __TEXT,__swift5_fieldmd,regular,no_dead_strip
- .p2align 2
+ .section __TEXT,__swift5_fieldmd
+ .p2align 2
_$s4Test3FooVMF:
- .long "_symbolic _____ 4Test3FooV"-_$s4Test3FooVMF
- .long 0
- .short 0
- .short 12
- .long 0
+ .long "_symbolic _____ 4Test3FooV"-_$s4Test3FooVMF
+ .long 0
+ .short 0
+ .short 12
+ .long 0
- .section __TEXT,__swift5_types,regular,no_dead_strip
- .p2align 2
-l_type_metadata_table:
- .long _$s4Test3FooVMn-l_type_metadata_table
+ .section __TEXT,__swift5_types
+ .p2align 2
+l_$s4Test3FooVHn:
+ .long _$s4Test3FooVMn-l_$s4Test3FooVHn
+
+ .private_extern ___swift_reflection_version
+ .section __TEXT,__const
+ .globl ___swift_reflection_version
+ .weak_definition ___swift_reflection_version
+ .p2align 1
+___swift_reflection_version:
+ .short 3
+
+ .section __DATA,__objc_imageinfo,regular,no_dead_strip
+L_OBJC_IMAGE_INFO:
+ .long 0
+ .long 84477760
+
+ .globl _$s4Test3FooVN
+ .private_extern _$s4Test3FooVN
+ .alt_entry _$s4Test3FooVN
+.set _$s4Test3FooVN, _$s4Test3FooVMf+8
+.subsections_via_symbols
diff --git a/third_party/llvm-project/compiler-rt/test/profile/AIX/binary-id-shared.c b/third_party/llvm-project/compiler-rt/test/profile/AIX/binary-id-shared.c
new file mode 100644
index 0000000..55ba9d8
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/AIX/binary-id-shared.c
@@ -0,0 +1,35 @@
+// RUN: split-file %s %t
+// RUN: cd %t
+// RUN: %clang_pgogen -c shr1.c -o shr1.o -Xclang -fprofile-instrument-path=default_1.profraw
+// RUN: %clang_pgogen -shared shr1.o -o shr1.so -mxcoff-build-id=0x01
+//
+// RUN: %clangxx_pgogen -c shr2.cpp -o shr2.o -Xclang -fprofile-instrument-path=default_2.profraw
+// RUN: %clangxx_pgogen -shared shr2.o -o shr2.so -mxcoff-build-id=0x02
+//
+// RUN: %clang_pgogen -c main.c -o main.o -Xclang -fprofile-instrument-path=default_main.profraw
+// RUN: %clang_pgogen main.o -L%t shr1.so shr2.so -o a.out -mxcoff-build-id=0xFFFFFFFFFFFFFFFF
+//
+// RUN: %run ./a.out
+//
+// RUN: llvm-profdata show --binary-ids default_1.profraw | FileCheck %s --check-prefix=SHARED1
+// RUN: llvm-profdata show --binary-ids default_2.profraw | FileCheck %s --check-prefix=SHARED2
+// RUN: llvm-profdata show --binary-ids default_main.profraw | FileCheck %s --check-prefix=MAIN
+
+// SHARED1: Binary IDs:
+// SHARED1-NEXT: {{^}}01{{$}}
+// SHARED2: Binary IDs:
+// SHARED2-NEXT: {{^}}02{{$}}
+// MAIN: Binary IDs:
+// MAIN-NEXT: {{^}}ffffffffffffffff{{$}}
+
+//--- shr1.c
+int shr1() { return 1; }
+
+//--- shr2.cpp
+int helper() { return 3; }
+extern "C" int shr2() { return helper(); }
+
+//--- main.c
+int shr1();
+int shr2();
+int main() { return 4 - shr1() - shr2(); }
diff --git a/third_party/llvm-project/compiler-rt/test/profile/AIX/binary-id.c b/third_party/llvm-project/compiler-rt/test/profile/AIX/binary-id.c
new file mode 100644
index 0000000..b60bfd8
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/AIX/binary-id.c
@@ -0,0 +1,47 @@
+// RUN: %clang_pgogen -c -o %t.o %s
+//
+// Test valid IDs:
+// (20-byte, ends with 2 zeroes, upper case)
+// RUN: %clang_pgogen -mxcoff-build-id=0x8d7AEC8b900dce6c14afe557dc8889230518be00 -o %t %t.o
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=LONG
+
+// (all zeroes)
+// RUN: %clang_pgogen -mxcoff-build-id=0x00 -o %t %t.o
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=00
+
+// (starts with one zero)
+// RUN: %clang_pgogen -mxcoff-build-id=0x0120 -o %t %t.o
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=0120
+
+// (starts with 8 zeroes == 4 bytes)
+// RUN: %clang_pgogen -mxcoff-build-id=0x0000000012 -o %t %t.o
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=0000000012
+
+// (starts with 16 zeroes == 8 bytes)
+// RUN: %clang_pgogen -mxcoff-build-id=0x0000000000000000ff -o %t %t.o
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=0000000000000000ff
+
+// (starts with 17 zeroes)
+// RUN: %clang_pgogen -mxcoff-build-id=0x00000000000000000f -o %t %t.o
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata show --binary-ids %t.profraw | FileCheck %s --check-prefix=00000000000000000f
+
+// LONG: Binary IDs:
+// LONG-NEXT: 8d7aec8b900dce6c14afe557dc8889230518be00
+// 00: Binary IDs:
+// 00-NEXT: {{^}}00{{$}}
+// 0120: Binary IDs:
+// 0120-NEXT: {{^}}0120{{$}}
+// 0000000012: Binary IDs:
+// 0000000012-NEXT: {{^}}0000000012{{$}}
+// 0000000000000000ff: Binary IDs:
+// 0000000000000000ff-NEXT: {{^}}0000000000000000ff{{$}}
+// 00000000000000000f: Binary IDs:
+// 00000000000000000f-NEXT: {{^}}00000000000000000f{{$}}
+
+int main() { return 0; }
diff --git a/third_party/llvm-project/compiler-rt/test/profile/CMakeLists.txt b/third_party/llvm-project/compiler-rt/test/profile/CMakeLists.txt
index 782be30..1b61d1e 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/CMakeLists.txt
+++ b/third_party/llvm-project/compiler-rt/test/profile/CMakeLists.txt
@@ -16,6 +16,8 @@
darwin_filter_host_archs(PROFILE_SUPPORTED_ARCH PROFILE_TEST_ARCH)
endif()
+pythonize_bool(LLVM_ENABLE_CURL)
+
foreach(arch ${PROFILE_TEST_ARCH})
set(PROFILE_TEST_TARGET_ARCH ${arch})
get_test_cc_for_arch(${arch} PROFILE_TEST_TARGET_CC PROFILE_TEST_TARGET_CFLAGS)
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Linux/binary-id-debuginfod.c b/third_party/llvm-project/compiler-rt/test/profile/Linux/binary-id-debuginfod.c
new file mode 100644
index 0000000..39a125b
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/Linux/binary-id-debuginfod.c
@@ -0,0 +1,33 @@
+// REQUIRES: linux, curl
+// RUN: split-file %s %t
+// RUN: %clang_profgen -Wl,--build-id=0x12345678 -fcoverage-mapping -O2 -shared %t/foo.c -o %t/libfoo.so
+// RUN: %clang_profgen -Wl,--build-id=0xabcd1234 -fcoverage-mapping -O2 %t/main.c -L%t -lfoo -o %t.main
+// RUN: rm -rf %t.profdir
+// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw LD_LIBRARY_PATH=%t %run %t.main
+// RUN: mkdir -p %t/buildid/12345678 %t/buildid/abcd1234
+// RUN: cp %t/libfoo.so %t/buildid/12345678/debuginfo
+// RUN: cp %t.main %t/buildid/abcd1234/debuginfo
+// RUN: llvm-profdata merge -o %t.profdata %t.profdir/default_*.profraw
+// RUN: env DEBUGINFOD_URLS=file://%t llvm-cov show -instr-profile %t.profdata | FileCheck %s
+// RUN: echo "bad" > %t/libfoo.so %t/buildid/12345678/debuginfo
+// RUN: echo "bad" > %t/buildid/abcd1234/debuginfo
+// RUN: env DEBUGINFOD_URLS=file://%t llvm-cov show -instr-profile %t.profdata -debuginfod=false %t.main | FileCheck %s --check-prefix=NODEBUGINFOD
+
+// CHECK: 1| 1|void foo(void) {}
+// CHECK: 2| 1|void bar(void) {}
+// CHECK: 3| 1|int main() {
+
+// NODEBUGINFOD-NOT: foo(void) {}
+// NODEBUGINFOD: main
+
+//--- foo.c
+void foo(void) {}
+
+//--- main.c
+void foo(void);
+void bar(void) {}
+int main() {
+ foo();
+ bar();
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Linux/binary-id-lookup.c b/third_party/llvm-project/compiler-rt/test/profile/Linux/binary-id-lookup.c
new file mode 100644
index 0000000..1496e70
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/Linux/binary-id-lookup.c
@@ -0,0 +1,45 @@
+// REQUIRES: linux
+// RUN: split-file %s %t
+// RUN: %clang_profgen -Wl,--build-id=0x12345678 -fcoverage-mapping -O2 -shared %t/foo.c -o %t/libfoo.so
+// RUN: %clang_profgen -Wl,--build-id=0xabcd1234 -fcoverage-mapping -O2 %t/main.c -L%t -lfoo -o %t.main
+// RUN: rm -rf %t.profdir
+// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw LD_LIBRARY_PATH=%t %run %t.main
+// RUN: mkdir -p %t/.build-id/12 %t/.build-id/ab
+// RUN: cp %t/libfoo.so %t/.build-id/12/345678.debug
+// RUN: cp %t.main %t/.build-id/ab/cd1234.debug
+// RUN: llvm-profdata merge -o %t.profdata %t.profdir/default_*.profraw
+
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t | FileCheck %s
+// RUN: llvm-cov show -instr-profile %t.profdata %t/libfoo.so -sources %t/foo.c -object %t.main | FileCheck %s --check-prefix=FOO-ONLY
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t -sources %t/foo.c | FileCheck %s --check-prefix=FOO-ONLY
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t %t/libfoo.so -sources %t/foo.c | FileCheck %s --check-prefix=FOO-ONLY
+
+// RUN: rm %t/.build-id/ab/cd1234.debug
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t %t.main | FileCheck %s
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t | FileCheck %s --check-prefix=FOO-ONLY
+// RUN: not llvm-cov show -instr-profile %t.profdata -debug-file-directory %t --check-binary-ids 2>&1 | FileCheck %s --check-prefix=MISSING-BINARY-ID -DFILENAME=%t.profdata
+
+// RUN: echo "bad" > %t/.build-id/ab/cd1234.debug
+// RUN: llvm-cov show -instr-profile %t.profdata -debug-file-directory %t %t.main | FileCheck %s
+
+// RUN: not llvm-cov show -instr-profile %t.profdata -debug-file-directory %t/empty 2>&1 | FileCheck %s --check-prefix=NODATA
+
+// CHECK: 1| 1|void foo(void) {}
+// CHECK: 2| 1|void bar(void) {}
+// CHECK: 3| 1|int main() {
+
+// FOO-ONLY: 1| 1|void foo(void) {}
+// MISSING-BINARY-ID: error: Failed to load coverage: '[[FILENAME]]': Missing binary ID: abcd1234
+// NODATA: error: Failed to load coverage: '': No coverage data found
+
+//--- foo.c
+void foo(void) {}
+
+//--- main.c
+void foo(void);
+void bar(void) {}
+int main() {
+ foo();
+ bar();
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_for.c b/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_for.c
index a63b645..1694e38 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_for.c
+++ b/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_for.c
@@ -1,13 +1,13 @@
// RUN: rm -fr %t.promo.prof
// RUN: rm -fr %t.nopromo.prof
-// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen -O2 %s
-// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen.ll -emit-llvm -S -O2 %s
+// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen -O2 %s -fno-slp-vectorize
+// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen.ll -emit-llvm -S -O2 %s -fno-slp-vectorize
// RUN: cat %t.promo.gen.ll | FileCheck --check-prefix=PROMO %s
// RUN: %run %t.promo.gen
// RUN: llvm-profdata merge -o %t.promo.profdata %t.promo.prof/
// RUN: llvm-profdata show --counts --all-functions %t.promo.profdata > %t.promo.dump
-// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen -O2 %s
-// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen.ll -emit-llvm -S -O2 %s
+// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen -O2 %s -fno-slp-vectorize
+// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen.ll -emit-llvm -S -O2 %s -fno-slp-vectorize
// RUN: cat %t.nopromo.gen.ll | FileCheck --check-prefix=NOPROMO %s
// RUN: %run %t.nopromo.gen
// RUN: llvm-profdata merge -o %t.nopromo.profdata %t.nopromo.prof/
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_while.c b/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_while.c
index b9ca5a5..71c4a90 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_while.c
+++ b/third_party/llvm-project/compiler-rt/test/profile/Linux/counter_promo_while.c
@@ -1,13 +1,13 @@
// RUN: rm -fr %t.promo.prof
// RUN: rm -fr %t.nopromo.prof
-// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen -O2 %s
-// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen.ll -emit-llvm -S -O2 %s
+// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen -O2 %s -fno-slp-vectorize
+// RUN: %clang_pgogen=%t.promo.prof/ -o %t.promo.gen.ll -emit-llvm -S -O2 %s -fno-slp-vectorize
// RUN: cat %t.promo.gen.ll | FileCheck --check-prefix=PROMO %s
// RUN: %run %t.promo.gen
// RUN: llvm-profdata merge -o %t.promo.profdata %t.promo.prof/
// RUN: llvm-profdata show --counts --all-functions %t.promo.profdata > %t.promo.dump
-// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen -O2 %s
-// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen.ll -emit-llvm -S -O2 %s
+// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen -O2 %s -fno-slp-vectorize
+// RUN: %clang_pgogen=%t.nopromo.prof/ -mllvm -do-counter-promotion=false -mllvm -simplifycfg-sink-common=false -o %t.nopromo.gen.ll -emit-llvm -S -O2 %s -fno-slp-vectorize
// RUN: cat %t.nopromo.gen.ll | FileCheck --check-prefix=NOPROMO %s
// RUN: %run %t.nopromo.gen
// RUN: llvm-profdata merge -o %t.nopromo.profdata %t.nopromo.prof/
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c b/third_party/llvm-project/compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c
index f143901..b42f3b3 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c
+++ b/third_party/llvm-project/compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c
@@ -6,7 +6,6 @@
// RUN: not llvm-profdata show --debug-info=%t.no.dbg 2>&1 | FileCheck %s --check-prefix NO-DBG
// NO-DBG: unable to correlate profile: could not find any profile metadata in debug info
-// CHECK: a
// YAML: Probes:
// YAML: - Function Name: a
// YAML: Linkage Name: a
@@ -17,7 +16,6 @@
// YAML: Line: [[@LINE+1]]
void a() {}
-// CHECK: b
// YAML: - Function Name: b
// YAML: Linkage Name: b
// YAML: CFG Hash: 0x[[#%.1X,HASH:]]
@@ -27,7 +25,6 @@
// YAML: Line: [[@LINE+1]]
void b() {}
-// CHECK: main
// YAML: - Function Name: main
// YAML: Linkage Name: main
// YAML: CFG Hash: 0x[[#%.1X,HASH:]]
@@ -37,5 +34,8 @@
// YAML: Line: [[@LINE+1]]
int main() { return 0; }
+// CHECK: main
+// CHECK: a
+// CHECK: b
// CHECK: Counters section size: 0x18 bytes
// CHECK: Found 3 functions
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Linux/lit.local.cfg.py b/third_party/llvm-project/compiler-rt/test/profile/Linux/lit.local.cfg.py
index 98d7951..9bb92b7 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/Linux/lit.local.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/profile/Linux/lit.local.cfg.py
@@ -38,3 +38,6 @@
if root.host_os not in ['Linux'] or not is_gold_linker_available():
config.unsupported = True
+
+if config.have_curl:
+ config.available_features.add('curl')
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-linkage.cpp b/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-linkage.cpp
index 648b3fb..315c533 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-linkage.cpp
+++ b/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-linkage.cpp
@@ -3,7 +3,7 @@
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
// RUN: llvm-profdata show %t.profraw --all-functions | FileCheck %s
-// RUN: %clang_profgen -fcoverage-mapping -ffunction-sections -Wl,-opt:ref %s -o %t
+// RUN: %clang_profgen -fcoverage-mapping -ffunction-sections %if target={{.*-windows-msvc.*}} %{ -Wl,-opt:ref %} %s -o %t
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
// RUN: llvm-profdata show %t.profraw --all-functions | FileCheck %s
diff --git a/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-weak-lld.cpp b/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-weak-lld.cpp
index 1dc74cb..338be8e 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-weak-lld.cpp
+++ b/third_party/llvm-project/compiler-rt/test/profile/Windows/coverage-weak-lld.cpp
@@ -1,5 +1,6 @@
// REQUIRES: lld-available
+// REQUIRES: target={{.*windows-msvc.*}}
// RUN: %clang_profgen -fcoverage-mapping -c %s -o %t0.o
// RUN: %clang_profgen -fcoverage-mapping -c %s -DOBJ_1 -o %t1.o
// RUN: %clang_profgen -fcoverage-mapping -c %s -DOBJ_2 -o %t2.o
diff --git a/third_party/llvm-project/compiler-rt/test/profile/instrprof-block-coverage.c b/third_party/llvm-project/compiler-rt/test/profile/instrprof-block-coverage.c
new file mode 100644
index 0000000..4f1e778
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/instrprof-block-coverage.c
@@ -0,0 +1,47 @@
+// RUN: %clang_pgogen -mllvm -pgo-block-coverage %s -o %t.out
+// RUN: env LLVM_PROFILE_FILE=%t1.profraw %run %t.out 1
+// RUN: env LLVM_PROFILE_FILE=%t2.profraw %run %t.out 2
+// RUN: llvm-profdata merge -o %t.profdata %t1.profraw %t2.profraw
+// RUN: %clang_profuse=%t.profdata -mllvm -pgo-verify-bfi -o - -S -emit-llvm %s 2>%t.errs | FileCheck %s --implicit-check-not="!prof"
+// RUN: FileCheck %s < %t.errs --allow-empty --check-prefix=CHECK-ERROR
+
+#include <stdlib.h>
+
+// CHECK: @foo({{.*}})
+// CHECK-SAME: !prof ![[PROF0:[0-9]+]]
+void foo(int a) {
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PROF1:[0-9]+]]
+ if (a % 2 == 0) {
+ //
+ } else {
+ //
+ }
+
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PROF1]]
+ for (int i = 1; i < a; i++) {
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PROF2:[0-9]+]]
+ if (a % 3 == 0) {
+ //
+ } else {
+ // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PROF2]]
+ if (a % 1001 == 0) {
+ return;
+ }
+ }
+ }
+
+ return;
+}
+
+// CHECK: @main({{.*}})
+// CHECK-SAME: !prof ![[PROF0]]
+int main(int argc, char *argv[]) {
+ foo(atoi(argv[1]));
+ return 0;
+}
+
+// CHECK-DAG: ![[PROF0]] = !{!"function_entry_count", i64 10000}
+// CHECK-DAG: ![[PROF1]] = !{!"branch_weights", i32 1, i32 1}
+// CHECK-DAG: ![[PROF2]] = !{!"branch_weights", i32 0, i32 1}
+
+// CHECK-ERROR-NOT: warning: {{.*}}: Found inconsistent block coverage
diff --git a/third_party/llvm-project/compiler-rt/test/profile/instrprof-discarded-comdat.cpp b/third_party/llvm-project/compiler-rt/test/profile/instrprof-discarded-comdat.cpp
new file mode 100644
index 0000000..feaa7c1
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/instrprof-discarded-comdat.cpp
@@ -0,0 +1,51 @@
+// Check that instrprof does not introduce references to discarded sections when
+// using comdats.
+//
+// Occasionally, it is possible that the same function can be compiled in
+// different TUs with slightly different linkages, e.g., due to different
+// compiler options. However, if these are comdat functions, a single
+// implementation will be chosen at link time. we want to ensure that the
+// profiling data does not contain a reference to the discarded section.
+
+// UNSUPPORTED: target={{.*windows.*}}
+
+// RUN: mkdir -p %t.d
+// RUN: %clangxx_pgogen -O2 -fPIC -ffunction-sections -fdata-sections -c %s -o %t.d/a1.o -DOBJECT_1 -mllvm -disable-preinline
+// RUN: %clangxx_pgogen -O2 -fPIC -ffunction-sections -fdata-sections -c %s -o %t.d/a2.o
+// RUN: %clangxx_pgogen -fPIC -shared -o %t.d/liba.so %t.d/a1.o %t.d/a2.o 2>&1 | FileCheck %s --allow-empty
+
+// Ensure that we don't get an error when linking
+// CHECK-NOT: relocation refers to a discarded section: .text._ZN1CIiE1fEi
+
+template <typename T> struct C {
+ void f(T x);
+ int g(T x) {
+ f(x);
+ return v;
+ }
+ int v;
+};
+
+template <typename T>
+#ifdef OBJECT_1
+__attribute__((weak))
+#else
+__attribute__((noinline))
+#endif
+void C<T>::f(T x) {
+ v += x;
+}
+
+#ifdef OBJECT_1
+int foo() {
+ C<int> c;
+ c.f(1);
+ return c.g(2);
+}
+#else
+int bar() {
+ C<int> c;
+ c.f(3);
+ return c.g(4);
+}
+#endif
diff --git a/third_party/llvm-project/compiler-rt/test/profile/instrprof-coverage.c b/third_party/llvm-project/compiler-rt/test/profile/instrprof-entry-coverage.c
similarity index 100%
rename from third_party/llvm-project/compiler-rt/test/profile/instrprof-coverage.c
rename to third_party/llvm-project/compiler-rt/test/profile/instrprof-entry-coverage.c
diff --git a/third_party/llvm-project/compiler-rt/test/profile/instrprof-timestamp.c b/third_party/llvm-project/compiler-rt/test/profile/instrprof-timestamp.c
new file mode 100644
index 0000000..ad14e66
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/profile/instrprof-timestamp.c
@@ -0,0 +1,47 @@
+// RUN: rm -f %t.profdata
+// RUN: %clang_pgogen -o %t -mllvm -pgo-temporal-instrumentation %s
+// RUN: env LLVM_PROFILE_FILE=%t.0.profraw %run %t n
+// RUN: env LLVM_PROFILE_FILE=%t.1.profraw %run %t y
+// RUN: llvm-profdata merge -o %t.profdata %t.0.profraw --weighted-input=5,%t.1.profraw
+// RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --implicit-check-not=unused
+
+// RUN: rm -f %t.profdata
+// RUN: %clang_pgogen -o %t -mllvm -pgo-temporal-instrumentation -mllvm -pgo-block-coverage %s
+// RUN: env LLVM_PROFILE_FILE=%t.0.profraw %run %t n
+// RUN: env LLVM_PROFILE_FILE=%t.1.profraw %run %t y
+// RUN: llvm-profdata merge -o %t.profdata %t.0.profraw --weighted-input=5,%t.1.profraw
+// RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --implicit-check-not=unused
+
+extern void exit(int);
+extern void __llvm_profile_reset_counters();
+
+void a() {}
+void b() {}
+void unused() { exit(1); }
+void c() {}
+
+int main(int argc, const char *argv[]) {
+ if (argc != 2)
+ unused();
+ a();
+ b();
+ b();
+ c();
+ if (*argv[1] == 'y')
+ __llvm_profile_reset_counters();
+ a();
+ c();
+ b();
+ return 0;
+}
+
+// CHECK: Temporal Profile Traces (samples=2 seen=2):
+// CHECK: Temporal Profile Trace 0 (weight=1 count=4):
+// CHECK: main
+// CHECK: a
+// CHECK: b
+// CHECK: c
+// CHECK: Temporal Profile Trace 1 (weight=5 count=3):
+// CHECK: a
+// CHECK: c
+// CHECK: b
diff --git a/third_party/llvm-project/compiler-rt/test/profile/instrprof-without-libc.c b/third_party/llvm-project/compiler-rt/test/profile/instrprof-without-libc.c
index b7f7a1e..3142138 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/instrprof-without-libc.c
+++ b/third_party/llvm-project/compiler-rt/test/profile/instrprof-without-libc.c
@@ -9,6 +9,9 @@
// an MSVC environment, so we can't make this test portable.
// UNSUPPORTED: target={{.*msvc.*}}
+// The MinGW CRT init files do reference malloc etc, so this test fails.
+// UNSUPPORTED: target={{.*windows-gnu.*}}
+
#include <stdint.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/profile/lit.cfg.py b/third_party/llvm-project/compiler-rt/test/profile/lit.cfg.py
index de8840b..9a96f47 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/lit.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/profile/lit.cfg.py
@@ -1,6 +1,7 @@
# -*- Python -*-
import os
+import re
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
@@ -22,9 +23,11 @@
config.profile_lit_binary_dir is not None:
config.test_exec_root = os.path.join(config.profile_lit_binary_dir, config.name)
+target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple))
+
if config.host_os in ['Linux']:
extra_link_flags = ["-ldl"]
-elif config.host_os in ['Windows']:
+elif target_is_msvc:
# InstrProf is incompatible with incremental linking. Disable it as a
# workaround.
extra_link_flags = ["-Wl,-incremental:no"]
diff --git a/third_party/llvm-project/compiler-rt/test/profile/lit.site.cfg.py.in b/third_party/llvm-project/compiler-rt/test/profile/lit.site.cfg.py.in
index bb81fb0..3466eab 100644
--- a/third_party/llvm-project/compiler-rt/test/profile/lit.site.cfg.py.in
+++ b/third_party/llvm-project/compiler-rt/test/profile/lit.site.cfg.py.in
@@ -4,6 +4,7 @@
config.profile_lit_binary_dir = "@PROFILE_LIT_BINARY_DIR@"
config.target_cflags = "@PROFILE_TEST_TARGET_CFLAGS@"
config.target_arch = "@PROFILE_TEST_TARGET_ARCH@"
+config.have_curl = @LLVM_ENABLE_CURL_PYBOOL@
# Load common config for all compiler-rt lit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Darwin/atos-symbolized-recover.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Darwin/atos-symbolized-recover.cpp
new file mode 100644
index 0000000..4234e0c
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Darwin/atos-symbolized-recover.cpp
@@ -0,0 +1,22 @@
+// Check that there is a warning when atos fails to symbolize an address
+// and that atos continues symbolicating correctly after.
+
+// RUN: %clangxx -O0 %s -o %t
+// RUN: not %run %t 2>&1 | FileCheck %s
+
+// This test tests for undefined behavior and is leading to various failures.
+// Going to disable to unblock CI and rethink a test for this. rdar://107846128
+// UNSUPPORTED: darwin
+
+void bar() {
+ void *invalid_addr = reinterpret_cast<void *>(0xDEADBEEF);
+ void (*func_ptr)() = reinterpret_cast<void (*)()>(invalid_addr);
+ func_ptr();
+}
+
+int main() {
+ bar();
+ return 0;
+ // CHECK: WARNING: atos failed to symbolize address{{.*}}
+ // CHECK: {{.*}}atos-symbolized-recover.cpp:[[@LINE-3]]{{.*}}
+}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/FreeBSD/hexdump.cc b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/FreeBSD/hexdump.cc
new file mode 100644
index 0000000..e07650d
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/FreeBSD/hexdump.cc
@@ -0,0 +1,23 @@
+// RUN: %clangxx -O0 -g %s -o %t -lutil && %run %t 2>&1 | FileCheck %s
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <libutil.h>
+
+int main(void) {
+ printf("hexdump");
+ char *line;
+ size_t lineno = 0, len;
+ const char *delim = "\\\\#";
+ FILE *fp = fopen("/etc/fstab", "r");
+ assert(fp);
+ line = fparseln(fp, &len, &lineno, delim, 0);
+ hexdump(line, len, nullptr, 0);
+ free(line);
+ fclose(fp);
+ assert(lineno != 0);
+ assert(len > 0);
+
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/argp_parse.c b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/argp_parse.c
new file mode 100644
index 0000000..ec78f27
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/argp_parse.c
@@ -0,0 +1,60 @@
+// RUN: %clang %s -o %t && %run %t -o baz
+
+// argp_parse is glibc specific.
+// UNSUPPORTED: android, target={{.*(freebsd|netbsd).*}}
+
+#include <argp.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+struct test {
+ const char *option_value;
+};
+
+static const struct argp_option options[] = {
+ {"option", 'o', "OPTION", 0, "Option", 0},
+ {NULL, 0, NULL, 0, NULL, 0},
+};
+
+static error_t parser(int key, char *arg, struct argp_state *state) {
+ if (key == 'o') {
+ ((struct test *)(state->input))->option_value = arg;
+ return 0;
+ }
+ return ARGP_ERR_UNKNOWN;
+}
+
+static struct argp argp = {.options = options, .parser = parser};
+
+void test_nulls(char *argv0) {
+ char *argv[] = {argv0, NULL};
+ int res = argp_parse(NULL, 1, argv, 0, NULL, NULL);
+ assert(res == 0);
+}
+
+void test_synthetic(char *argv0) {
+ char *argv[] = {argv0, "-o", "foo", "bar", NULL};
+ struct test t = {NULL};
+ int arg_index;
+ int res = argp_parse(&argp, 4, argv, 0, &arg_index, &t);
+ assert(res == 0);
+ assert(arg_index == 3);
+ assert(strcmp(t.option_value, "foo") == 0);
+}
+
+void test_real(int argc, char **argv) {
+ struct test t = {NULL};
+ int arg_index;
+ int res = argp_parse(&argp, argc, argv, 0, &arg_index, &t);
+ assert(res == 0);
+ assert(arg_index == 3);
+ assert(strcmp(t.option_value, "baz") == 0);
+}
+
+int main(int argc, char **argv) {
+ test_nulls(argv[0]);
+ test_synthetic(argv[0]);
+ test_real(argc, argv);
+ return EXIT_SUCCESS;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/cap.c b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/cap.c
new file mode 100644
index 0000000..68d9113
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/cap.c
@@ -0,0 +1,48 @@
+// RUN: %clang %s -o %t && %run %t
+// capget() and capset() are not intercepted on Android.
+// UNSUPPORTED: android
+
+#include <assert.h>
+#include <errno.h>
+#include <linux/capability.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "sanitizer_common/sanitizer_specific.h"
+
+/* Use capget() and capset() from glibc. */
+int capget(cap_user_header_t header, cap_user_data_t data);
+int capset(cap_user_header_t header, const cap_user_data_t data);
+
+static void test(int version, int u32s) {
+ struct __user_cap_header_struct hdr = {
+ .version = version,
+ .pid = 0,
+ };
+ struct __user_cap_data_struct data[u32s];
+ if (capget(&hdr, data)) {
+ assert(errno == EINVAL);
+ /* Check that memory is not touched. */
+#if __has_feature(memory_sanitizer)
+ assert(__msan_test_shadow(data, sizeof(data)) == 0);
+#endif
+ hdr.version = version;
+ int err = capset(&hdr, data);
+ assert(errno == EINVAL);
+ } else {
+ for (int i = 0; i < u32s; i++)
+ printf("%x %x %x\n", data[i].effective, data[i].permitted,
+ data[i].inheritable);
+ int err = capset(&hdr, data);
+ assert(!err);
+ }
+}
+
+int main() {
+ test(0, 1); /* Test an incorrect version. */
+ test(_LINUX_CAPABILITY_VERSION_1, _LINUX_CAPABILITY_U32S_1);
+ test(_LINUX_CAPABILITY_VERSION_2, _LINUX_CAPABILITY_U32S_2);
+ test(_LINUX_CAPABILITY_VERSION_3, _LINUX_CAPABILITY_U32S_3);
+
+ return EXIT_SUCCESS;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
index 60f32c2..d0400af 100644
--- a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
@@ -49,6 +49,10 @@
// CHECK-asan: ---p {{.*}} [shadow gap]
// CHECK-asan: rw-p {{.*}} [high shadow]
+// CHECK-hwasan: rw-p {{.*}} [low shadow]
+// CHECK-hwasan: ---p {{.*}} [shadow gap]
+// CHECK-hwasan: rw-p {{.*}} [high shadow]
+
// CHECK-msan: ---p {{.*}} [invalid]
// CHECK-msan: rw-p {{.*}} [shadow{{.*}}]
// CHECK-msan: ---p {{.*}} [origin{{.*}}]
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
index 82c0faf..7633eb4 100644
--- a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
@@ -1,5 +1,5 @@
// RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: android, ubsan
+// UNSUPPORTED: android, hwasan, ubsan
#include <stdio.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/odd_stack_size.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/odd_stack_size.cpp
new file mode 100644
index 0000000..fc31212
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/odd_stack_size.cpp
@@ -0,0 +1,35 @@
+// RUN: %clangxx -O1 %s -o %t && %run %t
+// UNSUPPORTED: android
+
+// Fail on powerpc64 bots with:
+// AddressSanitizer: CHECK failed: asan_thread.cpp:315 "((AddrIsInStack((uptr)&local))) != (0)"
+// https://lab.llvm.org/buildbot/#/builders/18/builds/8162
+// UNSUPPORTED: target=powerpc64{{.*}}
+
+#include <assert.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ if (getenv("SANITIZER_TEST_REEXECED"))
+ exit(0);
+ struct rlimit rl;
+ assert(!getrlimit(RLIMIT_STACK, &rl));
+ struct rlimit rl_new = rl;
+ rl_new.rlim_cur = 17351;
+ assert(!setrlimit(RLIMIT_STACK, &rl_new));
+ int pid = fork();
+ assert(pid >= 0);
+ if (pid == 0) {
+ const char *envp[] = {"SANITIZER_TEST_REEXECED=1", nullptr};
+ execve(argv[0], argv, const_cast<char **>(envp));
+ assert(false);
+ }
+ int status;
+ while (waitpid(-1, &status, __WALL) != pid) {
+ }
+ assert(WIFEXITED(status) && WEXITSTATUS(status) == 0);
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
index 5cb8fe3..2d6e6c6 100644
--- a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
@@ -6,7 +6,7 @@
// UNSUPPORTED: i386-linux
// Do not intercept __tls_get_addr
-// UNSUPPORTED: lsan, ubsan, android
+// UNSUPPORTED: hwasan, lsan, ubsan, android
// FIXME: Investigate
// UNSUPPORTED: target=powerpc64{{.*}}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
index 6414955..fdce916 100644
--- a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
@@ -1,4 +1,5 @@
// RUN: %clang -w -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: hwasan
// UNSUPPORTED: lsan
// UNSUPPORTED: msan
// UNSUPPORTED: ubsan
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
new file mode 100644
index 0000000..1683063
--- /dev/null
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
@@ -0,0 +1,58 @@
+// RUN: %clangxx -O0 -g %s -o %t && %run %t
+
+// UBSan does not have its own allocator
+// UNSUPPORTED: ubsan
+
+#include <assert.h>
+#include <sanitizer/allocator_interface.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+// Based on lib/msan/tests/msan_test.cpp::get_allocated_size_and_ownership
+int main(void) {
+ int sizes[] = {10, 100, 1000, 10000, 100000, 1000000};
+
+ for (int i = 0; i < sizeof(sizes) / sizeof(int); i++) {
+ printf("Testing size %d\n", sizes[i]);
+
+ char *array = reinterpret_cast<char *>(malloc(sizes[i]));
+ int *int_ptr = new int;
+ printf("array: %p\n", array);
+ printf("int_ptr: %p\n", int_ptr);
+
+ // Bogus value to unpoison start. Calling __sanitizer_get_allocated_begin
+ // does not unpoison it.
+ const void *start = NULL;
+ for (int j = 0; j < sizes[i]; j++) {
+ printf("j: %d\n", j);
+
+ start = __sanitizer_get_allocated_begin(array + j);
+ printf("Start: %p (expected: %p)\n", start, array);
+ fflush(stdout);
+ assert(array == start);
+ }
+
+ start = __sanitizer_get_allocated_begin(int_ptr);
+ assert(int_ptr == start);
+
+ void *wild_addr = reinterpret_cast<void *>(4096 * 160);
+ assert(__sanitizer_get_allocated_begin(wild_addr) == NULL);
+
+ wild_addr = reinterpret_cast<void *>(0x1);
+ assert(__sanitizer_get_allocated_begin(wild_addr) == NULL);
+
+ // NULL is a valid argument for GetAllocatedSize but is not owned.
+ assert(__sanitizer_get_allocated_begin(NULL) == NULL);
+
+ free(array);
+ for (int j = 0; j < sizes[i]; j++) {
+ assert(__sanitizer_get_allocated_begin(array + j) == NULL);
+ }
+
+ delete int_ptr;
+ assert(__sanitizer_get_allocated_begin(int_ptr) == NULL);
+ }
+
+ return 0;
+}
diff --git a/third_party/llvm-project/compiler-rt/test/sanitizer_common/print_address.h b/third_party/llvm-project/compiler-rt/test/sanitizer_common/print_address.h
index 1128c92..df31322 100644
--- a/third_party/llvm-project/compiler-rt/test/sanitizer_common/print_address.h
+++ b/third_party/llvm-project/compiler-rt/test/sanitizer_common/print_address.h
@@ -1,6 +1,9 @@
#include <stdio.h>
#include <stdarg.h>
+#ifndef __SANITIZER_COMMON_PRINT_ADDRESS_H__
+# define __SANITIZER_COMMON_PRINT_ADDRESS_H__
+
void print_address(const char *str, int n, ...) {
fprintf(stderr, "%s", str);
va_list ap;
@@ -21,3 +24,5 @@
}
fprintf(stderr, "\n");
}
+
+#endif // __SANITIZER_COMMON_PRINT_ADDRESS_H__
\ No newline at end of file
diff --git a/third_party/llvm-project/compiler-rt/test/shadowcallstack/lit.cfg.py b/third_party/llvm-project/compiler-rt/test/shadowcallstack/lit.cfg.py
index fc736af..062ce83 100644
--- a/third_party/llvm-project/compiler-rt/test/shadowcallstack/lit.cfg.py
+++ b/third_party/llvm-project/compiler-rt/test/shadowcallstack/lit.cfg.py
@@ -19,5 +19,5 @@
scs_arch_cflags += ' -ffixed-x18 '
config.substitutions.append( ("%clang_scs ", config.clang + ' -O0 -fsanitize=shadow-call-stack ' + scs_arch_cflags + ' ') )
-if config.host_os not in ['Linux'] or config.target_arch not in ['aarch64']:
+if config.host_os not in ['Linux'] or config.target_arch not in ['aarch64','riscv64']:
config.unsupported = True
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/Darwin/external-swift-debugging.cpp b/third_party/llvm-project/compiler-rt/test/tsan/Darwin/external-swift-debugging.cpp
index 72335ed..8f8b2d5 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/Darwin/external-swift-debugging.cpp
+++ b/third_party/llvm-project/compiler-rt/test/tsan/Darwin/external-swift-debugging.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx_tsan %s -o %t
// RUN: %deflake %run %t 2>&1 | FileCheck %s
+#include <dlfcn.h>
#include <thread>
#import "../test.h"
@@ -13,6 +14,9 @@
int *unique_tid_count, void **sleep_trace,
unsigned long trace_size);
int __tsan_get_report_tag(void *report, unsigned long *tag);
+int __tsan_get_report_mop(void *report, unsigned long idx, int *tid, void **addr,
+ int *size, int *write, int *atomic, void **trace,
+ unsigned long trace_size);
}
__attribute__((no_sanitize("thread"), noinline))
@@ -25,7 +29,7 @@
barrier_init(&barrier, 2);
fprintf(stderr, "Start.\n");
// CHECK: Start.
-
+
void *opaque_object = malloc(16);
std::thread t1([opaque_object] {
ExternalWrite(opaque_object);
@@ -37,7 +41,9 @@
});
// CHECK: WARNING: ThreadSanitizer: Swift access race
// CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
+ // CHECK: #0 ExternalWrite
// CHECK: Previous modifying access of Swift variable at {{.*}} by thread {{.*}}
+ // CHECK: #0 ExternalWrite
// CHECK: SUMMARY: ThreadSanitizer: Swift access race
t1.join();
t2.join();
@@ -55,13 +61,28 @@
__tsan_get_report_data(report, &description, &count, &stack_count, &mop_count,
&loc_count, &mutex_count, &thread_count,
&unique_tid_count, sleep_trace, 16);
- fprintf(stderr, "report type = '%s', count = %d\n", description, count);
- // CHECK: report type = 'external-race', count = 0
+ fprintf(stderr, "report type = '%s', count = %d, mop_count = %d\n", description, count, mop_count);
+ // CHECK: report type = 'external-race', count = 0, mop_count = 2
unsigned long tag;
__tsan_get_report_tag(report, &tag);
fprintf(stderr, "tag = %ld\n", tag);
// CHECK: tag = 1
+
+ int tid, size, write, atomic;
+ void *addr;
+ void *trace[16] = {0};
+ __tsan_get_report_mop(report, /*idx=*/0, &tid, &addr, &size, &write, &atomic,
+ trace, 16);
+ fprintf(stderr, "Racy write trace (1 of 2):\n");
+ for (int i = 0; i < 16 && trace[i]; i++) {
+ Dl_info info;
+ dladdr(trace[i], &info);
+ fprintf(stderr, " %d: frame: %p, function: %p %s\n", i, trace[i],
+ info.dli_saddr, info.dli_sname);
+ }
+ // Ensure ExternalWrite() function is top of trace
+ // CHECK: 0: frame: 0x{{[0-9a-z]+}}, function: 0x{{[0-9a-z]+}} _Z13ExternalWritePv
}
// CHECK: Done.
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/Linux/check_preinit.cpp b/third_party/llvm-project/compiler-rt/test/tsan/Linux/check_preinit.cpp
index 8f5bf40..b5f63d3 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/Linux/check_preinit.cpp
+++ b/third_party/llvm-project/compiler-rt/test/tsan/Linux/check_preinit.cpp
@@ -12,6 +12,7 @@
// constructors of the binary which are called after constructors of shared
// library.
+#include <sanitizer/tsan_interface.h>
#include <stdio.h>
#if BUILD_SO
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/cxa_guard_acquire.cpp b/third_party/llvm-project/compiler-rt/test/tsan/cxa_guard_acquire.cpp
index d483cd3..100a40b 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/cxa_guard_acquire.cpp
+++ b/third_party/llvm-project/compiler-rt/test/tsan/cxa_guard_acquire.cpp
@@ -1,5 +1,6 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
+#include <sanitizer/tsan_interface.h>
#include <stdio.h>
namespace __tsan {
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/default_options.cpp b/third_party/llvm-project/compiler-rt/test/tsan/default_options.cpp
index 3b447e7..37af057 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/default_options.cpp
+++ b/third_party/llvm-project/compiler-rt/test/tsan/default_options.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <pthread.h>
+#include <sanitizer/tsan_interface.h>
#include <stdio.h>
#if (__APPLE__)
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/java.h b/third_party/llvm-project/compiler-rt/test/tsan/java.h
index 9df7fb6..b6a7129 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/java.h
+++ b/third_party/llvm-project/compiler-rt/test/tsan/java.h
@@ -1,3 +1,6 @@
+#ifndef __TSAN_JAVA_H__
+#define __TSAN_JAVA_H__
+
#include "test.h"
extern "C" {
@@ -27,3 +30,5 @@
}
const jptr kExternalPCBit = 1ULL << 60;
+
+#endif // __TSAN_JAVA_H__
\ No newline at end of file
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization.cpp b/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization.cpp
index e6a3ee8..2600d05 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization.cpp
+++ b/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
#include "java.h"
#include <memory.h>
+#include <sanitizer/tsan_interface.h>
#if (__APPLE__)
__attribute__((weak)) // Required for dyld macOS 12.0+
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization_legacy.cpp b/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization_legacy.cpp
index bdf986a..502d59d 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization_legacy.cpp
+++ b/third_party/llvm-project/compiler-rt/test/tsan/java_symbolization_legacy.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
#include "java.h"
#include <memory.h>
+#include <sanitizer/tsan_interface.h>
#if (__APPLE__)
__attribute__((weak)) // Required for dyld macOS 12.0+
diff --git a/third_party/llvm-project/compiler-rt/test/tsan/test.h b/third_party/llvm-project/compiler-rt/test/tsan/test.h
index efd66cb..7406318 100644
--- a/third_party/llvm-project/compiler-rt/test/tsan/test.h
+++ b/third_party/llvm-project/compiler-rt/test/tsan/test.h
@@ -1,3 +1,6 @@
+#ifndef __TSAN_TEST_H__
+#define __TSAN_TEST_H__
+
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
@@ -133,3 +136,5 @@
#else
#define ASM_SYMBOL(symbol) #symbol
#endif
+
+#endif // __TSAN_TEST_H__
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c
index 969ce46..3557566 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c
@@ -7,14 +7,14 @@
// RUN: %clang -x c -fsanitize=implicit-integer-arithmetic-value-change %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
// RUN: %clang -x c -fsanitize=implicit-integer-arithmetic-value-change %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
-// RUN: %clang -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-arithmetic-value-change %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
#include <stdint.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion-incdec.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion-incdec.c
index 0e62c02..8015ed9 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion-incdec.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion-incdec.c
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=implicit-conversion -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
// RUN: %clang -x c -fsanitize=implicit-conversion -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-conversion -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-conversion -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-conversion -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-conversion -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
void test_unsigned() {
unsigned char x;
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c
index 5f15b1b..57748df 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c
@@ -7,14 +7,14 @@
// RUN: %clang -x c -fsanitize=implicit-conversion %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
// RUN: %clang -x c -fsanitize=implicit-conversion %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
-// RUN: %clang -x c++ -fsanitize=implicit-conversion %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
+// RUN: %clangxx -x c++ -fsanitize=implicit-conversion %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
#include <stdint.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-incdec.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-incdec.c
index 4b56a10..e740fb8 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-incdec.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-incdec.c
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=implicit-integer-sign-change -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
// RUN: %clang -x c -fsanitize=implicit-integer-sign-change -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
void test_unsigned() {
unsigned char x;
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c
index 5313ad2..b2e6573 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c
@@ -6,13 +6,13 @@
// RUN: %clang -x c -fsanitize=implicit-integer-sign-change %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
// RUN: %clang -x c -fsanitize=implicit-integer-sign-change %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
-// RUN: %clang -x c++ -fsanitize=implicit-integer-sign-change %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-sign-change %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
#include <stdint.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c
index 1d6845a..30c6eb2 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c
@@ -7,14 +7,14 @@
// RUN: %clang -x c -fsanitize=implicit-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
// RUN: %clang -x c -fsanitize=implicit-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
-// RUN: %clang -x c++ -fsanitize=implicit-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
+// RUN: %clangxx -x c++ -fsanitize=implicit-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
#include <stdint.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-incdec.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-incdec.c
index 4806efb..24c01a5 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-incdec.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-incdec.c
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=implicit-signed-integer-truncation -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
// RUN: %clang -x c -fsanitize=implicit-signed-integer-truncation -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK
void test_unsigned() {
unsigned char x;
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c
index 75fe2e0..60fc48b 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c
@@ -7,14 +7,14 @@
// RUN: %clang -x c -fsanitize=implicit-signed-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
// RUN: %clang -x c -fsanitize=implicit-signed-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
-// RUN: %clang -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V0
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V1
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V2
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V3
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V4
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V5
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V6
+// RUN: %clangxx -x c++ -fsanitize=implicit-signed-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" --check-prefixes=CHECK-V7
#include <stdint.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c
index 44ed360..20c1091 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c
@@ -7,14 +7,14 @@
// RUN: %clang -x c -fsanitize=implicit-unsigned-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V6,CHECK
// RUN: %clang -x c -fsanitize=implicit-unsigned-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V7,CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V0,CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V1,CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V2,CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V5,CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V6,CHECK
-// RUN: %clang -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V7,CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV0 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V0,CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV1 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V1,CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV2 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V2,CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV3 -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV4 -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV5 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V5,CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV6 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V6,CHECK
+// RUN: %clangxx -x c++ -fsanitize=implicit-unsigned-integer-truncation %s -DV7 -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-V7,CHECK
#include <stdint.h>
#include <stdio.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-lvalue.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-lvalue.cpp
index e0a839d..9a8f32c 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-lvalue.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-lvalue.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-paramvar.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-paramvar.cpp
index 4e745efe..edfa93d 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-paramvar.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-align_value-on-paramvar.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function-variable.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function-variable.cpp
index 98ee103..4a81484 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function-variable.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function-variable.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function.cpp
index b9a9d12..b442917 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-alloc_align-on-function.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function-two-params.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function-two-params.cpp
index 4c0c926..95ec1f4 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function-two-params.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function-two-params.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function.cpp
index 1fcb818..8921cd5 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-attribute-assume_aligned-on-function.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params-variable.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params-variable.cpp
index 99624cd..2a696a4 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params-variable.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params-variable.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params.cpp
index 09f1983..ecc7816 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-three-params.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-two-params.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-two-params.cpp
index 567b4a8..379f848 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-two-params.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-builtin_assume_aligned-two-params.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-ignorelist.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-ignorelist.cpp
index 6c55aa1..3f9a1ce 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-ignorelist.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-ignorelist.cpp
@@ -1,9 +1,9 @@
-// RUN: %clang -fsanitize=alignment -fno-sanitize-recover=alignment -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption "
+// RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption "
// RUN: rm -f %tmp
// RUN: echo "[alignment]" >> %tmp
// RUN: echo "fun:main" >> %tmp
-// RUN: %clang -fsanitize=alignment -fno-sanitize-recover=alignment -fsanitize-ignorelist=%tmp -O0 %s -o %t && %run %t 2>&1
+// RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment -fsanitize-ignorelist=%tmp -O0 %s -o %t && %run %t 2>&1
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-openmp.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-openmp.cpp
index 60db197..f63f5e0 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-openmp.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/align-assume-openmp.cpp
@@ -3,10 +3,10 @@
// RUN: %clang -x c -fsanitize=alignment -fopenmp-simd -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
// RUN: %clang -x c -fsanitize=alignment -fopenmp-simd -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
-// RUN: %clang -x c++ -fsanitize=alignment -fopenmp-simd -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -fopenmp-simd -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -fopenmp-simd -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -fopenmp-simd -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
+// RUN: %clangxx -x c++ -fsanitize=alignment -fopenmp-simd -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption " --implicit-check-not="note:" --implicit-check-not="runtime error:"
#include <stdlib.h>
diff --git a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp
index e1fd533..5cbabf1 100644
--- a/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp
+++ b/third_party/llvm-project/compiler-rt/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp
@@ -3,20 +3,20 @@
// RUN: %clang -x c -fsanitize=pointer-overflow -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB-C
// RUN: %clang -x c -fsanitize=pointer-overflow -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB-C
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK
// RUN: %clang -x c -fsanitize=pointer-overflow -O0 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
// RUN: %clang -x c -fsanitize=pointer-overflow -O1 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
// RUN: %clang -x c -fsanitize=pointer-overflow -O2 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
// RUN: %clang -x c -fsanitize=pointer-overflow -O3 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O0 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O1 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O2 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
-// RUN: %clang -x c++ -fsanitize=pointer-overflow -O3 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O0 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O1 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O2 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
+// RUN: %clangxx -x c++ -fsanitize=pointer-overflow -O3 %s -o %t && %run %t I_AM_UB 2>&1 | FileCheck %s --implicit-check-not="runtime error:" --check-prefix=CHECK-UB
#include <stdint.h>
#include <stdio.h>
diff --git a/third_party/llvm-project/compiler-rt/www/index.html b/third_party/llvm-project/compiler-rt/www/index.html
index cc772c8..eaeb490 100644
--- a/third_party/llvm-project/compiler-rt/www/index.html
+++ b/third_party/llvm-project/compiler-rt/www/index.html
@@ -38,7 +38,7 @@
<ul>
<li><a href="https://clang.llvm.org/docs/AddressSanitizer.html">AddressSanitizer</a></li>
<li><a href="https://clang.llvm.org/docs/ThreadSanitizer.html">ThreadSanitizer</a></li>
- <li><a href="https://clang.llvm.org/docs/UsersManual.html#opt-fsanitize-undefined">UndefinedBehaviorSanitizer</a></li>
+ <li><a href="https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html">UndefinedBehaviorSanitizer</a></li>
<li><a href="https://clang.llvm.org/docs/MemorySanitizer.html">MemorySanitizer</a></li>
<li><a href="https://clang.llvm.org/docs/LeakSanitizer.html">LeakSanitizer</a></li>
<li><a href="https://clang.llvm.org/docs/DataFlowSanitizer.html">DataFlowSanitizer</a></li>
diff --git a/third_party/llvm-project/libcxx/.clang-format b/third_party/llvm-project/libcxx/.clang-format
index 77ffa23..acf987d 100644
--- a/third_party/llvm-project/libcxx/.clang-format
+++ b/third_party/llvm-project/libcxx/.clang-format
@@ -37,7 +37,6 @@
'_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
'_LIBCPP_HIDE_FROM_ABI_AFTER_V1',
'_LIBCPP_INLINE_VISIBILITY',
- '_LIBCPP_CONSTEVAL',
'_LIBCPP_NOALIAS',
'_LIBCPP_USING_IF_EXISTS',
'_LIBCPP_DEPRECATED',
@@ -77,10 +76,6 @@
PointerAlignment: Left
-# Disable formatting options which may break tests.
-SortIncludes: false
-ReflowComments: false
-
# libc++'s preferred indentions of preprocessor statements.
IndentPPDirectives: AfterHash
diff --git a/third_party/llvm-project/libcxx/.clang-tidy b/third_party/llvm-project/libcxx/.clang-tidy
index 4bc25c3..8f7cef9 100644
--- a/third_party/llvm-project/libcxx/.clang-tidy
+++ b/third_party/llvm-project/libcxx/.clang-tidy
@@ -46,6 +46,10 @@
value: __
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
+ - key: readability-identifier-naming.LocalVariableCase
+ value: lower_case
+ - key: readability-identifier-naming.LocalVariablePrefix
+ value: __
# TODO: investigate these checks
# bugprone-branch-clone,
diff --git a/third_party/llvm-project/libcxx/BUILD.gn b/third_party/llvm-project/libcxx/BUILD.gn
index 0c80cac..d40ed65 100644
--- a/third_party/llvm-project/libcxx/BUILD.gn
+++ b/third_party/llvm-project/libcxx/BUILD.gn
@@ -16,7 +16,7 @@
cflags = [ "-nostdinc" ]
cflags_cc = [
- "-std=c++17",
+ "-std=c++20",
"-nostdinc++",
"-fvisibility-inlines-hidden",
"-fms-compatibility-version=19.00",
@@ -57,6 +57,7 @@
}
static_library("cxx") {
+
sources = [
"src/algorithm.cpp",
"src/any.cpp",
@@ -88,6 +89,7 @@
"src/valarray.cpp",
"src/variant.cpp",
"src/vector.cpp",
+ "src/verbose_abort.cpp",
# src/atomic.cpp is omitted because this file breaks the build.
@@ -106,12 +108,11 @@
# src/random_shuffle.cpp are unneeded. These require replacing C++20's
# "constinit" with "_LIBCPP_CONSTINIT".
- # src/barrier.cpp, src/debug.cpp, src/legacy_pointer_safety.cpp, and
- # src/verbose_abort.cpp are unneeded.
+ # src/barrier.cpp, src/debug.cpp, src/legacy_pointer_safety.cpp are unneeded.
]
configs += [ ":cxx_config" ]
-
+ configs -= ["//starboard/build/config:default_cpp_standard"]
deps = [
"//starboard:starboard_headers_only",
"//starboard/common",
diff --git a/third_party/llvm-project/libcxx/CMakeLists.txt b/third_party/llvm-project/libcxx/CMakeLists.txt
index f3b2c10..cf572af 100644
--- a/third_party/llvm-project/libcxx/CMakeLists.txt
+++ b/third_party/llvm-project/libcxx/CMakeLists.txt
@@ -12,6 +12,7 @@
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../runtimes/cmake/Modules"
"${LLVM_COMMON_CMAKE_UTILS}"
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
)
@@ -23,6 +24,7 @@
set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
include(GNUInstallDirs)
+include(WarningFlags)
# Require out of source build.
include(MacroEnsureOutOfSourceBuild)
@@ -464,7 +466,7 @@
# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'
if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
- add_target_flags_if_supported("-mdefault-visibility-export-mapping=explicit")
+ add_flags_if_supported("-mdefault-visibility-export-mapping=explicit")
set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF)
endif()
@@ -538,15 +540,15 @@
target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility=hidden)
endif()
- if (LIBCXX_CONFIGURE_IDE)
- # This simply allows IDE to process <experimental/coroutine>
- target_add_compile_flags_if_supported(${target} PRIVATE -fcoroutines-ts)
- endif()
-
# Let the library headers know they are currently being used to build the
# library.
target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY)
+ # Make sure the library can be build without transitive includes. This makes
+ # it easier to upgrade the library to a newer language standard without build
+ # errors.
+ target_compile_definitions(${target} PRIVATE -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
+
if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
endif()
@@ -562,65 +564,6 @@
target_compile_options(${target} PUBLIC "${LIBCXX_ADDITIONAL_COMPILE_FLAGS}")
endfunction()
-# Warning flags ===============================================================
-function(cxx_add_warning_flags target)
- target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
- if (MSVC)
- # -W4 is the cl.exe/clang-cl equivalent of -Wall. (In cl.exe and clang-cl,
- # -Wall is equivalent to -Weverything in GCC style compiler drivers.)
- target_add_compile_flags_if_supported(${target} PRIVATE -W4)
- else()
- target_add_compile_flags_if_supported(${target} PRIVATE -Wall)
- endif()
- target_add_compile_flags_if_supported(${target} PRIVATE -Wextra -W -Wwrite-strings
- -Wno-unused-parameter -Wno-long-long
- -Werror=return-type -Wextra-semi -Wundef
- -Wformat-nonliteral)
- if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- target_add_compile_flags_if_supported(${target} PRIVATE
- -Wno-user-defined-literals
- -Wno-covered-switch-default
- -Wno-suggest-override
- )
- if (LIBCXX_TARGETING_CLANG_CL)
- target_add_compile_flags_if_supported(${target} PRIVATE
- -Wno-c++98-compat
- -Wno-c++98-compat-pedantic
- -Wno-c++11-compat
- -Wno-undef
- -Wno-reserved-id-macro
- -Wno-gnu-include-next
- -Wno-gcc-compat # For ignoring "'diagnose_if' is a clang extension" warnings
- -Wno-zero-as-null-pointer-constant # FIXME: Remove this and fix all occurrences.
- -Wno-deprecated-dynamic-exception-spec # For auto_ptr
- -Wno-sign-conversion
- -Wno-old-style-cast
- -Wno-deprecated # FIXME: Remove this and fix all occurrences.
- -Wno-shift-sign-overflow # FIXME: Why do we need this with clang-cl but not clang?
- -Wno-double-promotion # FIXME: remove me
- )
- endif()
- elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- target_add_compile_flags_if_supported(${target} PRIVATE
- -Wno-attributes
- -Wno-literal-suffix
- -Wno-c++14-compat
- -Wno-noexcept-type
- -Wno-suggest-override)
- endif()
- if (LIBCXX_ENABLE_WERROR)
- target_add_compile_flags_if_supported(${target} PRIVATE -Werror)
- target_add_compile_flags_if_supported(${target} PRIVATE -WX)
- else()
- # TODO(EricWF) Remove this. We shouldn't be suppressing errors when -Werror is
- # added elsewhere.
- target_add_compile_flags_if_supported(${target} PRIVATE -Wno-error)
- endif()
- if (LIBCXX_ENABLE_PEDANTIC)
- target_add_compile_flags_if_supported(${target} PRIVATE -pedantic)
- endif()
-endfunction()
-
# Exception flags =============================================================
function(cxx_add_exception_flags target)
if (LIBCXX_ENABLE_EXCEPTIONS)
@@ -903,7 +846,7 @@
# Setup all common build flags =================================================
function(cxx_add_common_build_flags target)
cxx_add_basic_build_flags(${target})
- cxx_add_warning_flags(${target})
+ cxx_add_warning_flags(${target} ${LIBCXX_ENABLE_WERROR} ${LIBCXX_ENABLE_PEDANTIC})
cxx_add_windows_flags(${target})
cxx_add_exception_flags(${target})
cxx_add_rtti_flags(${target})
diff --git a/third_party/llvm-project/libcxx/METADATA b/third_party/llvm-project/libcxx/METADATA
index b067d6c..88b9508 100644
--- a/third_party/llvm-project/libcxx/METADATA
+++ b/third_party/llvm-project/libcxx/METADATA
@@ -1,21 +1,26 @@
name: "libcxx"
description:
- "Filtered subtree at third_party/llvm-project/libcxx."
+ "Subdirectory subtree of llvm-project."
third_party {
identifier {
type: "ChromiumVersion"
- value: "111.0.5563.150" # from https://chromereleases.googleblog.com/2023/03/stable-channel-update-for-chromeos_29.html
+ value: "114.0.5735.351"
}
identifier {
type: "Git"
- value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git"
- version: "1127c78cf90cf253be614a1e1d3645da57edbeb4"
- # from https://chromium.googlesource.com/chromium/src/+/111.0.5563.150/DEPS#486
+ value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project"
+ version: "27f27d15f6c90b026eca23b8ee238fdbf772fd80"
+ # from https://chromium.googlesource.com/chromium/src/+/refs/tags/114.0.5735.351/tools/clang/scripts/update.py#38
+ closest_version: "llvmorg-17-init-8029-g27f27d15"
+ }
+ identifier {
+ type: "UpstreamSubdir"
+ value: "libcxx"
}
last_upgrade_date {
- year: 2023
- month: 1
- day: 17
+ year: 2024
+ month: 2
+ day: 21
}
}
diff --git a/third_party/llvm-project/libcxx/benchmarks/CMakeLists.txt b/third_party/llvm-project/libcxx/benchmarks/CMakeLists.txt
index 7eb76ac..bf7c4b4 100644
--- a/third_party/llvm-project/libcxx/benchmarks/CMakeLists.txt
+++ b/third_party/llvm-project/libcxx/benchmarks/CMakeLists.txt
@@ -107,7 +107,7 @@
add_library( cxx-benchmarks-flags-libcxx INTERFACE)
target_link_libraries( cxx-benchmarks-flags-libcxx INTERFACE cxx-benchmarks-flags)
target_compile_options(cxx-benchmarks-flags-libcxx INTERFACE ${SANITIZER_FLAGS} -Wno-user-defined-literals -Wno-suggest-override)
-target_link_options( cxx-benchmarks-flags-libcxx INTERFACE -nodefaultlibs "-L${BENCHMARK_LIBCXX_INSTALL}/lib" ${SANITIZER_FLAGS})
+target_link_options( cxx-benchmarks-flags-libcxx INTERFACE -nodefaultlibs "-L${BENCHMARK_LIBCXX_INSTALL}/lib" "-L${BENCHMARK_LIBCXX_INSTALL}/lib64" ${SANITIZER_FLAGS})
set(libcxx_benchmark_targets)
@@ -158,9 +158,11 @@
#==============================================================================
set(BENCHMARK_TESTS
algorithms.partition_point.bench.cpp
+ algorithms/equal.bench.cpp
algorithms/lower_bound.bench.cpp
algorithms/make_heap.bench.cpp
algorithms/make_heap_then_sort_heap.bench.cpp
+ algorithms/min.bench.cpp
algorithms/min_max_element.bench.cpp
algorithms/pop_heap.bench.cpp
algorithms/push_heap.bench.cpp
@@ -174,6 +176,7 @@
algorithms/sort.bench.cpp
algorithms/sort_heap.bench.cpp
algorithms/stable_sort.bench.cpp
+ libcxxabi/dynamic_cast.bench.cpp
allocation.bench.cpp
deque.bench.cpp
deque_iterator.bench.cpp
@@ -186,6 +189,7 @@
formatter_int.bench.cpp
function.bench.cpp
join_view.bench.cpp
+ lexicographical_compare_three_way.bench.cpp
map.bench.cpp
monotonic_buffer.bench.cpp
ordered_set.bench.cpp
diff --git a/third_party/llvm-project/libcxx/benchmarks/algorithms/equal.bench.cpp b/third_party/llvm-project/libcxx/benchmarks/algorithms/equal.bench.cpp
new file mode 100644
index 0000000..6d63d8c
--- /dev/null
+++ b/third_party/llvm-project/libcxx/benchmarks/algorithms/equal.bench.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <algorithm>
+#include <benchmark/benchmark.h>
+#include <vector>
+
+static void bm_equal_iter(benchmark::State& state) {
+ std::vector<char> vec1(state.range(), '1');
+ std::vector<char> vec2(state.range(), '1');
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(vec1);
+ benchmark::DoNotOptimize(vec2);
+ benchmark::DoNotOptimize(std::equal(vec1.begin(), vec1.end(), vec2.begin()));
+ }
+}
+BENCHMARK(bm_equal_iter)->DenseRange(1, 8)->Range(16, 1 << 20);
+
+static void bm_equal(benchmark::State& state) {
+ std::vector<char> vec1(state.range(), '1');
+ std::vector<char> vec2(state.range(), '1');
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(vec1);
+ benchmark::DoNotOptimize(vec2);
+ benchmark::DoNotOptimize(std::equal(vec1.begin(), vec1.end(), vec2.begin(), vec2.end()));
+ }
+}
+BENCHMARK(bm_equal)->DenseRange(1, 8)->Range(16, 1 << 20);
+
+static void bm_ranges_equal(benchmark::State& state) {
+ std::vector<char> vec1(state.range(), '1');
+ std::vector<char> vec2(state.range(), '1');
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(vec1);
+ benchmark::DoNotOptimize(vec2);
+ benchmark::DoNotOptimize(std::ranges::equal(vec1, vec2));
+ }
+}
+BENCHMARK(bm_ranges_equal)->DenseRange(1, 8)->Range(16, 1 << 20);
+
+BENCHMARK_MAIN();
diff --git a/third_party/llvm-project/libcxx/benchmarks/algorithms/min.bench.cpp b/third_party/llvm-project/libcxx/benchmarks/algorithms/min.bench.cpp
new file mode 100644
index 0000000..1e1dd4e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/benchmarks/algorithms/min.bench.cpp
@@ -0,0 +1,70 @@
+#include <algorithm>
+#include <cassert>
+
+#include <benchmark/benchmark.h>
+
+void run_sizes(auto benchmark) {
+ benchmark->Arg(1)
+ ->Arg(2)
+ ->Arg(3)
+ ->Arg(4)
+ ->Arg(5)
+ ->Arg(6)
+ ->Arg(7)
+ ->Arg(8)
+ ->Arg(9)
+ ->Arg(10)
+ ->Arg(11)
+ ->Arg(12)
+ ->Arg(13)
+ ->Arg(14)
+ ->Arg(15)
+ ->Arg(16)
+ ->Arg(17)
+ ->Arg(18)
+ ->Arg(19)
+ ->Arg(20)
+ ->Arg(21)
+ ->Arg(22)
+ ->Arg(23)
+ ->Arg(24)
+ ->Arg(25)
+ ->Arg(26)
+ ->Arg(27)
+ ->Arg(28)
+ ->Arg(29)
+ ->Arg(30)
+ ->Arg(31)
+ ->Arg(32)
+ ->Arg(64)
+ ->Arg(512)
+ ->Arg(1024)
+ ->Arg(4000)
+ ->Arg(4096)
+ ->Arg(5500)
+ ->Arg(64000)
+ ->Arg(65536)
+ ->Arg(70000);
+}
+
+template <class T>
+static void BM_std_min(benchmark::State& state) {
+ std::vector<T> vec(state.range(), 3);
+
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(vec);
+ benchmark::DoNotOptimize(std::ranges::min(vec));
+ }
+}
+BENCHMARK(BM_std_min<char>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<short>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<int>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<long long>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<__int128>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<unsigned char>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<unsigned short>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<unsigned int>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<unsigned long long>)->Apply(run_sizes);
+BENCHMARK(BM_std_min<unsigned __int128>)->Apply(run_sizes);
+
+BENCHMARK_MAIN();
diff --git a/third_party/llvm-project/libcxx/benchmarks/lexicographical_compare_three_way.bench.cpp b/third_party/llvm-project/libcxx/benchmarks/lexicographical_compare_three_way.bench.cpp
new file mode 100644
index 0000000..e58134a
--- /dev/null
+++ b/third_party/llvm-project/libcxx/benchmarks/lexicographical_compare_three_way.bench.cpp
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <algorithm>
+
+#include "benchmark/benchmark.h"
+#include "test_iterators.h"
+
+static void BM_lexicographical_compare_three_way_slow_path(benchmark::State& state) {
+ auto size = state.range(0);
+ std::vector<int> v1;
+ v1.resize(size);
+ // v2 is identical except for the last value.
+ // This means, that `lexicographical_compare_three_way` actually has to
+ // compare the complete vector and cannot bail out early.
+ std::vector<int> v2 = v1;
+ v2.back() += 1;
+ int* b1 = v1.data();
+ int* e1 = b1 + v1.size();
+ int* b2 = v2.data();
+ int* e2 = b2 + v2.size();
+
+ for (auto _ : state) {
+ auto cmp = std::compare_three_way();
+ benchmark::DoNotOptimize(std::__lexicographical_compare_three_way_slow_path(b1, e1, b2, e2, cmp));
+ }
+}
+
+BENCHMARK(BM_lexicographical_compare_three_way_slow_path)->RangeMultiplier(4)->Range(1, 1 << 20);
+
+static void BM_lexicographical_compare_three_way_fast_path(benchmark::State& state) {
+ auto size = state.range(0);
+ std::vector<int> v1;
+ v1.resize(size);
+ // v2 is identical except for the last value.
+ // This means, that `lexicographical_compare_three_way` actually has to
+ // compare the complete vector and cannot bail out early.
+ std::vector<int> v2 = v1;
+ v2.back() += 1;
+ int* b1 = v1.data();
+ int* e1 = b1 + v1.size();
+ int* b2 = v2.data();
+ int* e2 = b2 + v2.size();
+
+ for (auto _ : state) {
+ auto cmp = std::compare_three_way();
+ benchmark::DoNotOptimize(std::__lexicographical_compare_three_way_fast_path(b1, e1, b2, e2, cmp));
+ }
+}
+
+BENCHMARK(BM_lexicographical_compare_three_way_fast_path)->RangeMultiplier(4)->Range(1, 1 << 20);
+
+template <class IteratorT>
+static void BM_lexicographical_compare_three_way(benchmark::State& state) {
+ auto size = state.range(0);
+ std::vector<int> v1;
+ v1.resize(size);
+ // v2 is identical except for the last value.
+ // This means, that `lexicographical_compare_three_way` actually has to
+ // compare the complete vector and cannot bail out early.
+ std::vector<int> v2 = v1;
+ v2.back() += 1;
+ auto b1 = IteratorT{v1.data()};
+ auto e1 = IteratorT{v1.data() + v1.size()};
+ auto b2 = IteratorT{v2.data()};
+ auto e2 = IteratorT{v2.data() + v2.size()};
+
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(std::lexicographical_compare_three_way(b1, e1, b2, e2));
+ }
+}
+
+// Type alias to make sure the `*` does not appear in the benchmark name.
+// A `*` would confuse the Python test runner running this google benchmark.
+using IntPtr = int*;
+
+// `lexicographical_compare_three_way` has a fast path for random access iterators.
+BENCHMARK_TEMPLATE(BM_lexicographical_compare_three_way, IntPtr)->RangeMultiplier(4)->Range(1, 1 << 20);
+BENCHMARK_TEMPLATE(BM_lexicographical_compare_three_way, random_access_iterator<IntPtr>)
+ ->RangeMultiplier(4)
+ ->Range(1, 1 << 20);
+BENCHMARK_TEMPLATE(BM_lexicographical_compare_three_way, cpp17_input_iterator<IntPtr>)
+ ->RangeMultiplier(4)
+ ->Range(1, 1 << 20);
+
+int main(int argc, char** argv) {
+ benchmark::Initialize(&argc, argv);
+ if (benchmark::ReportUnrecognizedArguments(argc, argv))
+ return 1;
+
+ benchmark::RunSpecifiedBenchmarks();
+}
diff --git a/third_party/llvm-project/libcxx/benchmarks/libcxxabi/dynamic_cast.bench.cpp b/third_party/llvm-project/libcxx/benchmarks/libcxxabi/dynamic_cast.bench.cpp
new file mode 100644
index 0000000..439eea8
--- /dev/null
+++ b/third_party/llvm-project/libcxx/benchmarks/libcxxabi/dynamic_cast.bench.cpp
@@ -0,0 +1,172 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstddef>
+
+#include "benchmark/benchmark.h"
+
+template <std::size_t Depth>
+struct Chain : Chain<Depth - 1> {};
+
+template <>
+struct Chain<0> {
+ virtual ~Chain() noexcept = default;
+};
+
+template <std::size_t Index, std::size_t Depth>
+struct Dag : Dag<Index, Depth - 1>, Dag<Index + 1, Depth - 1> {};
+
+template <std::size_t Index>
+struct Dag<Index, 0> {
+ virtual ~Dag() noexcept = default;
+};
+
+template <std::size_t Depth>
+struct VChain : virtual VChain<Depth - 1> {};
+
+template <>
+struct VChain<0> {
+ virtual ~VChain() noexcept = default;
+};
+
+template <std::size_t Index, std::size_t Depth>
+struct VDag : virtual VDag<Index, Depth - 1>, virtual VDag<Index + 1, Depth - 1> {};
+
+template <std::size_t Index>
+struct VDag<Index, 0> {
+ virtual ~VDag() noexcept = default;
+};
+
+template <typename Dyn, typename From, typename To = Dyn>
+static void DynCast(benchmark::State& state) {
+ Dyn obj;
+ From* from_ptr = &obj;
+ for (auto _ : state) {
+ To* to_ptr = dynamic_cast<To*>(from_ptr);
+ benchmark::DoNotOptimize(to_ptr);
+ }
+}
+
+static void StaticCast(benchmark::State& state) {
+ Chain<9> obj;
+ Chain<0>* from_ptr = &obj;
+ for (auto _ : state) {
+ Chain<9>* to_ptr = static_cast<Chain<9>*>(from_ptr);
+ benchmark::DoNotOptimize(to_ptr);
+ }
+}
+
+// Downcast along a chain from base to the most derived type
+BENCHMARK(DynCast<Chain<1>, Chain<0>>)->Name("Chain, 1 level");
+BENCHMARK(DynCast<Chain<2>, Chain<0>>)->Name("Chain, 2 levels");
+BENCHMARK(DynCast<Chain<3>, Chain<0>>)->Name("Chain, 3 levels");
+BENCHMARK(DynCast<Chain<4>, Chain<0>>)->Name("Chain, 4 levels");
+BENCHMARK(DynCast<Chain<5>, Chain<0>>)->Name("Chain, 5 levels");
+BENCHMARK(DynCast<Chain<6>, Chain<0>>)->Name("Chain, 6 levels");
+BENCHMARK(DynCast<Chain<7>, Chain<0>>)->Name("Chain, 7 levels");
+BENCHMARK(DynCast<Chain<8>, Chain<0>>)->Name("Chain, 8 levels");
+BENCHMARK(DynCast<Chain<9>, Chain<0>>)->Name("Chain, 9 levels");
+
+// Downcast along a chain from base to the middle of the chain
+BENCHMARK(DynCast<Chain<2>, Chain<0>, Chain<1>>)->Name("Chain middle, 1 level");
+BENCHMARK(DynCast<Chain<4>, Chain<0>, Chain<2>>)->Name("Chain middle, 2 levels");
+BENCHMARK(DynCast<Chain<6>, Chain<0>, Chain<3>>)->Name("Chain middle, 3 levels");
+BENCHMARK(DynCast<Chain<8>, Chain<0>, Chain<4>>)->Name("Chain middle, 4 levels");
+
+// Downcast along a chain that fails
+BENCHMARK(DynCast<Chain<1>, Chain<0>, Chain<9>>)->Name("Chain fail, 1 level");
+BENCHMARK(DynCast<Chain<2>, Chain<0>, Chain<9>>)->Name("Chain fail, 2 levels");
+BENCHMARK(DynCast<Chain<3>, Chain<0>, Chain<9>>)->Name("Chain fail, 3 levels");
+BENCHMARK(DynCast<Chain<4>, Chain<0>, Chain<9>>)->Name("Chain fail, 4 levels");
+BENCHMARK(DynCast<Chain<5>, Chain<0>, Chain<9>>)->Name("Chain fail, 5 levels");
+BENCHMARK(DynCast<Chain<6>, Chain<0>, Chain<9>>)->Name("Chain fail, 6 levels");
+BENCHMARK(DynCast<Chain<7>, Chain<0>, Chain<9>>)->Name("Chain fail, 7 levels");
+BENCHMARK(DynCast<Chain<8>, Chain<0>, Chain<9>>)->Name("Chain fail, 8 levels");
+
+// Downcast along a virtual inheritance chain from base to the most derived type
+BENCHMARK(DynCast<VChain<1>, VChain<0>>)->Name("VChain, 1 level");
+BENCHMARK(DynCast<VChain<2>, VChain<0>>)->Name("VChain, 2 levels");
+BENCHMARK(DynCast<VChain<3>, VChain<0>>)->Name("VChain, 3 levels");
+BENCHMARK(DynCast<VChain<4>, VChain<0>>)->Name("VChain, 4 levels");
+BENCHMARK(DynCast<VChain<5>, VChain<0>>)->Name("VChain, 5 levels");
+
+// Downcast along a virtual inheritance chain from base to the middle of the chain
+BENCHMARK(DynCast<VChain<2>, VChain<0>, VChain<1>>)->Name("VChain middle, 1 level");
+BENCHMARK(DynCast<VChain<4>, VChain<0>, VChain<2>>)->Name("VChain middle, 2 levels");
+BENCHMARK(DynCast<VChain<6>, VChain<0>, VChain<3>>)->Name("VChain middle, 3 levels");
+BENCHMARK(DynCast<VChain<8>, VChain<0>, VChain<4>>)->Name("VChain middle, 4 levels");
+
+// Downcast along a virtual chain that fails
+BENCHMARK(DynCast<VChain<1>, VChain<0>, VChain<8>>)->Name("VChain fail, 1 level");
+BENCHMARK(DynCast<VChain<2>, VChain<0>, VChain<8>>)->Name("VChain fail, 2 levels");
+BENCHMARK(DynCast<VChain<3>, VChain<0>, VChain<8>>)->Name("VChain fail, 3 levels");
+BENCHMARK(DynCast<VChain<4>, VChain<0>, VChain<8>>)->Name("VChain fail, 4 levels");
+BENCHMARK(DynCast<VChain<5>, VChain<0>, VChain<8>>)->Name("VChain fail, 5 levels");
+
+// Downcast along a DAG from base to the most derived type
+BENCHMARK(DynCast<Dag<0, 3>, Dag<3, 0>>)->Name("DAG rightmost, 3 levels");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<4, 0>>)->Name("DAG rightmost, 4 levels");
+BENCHMARK(DynCast<Dag<0, 5>, Dag<5, 0>>)->Name("DAG rightmost, 5 levels");
+BENCHMARK(DynCast<Dag<0, 3>, Dag<0, 0>>)->Name("DAG leftmost, 3 levels");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<0, 0>>)->Name("DAG leftmost, 4 levels");
+BENCHMARK(DynCast<Dag<0, 5>, Dag<0, 0>>)->Name("DAG leftmost, 5 levels");
+
+// Downcast along a DAG from base to the middle of the DAG
+BENCHMARK(DynCast<Dag<0, 4>, Dag<4, 0>, Dag<3, 1>>)->Name("DAG rightmost middle, 1 level");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<4, 0>, Dag<2, 2>>)->Name("DAG rightmost middle, 2 levels");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<4, 0>, Dag<1, 3>>)->Name("DAG rightmost middle, 3 levels");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<0, 0>, Dag<0, 1>>)->Name("DAG leftmost middle, 1 level");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<0, 0>, Dag<0, 2>>)->Name("DAG leftmost middle, 2 levels");
+BENCHMARK(DynCast<Dag<0, 4>, Dag<0, 0>, Dag<0, 3>>)->Name("DAG leftmost middle, 3 levels");
+
+// Sidecast along a DAG
+BENCHMARK(DynCast<Dag<0, 3>, Dag<3, 0>, Dag<0, 0>>)->Name("DAG sidecast, 3 levels");
+BENCHMARK(DynCast<Dag<0, 3>, Dag<2, 1>, Dag<0, 1>>)->Name("DAG sidecast, 2 levels");
+BENCHMARK(DynCast<Dag<0, 3>, Dag<1, 2>, Dag<0, 2>>)->Name("DAG sidecast, 1 level");
+
+// Sidecast along a DAG that fails
+BENCHMARK(DynCast<Dag<0, 3>, Dag<3, 0>, Dag<0, 4>>)->Name("DAG sidecast fail, 3 levels");
+BENCHMARK(DynCast<Dag<0, 3>, Dag<2, 1>, Dag<0, 4>>)->Name("DAG sidecast fail, 2 levels");
+BENCHMARK(DynCast<Dag<0, 3>, Dag<1, 2>, Dag<0, 4>>)->Name("DAG sidecast fail, 1 level");
+
+// Downcast along a virtual inheritance DAG from base to the most derived type
+BENCHMARK(DynCast<VDag<0, 3>, VDag<3, 0>>)->Name("VDAG rightmost, 3 levels");
+BENCHMARK(DynCast<VDag<0, 4>, VDag<4, 0>>)->Name("VDAG rightmost, 4 levels");
+BENCHMARK(DynCast<VDag<0, 5>, VDag<5, 0>>)->Name("VDAG rightmost, 5 levels");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<0, 0>>)->Name("VDAG leftmost, 3 levels");
+BENCHMARK(DynCast<VDag<0, 4>, VDag<0, 0>>)->Name("VDAG leftmost, 4 levels");
+BENCHMARK(DynCast<VDag<0, 5>, VDag<0, 0>>)->Name("VDAG leftmost, 5 levels");
+
+// Downcast along a virtual inheritance DAG from base to the middle of the DAG
+BENCHMARK(DynCast<VDag<0, 3>, VDag<3, 0>, VDag<2, 1>>)->Name("VDAG rightmost middle, 1 level");
+BENCHMARK(DynCast<VDag<0, 4>, VDag<4, 0>, VDag<2, 2>>)->Name("VDAG rightmost middle, 2 levels");
+BENCHMARK(DynCast<VDag<0, 5>, VDag<5, 0>, VDag<2, 3>>)->Name("VDAG rightmost middle, 3 levels");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<0, 0>, VDag<0, 1>>)->Name("VDAG leftmost middle, 1 level");
+BENCHMARK(DynCast<VDag<0, 4>, VDag<0, 0>, VDag<0, 2>>)->Name("VDAG leftmost middle, 2 levels");
+BENCHMARK(DynCast<VDag<0, 5>, VDag<0, 0>, VDag<0, 3>>)->Name("VDAG leftmost middle, 3 levels");
+
+// Sidecast along a virtual inheritance DAG
+BENCHMARK(DynCast<VDag<0, 3>, VDag<3, 0>, VDag<0, 0>>)->Name("VDAG sidecast, 3 levels");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<2, 1>, VDag<0, 1>>)->Name("VDAG sidecast, 2 levels");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<1, 2>, VDag<0, 2>>)->Name("VDAG sidecast, 1 level");
+
+// Sidecast along a virtual inheritance DAG that fails
+BENCHMARK(DynCast<VDag<0, 3>, VDag<3, 0>, VDag<0, 4>>)->Name("VDAG sidecast fail, 3 levels");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<2, 1>, VDag<0, 4>>)->Name("VDAG sidecast fail, 2 levels");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<1, 2>, VDag<0, 4>>)->Name("VDAG sidecast fail, 1 level");
+
+// Cast to complete object pointer
+BENCHMARK(DynCast<Chain<8>, Chain<0>, void>)->Name("Chain to complete");
+BENCHMARK(DynCast<VChain<5>, VChain<0>, void>)->Name("VChain to complete");
+BENCHMARK(DynCast<Dag<0, 3>, Dag<3, 0>, void>)->Name("DAG to complete");
+BENCHMARK(DynCast<VDag<0, 3>, VDag<3, 0>, void>)->Name("VDAG to complete");
+
+// Static cast as the baseline.
+BENCHMARK(StaticCast)->Name("Static");
+
+BENCHMARK_MAIN();
diff --git a/third_party/llvm-project/libcxx/cmake/Modules/HandleLibcxxFlags.cmake b/third_party/llvm-project/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
index 7251254..ffd859e 100644
--- a/third_party/llvm-project/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
+++ b/third_party/llvm-project/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
@@ -5,133 +5,10 @@
# - LIBCXX_LIBRARIES: libraries to link libc++ to.
include(CheckCXXCompilerFlag)
+include(HandleFlags)
unset(add_flag_if_supported)
-# Mangle the name of a compiler flag into a valid CMake identifier.
-# Ex: --std=c++11 -> STD_EQ_CXX11
-macro(mangle_name str output)
- string(STRIP "${str}" strippedStr)
- string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")
- string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}")
- string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}")
- string(REPLACE "-" "_" strippedStr "${strippedStr}")
- string(REPLACE ":" "_COLON_" strippedStr "${strippedStr}")
- string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}")
- string(REPLACE "+" "X" strippedStr "${strippedStr}")
- string(TOUPPER "${strippedStr}" ${output})
-endmacro()
-
-# Remove a list of flags from all CMake variables that affect compile flags.
-# This can be used to remove unwanted flags specified on the command line
-# or added in other parts of LLVM's cmake configuration.
-macro(remove_flags)
- foreach(var ${ARGN})
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS "${CMAKE_SHARED_MODULE_FLAGS}")
- remove_definitions(${var})
- endforeach()
-endmacro(remove_flags)
-
-macro(check_flag_supported flag)
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
-endmacro()
-
-macro(append_flags DEST)
- foreach(value ${ARGN})
- list(APPEND ${DEST} ${value})
- list(APPEND ${DEST} ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then append the specified list of flags to DEST
-macro(append_flags_if condition DEST)
- if (${condition})
- list(APPEND ${DEST} ${ARGN})
- endif()
-endmacro()
-
-# Add each flag in the list specified by DEST if that flag is supported by the current compiler.
-macro(append_flags_if_supported DEST)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag})
- endforeach()
-endmacro()
-
-# Add a macro definition if condition is true.
-macro(define_if condition def)
- if (${condition})
- add_definitions(${def})
- endif()
-endmacro()
-
-# Add a macro definition if condition is not true.
-macro(define_if_not condition def)
- if (NOT ${condition})
- add_definitions(${def})
- endif()
-endmacro()
-
-# Add a macro definition to the __config_site file if the specified condition
-# is 'true'. Note that '-D${def}' is not added. Instead it is expected that
-# the build include the '__config_site' header.
-macro(config_define_if condition def)
- if (${condition})
- set(${def} ON)
- endif()
-endmacro()
-
-macro(config_define_if_not condition def)
- if (NOT ${condition})
- set(${def} ON)
- endif()
-endmacro()
-
-macro(config_define value def)
- set(${def} ${value})
-endmacro()
-
-# Add a list of flags to all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS',
-# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'.
-macro(add_target_flags)
- foreach(value ${ARGN})
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${value}")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${value}")
- list(APPEND LIBCXX_COMPILE_FLAGS ${value})
- list(APPEND LIBCXX_LINK_FLAGS ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then add a list of flags to
-# all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXX_COMPILE_FLAGS'
-# and 'LIBCXX_LINK_FLAGS'.
-macro(add_target_flags_if condition)
- if (${condition})
- add_target_flags(${ARGN})
- endif()
-endmacro()
-
-# Add all the flags supported by the compiler to all of
-# 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXX_COMPILE_FLAGS'
-# and 'LIBCXX_LINK_FLAGS'.
-macro(add_target_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- add_target_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
# Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' and
# 'LIBCXX_LINK_FLAGS'.
macro(add_flags)
@@ -159,31 +36,6 @@
endforeach()
endmacro()
-# Add a list of flags to 'LIBCXX_COMPILE_FLAGS'.
-macro(add_compile_flags)
- foreach(f ${ARGN})
- list(APPEND LIBCXX_COMPILE_FLAGS ${f})
- endforeach()
-endmacro()
-
-# If 'condition' is true then add the specified list of flags to
-# 'LIBCXX_COMPILE_FLAGS'
-macro(add_compile_flags_if condition)
- if (${condition})
- add_compile_flags(${ARGN})
- endif()
-endmacro()
-
-# For each specified flag, add that flag to 'LIBCXX_COMPILE_FLAGS' if the
-# flag is supported by the C++ compiler.
-macro(add_compile_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- add_compile_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
# Add a list of flags to 'LIBCXX_LINK_FLAGS'.
macro(add_link_flags)
foreach(f ${ARGN})
@@ -191,24 +43,6 @@
endforeach()
endmacro()
-# If 'condition' is true then add the specified list of flags to
-# 'LIBCXX_LINK_FLAGS'
-macro(add_link_flags_if condition)
- if (${condition})
- add_link_flags(${ARGN})
- endif()
-endmacro()
-
-# For each specified flag, add that flag to 'LIBCXX_LINK_FLAGS' if the
-# flag is supported by the C++ compiler.
-macro(add_link_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- add_link_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
# Add a list of libraries or link flags to 'LIBCXX_LIBRARIES'.
macro(add_library_flags)
foreach(lib ${ARGN})
@@ -224,11 +58,6 @@
endif()
endmacro()
-# Turn a comma separated CMake list into a space separated string.
-macro(split_list listname)
- string(REPLACE ";" " " ${listname} "${${listname}}")
-endmacro()
-
# For each specified flag, add that link flag to the provided target.
# The flags are added with the given visibility, i.e. PUBLIC|PRIVATE|INTERFACE.
function(target_add_link_flags_if_supported target visibility)
@@ -240,15 +69,3 @@
endif()
endforeach()
endfunction()
-
-# For each specified flag, add that compile flag to the provided target.
-# The flags are added with the given visibility, i.e. PUBLIC|PRIVATE|INTERFACE.
-function(target_add_compile_flags_if_supported target visibility)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- if (CXX_SUPPORTS_${flagname}_FLAG)
- target_compile_options(${target} ${visibility} ${flag})
- endif()
- endforeach()
-endfunction()
diff --git a/third_party/llvm-project/libcxx/cmake/caches/Apple.cmake b/third_party/llvm-project/libcxx/cmake/caches/Apple.cmake
index 5224e04..c9ee3b0 100644
--- a/third_party/llvm-project/libcxx/cmake/caches/Apple.cmake
+++ b/third_party/llvm-project/libcxx/cmake/caches/Apple.cmake
@@ -17,5 +17,3 @@
set(LIBCXX_TEST_CONFIG "apple-libc++-shared.cfg.in" CACHE STRING "")
set(LIBCXXABI_TEST_CONFIG "apple-libc++abi-shared.cfg.in" CACHE STRING "")
-set(LIBCXX_TEST_PARAMS "stdlib=apple-libc++" CACHE STRING "")
-set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git a/third_party/llvm-project/libcxx/cmake/caches/Generic-modules-lsv.cmake b/third_party/llvm-project/libcxx/cmake/caches/Generic-modules-lsv.cmake
new file mode 100644
index 0000000..b44424f
--- /dev/null
+++ b/third_party/llvm-project/libcxx/cmake/caches/Generic-modules-lsv.cmake
@@ -0,0 +1,2 @@
+set(LIBCXX_TEST_PARAMS "enable_modules=True;enable_modules_lsv=True" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git a/third_party/llvm-project/libcxx/docs/AddingNewCIJobs.rst b/third_party/llvm-project/libcxx/docs/AddingNewCIJobs.rst
index f9428f8..9d749c0 100644
--- a/third_party/llvm-project/libcxx/docs/AddingNewCIJobs.rst
+++ b/third_party/llvm-project/libcxx/docs/AddingNewCIJobs.rst
@@ -37,7 +37,7 @@
[...]
If you create your own agents, put them in the ``libcxx-builders`` queue and
-use agent tags to allow targetting your agents from the Buildkite pipeline
+use agent tags to allow targeting your agents from the Buildkite pipeline
config appropriately.
We try to keep the pipeline definition file as simple as possible, and to
diff --git a/third_party/llvm-project/libcxx/docs/Contributing.rst b/third_party/llvm-project/libcxx/docs/Contributing.rst
index 186ac66..8c0b3a1 100644
--- a/third_party/llvm-project/libcxx/docs/Contributing.rst
+++ b/third_party/llvm-project/libcxx/docs/Contributing.rst
@@ -31,7 +31,7 @@
Before committing or creating a review, please go through this check-list to make
sure you don't forget anything:
-- Do you have tests for every public class and/or function you're adding or modifying?
+- Do you have :ref:`tests <testing>` for every public class and/or function you're adding or modifying?
- Did you update the synopsis of the relevant headers?
- Did you update the relevant files to track implementation status (in ``docs/Status/``)?
- Did you mark all functions and type declarations with the :ref:`proper visibility macro <visibility-macros>`?
diff --git a/third_party/llvm-project/libcxx/docs/FeatureTestMacroTable.rst b/third_party/llvm-project/libcxx/docs/FeatureTestMacroTable.rst
index b46fc8c..677a719 100644
--- a/third_party/llvm-project/libcxx/docs/FeatureTestMacroTable.rst
+++ b/third_party/llvm-project/libcxx/docs/FeatureTestMacroTable.rst
@@ -260,6 +260,8 @@
------------------------------------------------- -----------------
``__cpp_lib_math_constants`` ``201907L``
------------------------------------------------- -----------------
+ ``__cpp_lib_move_iterator_concept`` ``202207L``
+ ------------------------------------------------- -----------------
``__cpp_lib_polymorphic_allocator`` ``201902L``
------------------------------------------------- -----------------
``__cpp_lib_ranges`` ``202106L``
@@ -316,13 +318,17 @@
------------------------------------------------- -----------------
``__cpp_lib_constexpr_memory`` ``202202L``
------------------------------------------------- -----------------
- ``__cpp_lib_constexpr_typeinfo`` *unimplemented*
+ ``__cpp_lib_constexpr_typeinfo`` ``202106L``
------------------------------------------------- -----------------
``__cpp_lib_expected`` ``202202L``
------------------------------------------------- -----------------
+ ``__cpp_lib_format_ranges`` ``202207L``
+ ------------------------------------------------- -----------------
+ ``__cpp_lib_formatters`` *unimplemented*
+ ------------------------------------------------- -----------------
``__cpp_lib_forward_like`` ``202207L``
------------------------------------------------- -----------------
- ``__cpp_lib_invoke_r`` *unimplemented*
+ ``__cpp_lib_invoke_r`` ``202106L``
------------------------------------------------- -----------------
``__cpp_lib_is_scoped_enum`` ``202011L``
------------------------------------------------- -----------------
@@ -332,6 +338,8 @@
------------------------------------------------- -----------------
``__cpp_lib_out_ptr`` *unimplemented*
------------------------------------------------- -----------------
+ ``__cpp_lib_ranges_as_rvalue`` ``202207L``
+ ------------------------------------------------- -----------------
``__cpp_lib_ranges_chunk`` *unimplemented*
------------------------------------------------- -----------------
``__cpp_lib_ranges_chunk_by`` *unimplemented*
diff --git a/third_party/llvm-project/libcxx/docs/ReleaseNotes.rst b/third_party/llvm-project/libcxx/docs/ReleaseNotes.rst
index 88a4859..100c3b4 100644
--- a/third_party/llvm-project/libcxx/docs/ReleaseNotes.rst
+++ b/third_party/llvm-project/libcxx/docs/ReleaseNotes.rst
@@ -37,13 +37,53 @@
Implemented Papers
------------------
+- P2520R0 - ``move_iterator<T*>`` should be a random access iterator
+- P1328R1 - ``constexpr type_info::operator==()``
+- P1413R3 - Formatting ``thread::id`` (the ``stacktrace`` is not done yet)
Improvements and New Features
-----------------------------
+- ``std::equal`` and ``std::ranges::equal`` are now forwarding to ``std::memcmp`` for integral types and pointers,
+ which can lead up to 40x performance improvements.
+
+- ``std::string_view`` now provides iterators that check for out-of-bounds accesses when the safe
+ libc++ mode is enabled.
+
+- The performance of ``dynamic_cast`` on its hot paths is greatly improved and is as efficient as the
+ ``libsupc++`` implementation. Note that the performance improvements are shipped in ``libcxxabi``.
Deprecations and Removals
-------------------------
+- The ``<experimental/coroutine>`` header has been removed in this release. The ``<coroutine>`` header
+ has been shipping since LLVM 14, so the Coroutines TS implementation is being removed per our policy
+ for removing TSes.
+
+- Several incidental transitive includes have been removed from libc++. Those
+ includes are removed based on the language version used. Incidental transitive
+ inclusions of the following headers have been removed:
+
+ - C++2b: ``atomic``, ``bit``, ``cstdint``, ``cstdlib``, ``cstring``, ``initializer_list``, ``limits``, ``new``,
+ ``stdexcept``, ``system_error``, ``type_traits``, ``typeinfo``
+
+- The headers ``<experimental/algorithm>`` and ``<experimental/functional>`` have been removed, since all the contents
+ have been implemented in namespace ``std`` for at least two releases.
+
+- The formatter specialization ``template<size_t N> struct formatter<const charT[N], charT>``
+ has been removed. Since libc++'s format library was marked experimental there
+ is no backwards compatibility option. This specialization has been removed
+ from the Standard since it was never used, the proper specialization to use
+ instead is ``template<size_t N> struct formatter<charT[N], charT>``.
+
+- Libc++ used to provide some C++11 tag type global variables in C++03 as an extension, which are removed in
+ this release. Those variables were ``std::allocator_arg``, ``std::defer_lock``, ``std::try_to_lock``,
+ ``std::adopt_lock``, and ``std::piecewise_construct``. Note that the types associated to those variables are
+ still provided in C++03 as an extension (e.g. ``std::piecewise_construct_t``). Providing those variables in
+ C++03 mode made it impossible to define them properly -- C++11 mandated that they be ``constexpr`` variables,
+ which is impossible in C++03 mode. Furthermore, C++17 mandated that they be ``inline constexpr`` variables,
+ which led to ODR violations when mixed with the C++03 definition. Cleaning this up is required for libc++ to
+ make progress on support for C++20 modules.
+
Upcoming Deprecations and Removals
----------------------------------
@@ -51,6 +91,12 @@
Please see the updated documentation about the safe libc++ mode and in particular the ``_LIBCPP_VERBOSE_ABORT``
macro for details.
+- The headers ``<experimental/deque>``, ``<experimental/forward_list>``, ``<experimental/list>``,
+ ``<experimental/map>``, ``<experimental/memory_resource>``, ``<experimental/regex>``, ``<experimental/set>``,
+ ``<experimental/string>``, ``<experimental/unordered_map>``, ``<experimental/unordered_set>``,
+ and ``<experimental/vector>`` will be removed in LLVM 18, as all their contents will have been implemented in
+ namespace ``std`` for at least two releases.
+
API Changes
-----------
@@ -59,3 +105,7 @@
Build System Changes
--------------------
+
+- Building libc++ and libc++abi for Apple platforms now requires targeting macOS 10.13 and later.
+ This is relevant for vendors building the libc++ shared library and for folks statically linking
+ libc++ into an application that has back-deployment requirements on Apple platforms.
diff --git a/third_party/llvm-project/libcxx/docs/Status/Cxx20Issues.csv b/third_party/llvm-project/libcxx/docs/Status/Cxx20Issues.csv
index db05461..c014393 100644
--- a/third_party/llvm-project/libcxx/docs/Status/Cxx20Issues.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/Cxx20Issues.csv
@@ -1,6 +1,6 @@
"Issue #","Issue Name","Meeting","Status","First released version","Labels"
"`2070 <https://wg21.link/LWG2070>`__","``allocate_shared``\ should use ``allocator_traits<A>::construct``\ ","Toronto","Resolved by `P0674R1 <https://wg21.link/P0674R1>`__",""
-"`2444 <https://wg21.link/LWG2444>`__","Inconsistent complexity for ``std::sort_heap``\ ","Toronto","",""
+"`2444 <https://wg21.link/LWG2444>`__","Inconsistent complexity for ``std::sort_heap``\ ","Toronto","|Nothing To Do|",""
"`2593 <https://wg21.link/LWG2593>`__","Moved-from state of Allocators","Toronto","",""
"`2597 <https://wg21.link/LWG2597>`__","``std::log``\ misspecified for complex numbers","Toronto","",""
"`2783 <https://wg21.link/LWG2783>`__","``stack::emplace()``\ and ``queue::emplace()``\ should return ``decltype(auto)``\ ","Toronto","|Complete|",""
@@ -76,7 +76,7 @@
"`3075 <https://wg21.link/LWG3075>`__","``basic_string``\ needs deduction guides from ``basic_string_view``\ ","Jacksonville","|Complete|",""
"","","","","",""
"`2139 <https://wg21.link/LWG2139>`__","What is a user-defined type?","Rapperswil","",""
-"`2970 <https://wg21.link/LWG2970>`__","Return type of std::visit misspecified","Rapperswil","",""
+"`2970 <https://wg21.link/LWG2970>`__","Return type of std::visit misspecified","Rapperswil","|Complete|","11.0"
"`3058 <https://wg21.link/LWG3058>`__","Parallel adjacent_difference shouldn't require creating temporaries","Rapperswil","",""
"`3062 <https://wg21.link/LWG3062>`__","Unnecessary decay_t in is_execution_policy_v should be remove_cvref_t","Rapperswil","",""
"`3067 <https://wg21.link/LWG3067>`__","recursive_directory_iterator::pop must invalidate","Rapperswil","|Nothing To Do|",""
@@ -103,7 +103,7 @@
"`2960 <https://wg21.link/LWG2960>`__","[fund.ts.v3] ``nonesuch``\ is insufficiently useless","San Diego","|Complete|",""
"`2995 <https://wg21.link/LWG2995>`__","``basic_stringbuf``\ default constructor forbids it from using SSO capacity","San Diego","",""
"`2996 <https://wg21.link/LWG2996>`__","Missing rvalue overloads for ``shared_ptr``\ operations","San Diego","",""
-"`3008 <https://wg21.link/LWG3008>`__","``make_shared``\ (sub)object destruction semantics are not specified","San Diego","",""
+"`3008 <https://wg21.link/LWG3008>`__","``make_shared``\ (sub)object destruction semantics are not specified","San Diego","|Complete|","16.0"
"`3022 <https://wg21.link/LWG3022>`__","``is_convertible<derived*, base*>``\ may lead to ODR","San Diego","Resolved by 1285R0",""
"`3025 <https://wg21.link/LWG3025>`__","Map-like container deduction guides should use ``pair<Key, T>``\ , not ``pair<const Key, T>``\ ","San Diego","|Complete|",""
"`3031 <https://wg21.link/LWG3031>`__","Algorithms and predicates with non-const reference arguments","San Diego","",""
@@ -183,7 +183,7 @@
"`3266 <https://wg21.link/LWG3266>`__","``to_chars(bool)``\ should be deleted","Belfast","|Complete|","14.0"
"`3272 <https://wg21.link/LWG3272>`__","``%I%p``\ should parse/format ``duration``\ since midnight","Belfast","","","|chrono| |format|"
"`3259 <https://wg21.link/LWG3259>`__","The definition of *constexpr iterators* should be adjusted","Belfast","|Nothing To Do|",""
-"`3103 <https://wg21.link/LWG3103>`__","Errors in taking subview of ``span``\ should be ill-formed where possible","Belfast","",""
+"`3103 <https://wg21.link/LWG3103>`__","Errors in taking subview of ``span``\ should be ill-formed where possible","Belfast","11.0","|Complete|"
"`3274 <https://wg21.link/LWG3274>`__","Missing feature test macro for ``<span>``\ ","Belfast","|Complete|","11.0"
"`3276 <https://wg21.link/LWG3276>`__","Class ``split_view::outer_iterator::value_type``\ should inherit from ``view_interface``\ ","Belfast","|Complete|","15.0","|ranges|"
"`3277 <https://wg21.link/LWG3277>`__","Pre-increment on prvalues is not a requirement of ``weakly_incrementable``\ ","Belfast","|Nothing To Do|","","|ranges|"
@@ -262,13 +262,13 @@
"`3347 <https://wg21.link/LWG3347>`__","``std::pair<T, U>``\ now requires ``T``\ and ``U``\ to be less-than-comparable","Prague","",""
"`3348 <https://wg21.link/LWG3348>`__","``__cpp_lib_unwrap_ref``\ in wrong header","Prague","|Complete|","12.0"
"`3349 <https://wg21.link/LWG3349>`__","Missing ``__cpp_lib_constexpr_complex``\ for P0415R1","Prague","|Complete|","16.0"
-"`3350 <https://wg21.link/LWG3350>`__","Simplify return type of ``lexicographical_compare_three_way``\ ","Prague","","","|spaceship|"
+"`3350 <https://wg21.link/LWG3350>`__","Simplify return type of ``lexicographical_compare_three_way``\ ","Prague","|Complete|","17.0","|spaceship|"
"`3351 <https://wg21.link/LWG3351>`__","``ranges::enable_safe_range``\ should not be constrained","Prague","|Complete|","15.0","|ranges|"
"`3352 <https://wg21.link/LWG3352>`__","``strong_equality``\ isn't a thing","Prague","|Nothing To Do|","","|spaceship|"
"`3354 <https://wg21.link/LWG3354>`__","``has_strong_structural_equality``\ has a meaningless definition","Prague","|Nothing To Do|","","|spaceship|"
"`3355 <https://wg21.link/LWG3355>`__","The memory algorithms should support move-only input iterators introduced by P1207","Prague","|Complete|","15.0","|ranges|"
"`3356 <https://wg21.link/LWG3356>`__","``__cpp_lib_nothrow_convertible``\ should be ``__cpp_lib_is_nothrow_convertible``\ ","Prague","|Complete|","12.0"
-"`3358 <https://wg21.link/LWG3358>`__","|sect|\ [span.cons] is mistaken that ``to_address``\ can throw","Prague","",""
+"`3358 <https://wg21.link/LWG3358>`__","|sect|\ [span.cons] is mistaken that ``to_address``\ can throw","Prague","|Complete|","17.0"
"`3359 <https://wg21.link/LWG3359>`__","``<chrono>``\ leap second support should allow for negative leap seconds","Prague","","","|chrono|"
"`3360 <https://wg21.link/LWG3360>`__","``three_way_comparable_with``\ is inconsistent with similar concepts","Prague","|Nothing To Do|","","|spaceship|"
"`3362 <https://wg21.link/LWG3362>`__","Strike ``stop_source``\ 's ``operator!=``\ ","Prague","",""
diff --git a/third_party/llvm-project/libcxx/docs/Status/Cxx2b.rst b/third_party/llvm-project/libcxx/docs/Status/Cxx2b.rst
index e79ed28..df915d8 100644
--- a/third_party/llvm-project/libcxx/docs/Status/Cxx2b.rst
+++ b/third_party/llvm-project/libcxx/docs/Status/Cxx2b.rst
@@ -42,6 +42,11 @@
.. [#note-P0533R9] P0533R9: ``isfinite``, ``isinf``, ``isnan`` and ``isnormal`` are implemented.
.. [#note-P1413R3] P1413R3: ``std::aligned_storage_t`` and ``std::aligned_union_t`` are marked deprecated, but
clang doesn't issue a diagnostic for deprecated using template declarations.
+ .. [#note-P2520R0] P2520R0: Libc++ implemented this paper as a DR in C++20 as well.
+ .. [#note-P2711R1] P2711R1: ``join_with_view`` hasn't been done yet since this type isn't implemented yet.
+ .. [#note-P2693R1] P1413R3: The formatter for ``std::thread::id`` is implemented.
+ The formatter for ``stacktrace`` is not implemented, since ``stacktrace`` is
+ not implemented yet.
.. _issues-status-cxx2b:
@@ -52,3 +57,8 @@
:file: Cxx2bIssues.csv
:header-rows: 1
:widths: auto
+
+.. note::
+
+ .. [#note-LWG3750] LWG3750 Only ``__cpp_lib_format_ranges`` is fully implemented.
+ .. [#note-LWG3798] LWG3798: ``join_with_view``, ``zip_transform_view``, and ``adjacent_transform_view`` haven't been done yet since these types aren't implemented yet.
diff --git a/third_party/llvm-project/libcxx/docs/Status/Cxx2bIssues.csv b/third_party/llvm-project/libcxx/docs/Status/Cxx2bIssues.csv
index b2cc710..8fa96fe 100644
--- a/third_party/llvm-project/libcxx/docs/Status/Cxx2bIssues.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/Cxx2bIssues.csv
@@ -63,7 +63,7 @@
`2774 <https://wg21.link/LWG2774>`__,"``std::function`` construction vs assignment","June 2021","",""
`2818 <https://wg21.link/LWG2818>`__,"``::std::`` everywhere rule needs tweaking","June 2021","|Nothing To Do|",""
`2997 <https://wg21.link/LWG2997>`__,"LWG 491 and the specification of ``{forward_,}list::unique``","June 2021","",""
-`3410 <https://wg21.link/LWG3410>`__,"``lexicographical_compare_three_way`` is overspecified","June 2021","","","|spaceship|"
+`3410 <https://wg21.link/LWG3410>`__,"``lexicographical_compare_three_way`` is overspecified","June 2021","|Complete|","17.0","|spaceship|"
`3430 <https://wg21.link/LWG3430>`__,"``std::fstream`` & co. should be constructible from string_view","June 2021","",""
`3462 <https://wg21.link/LWG3462>`__,"§[formatter.requirements]: Formatter requirements forbid use of ``fc.arg()``","June 2021","","","|format|"
`3481 <https://wg21.link/LWG3481>`__,"``viewable_range`` mishandles lvalue move-only views","June 2021","Superseded by `P2415R2 <https://wg21.link/P2415R2>`__","","|ranges|"
@@ -155,7 +155,7 @@
"`3649 <https://wg21.link/LWG3649>`__","[fund.ts.v2] Reinstate and bump ``__cpp_lib_experimental_memory_resource`` feature test macro","February 2022","",""
"`3650 <https://wg21.link/LWG3650>`__","Are ``std::basic_string`` 's ``iterator`` and ``const_iterator`` constexpr iterators?","February 2022","|Nothing to do|",""
"`3654 <https://wg21.link/LWG3654>`__","``basic_format_context::arg(size_t)`` should be ``noexcept`` ","February 2022","|Complete|","15.0","|format|"
-"`3657 <https://wg21.link/LWG3657>`__","``std::hash<std::filesystem::path>`` is not enabled","February 2022","",""
+"`3657 <https://wg21.link/LWG3657>`__","``std::hash<std::filesystem::path>`` is not enabled","February 2022","|Complete|","17.0"
"`3660 <https://wg21.link/LWG3660>`__","``iterator_traits<common_iterator>::pointer`` should conform to §[iterator.traits]","February 2022","|Complete|","14.0","|ranges|"
"`3661 <https://wg21.link/LWG3661>`__","``constinit atomic<shared_ptr<T>> a(nullptr);`` should work","February 2022","",""
"","","","","",""
@@ -208,17 +208,17 @@
"`3745 <https://wg21.link/LWG3745>`__","``std::atomic_wait`` and its friends lack ``noexcept``", "November 2022","|Complete|","16.0",""
"`3746 <https://wg21.link/LWG3746>`__","``optional``'s spaceship with ``U`` with a type derived from optional causes infinite constraint meta-recursion", "November 2022","","","|spaceship|"
"`3747 <https://wg21.link/LWG3747>`__","``ranges::uninitialized_copy_n``, ``ranges::uninitialized_move_n``, and ``ranges::destroy_n`` should use ``std::move``", "November 2022","","","|ranges|"
-"`3750 <https://wg21.link/LWG3750>`__","Too many papers bump ``__cpp_lib_format``", "November 2022","","","|format|"
+"`3750 <https://wg21.link/LWG3750>`__","Too many papers bump ``__cpp_lib_format``", "November 2022","|Partial| [#note-LWG3750]_","","|format|"
"`3751 <https://wg21.link/LWG3751>`__","Missing feature macro for ``flat_set``", "November 2022","","","|flat_containers|"
"`3753 <https://wg21.link/LWG3753>`__","Clarify entity vs. freestanding entity", "November 2022","","",""
-"`3754 <https://wg21.link/LWG3754>`__","Class template expected synopsis contains declarations that do not match the detailed description", "November 2022","","",""
-"`3755 <https://wg21.link/LWG3755>`__","``tuple-for-each`` can call ``user-defined`` ``operator,``", "November 2022","","",""
+"`3754 <https://wg21.link/LWG3754>`__","Class template expected synopsis contains declarations that do not match the detailed description", "November 2022","|Nothing to do|","",""
+"`3755 <https://wg21.link/LWG3755>`__","``tuple-for-each`` can call ``user-defined`` ``operator,``", "November 2022","|Complete|","17.0",""
"`3757 <https://wg21.link/LWG3757>`__","What's the effect of ``std::forward_like<void>(x)``?", "November 2022","","",""
"`3759 <https://wg21.link/LWG3759>`__","``ranges::rotate_copy`` should use ``std::move``", "November 2022","","","|ranges|"
"`3760 <https://wg21.link/LWG3760>`__","``cartesian_product_view::iterator``'s ``parent_`` is never valid", "November 2022","","","|ranges|"
"`3761 <https://wg21.link/LWG3761>`__","``cartesian_product_view::iterator::operator-`` should pass by reference", "November 2022","","","|ranges|"
"`3762 <https://wg21.link/LWG3762>`__","``generator::iterator::operator==`` should pass by reference", "November 2022","","",""
-"`3764 <https://wg21.link/LWG3764>`__","``reference_wrapper::operator()`` should propagate noexcept", "November 2022","","",""
+"`3764 <https://wg21.link/LWG3764>`__","``reference_wrapper::operator()`` should propagate noexcept", "November 2022","17.0","|Complete|",""
"`3765 <https://wg21.link/LWG3765>`__","``const_sentinel`` should be constrained", "November 2022","","","|ranges|"
"`3766 <https://wg21.link/LWG3766>`__","``view_interface::cbegin`` is underconstrained", "November 2022","","","|ranges|"
"`3770 <https://wg21.link/LWG3770>`__","``const_sentinel_t`` is missing", "November 2022","","","|ranges|"
@@ -226,15 +226,15 @@
"`3774 <https://wg21.link/LWG3774>`__","``<flat_set>`` should include ``<compare>``", "November 2022","","","|flat_containers|"
"`3775 <https://wg21.link/LWG3775>`__","Broken dependencies in the ``Cpp17Allocator`` requirements", "November 2022","","",""
"`3778 <https://wg21.link/LWG3778>`__","``vector<bool>`` missing exception specifications", "November 2022","","",""
-"`3781 <https://wg21.link/LWG3781>`__","The exposition-only alias templates ``cont-key-type`` and ``cont-mapped-type`` should be removed", "November 2022","","",""
-"`3782 <https://wg21.link/LWG3782>`__","Should ``<math.h>`` declare ``::lerp``?", "November 2022","","",""
+"`3781 <https://wg21.link/LWG3781>`__","The exposition-only alias templates ``cont-key-type`` and ``cont-mapped-type`` should be removed", "November 2022","|Nothing to do|","",""
+"`3782 <https://wg21.link/LWG3782>`__","Should ``<math.h>`` declare ``::lerp``?", "November 2022","|Complete|","17.0",""
"`3784 <https://wg21.link/LWG3784>`__","std.compat should not provide ``::byte`` and its friends", "November 2022","","",""
"`3785 <https://wg21.link/LWG3785>`__","``ranges::to`` is over-constrained on the destination type being a range", "November 2022","","","|ranges|"
"`3788 <https://wg21.link/LWG3788>`__","``jthread::operator=(jthread&&)`` postconditions are unimplementable under self-assignment", "November 2022","","",""
"`3792 <https://wg21.link/LWG3792>`__","``__cpp_lib_constexpr_algorithms`` should also be defined in ``<utility>``", "November 2022","|Complete|","16.0",""
"`3795 <https://wg21.link/LWG3795>`__","Self-move-assignment of ``std::future`` and ``std::shared_future`` have unimplementable postconditions", "November 2022","","",""
"`3796 <https://wg21.link/LWG3796>`__","``movable-box`` as member should use ``default-initialization`` instead of ``copy-initialization``", "November 2022","","","|ranges|"
-"`3798 <https://wg21.link/LWG3798>`__","Rvalue reference and ``iterator_category``", "November 2022","","",""
+"`3798 <https://wg21.link/LWG3798>`__","Rvalue reference and ``iterator_category``", "November 2022","|Partial| [#note-LWG3798]_","","|ranges|"
"`3801 <https://wg21.link/LWG3801>`__","``cartesian_product_view::iterator::distance-from`` ignores the size of last underlying range", "November 2022","","","|ranges|"
"`3814 <https://wg21.link/LWG3814>`__","Add freestanding items requested by NB comments", "November 2022","","",""
"`3816 <https://wg21.link/LWG3816>`__","``flat_map`` and ``flat_multimap`` should impose sequence container requirements", "November 2022","","","|flat_containers|"
@@ -245,6 +245,67 @@
"`3824 <https://wg21.link/LWG3824>`__","Number of ``bind`` placeholders is underspecified", "November 2022","|Nothing to do|","",""
"`3826 <https://wg21.link/LWG3826>`__","Redundant specification [for overload of yield_value]", "November 2022","","",""
"","","","","",""
-"`3631 <https://wg21.link/LWG3631>`__","``basic_format_arg(T&&)`` should use ``remove_cvref_t<T>`` throughout","Not voted in","|Complete|","15.0",""
-"`3645 <https://wg21.link/LWG3645>`__","``resize_and_overwrite`` is overspecified to call its callback with lvalues","Not voted in","|Complete|","14.0",""
+"`2195 <https://wg21.link/LWG2195>`__","Missing constructors for ``match_results``","February 2023","","",""
+"`2295 <https://wg21.link/LWG2295>`__","Locale name when the provided ``Facet`` is a ``nullptr``","February 2023","","",""
+"`3032 <https://wg21.link/LWG3032>`__","``ValueSwappable`` requirement missing for ``push_heap`` and ``make_heap``","February 2023","","",""
+"`3085 <https://wg21.link/LWG3085>`__","``char_traits::copy`` precondition too weak","February 2023","","",""
+"`3664 <https://wg21.link/LWG3664>`__","`LWG 3392 <https://wg21.link/LWG3392>`__ ``broke std::ranges::distance(a, a+3)``","February 2023","","","|ranges|"
+"`3720 <https://wg21.link/LWG3720>`__","Restrict the valid types of ``arg-id`` for width and precision in ``std-format-spec``","February 2023","|Complete|","17.0","|format|"
+"`3756 <https://wg21.link/LWG3756>`__","Is the ``std::atomic_flag`` class signal-safe?","February 2023","","",""
+"`3769 <https://wg21.link/LWG3769>`__","``basic_const_iterator::operator==`` causes infinite constraint recursion","February 2023","","","|spaceship|"
+"`3807 <https://wg21.link/LWG3807>`__","The feature test macro for ``ranges::find_last`` should be renamed","February 2023","","","|ranges|"
+"`3811 <https://wg21.link/LWG3811>`__","``views::as_const`` on ``ref_view<T>`` should return ``ref_view<const T>``","February 2023","","","|ranges|"
+"`3820 <https://wg21.link/LWG3820>`__","``cartesian_product_view::iterator::prev`` is not quite right","February 2023","","","|ranges|"
+"`3825 <https://wg21.link/LWG3825>`__","Missing compile-time argument ``id`` check in ``basic_format_parse_context::next_arg_id``","February 2023","|Complete|","17.0","|format|"
+"`3204 <https://wg21.link/LWG3204>`__","``sub_match::swap`` only swaps the base class","February 2023","|Complete|","17.0",""
+"`3733 <https://wg21.link/LWG3733>`__","``ranges::to`` misuses ``cpp17-input-iterator``","February 2023","","","|ranges|"
+"`3742 <https://wg21.link/LWG3742>`__","``deque::prepend_range`` needs to permute","February 2023","","","|ranges|"
+"`3790 <https://wg21.link/LWG3790>`__","`P1467 <https://wg21.link/P1467>`__ accidentally changed ``nexttoward``'s signature","February 2023","","",""
+"`3819 <https://wg21.link/LWG3819>`__","``reference_meows_from_temporary`` should not use ``is_meowible``","February 2023","","",""
+"`3821 <https://wg21.link/LWG3821>`__","``uses_allocator_construction_args`` should have overload for ``pair-like``","February 2023","","",""
+"`3834 <https://wg21.link/LWG3834>`__","Missing ``constexpr`` for ``std::intmax_t`` math functions in ``<cinttypes>``","February 2023","","",""
+"`3839 <https://wg21.link/LWG3839>`__","``range_formatter``'s ``set_separator``, ``set_brackets``, and ``underlying`` functions should be ``noexcept``","February 2023","|Complete|","17.0","|format|"
+"`3841 <https://wg21.link/LWG3841>`__","``<version>`` should not be ""all freestanding""","February 2023","","",""
+"`3842 <https://wg21.link/LWG3842>`__","Unclear wording for ``precision`` in ``chrono-format-spec``","February 2023","|Complete|","16.0","|format|"
+"`3848 <https://wg21.link/LWG3848>`__","``adjacent_view``, ``adjacent_transform_view`` and ``slide_view`` missing ``base`` accessor","February 2023","","","|ranges|"
+"`3849 <https://wg21.link/LWG3849>`__","``cartesian_product_view::iterator``'s default constructor is overconstrained","February 2023","","","|ranges|"
+"`3850 <https://wg21.link/LWG3850>`__","``views::as_const`` on ``empty_view<T>`` should return ``empty_view<const T>``","February 2023","","","|ranges|"
+"`3851 <https://wg21.link/LWG3851>`__","``chunk_view::inner-iterator`` missing custom ``iter_move`` and ``iter_swap``","February 2023","","","|ranges|"
+"`3853 <https://wg21.link/LWG3853>`__","``basic_const_iterator<volatile int*>::operator->`` is ill-formed","February 2023","","",""
+"`3857 <https://wg21.link/LWG3857>`__","``basic_string_view`` should allow explicit conversion when only traits vary","February 2023","|Complete|","17.0",""
+"`3860 <https://wg21.link/LWG3860>`__","``range_common_reference_t`` is missing","February 2023","|Complete|","17.0","|ranges|"
+"`3866 <https://wg21.link/LWG3866>`__","Bad Mandates for ``expected::transform_error`` overloads","February 2023","","",""
+"`3867 <https://wg21.link/LWG3867>`__","Should ``std::basic_osyncstream``'s move assignment operator be ``noexcept``?","February 2023","","",""
+"`3441 <https://wg21.link/LWG3441>`__","Misleading note about calls to customization points","February 2023","","",""
+"`3622 <https://wg21.link/LWG3622>`__","Misspecified transitivity of equivalence in §[unord.req.general]","February 2023","","",""
+"`3631 <https://wg21.link/LWG3631>`__","``basic_format_arg(T&&)`` should use ``remove_cvref_t<T>`` throughout","February 2023","|Complete|","15.0",""
+"`3645 <https://wg21.link/LWG3645>`__","``resize_and_overwrite`` is overspecified to call its callback with lvalues","February 2023","|Complete|","14.0",""
+"`3655 <https://wg21.link/LWG3655>`__","The ``INVOKE`` operation and union types","February 2023","","",""
+"`3723 <https://wg21.link/LWG3723>`__","``priority_queue::push_range`` needs to ``append_range``","February 2023","","","|ranges|"
+"`3734 <https://wg21.link/LWG3734>`__","Inconsistency in ``inout_ptr`` and ``out_ptr`` for empty case","February 2023","","",""
+"`3772 <https://wg21.link/LWG3772>`__","``repeat_view``'s ``piecewise`` constructor is missing Postconditions","February 2023","","","|ranges|"
+"`3786 <https://wg21.link/LWG3786>`__","Flat maps' deduction guide needs to default ``Allocator`` to be useful","February 2023","","",""
+"`3803 <https://wg21.link/LWG3803>`__","``flat_foo`` constructors taking ``KeyContainer`` lack ``KeyCompare`` parameter","February 2023","","",""
+"`3810 <https://wg21.link/LWG3810>`__","CTAD for ``std::basic_format_args``","February 2023","|Complete|","17.0","|format|"
+"`3827 <https://wg21.link/LWG3827>`__","Deprecate ``<stdalign.h>`` and ``<stdbool.h>`` macros","February 2023","","",""
+"`3828 <https://wg21.link/LWG3828>`__","Sync ``intmax_t`` and ``uintmax_t`` with C2x","February 2023","","",""
+"`3833 <https://wg21.link/LWG3833>`__","Remove specialization ``template<size_t N> struct formatter<const charT[N], charT>``","February 2023","|Complete|","17.0","|format|"
+"`3836 <https://wg21.link/LWG3836>`__","``std::expected<bool, E1>`` conversion constructor ``expected(const expected<U, G>&)`` should take precedence over ``expected(U&&)`` with operator ``bool``","February 2023","","",""
+"`3843 <https://wg21.link/LWG3843>`__","``std::expected<T,E>::value() &`` assumes ``E`` is copy constructible","February 2023","","",""
+"`3847 <https://wg21.link/LWG3847>`__","``ranges::to`` can still return views","February 2023","","","|ranges|"
+"`3862 <https://wg21.link/LWG3862>`__","``basic_const_iterator``'s ``common_type`` specialization is underconstrained","February 2023","","",""
+"`3865 <https://wg21.link/LWG3865>`__","Sorting a range of ``pairs``","February 2023","|Complete|","17.0","|ranges|"
+"`3869 <https://wg21.link/LWG3869>`__","Deprecate ``std::errc`` constants related to UNIX STREAMS","February 2023","","",""
+"`3870 <https://wg21.link/LWG3870>`__","Remove ``voidify``","February 2023","","",""
+"`3871 <https://wg21.link/LWG3871>`__","Adjust note about ``terminate``","February 2023","","",""
+"`3872 <https://wg21.link/LWG3872>`__","``basic_const_iterator`` should have custom ``iter_move``","February 2023","","",""
+"`3875 <https://wg21.link/LWG3875>`__","``std::ranges::repeat_view<T, IntegerClass>::iterator`` may be ill-formed","February 2023","","","|ranges|"
+"`3876 <https://wg21.link/LWG3876>`__","Default constructor of ``std::layout_XX::mapping`` misses precondition","February 2023","","",""
+"`3877 <https://wg21.link/LWG3877>`__","Incorrect constraints on ``const``-qualified monadic overloads for ``std::expected``","February 2023","","",""
+"`3878 <https://wg21.link/LWG3878>`__","import ``std;`` should guarantee initialization of standard iostreams objects","February 2023","","",""
+"`3879 <https://wg21.link/LWG3879>`__","``erase_if`` for ``flat_{,multi}set`` is incorrectly specified","February 2023","","",""
+"`3880 <https://wg21.link/LWG3880>`__","Clarify ``operator+=`` complexity for ``{chunk,stride}_view::iterator``","February 2023","","","|ranges|"
+"`3881 <https://wg21.link/LWG3881>`__","Incorrect formatting of container adapters backed by ``std::string``","February 2023","|Complete|","17.0","|format|"
+"","","","","",""
"`3343 <https://wg21.link/LWG3343>`__","Ordering of calls to ``unlock()`` and ``notify_all()`` in Effects element of ``notify_all_at_thread_exit()`` should be reversed","Not Yet Adopted","|Complete|","16.0",""
+"`3892 <https://wg21.link/LWG3892>`__","Incorrect formatting of nested ranges and tuples","Not Yet Adopted","|Complete|","17.0",""
diff --git a/third_party/llvm-project/libcxx/docs/Status/Cxx2bPapers.csv b/third_party/llvm-project/libcxx/docs/Status/Cxx2bPapers.csv
index e3f39d4..47ea734 100644
--- a/third_party/llvm-project/libcxx/docs/Status/Cxx2bPapers.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/Cxx2bPapers.csv
@@ -14,13 +14,13 @@
"`P0401R6 <https://wg21.link/P0401R6>`__","LWG","Providing size feedback in the Allocator interface","June 2021","|Complete|","15.0"
"`P0448R4 <https://wg21.link/P0448R4>`__","LWG","A strstream replacement using span<charT> as buffer","June 2021","",""
"`P1132R8 <https://wg21.link/P1132R8>`__","LWG","out_ptr - a scalable output pointer abstraction","June 2021","",""
-"`P1328R1 <https://wg21.link/P1328R1>`__","LWG","Making std::type_info::operator== constexpr","June 2021","",""
+"`P1328R1 <https://wg21.link/P1328R1>`__","LWG","Making std::type_info::operator== constexpr","June 2021","|Complete|","17.0"
"`P1425R4 <https://wg21.link/P1425R4>`__","LWG","Iterators pair constructors for stack and queue","June 2021","|Complete|","14.0","|ranges|"
"`P1518R2 <https://wg21.link/P1518R2>`__","LWG","Stop overconstraining allocators in container deduction guides","June 2021","|Complete|","13.0"
"`P1659R3 <https://wg21.link/P1659R3>`__","LWG","starts_with and ends_with","June 2021","","","|ranges|"
"`P1951R1 <https://wg21.link/P1951R1>`__","LWG","Default Arguments for pair Forwarding Constructor","June 2021","|Complete|","14.0"
"`P1989R2 <https://wg21.link/P1989R2>`__","LWG","Range constructor for std::string_view","June 2021","|Complete|","14.0","|ranges|"
-"`P2136R3 <https://wg21.link/P2136R3>`__","LWG","invoke_r","June 2021","",""
+"`P2136R3 <https://wg21.link/P2136R3>`__","LWG","invoke_r","June 2021","|Complete|","17.0"
"`P2166R1 <https://wg21.link/P2166R1>`__","LWG","A Proposal to Prohibit std::basic_string and std::basic_string_view construction from nullptr","June 2021","|Complete|","13.0"
"","","","","","",""
"`P0288R9 <https://wg21.link/P0288R9>`__","LWG","``any_invocable``","October 2021","",""
@@ -84,12 +84,12 @@
"`P2508R1 <https://wg21.link/P2508R1>`__","LWG","Exposing ``std::basic-format-string``","July 2022","|Complete|","15.0"
"`P2513R4 <https://wg21.link/P2513R4>`__","LWG","``char8_t`` Compatibility and Portability Fixes","July 2022","",""
"`P2517R1 <https://wg21.link/P2517R1>`__","LWG","Add a conditional ``noexcept`` specification to ``std::apply``","July 2022","",""
-"`P2520R0 <https://wg21.link/P2520R0>`__","LWG","``move_iterator`` should be a random access iterator","July 2022","","","|ranges|"
+"`P2520R0 <https://wg21.link/P2520R0>`__","LWG","``move_iterator`` should be a random access iterator","July 2022","|Complete| [#note-P2520R0]_","17.0","|ranges|"
"`P2540R1 <https://wg21.link/P2540R1>`__","LWG","Empty Product for certain Views","July 2022","","","|ranges|"
"`P2549R1 <https://wg21.link/P2549R1>`__","LWG","``std::unexpected`` should have ``error()`` as member accessor","July 2022","|Complete|","16.0"
"`P2553R1 <https://wg21.link/P2553R1>`__","LWG","Make ``mdspan`` ``size_type`` controllable","July 2022","",""
"`P2554R0 <https://wg21.link/P2554R0>`__","LWG","C-Array Interoperability of MDSpan","July 2022","",""
-"`P2585R0 <https://wg21.link/P2585R0>`__","LWG","Improving default container formatting","July 2022","|Partial|",""
+"`P2585R0 <https://wg21.link/P2585R0>`__","LWG","Improving default container formatting","July 2022","|Complete|","17.0"
"`P2590R2 <https://wg21.link/P2590R2>`__","LWG","Explicit lifetime management","July 2022","",""
"`P2599R2 <https://wg21.link/P2599R2>`__","LWG","``mdspan::size_type`` should be ``index_type``","July 2022","",""
"`P2604R0 <https://wg21.link/P2604R0>`__","LWG","mdspan: rename pointer and contiguous","July 2022","",""
@@ -104,3 +104,22 @@
"`P2539R4 <https://wg21.link/P2539R4>`__","LWG", "Should the output of ``std::print`` to a terminal be synchronized with the underlying stream?", "November 2022","","","|format|"
"`P2602R2 <https://wg21.link/P2602R2>`__","LWG", "Poison Pills are Too Toxic", "November 2022","","","|ranges|"
"`P2708R1 <https://wg21.link/P2708R1>`__","LWG", "No Further Fundamentals TSes", "November 2022","|Nothing to do|","",""
+"","","","","","",""
+"`P0290R4 <https://wg21.link/P0290R4>`__","LWG", "``apply()`` for ``synchronized_value<T>``","February 2023","","","|concurrency TS|"
+"`P2770R0 <https://wg21.link/P2770R0>`__","LWG", "Stashing stashing ``iterators`` for proper flattening","February 2023","","","|ranges|"
+"`P2164R9 <https://wg21.link/P2164R9>`__","LWG", "``views::enumerate``","February 2023","","","|ranges|"
+"`P2711R1 <https://wg21.link/P2711R1>`__","LWG", "Making multi-param constructors of ``views`` ``explicit``","February 2023","|Partial| [#note-P2711R1]_","","|ranges|"
+"`P2609R3 <https://wg21.link/P2609R3>`__","LWG", "Relaxing Ranges Just A Smidge","February 2023","","","|ranges|"
+"`P2713R1 <https://wg21.link/P2713R1>`__","LWG", "Escaping improvements in ``std::format``","February 2023","","","|format|"
+"`P2675R1 <https://wg21.link/P2675R1>`__","LWG", "``format``'s width estimation is too approximate and not forward compatible","February 2023","","","|format|"
+"`P2572R1 <https://wg21.link/P2572R1>`__","LWG", "``std::format`` fill character allowances","February 2023","","","|format|"
+"`P2693R1 <https://wg21.link/P2693R1>`__","LWG", "Formatting ``thread::id`` and ``stacktrace``","February 2023","|Partial| [#note-P2693R1]_","","|format|"
+"`P2679R2 <https://wg21.link/P2679R2>`__","LWG", "Fixing ``std::start_lifetime_as`` for arrays","February 2023","","",""
+"`P2674R1 <https://wg21.link/P2674R1>`__","LWG", "A trait for implicit lifetime types","February 2023","","",""
+"`P2655R3 <https://wg21.link/P2655R3>`__","LWG", "``common_reference_t`` of ``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
+"`P2652R2 <https://wg21.link/P2652R2>`__","LWG", "Disallow User Specialization of ``allocator_traits``","February 2023","","",""
+"`P2787R1 <https://wg21.link/P2787R1>`__","LWG", "``pmr::generator`` - Promise Types are not Values","February 2023","","",""
+"`P2614R2 <https://wg21.link/P2614R2>`__","LWG", "Deprecate ``numeric_limits::has_denorm``","February 2023","","",""
+"`P2588R3 <https://wg21.link/P2588R3>`__","LWG", "``barrier``’s phase completion guarantees","February 2023","","",""
+"`P2763R1 <https://wg21.link/P2763R1>`__","LWG", "``layout_stride`` static extents default constructor fix","February 2023","","",""
+"`P2736R2 <https://wg21.link/P2736R2>`__","CWG","Referencing The Unicode Standard","February 2023","","","|format|"
diff --git a/third_party/llvm-project/libcxx/docs/Status/FormatIssues.csv b/third_party/llvm-project/libcxx/docs/Status/FormatIssues.csv
index 3299b6d..f072ce0 100644
--- a/third_party/llvm-project/libcxx/docs/Status/FormatIssues.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/FormatIssues.csv
@@ -8,9 +8,12 @@
"`P2093R14 <https://wg21.link/P2093R14>`__","Formatted output","C++23"
"`P2286R8 <https://wg21.link/P2286R8>`__","Formatting Ranges","C++23","Mark de Wever","|Complete|",Clang 16
"`P2508R1 <https://wg21.link/P2508R1>`__","Exposing ``std::basic-format-string``","C++23","Mark de Wever","|Complete|", Clang 15
-"`P2585R0 <https://wg21.link/P2585R0>`__","Improving default container formatting","C++23","Mark de Wever","|In progress|"
+"`P2585R0 <https://wg21.link/P2585R0>`__","Improving default container formatting","C++23","Mark de Wever","|Complete|", Clang 17
"`P2539R4 <https://wg21.link/P2539R4>`__","Should the output of ``std::print`` to a terminal be synchronized with the underlying stream?","C++23"
-
+"`P2713R1 <https://wg21.link/P2713R1>`__","Escaping improvements in ``std::format``","C++23","Mark de Wever",""
+"`P2675R1 <https://wg21.link/P2675R1>`__","``format``'s width estimation is too approximate and not forward compatible","C++23","Mark de Wever",""
+"`P2572R1 <https://wg21.link/P2572R1>`__","``std::format`` fill character allowances","C++23","Mark de Wever","|In progress|"
+"`P2693R1 <https://wg21.link/P2693R1>`__","Formatting ``thread::id`` and ``stacktrace``","C++23","Mark de Wever","|In progress|"
`P1361 <https://wg21.link/P1361>`_,"Integration of chrono with text formatting","C++20",Mark de Wever,|In Progress|,
`P2372 <https://wg21.link/P2372>`__,"Fixing locale handling in chrono formatters","C++20",Mark de Wever,|In Progress|,
"`P2419R2 <https://wg21.link/P2419R2>`__","Clarify handling of encodings in localized formatting of chrono types","C++23",
diff --git a/third_party/llvm-project/libcxx/docs/Status/FormatPaper.csv b/third_party/llvm-project/libcxx/docs/Status/FormatPaper.csv
index 01585c0..19e8f03 100644
--- a/third_party/llvm-project/libcxx/docs/Status/FormatPaper.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/FormatPaper.csv
@@ -1,7 +1,7 @@
Section,Description,Dependencies,Assignee,Status,First released version
`P1361 <https://wg21.link/P1361>`__ `P2372 <https://wg21.link/P2372>`__,"Formatting chrono"
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::duration<Rep, Period>``",,Mark de Wever,|Complete|, Clang 16
-`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::sys_time<Duration>``",,Mark de Wever,|In Progress|,
+`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::sys_time<Duration>``",,Mark de Wever,|Complete|, Clang 17
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::utc_time<Duration>``",A ``<chrono>`` implementation,Not assigned,,,
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::tai_time<Duration>``",A ``<chrono>`` implementation,Not assigned,,,
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::gps_time<Duration>``",A ``<chrono>`` implementation,Not assigned,,,
@@ -23,7 +23,7 @@
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::year_month_day_last``",,Mark de Wever,|Complete|, Clang 16
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::year_month_weekday``",,Mark de Wever,|Complete|, Clang 16
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::year_month_weekday_last``",,Mark de Wever,|Complete|, Clang 16
-`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::hh_mm_ss<duration<Rep, Period>>``",,Mark de Wever,|In Progress|,
+`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::hh_mm_ss<duration<Rep, Period>>``",,Mark de Wever,|Complete|, Clang 17
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::sys_info``",A ``<chrono>`` implementation,Mark de Wever,,
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::local_info``",A ``<chrono>`` implementation,Mark de Wever,,
`[time.syn] <https://wg21.link/time.syn>`_,"Formatter ``chrono::zoned_time<Duration, TimeZonePtr>``",A ``<chrono>`` implementation,Mark de Wever,,
@@ -37,4 +37,8 @@
`[format.range] <https://wg21.link/format.range>`_,"Formatting for ranges: ``pair`` and ``tuple``",,Mark de Wever,|Complete|,Clang 16
`[format.range] <https://wg21.link/format.range>`_,"Formatting for ranges: ``vector<bool>``",,Mark de Wever,|Complete|,Clang 16
"`P2585R0 <https://wg21.link/P2585R0>`__","Improving default container formatting"
-`[format.range.fmtstr] <https://wg21.link/format.range.fmtstr>`_,"Formatting for ranges: strings",,Mark de Wever,|In Progress|,
+`[format.range.fmtstr] <https://wg21.link/format.range.fmtstr>`_,"Formatting for ranges: strings",,Mark de Wever,|Complete|,Clang 17
+`[format.range.fmtstr] <https://wg21.link/format.range.fmtstr>`_,"Formatting for ranges: debug_strings",,Mark de Wever,|Complete|,Clang 17
+"`P2693R1 <https://wg21.link/P2693R1>`__","Formatting ``thread::id`` and ``stacktrace``"
+`[thread.thread.id] <https://wg21.link/thread.thread.id>`_,"Formatting ``thread::id``",,Mark de Wever,|Complete|,Clang 17
+`[stacktrace.format] <https://wg21.link/stacktrace.format>`_,"Formatting ``stacktrace``",A ``<stacktrace>`` implementation,Mark de Wever,,
diff --git a/third_party/llvm-project/libcxx/docs/Status/Parallelism.rst b/third_party/llvm-project/libcxx/docs/Status/Parallelism.rst
new file mode 100644
index 0000000..4fce429
--- /dev/null
+++ b/third_party/llvm-project/libcxx/docs/Status/Parallelism.rst
@@ -0,0 +1,29 @@
+.. parallelism-status:
+
+====================================
+libc++ Parallelism TS Status (N4808)
+====================================
+
+.. include:: ../Helpers/Styles.rst
+
+.. contents::
+ :local:
+
+Overview
+========
+
+This document contains the status of the Parallelism TS implementation in libc++.
+It is used to track both the status of the sub-projects of the effort and who
+is assigned to these sub-projects. This avoids duplicating effort.
+
+If you are interested in contributing to this effort, please send a message
+to the #libcxx channel in the LLVM discord. Please *do not* start working
+on any items below that has already been assigned to someone else.
+
+Sub-projects in the Implementation Effort
+=========================================
+
+.. csv-table::
+ :file: ParallelismProjects.csv
+ :header-rows: 1
+ :widths: auto
diff --git a/third_party/llvm-project/libcxx/docs/Status/ParallelismProjects.csv b/third_party/llvm-project/libcxx/docs/Status/ParallelismProjects.csv
new file mode 100644
index 0000000..de59ad6
--- /dev/null
+++ b/third_party/llvm-project/libcxx/docs/Status/ParallelismProjects.csv
@@ -0,0 +1,12 @@
+Section,Description,Dependencies,Assignee,Complete
+| `[parallel.exceptions] <https://wg21.link/N4808>`_, "Parallel Exceptions", None, unassigned, |Not Started|
+| `[parallel.execpol] <https://wg21.link/N4808>`_, "Execution policies", None, unassigned, |Not Started|
+| `[parallel.alg] <https://wg21.link/N4808>`_, "Parallel algorithms", None, unassigned, |Not Started|
+| `[parallel.taskblock] <https://wg21.link/N4808>`_, "Task Block", None, unassigned, |Not Started|
+| `[parallel.simd.abi] <https://wg21.link/N4808>`_, "simd ABI tags", None, Yin Zhang, |In Progress|
+| `[parallel.simd.traits] <https://wg21.link/N4808>`_, "simd type traits", None, Yin Zhang, |In Progress|
+| `[parallel.simd.whereexpr] <https://wg21.link/N4808>`_, "Where expression class templates", None, Yin Zhang, |In Progress|
+| `[parallel.simd.class] <https://wg21.link/N4808>`_, "Class template simd", None, Yin Zhang, |In Progress|
+| `[parallel.simd.nonmembers] <https://wg21.link/N4808>`_, "simd non-member operations", None, Yin Zhang, |In Progress|
+| `[parallel.simd.mask.class] <https://wg21.link/N4808>`_, "Class template simd_mask", None, Yin Zhang, |In Progress|
+| `[parallel.simd.mask.nonmembers] <https://wg21.link/N4808>`_, "simd_mask non-member operations", None, Yin Zhang, |In Progress|
diff --git a/third_party/llvm-project/libcxx/docs/Status/RangesViews.csv b/third_party/llvm-project/libcxx/docs/Status/RangesViews.csv
index 3bc9c62..f38e0d6 100644
--- a/third_party/llvm-project/libcxx/docs/Status/RangesViews.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/RangesViews.csv
@@ -12,7 +12,7 @@
C++20,`drop <https://wg21.link/P1035R7>`_,Zoe Carver,`D102037 <https://llvm.org/D102037>`_,✅
C++20,`drop_while <https://wg21.link/P1035R7>`_,Hui Xie,`D135460 <https://llvm.org/D135460>`_,✅
C++20,`join <https://wg21.link/P0896R4>`_,Zoe Carver,`D107671 <https://llvm.org/D107671>`_,✅
-C++20,`split <https://wg21.link/P2210R2>`_,Unassigned,No patch yet,Not started
+C++20,`split <https://wg21.link/P2210R2>`_,Hui Xie,`D142063 <https://llvm.org/D142063>`_,✅
C++20,`lazy_split <https://wg21.link/P0896R4>`_,Zoe Carver and Konstantin Varlamov,`D107500 <https://llvm.org/D107500>`_,✅
C++20,`counted <https://wg21.link/P0896R4>`_,Zoe Carver,`D106923 <https://llvm.org/D106923>`_,✅
C++20,`common <https://wg21.link/P0896R4>`_,Zoe Carver,`D105753 <https://llvm.org/D105753>`_,✅
@@ -33,5 +33,5 @@
C++23,`chunk <https://wg21.link/P2442R1>`_,Unassigned,No patch yet,Not started
C++23,`chunk_by <https://wg21.link/P2443R1>`_,Unassigned,No patch yet,Not started
C++23,`as_const <https://wg21.link/P2278R4>`_,Unassigned,No patch yet,Not started
-C++23,`as_rvalue <https://wg21.link/P2446R2>`_,Nikolas Klauser,`D137637 <https://llvm.org/D137637>`_,Complete
+C++23,`as_rvalue <https://wg21.link/P2446R2>`_,Nikolas Klauser,`D137637 <https://llvm.org/D137637>`_,✅
C++23,`stride <https://wg21.link/P1899R3>`_,Unassigned,No patch yet,Not started
diff --git a/third_party/llvm-project/libcxx/docs/Status/SpaceshipProjects.csv b/third_party/llvm-project/libcxx/docs/Status/SpaceshipProjects.csv
index f732ec7..02eac26 100644
--- a/third_party/llvm-project/libcxx/docs/Status/SpaceshipProjects.csv
+++ b/third_party/llvm-project/libcxx/docs/Status/SpaceshipProjects.csv
@@ -11,7 +11,7 @@
| `strong_order_fallback <https://reviews.llvm.org/D111514>`_
| `weak_order_fallback <https://reviews.llvm.org/D111514>`_
| `partial_order_fallback <https://reviews.llvm.org/D111514>`_",None,Arthur O'Dwyer,|Complete| [#note-strongorder]_
-| `[alg.three.way] <https://wg21.link/alg.three.way>`_,| `lexicographical_compare_three_way <https://reviews.llvm.org/D131395>`_,[comparisons.three.way],Adrian Vogelsgesang,|In Progress|
+| `[alg.three.way] <https://wg21.link/alg.three.way>`_,| `lexicographical_compare_three_way <https://reviews.llvm.org/D131395>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
| `[type.info] <https://wg21.link/type.info>`_,| `typeinfo <https://reviews.llvm.org/D130853>`_,None,Adrian Vogelsgesang,|Complete|
| `[coroutine.handle.compare] <https://wg21.link/coroutine.handle.compare>`_,| `coroutine_handle <https://reviews.llvm.org/D109433>`_,[comparisons.three.way],Chuanqi Xu,|Complete|
| `[pairs.spec] <https://wg21.link/pairs.spec>`_,| `pair <https://reviews.llvm.org/D107721>`_,[expos.only.func],Kent Ross,|Complete|
@@ -21,8 +21,8 @@
| `[tuple.rel] <https://wg21.link/tuple.rel>`_,| `tuple <https://reviews.llvm.org/D108250>`_,[expos.only.func],Kent Ross,|Complete|
"| `[optional.relops] <https://wg21.link/optional.relops>`_
| `[optional.nullops] <https://wg21.link/optional.nullops>`_
-| `[optional.comp.with.t] <https://wg21.link/optional.comp.with.t>`_","| optional
-| nullopt",None,Kent Ross,|In Progress|
+| `[optional.comp.with.t] <https://wg21.link/optional.comp.with.t>`_","| `optional <https://reviews.llvm.org/D146392>`_
+| `nullopt <https://reviews.llvm.org/D146392>`_",None,Hristo Hristov,|In Progress|
"| `[variant.relops] <https://wg21.link/variant.relops>`_
| `[variant.monostate.relops] <https://wg21.link/variant.monostate.relops>`_","| `monostate <https://reviews.llvm.org/D131372>`_
| `variant <https://reviews.llvm.org/D131372>`_",None,Kent Ross,|Complete|
@@ -31,29 +31,29 @@
| `[type.index.members] <https://wg21.link/type.index.members>`_,| `type_index <https://reviews.llvm.org/D131357>`_,None,Adrian Vogelsgesang,|Complete|
| `[charconv.syn] <https://wg21.link/charconv.syn>`_,| `to_chars_result <https://reviews.llvm.org/D112366>`_,None,Mark de Wever,|Complete|
| `[charconv.syn] <https://wg21.link/charconv.syn>`_,| `from_chars_result <https://reviews.llvm.org/D112366>`_,None,Mark de Wever,|Complete|
-| `[stacktrace.entry.cmp] <https://wg21.link/stacktrace.entry.cmp>`_,| stacktrace_entry,None,Unassigned,|Not Started|
-| `[stacktrace.basic.cmp] <https://wg21.link/stacktrace.basic.cmp>`_,| basic_stacktrace,[alg.three.way],Unassigned,|Not Started|
+| `[stacktrace.entry.cmp] <https://wg21.link/stacktrace.entry.cmp>`_,| `stacktrace_entry <https://reviews.llvm.org/D123228>`_,None,Nikolas Klauser,|In Progress|
+| `[stacktrace.basic.cmp] <https://wg21.link/stacktrace.basic.cmp>`_,| `basic_stacktrace <https://reviews.llvm.org/D123228>`_,[alg.three.way],Nikolas Klauser,|In Progress|
| `[string.cmp] <https://wg21.link/string.cmp>`_,| `basic_string <https://reviews.llvm.org/D131421>`_,None,Mark de Wever,|Complete|
| `[string.view.comparison] <https://wg21.link/string.view.comparison>`_,| `basic_string_view <https://reviews.llvm.org/D130295>`_,None,Mark de Wever,|Complete|
| `[array.syn] <https://wg21.link/array.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| `array <https://reviews.llvm.org/D132265>`_,[expos.only.func],Adrian Vogelsgesang,|In Progress|
-| `[deque.syn] <https://wg21.link/deque.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| deque,[expos.only.func],Unassigned,|Not Started|
-| `[forward.list.syn] <https://wg21.link/forward.list.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| forward_list,[expos.only.func],Unassigned,|Not Started|
-| `[list.syn] <https://wg21.link/list.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| list,[expos.only.func],Unassigned,|Not Started|
+| `[deque.syn] <https://wg21.link/deque.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| `deque <https://reviews.llvm.org/D144821>`_,[expos.only.func],Hristo Hristov,|Complete|
+| `[forward.list.syn] <https://wg21.link/forward.list.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| `forward_list <https://reviews.llvm.org/D145172>`_,[expos.only.func],Hristo Hristov,|Complete|
+| `[list.syn] <https://wg21.link/list.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| `list <https://reviews.llvm.org/D132312>`_,[expos.only.func],Adrian Vogelsgesang,|Complete|
| `[vector.syn] <https://wg21.link/vector.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),| `vector <https://reviews.llvm.org/D132268>`_,[expos.only.func],Adrian Vogelsgesang,|In Progress|
-| `[associative.map.syn] <https://wg21.link/associative.map.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),"| map
-| multimap",[expos.only.func],Unassigned,|Not Started|
+| `[associative.map.syn] <https://wg21.link/associative.map.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),"| `map <https://reviews.llvm.org/D145976>`_
+| `multimap <https://reviews.llvm.org/D145976>`_",[expos.only.func],Hristo Hristov,|Complete|
| `[associative.set.syn] <https://wg21.link/associative.set.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_),"| multiset
-| set",[expos.only.func],Unassigned,|Not Started|
-| `[queue.ops] <https://wg21.link/queue.ops>`_,| queue,None,Unassigned,|Not Started|
-| `[stack.ops] <https://wg21.link/stack.ops>`_,| stack,None,Unassigned,|Not Started|
+| set",[expos.only.func],Hristo Hristov,|In Progress|
+| `[queue.ops] <https://wg21.link/queue.ops>`_,| `queue <https://reviews.llvm.org/D146066>`_,None,Hristo Hristov,|In Progress|
+| `[stack.ops] <https://wg21.link/stack.ops>`_,| `stack <https://reviews.llvm.org/D146094>`_,None,Hristo Hristov,|In Progress|
| `[reverse.iter.cmp] <https://wg21.link/reverse.iter.cmp>`_,| `reverse_iterator <https://reviews.llvm.org/D113695>`_,None,Mikhail Maltsev,|Complete|
-| `[move.iter.op.comp] <https://wg21.link/move.iter.op.comp>`_,| move_iterator,None,Unassigned,|Not Started|
-| `[counted.iter.cmp] <https://wg21.link/counted.iter.cmp>`_,| counted_iterator,None,Unassigned,|Not Started|
+| `[move.iter.op.comp] <https://wg21.link/move.iter.op.comp>`_,| `move_iterator <https://reviews.llvm.org/D117656>`_,None,Arthur O'Dwyer,|Complete|
+| `[counted.iter.cmp] <https://wg21.link/counted.iter.cmp>`_,| `counted_iterator <https://reviews.llvm.org/D106205>`_,None,Zoe Carver,|Complete|
| `[range.iota.iterator] <https://wg21.link/range.iota.iterator>`_,| `ranges::iota_view::iterator <https://reviews.llvm.org/D110774>`_,[concepts.cmp],Arthur O'Dwyer,|Complete|
| `[range.transform.iterator] <https://wg21.link/range.transform.iterator>`_,| `ranges::transform_view::iterator <https://reviews.llvm.org/D110774>`_,[concepts.cmp],Arthur O'Dwyer,|Complete|
| `[range.elements.iterator] <https://wg21.link/range.elements.iterator>`_,| ranges::elements_view::iterator,[concepts.cmp],Hui Xie,|Complete|
-| `[time.duration.comparisons] <https://wg21.link/time.duration.comparisons>`_, "chrono::duration", None, Mark de Wever, |Not Started|
-| `[time.point.comparisons] <https://wg21.link/time.point.comparisons>`_, "chrono::time_point", None, Mark de Wever, |Not Started|
+| `[time.duration.comparisons] <https://wg21.link/time.duration.comparisons>`_, `chrono::duration <https://reviews.llvm.org/D145881>`_, None, Hristo Hristov, |Complete|
+| `[time.point.comparisons] <https://wg21.link/time.point.comparisons>`_, `chrono::time_point <https://reviews.llvm.org/D146250>`_, None, Hristo Hristov, |Complete|
"| `[time.cal.day.nonmembers] <https://wg21.link/time.cal.day.nonmembers>`_
| `[time.cal.month.nonmembers] <https://wg21.link/time.cal.month.nonmembers>`_
| `[time.cal.year.nonmembers] <https://wg21.link/time.cal.year.nonmembers>`_
@@ -77,5 +77,5 @@
| `[fs.filesystem.syn] <https://wg21.link/fs.filesystem.syn>`_,| `filesystem::space_info <https://reviews.llvm.org/D130861>`_,None,Adrian Vogelsgesang,|Complete|
| `[fs.path.nonmember] <https://wg21.link/fs.path.nonmember>`_,| `filesystem::path <https://reviews.llvm.org/D130859>`_,None,Adrian Vogelsgesang,|Complete|
| `[fs.dir.entry.obs] <https://wg21.link/fs.dir.entry.obs>`_,| `filesystem::directory_entry <https://reviews.llvm.org/D130860>`_,None,Adrian Vogelsgesang,|Complete|
-| `[re.submatch.op] <https://wg21.link/re.submatch.op>`_,| sub_match,None,Mark de Wever,|In Progress|
+| `[re.submatch.op] <https://wg21.link/re.submatch.op>`_,| `sub_match <https://reviews.llvm.org/D132310>`_,None,Mark de Wever,|In Progress|
| `[thread.thread.id] <https://wg21.link/thread.thread.id>`_,| `thread::id <https://reviews.llvm.org/D131362>`_,None,Adrian Vogelsgesang,|Complete|
diff --git a/third_party/llvm-project/libcxx/docs/TestingLibcxx.rst b/third_party/llvm-project/libcxx/docs/TestingLibcxx.rst
index 283646a..9a69000 100644
--- a/third_party/llvm-project/libcxx/docs/TestingLibcxx.rst
+++ b/third_party/llvm-project/libcxx/docs/TestingLibcxx.rst
@@ -5,6 +5,8 @@
.. contents::
:local:
+.. _testing:
+
Getting Started
===============
@@ -100,8 +102,28 @@
These tools are:
- clang-tidy (you might need additional dev packages to compile libc++-specific clang-tidy checks)
+Reproducing CI issues locally
+-----------------------------
+
+Libc++ has extensive CI that tests various configurations of the library. The testing for
+all these configurations is located in ``libcxx/utils/ci/run-buildbot``. Most of our
+CI jobs are being run on a Docker image for reproducibility. The definition of this Docker
+image is located in ``libcxx/utils/ci/Dockerfile``. If you are looking to reproduce the
+failure of a specific CI job locally, you should first drop into a Docker container that
+matches our CI images by running ``libcxx/utils/ci/run-buildbot-container``, and then run
+the specific CI job that you're interested in (from within the container) using the ``run-buildbot``
+script above. If you want to control which compiler is used, you can set the ``CC`` and the
+``CXX`` environment variables before calling ``run-buildbot`` to select the right compiler.
+Take note that some CI jobs are testing the library on specific platforms and are *not* run
+in our Docker image. In the general case, it is not possible to reproduce these failures
+locally, unless they aren't specific to the platform.
+
+Also note that the Docker container shares the same filesystem as your local machine, so
+modifying files on your local machine will also modify what the Docker container sees.
+This is useful for editing source files as you're testing your code in the Docker container.
+
Writing Tests
--------------
+=============
When writing tests for the libc++ test suite, you should follow a few guidelines.
This will ensure that your tests can run on a wide variety of hardware and under
@@ -123,6 +145,189 @@
necessarily available on all devices we may want to run the tests on (even
though supporting Python is probably trivial for the build-host).
+Structure of the testing related directories
+--------------------------------------------
+
+The tests of libc++ are stored in libc++'s testing related subdirectories:
+
+- ``libcxx/test/support`` This directory contains several helper headers with
+ generic parts for the tests. The most important header is ``test_macros.h``.
+ This file contains configuration information regarding the platform used.
+ This is similar to the ``__config`` file in libc++'s ``include`` directory.
+ Since libc++'s tests are used by other Standard libraries, tests should use
+ the ``TEST_FOO`` macros instead of the ``_LIBCPP_FOO`` macros, which are
+ specific to libc++.
+- ``libcxx/test/std`` This directory contains the tests that validate the library under
+ test conforms to the C++ Standard. The paths and the names of the test match
+ the section names in the C++ Standard. Note that the C++ Standard sometimes
+ reorganises its structure, therefore some tests are at a location based on
+ where they appeared historically in the standard. We try to strike a balance
+ between keeping things at up-to-date locations and unnecessary churn.
+- ``libcxx/test/libcxx`` This directory contains the tests that validate libc++
+ specific behavior and implementation details. For example, libc++ has
+ "wrapped iterators" that perform bounds checks. Since those are specific to
+ libc++ and not mandated by the Standard, tests for those are located under
+ ``libcxx/test/libcxx``. The structure of this directories follows the
+ structure of ``libcxx/test/std``.
+
+Structure of a test
+-------------------
+
+Some platforms where libc++ is tested have requirement on the signature of
+``main`` and require ``main`` to explicitly return a value. Therefore the
+typical ``main`` function should look like:
+
+.. code-block:: cpp
+
+ int main(int, char**) {
+ ...
+ return 0;
+ }
+
+
+The C++ Standard has ``constexpr`` requirements. The typical way to test that,
+is to create a helper ``test`` function that returns a ``bool`` and use the
+following ``main`` function:
+
+.. code-block:: cpp
+
+ constexpr bool test() {
+ ...
+ return true;
+ }
+
+ int main(int, char**) {
+ test()
+ static_assert(test());
+
+ return 0;
+ }
+
+Tests in libc++ mainly use ``assert`` and ``static_assert`` for testing. There
+are a few helper macros and function that can be used to make it easier to
+write common tests.
+
+libcxx/test/support/assert_macros.h
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The header contains several macros with user specified log messages. This is
+useful when a normal assertion failure lacks the information to easily
+understand why the test has failed. This usually happens when the test is in a
+helper function. For example the ``std::format`` tests use a helper function
+for its validation. When the test fails it will give the line in the helper
+function with the condition ``out == expected`` failed. Without knowing what
+the value of ``format string``, ``out`` and ``expected`` are it is not easy to
+understand why the test has failed. By logging these three values the point of
+failure can be found without resorting to a debugger.
+
+Several of these macros are documented to take an ``ARG``. This ``ARG``:
+
+ - if it is a ``const char*`` or ``std::string`` its contents are written to
+ the ``stderr``,
+ - otherwise it must be a callable that is invoked without any additional
+ arguments and is expected to produce useful output to e.g. ``stderr``.
+
+This makes it possible to write additional information when a test fails,
+either by supplying a hard-coded string or generate it at runtime.
+
+TEST_FAIL(ARG)
+^^^^^^^^^^^^^^
+
+This macro is an unconditional failure with a log message ``ARG``. The main
+use-case is to fail when code is reached that should be unreachable.
+
+
+TEST_REQUIRE(CONDITION, ARG)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This macro requires its ``CONDITION`` to evaluate to ``true``. If that fails it
+will fail the test with a log message ``ARG``.
+
+
+TEST_LIBCPP_REQUIRE((CONDITION, ARG)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If the library under test is libc++ it behaves like ``TEST_REQUIRE``, else it
+is a no-op. This makes it possible to test libc++ specific behaviour. For
+example testing whether the ``what()`` of an exception thrown matches libc++'s
+expectations. (Usually the Standard requires certain exceptions to be thrown,
+but not the contents of its ``what()`` message.)
+
+
+TEST_DOES_NOT_THROW(EXPR)
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Validates execution of ``EXPR`` does not throw an exception.
+
+TEST_THROWS_TYPE(TYPE, EXPR)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Validates the execution of ``EXPR`` throws an exception of the type ``TYPE``.
+
+
+TEST_VALIDATE_EXCEPTION(TYPE, PRED, EXPR)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Validates the execution of ``EXPR`` throws an exception of the type ``TYPE``
+which passes validation of ``PRED``. Using this macro makes it easier to write
+tests using exceptions. The code to write a test manually would be:
+
+
+.. code-block:: cpp
+
+ void test_excption([[maybe_unused]] int arg) {
+ #ifndef TEST_HAS_NO_EXCEPTIONS // do nothing when tests are disabled
+ try {
+ foo(arg);
+ assert(false); // validates foo really throws
+ } catch ([[maybe_unused]] const bar& e) {
+ LIBCPP_ASSERT(e.what() == what);
+ return;
+ }
+ assert(false); // validates bar was thrown
+ #endif
+ }
+
+The same test using a macro:
+
+.. code-block:: cpp
+
+ void test_excption([[maybe_unused]] int arg) {
+ TEST_VALIDATE_EXCEPTION(bar,
+ [](const bar& e) {
+ LIBCPP_ASSERT(e.what() == what);
+ },
+ foo(arg));
+ }
+
+
+libcxx/test/support/concat_macros.h
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This file contains a helper macro ``TEST_WRITE_CONCATENATED`` to lazily
+concatenate its arguments to a ``std::string`` and write it to ``stderr``. When
+the output can't be concatenated a default message will be written to
+``stderr``. This is useful for tests where the arguments use different
+character types like ``char`` and ``wchar_t``, the latter can't simply be
+written to ``stderrr``.
+
+This macro is in a different header as ``assert_macros.h`` since it pulls in
+additional headers.
+
+ .. note: This macro can only be used in test using C++20 or newer. The macro
+ was added at a time where most of lib++'s C++17 support was complete.
+ Since it is not expected to add this to existing tests no effort was
+ taken to make it work in earlier language versions.
+
+
+Additional reading
+------------------
+
+The function ``CxxStandardLibraryTest`` in the file
+``libcxx/utils/libcxx/test/format.py`` has documentation about writing test. It
+explains the difference between the test named ``foo.pass.cpp`` and named
+``foo.verify.cpp`` are.
+
Benchmarks
==========
diff --git a/third_party/llvm-project/libcxx/docs/index.rst b/third_party/llvm-project/libcxx/docs/index.rst
index 265d23c..abcdeab 100644
--- a/third_party/llvm-project/libcxx/docs/index.rst
+++ b/third_party/llvm-project/libcxx/docs/index.rst
@@ -44,6 +44,7 @@
Status/Cxx20
Status/Cxx2b
Status/Format
+ Status/Parallelism
Status/Ranges
Status/Spaceship
Status/Zip
@@ -116,11 +117,11 @@
=============== ========================= ============================
Target platform Target architecture Notes
=============== ========================= ============================
-macOS 10.9+ i386, x86_64, arm64 Building the shared library itself requires targetting macOS 10.11+
-FreeBSD 10+ i386, x86_64, arm
-Linux i386, x86_64, arm, arm64
+macOS 10.9+ i386, x86_64, arm64 Building the shared library itself requires targetting macOS 10.13+
+FreeBSD 12+ i386, x86_64, arm
+Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported
Windows i386, x86_64 Both MSVC and MinGW style environments
-AIX powerpc, powerpc64
+AIX 7.2TL5+ powerpc, powerpc64
=============== ========================= ============================
Generally speaking, libc++ should work on any platform that provides a fairly complete
diff --git a/third_party/llvm-project/libcxx/include/CMakeLists.txt b/third_party/llvm-project/libcxx/include/CMakeLists.txt
index a12aa1d..439cddd 100644
--- a/third_party/llvm-project/libcxx/include/CMakeLists.txt
+++ b/third_party/llvm-project/libcxx/include/CMakeLists.txt
@@ -44,6 +44,7 @@
__algorithm/iter_swap.h
__algorithm/iterator_operations.h
__algorithm/lexicographical_compare.h
+ __algorithm/lexicographical_compare_three_way.h
__algorithm/lower_bound.h
__algorithm/make_heap.h
__algorithm/make_projected.h
@@ -183,6 +184,7 @@
__algorithm/stable_partition.h
__algorithm/stable_sort.h
__algorithm/swap_ranges.h
+ __algorithm/three_way_comp_ref_type.h
__algorithm/transform.h
__algorithm/uniform_random_bit_generator_adaptor.h
__algorithm/unique.h
@@ -191,6 +193,20 @@
__algorithm/unwrap_range.h
__algorithm/upper_bound.h
__assert
+ __atomic/aliases.h
+ __atomic/atomic.h
+ __atomic/atomic_base.h
+ __atomic/atomic_flag.h
+ __atomic/atomic_init.h
+ __atomic/atomic_lock_free.h
+ __atomic/atomic_sync.h
+ __atomic/check_memory_order.h
+ __atomic/contention_t.h
+ __atomic/cxx_atomic_impl.h
+ __atomic/fence.h
+ __atomic/is_always_lock_free.h
+ __atomic/kill_dependency.h
+ __atomic/memory_order.h
__availability
__bit/bit_cast.h
__bit/bit_ceil.h
@@ -209,11 +225,17 @@
__bsd_locale_defaults.h
__bsd_locale_fallbacks.h
__charconv/chars_format.h
+ __charconv/from_chars_integral.h
__charconv/from_chars_result.h
__charconv/tables.h
+ __charconv/to_chars.h
__charconv/to_chars_base_10.h
+ __charconv/to_chars_floating_point.h
+ __charconv/to_chars_integral.h
__charconv/to_chars_result.h
+ __charconv/traits.h
__chrono/calendar.h
+ __chrono/concepts.h
__chrono/convert_to_timespec.h
__chrono/convert_to_tm.h
__chrono/day.h
@@ -272,6 +294,7 @@
__concepts/semiregular.h
__concepts/swappable.h
__concepts/totally_ordered.h
+ __condition_variable/condition_variable.h
__config
__coroutine/coroutine_handle.h
__coroutine/coroutine_traits.h
@@ -279,7 +302,11 @@
__coroutine/trivial_awaitables.h
__debug
__debug_utils/randomize_range.h
- __errc
+ __exception/exception.h
+ __exception/exception_ptr.h
+ __exception/nested_exception.h
+ __exception/operations.h
+ __exception/terminate.h
__expected/bad_expected_access.h
__expected/expected.h
__expected/unexpect.h
@@ -414,6 +441,7 @@
__mbstate_t.h
__memory/addressof.h
__memory/align.h
+ __memory/aligned_alloc.h
__memory/allocate_at_least.h
__memory/allocation_guard.h
__memory/allocator.h
@@ -446,7 +474,10 @@
__memory_resource/pool_options.h
__memory_resource/synchronized_pool_resource.h
__memory_resource/unsynchronized_pool_resource.h
- __mutex_base
+ __mutex/lock_guard.h
+ __mutex/mutex.h
+ __mutex/tag_types.h
+ __mutex/unique_lock.h
__node_handle
__numeric/accumulate.h
__numeric/adjacent_difference.h
@@ -537,8 +568,8 @@
__ranges/views.h
__ranges/zip_view.h
__split_buffer
- __std_stream
__string/char_traits.h
+ __string/constexpr_c_functions.h
__string/extern_template_lists.h
__support/android/locale_bionic.h
__support/fuchsia/xlocale.h
@@ -556,20 +587,25 @@
__support/xlocale/__nop_locale_mgmt.h
__support/xlocale/__posix_l_fallback.h
__support/xlocale/__strtonum_fallback.h
+ __system_error/errc.h
+ __system_error/error_category.h
+ __system_error/error_code.h
+ __system_error/error_condition.h
+ __system_error/system_error.h
__thread/poll_with_backoff.h
__thread/timed_backoff_policy.h
__threading_support
__tree
- __tuple_dir/apply_cv.h
- __tuple_dir/make_tuple_types.h
- __tuple_dir/pair_like.h
- __tuple_dir/sfinae_helpers.h
- __tuple_dir/tuple_element.h
- __tuple_dir/tuple_indices.h
- __tuple_dir/tuple_like.h
- __tuple_dir/tuple_like_ext.h
- __tuple_dir/tuple_size.h
- __tuple_dir/tuple_types.h
+ __tuple/apply_cv.h
+ __tuple/make_tuple_types.h
+ __tuple/pair_like.h
+ __tuple/sfinae_helpers.h
+ __tuple/tuple_element.h
+ __tuple/tuple_indices.h
+ __tuple/tuple_like.h
+ __tuple/tuple_like_ext.h
+ __tuple/tuple_size.h
+ __tuple/tuple_types.h
__type_traits/add_const.h
__type_traits/add_cv.h
__type_traits/add_lvalue_reference.h
@@ -619,6 +655,7 @@
__type_traits/is_destructible.h
__type_traits/is_empty.h
__type_traits/is_enum.h
+ __type_traits/is_equality_comparable.h
__type_traits/is_final.h
__type_traits/is_floating_point.h
__type_traits/is_function.h
@@ -683,6 +720,7 @@
__type_traits/nat.h
__type_traits/negation.h
__type_traits/noexcept_move_assign_container.h
+ __type_traits/predicate_traits.h
__type_traits/promote.h
__type_traits/rank.h
__type_traits/remove_all_extents.h
@@ -771,11 +809,8 @@
expected
experimental/__config
experimental/__memory
- experimental/algorithm
- experimental/coroutine
experimental/deque
experimental/forward_list
- experimental/functional
experimental/iterator
experimental/list
experimental/map
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/clamp.h b/third_party/llvm-project/libcxx/include/__algorithm/clamp.h
index 30ddbdc..336b93f 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/clamp.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/clamp.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY constexpr
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/comp.h b/third_party/llvm-project/libcxx/include/__algorithm/comp.h
index af8eb7b..1001e42 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/comp.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/comp.h
@@ -10,6 +10,8 @@
#define _LIBCPP___ALGORITHM_COMP_H
#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/predicate_traits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,6 +26,9 @@
}
};
+template <class _Lhs, class _Rhs>
+struct __is_trivial_equality_predicate<__equal_to, _Lhs, _Rhs> : true_type {};
+
template <class _T1, class _T2 = _T1>
struct __less
{
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/copy_n.h b/third_party/llvm-project/libcxx/include/__algorithm/copy_n.h
index b08bbdf..7089ef3 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/copy_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/copy_n.h
@@ -12,8 +12,8 @@
#include <__algorithm/copy.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/equal.h b/third_party/llvm-project/libcxx/include/__algorithm/equal.h
index cf37f46..a26299a 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/equal.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/equal.h
@@ -11,9 +11,20 @@
#define _LIBCPP___ALGORITHM_EQUAL_H
#include <__algorithm/comp.h>
+#include <__algorithm/unwrap_iter.h>
#include <__config>
+#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
+#include <__string/constexpr_c_functions.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_equality_comparable.h>
+#include <__type_traits/is_volatile.h>
+#include <__type_traits/predicate_traits.h>
+#include <__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,23 +33,42 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate& __pred) {
for (; __first1 != __last1; ++__first1, (void)++__first2)
if (!__pred(*__first1, *__first2))
return false;
return true;
}
+template <
+ class _Tp,
+ class _Up,
+ class _BinaryPredicate,
+ __enable_if_t<__is_trivial_equality_predicate<_BinaryPredicate, _Tp, _Up>::value && !is_volatile<_Tp>::value &&
+ !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ int> = 0>
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+__equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&) {
+ return std::__constexpr_memcmp(__first1, __first2, (__last1 - __first1) * sizeof(_Tp)) == 0;
+}
+
+template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
+ return std::__equal_iter_impl(
+ std::__unwrap_iter(__first1), std::__unwrap_iter(__last1), std::__unwrap_iter(__first2), __pred);
+}
+
template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) {
return std::equal(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred, input_iterator_tag, input_iterator_tag) {
for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
@@ -47,19 +77,52 @@
return __first1 == __last1 && __first2 == __last2;
}
+template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(
+ _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __comp, _Proj1& __proj1, _Proj2& __proj2) {
+ while (__first1 != __last1 && __first2 != __last2) {
+ if (!std::__invoke(__comp, std::__invoke(__proj1, *__first1), std::__invoke(__proj2, *__first2)))
+ return false;
+ ++__first1;
+ ++__first2;
+ }
+ return __first1 == __last1 && __first2 == __last2;
+}
+
+template <class _Tp,
+ class _Up,
+ class _Pred,
+ class _Proj1,
+ class _Proj2,
+ __enable_if_t<__is_trivial_equality_predicate<_Pred, _Tp, _Up>::value && __is_identity<_Proj1>::value &&
+ __is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value &&
+ __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ int> = 0>
+_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl(
+ _Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, _Proj2&) {
+ return std::__constexpr_memcmp(__first1, __first2, (__last1 - __first1) * sizeof(_Tp)) == 0;
+}
+
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
_RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag,
random_access_iterator_tag) {
if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
return false;
- return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,
- _BinaryPredicate&>(__first1, __last1, __first2, __pred);
+ __identity __proj;
+ return std::__equal_impl(
+ std::__unwrap_iter(__first1),
+ std::__unwrap_iter(__last1),
+ std::__unwrap_iter(__first2),
+ std::__unwrap_iter(__last2),
+ __pred,
+ __proj,
+ __proj);
}
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred) {
return _VSTD::__equal<_BinaryPredicate&>(
@@ -68,7 +131,7 @@
}
template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
return std::__equal(
__first1,
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/fill.h b/third_party/llvm-project/libcxx/include/__algorithm/fill.h
index 76cf4a1..0753c42 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/fill.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/fill.h
@@ -12,7 +12,6 @@
#include <__algorithm/fill_n.h>
#include <__config>
#include <__iterator/iterator_traits.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/fill_n.h b/third_party/llvm-project/libcxx/include/__algorithm/fill_n.h
index fe58c8d..e7863ac 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/fill_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/fill_n.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/find_end.h b/third_party/llvm-project/libcxx/include/__algorithm/find_end.h
index e2fee6b..edb9891 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/find_end.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/find_end.h
@@ -15,12 +15,12 @@
#include <__algorithm/search.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
#include <__iterator/reverse_iterator.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/for_each_n.h b/third_party/llvm-project/libcxx/include/__algorithm/for_each_n.h
index 38d204a..5bd7318 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/for_each_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/for_each_n.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -20,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _Size, class _Function>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator for_each_n(_InputIterator __first,
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/generate_n.h b/third_party/llvm-project/libcxx/include/__algorithm/generate_n.h
index 4525998..ff5c82d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/generate_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/generate_n.h
@@ -11,7 +11,6 @@
#include <__config>
#include <__utility/convert_to_integral.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/half_positive.h b/third_party/llvm-project/libcxx/include/__algorithm/half_positive.h
index 74aede2..5a0f4ba 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/half_positive.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/half_positive.h
@@ -10,7 +10,9 @@
#define _LIBCPP___ALGORITHM_HALF_POSITIVE_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/make_unsigned.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/in_found_result.h b/third_party/llvm-project/libcxx/include/__algorithm/in_found_result.h
index 3134d6e..d9ca287 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/in_found_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/in_found_result.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -44,6 +44,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_IN_FOUND_RESULT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/in_fun_result.h b/third_party/llvm-project/libcxx/include/__algorithm/in_fun_result.h
index 3cbb9e1..33374ed 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/in_fun_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/in_fun_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template <class _InIter1, class _Func1>
@@ -42,7 +42,7 @@
};
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/in_in_out_result.h b/third_party/llvm-project/libcxx/include/__algorithm/in_in_out_result.h
index 3e747be..6b50e0e 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/in_in_out_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/in_in_out_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -49,7 +49,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/in_in_result.h b/third_party/llvm-project/libcxx/include/__algorithm/in_in_result.h
index 2098c18..1eceb9d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/in_in_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/in_in_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -46,7 +46,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/in_out_out_result.h b/third_party/llvm-project/libcxx/include/__algorithm/in_out_out_result.h
index 4046eee..2f7a09b 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/in_out_out_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/in_out_out_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template <class _InIter1, class _OutIter1, class _OutIter2>
@@ -47,7 +47,7 @@
};
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/in_out_result.h b/third_party/llvm-project/libcxx/include/__algorithm/in_out_result.h
index 7f5a027..158b355 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/in_out_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/in_out_result.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -46,7 +46,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/is_permutation.h b/third_party/llvm-project/libcxx/include/__algorithm/is_permutation.h
index 0054456..2a7c606 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/is_permutation.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/is_permutation.h
@@ -19,8 +19,8 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
+#include <__type_traits/is_callable.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -31,7 +31,7 @@
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class = void>
struct _ConstTimeDistance : false_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2>
struct _ConstTimeDistance<_Iter1, _Sent1, _Iter2, _Sent2, __enable_if_t<
@@ -47,7 +47,7 @@
is_same<typename iterator_traits<_Iter2>::iterator_category, random_access_iterator_tag>::value
> > : true_type {};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// Internal functions
@@ -202,7 +202,7 @@
return std::is_permutation(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// 2+2 iterators
template <class _ForwardIterator1, class _ForwardIterator2>
@@ -231,7 +231,7 @@
__pred, __identity(), __identity());
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/iterator_operations.h b/third_party/llvm-project/libcxx/include/__algorithm/iterator_operations.h
index bd3e6f1..2bdc0ac 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/iterator_operations.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/iterator_operations.h
@@ -37,7 +37,7 @@
template <class _AlgPolicy> struct _IterOps;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct _RangeAlgPolicy {};
template <>
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/lexicographical_compare_three_way.h b/third_party/llvm-project/libcxx/include/__algorithm/lexicographical_compare_three_way.h
new file mode 100644
index 0000000..377c8d2
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__algorithm/lexicographical_compare_three_way.h
@@ -0,0 +1,125 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
+#define _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
+
+#include <__algorithm/min.h>
+#include <__algorithm/three_way_comp_ref_type.h>
+#include <__compare/compare_three_way.h>
+#include <__compare/ordering.h>
+#include <__concepts/arithmetic.h>
+#include <__config>
+#include <__iterator/iterator_traits.h>
+#include <__type_traits/common_type.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+// Fast path for random access iterators which computes the number of loop iterations up-front and
+// then skips the iterator comparisons inside the loop.
+template <class _InputIterator1, class _InputIterator2, class _Cmp>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_fast_path(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp& __comp)
+ -> decltype(__comp(*__first1, *__first2)) {
+ static_assert(
+ signed_integral<__iter_diff_t<_InputIterator1>>, "Using a non-integral difference_type is undefined behavior.");
+ static_assert(
+ signed_integral<__iter_diff_t<_InputIterator2>>, "Using a non-integral difference_type is undefined behavior.");
+
+ using _Len1 = __iter_diff_t<_InputIterator1>;
+ using _Len2 = __iter_diff_t<_InputIterator2>;
+ using _Common = common_type_t<_Len1, _Len2>;
+
+ _Len1 __len1 = __last1 - __first1;
+ _Len2 __len2 = __last2 - __first2;
+ _Common __min_len = std::min<_Common>(__len1, __len2);
+
+ for (_Common __i = 0; __i < __min_len; ++__i) {
+ auto __c = __comp(*__first1, *__first2);
+ if (__c != 0) {
+ return __c;
+ }
+ ++__first1;
+ ++__first2;
+ }
+
+ return __len1 <=> __len2;
+}
+
+// Unoptimized implementation which compares the iterators against the end in every loop iteration
+template <class _InputIterator1, class _InputIterator2, class _Cmp>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __lexicographical_compare_three_way_slow_path(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp& __comp)
+ -> decltype(__comp(*__first1, *__first2)) {
+ while (true) {
+ bool __exhausted1 = __first1 == __last1;
+ bool __exhausted2 = __first2 == __last2;
+
+ if (__exhausted1 || __exhausted2) {
+ if (!__exhausted1)
+ return strong_ordering::greater;
+ if (!__exhausted2)
+ return strong_ordering::less;
+ return strong_ordering::equal;
+ }
+
+ auto __c = __comp(*__first1, *__first2);
+ if (__c != 0) {
+ return __c;
+ }
+
+ ++__first1;
+ ++__first2;
+ }
+}
+
+template <class _InputIterator1, class _InputIterator2, class _Cmp>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Cmp __comp)
+ -> decltype(__comp(*__first1, *__first2)) {
+ static_assert(__comparison_category<decltype(__comp(*__first1, *__first2))>,
+ "The comparator passed to lexicographical_compare_three_way must return a comparison category type.");
+ static_assert(std::is_copy_constructible_v<_InputIterator1>, "Iterators must be copy constructible.");
+ static_assert(std::is_copy_constructible_v<_InputIterator2>, "Iterators must be copy constructible.");
+ __three_way_comp_ref_type<_Cmp> __wrapped_comp_ref(__comp);
+ if constexpr (__is_cpp17_random_access_iterator<_InputIterator1>::value &&
+ __is_cpp17_random_access_iterator<_InputIterator2>::value) {
+ return std::__lexicographical_compare_three_way_fast_path(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __wrapped_comp_ref);
+ } else {
+ // Unoptimized implementation which compares the iterators against the end in every loop iteration
+ return std::__lexicographical_compare_three_way_slow_path(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), __wrapped_comp_ref);
+ }
+}
+
+template <class _InputIterator1, class _InputIterator2>
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto lexicographical_compare_three_way(
+ _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
+ return std::lexicographical_compare_three_way(
+ std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2), std::compare_three_way());
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/lower_bound.h b/third_party/llvm-project/libcxx/include/__algorithm/lower_bound.h
index 2648982..8109393 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/lower_bound.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/lower_bound.h
@@ -20,7 +20,6 @@
#include <__iterator/iterator_traits.h>
#include <__type_traits/is_callable.h>
#include <__type_traits/remove_reference.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/make_projected.h b/third_party/llvm-project/libcxx/include/__algorithm/make_projected.h
index 87d4d59..defda46 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/make_projected.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/make_projected.h
@@ -55,25 +55,12 @@
};
-template <class _Pred, class _Proj, class = void>
-struct __can_use_pristine_comp : false_type {};
-
-template <class _Pred, class _Proj>
-struct __can_use_pristine_comp<_Pred, _Proj, __enable_if_t<
- !is_member_pointer<typename decay<_Pred>::type>::value && (
-#if _LIBCPP_STD_VER > 17
- is_same<typename decay<_Proj>::type, identity>::value ||
-#endif
- is_same<typename decay<_Proj>::type, __identity>::value
- )
-> > : true_type {};
-
-template <class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
-__enable_if_t<
- !__can_use_pristine_comp<_Pred, _Proj>::value,
- _ProjectedPred<_Pred, _Proj>
->
+template <class _Pred,
+ class _Proj,
+ __enable_if_t<!(!is_member_pointer<__decay_t<_Pred> >::value &&
+ __is_identity<__decay_t<_Proj> >::value),
+ int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ProjectedPred<_Pred, _Proj>
__make_projected(_Pred& __pred, _Proj& __proj) {
return _ProjectedPred<_Pred, _Proj>(__pred, __proj);
}
@@ -81,28 +68,27 @@
// Avoid creating the functor and just use the pristine comparator -- for certain algorithms, this would enable
// optimizations that rely on the type of the comparator. Additionally, this results in less layers of indirection in
// the call stack when the comparator is invoked, even in an unoptimized build.
-template <class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
-__enable_if_t<
- __can_use_pristine_comp<_Pred, _Proj>::value,
- _Pred&
->
-__make_projected(_Pred& __pred, _Proj&) {
+template <class _Pred,
+ class _Proj,
+ __enable_if_t<!is_member_pointer<__decay_t<_Pred> >::value &&
+ __is_identity<__decay_t<_Proj> >::value,
+ int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Pred& __make_projected(_Pred& __pred, _Proj&) {
return __pred;
}
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Comp, class _Proj1, class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr static
+_LIBCPP_HIDE_FROM_ABI constexpr
decltype(auto) __make_projected_comp(_Comp& __comp, _Proj1& __proj1, _Proj2& __proj2) {
- if constexpr (same_as<decay_t<_Proj1>, identity> && same_as<decay_t<_Proj2>, identity> &&
+ if constexpr (__is_identity<decay_t<_Proj1>>::value && __is_identity<decay_t<_Proj2>>::value &&
!is_member_pointer_v<decay_t<_Comp>>) {
// Avoid creating the lambda and just use the pristine comparator -- for certain algorithms, this would enable
// optimizations that rely on the type of the comparator.
@@ -121,6 +107,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_MAKE_PROJECTED_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/max.h b/third_party/llvm-project/libcxx/include/__algorithm/max.h
index a08a3fc..97f61f2 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/max.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/max.h
@@ -28,7 +28,7 @@
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp)
{
return __comp(__a, __b) ? __b : __a;
}
@@ -37,7 +37,7 @@
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-max(const _Tp& __a, const _Tp& __b)
+max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
{
return _VSTD::max(__a, __b, __less<_Tp>());
}
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/min.h b/third_party/llvm-project/libcxx/include/__algorithm/min.h
index 2882485..d073a16 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/min.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/min.h
@@ -28,7 +28,7 @@
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp)
{
return __comp(__b, __a) ? __b : __a;
}
@@ -37,7 +37,7 @@
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const _Tp&
-min(const _Tp& __a, const _Tp& __b)
+min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
{
return _VSTD::min(__a, __b, __less<_Tp>());
}
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/min_max_result.h b/third_party/llvm-project/libcxx/include/__algorithm/min_max_result.h
index 4be3999..ef2d990 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/min_max_result.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/min_max_result.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -47,7 +47,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/minmax.h b/third_party/llvm-project/libcxx/include/__algorithm/minmax.h
index 6ef0a77..f486de2 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/minmax.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/minmax.h
@@ -27,7 +27,7 @@
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<const _Tp&, const _Tp&>
-minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
+minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp)
{
return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) :
pair<const _Tp&, const _Tp&>(__a, __b);
@@ -37,7 +37,7 @@
_LIBCPP_NODISCARD_EXT inline
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<const _Tp&, const _Tp&>
-minmax(const _Tp& __a, const _Tp& __b)
+minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b)
{
return std::minmax(__a, __b, __less<_Tp>());
}
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/minmax_element.h b/third_party/llvm-project/libcxx/include/__algorithm/minmax_element.h
index caa963e..1ac4078 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/minmax_element.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/minmax_element.h
@@ -12,9 +12,10 @@
#include <__algorithm/comp.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_callable.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/mismatch.h b/third_party/llvm-project/libcxx/include/__algorithm/mismatch.h
index 600e2cd..e5b014f 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/mismatch.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/mismatch.h
@@ -38,7 +38,7 @@
return std::mismatch(__first1, __last1, __first2, __equal_to());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InputIterator1, _InputIterator2>
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/partial_sort.h b/third_party/llvm-project/libcxx/include/__algorithm/partial_sort.h
index e0812af..4b8e0e7 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/partial_sort.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/partial_sort.h
@@ -19,8 +19,9 @@
#include <__debug>
#include <__debug_utils/randomize_range.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/partition.h b/third_party/llvm-project/libcxx/include/__algorithm/partition.h
index 0e094bf8..a58dd64 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/partition.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/partition.h
@@ -14,7 +14,6 @@
#include <__iterator/iterator_traits.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/pop_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/pop_heap.h
index 94d32a4..4187523 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/pop_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/pop_heap.h
@@ -17,8 +17,9 @@
#include <__assert>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/push_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/push_heap.h
index 9068495..e831162 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/push_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/push_heap.h
@@ -14,8 +14,9 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_adjacent_find.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_adjacent_find.h
index d338d13..e3de36b 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_adjacent_find.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_adjacent_find.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -73,6 +73,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ADJACENT_FIND_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_all_of.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_all_of.h
index e45c4e5..494a77d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_all_of.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_all_of.h
@@ -22,7 +22,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -63,6 +63,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ALL_OF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_any_of.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_any_of.h
index e7d1e72..eb102bd 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_any_of.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_any_of.h
@@ -22,7 +22,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -63,6 +63,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ANY_OF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_binary_search.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_binary_search.h
index b2a8977..d89597e 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_binary_search.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_binary_search.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -36,7 +36,7 @@
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
bool operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
auto __ret = std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
- return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__first));
+ return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__ret));
}
template <forward_range _Range, class _Type, class _Proj = identity,
@@ -46,7 +46,7 @@
auto __first = ranges::begin(__r);
auto __last = ranges::end(__r);
auto __ret = std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
- return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__first));
+ return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__ret));
}
};
} // namespace __binary_search
@@ -58,6 +58,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_BINARY_SEARCH_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_clamp.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_clamp.h
index 09a97fc..45a8464 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_clamp.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_clamp.h
@@ -22,7 +22,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -60,6 +60,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_CLAMP_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy.h
index bb02c84..f5700c3 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -62,6 +62,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_backward.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_backward.h
index f41af66..b7b5b88 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_backward.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_backward.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -60,6 +60,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COPY_BACKWARD_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_if.h
index dba41c3..b714e4c 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_if.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -76,6 +76,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COPY_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_n.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_n.h
index 04bb80b..30ee019 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_copy_n.h
@@ -27,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -70,7 +70,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_count.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_count.h
index 527dd06..677ee38 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_count.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_count.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -57,6 +57,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COUNT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_count_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_count_if.h
index 931618b..48c4370 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_count_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_count_if.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -67,6 +67,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_COUNT_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal.h
index 3c417f0..8754453 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal.h
@@ -9,6 +9,8 @@
#ifndef _LIBCPP___ALGORITHM_RANGES_EQUAL_H
#define _LIBCPP___ALGORITHM_RANGES_EQUAL_H
+#include <__algorithm/equal.h>
+#include <__algorithm/unwrap_range.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
@@ -24,36 +26,13 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __equal {
struct __fn {
-private:
- template <class _Iter1, class _Sent1,
- class _Iter2, class _Sent2,
- class _Pred,
- class _Proj1,
- class _Proj2>
- _LIBCPP_HIDE_FROM_ABI constexpr static
- bool __equal_impl(_Iter1 __first1, _Sent1 __last1,
- _Iter2 __first2, _Sent2 __last2,
- _Pred& __pred,
- _Proj1& __proj1,
- _Proj2& __proj2) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (!std::invoke(__pred, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__first2)))
- return false;
- ++__first1;
- ++__first2;
- }
- return __first1 == __last1 && __first2 == __last2;
- }
-
-public:
-
template <input_iterator _Iter1, sentinel_for<_Iter1> _Sent1,
input_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
class _Pred = ranges::equal_to,
@@ -70,11 +49,13 @@
if (__last1 - __first1 != __last2 - __first2)
return false;
}
- return __equal_impl(std::move(__first1), std::move(__last1),
- std::move(__first2), std::move(__last2),
- __pred,
- __proj1,
- __proj2);
+ auto __unwrapped1 = std::__unwrap_range(std::move(__first1), std::move(__last1));
+ auto __unwrapped2 = std::__unwrap_range(std::move(__first2), std::move(__last2));
+ return std::__equal_impl(std::move(__unwrapped1.first), std::move(__unwrapped1.second),
+ std::move(__unwrapped2.first), std::move(__unwrapped2.second),
+ __pred,
+ __proj1,
+ __proj2);
}
template <input_range _Range1,
@@ -93,11 +74,13 @@
if (ranges::distance(__range1) != ranges::distance(__range2))
return false;
}
- return __equal_impl(ranges::begin(__range1), ranges::end(__range1),
- ranges::begin(__range2), ranges::end(__range2),
- __pred,
- __proj1,
- __proj2);
+ auto __unwrapped1 = std::__unwrap_range(ranges::begin(__range1), ranges::end(__range1));
+ auto __unwrapped2 = std::__unwrap_range(ranges::begin(__range2), ranges::end(__range2));
+ return std::__equal_impl(std::move(__unwrapped1.first), std::move(__unwrapped1.second),
+ std::move(__unwrapped2.first), std::move(__unwrapped2.second),
+ __pred,
+ __proj1,
+ __proj2);
return false;
}
};
@@ -110,6 +93,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal_range.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal_range.h
index 94dc058..075634a 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal_range.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_equal_range.h
@@ -30,7 +30,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -73,6 +73,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill.h
index 6ebc2bd..4e0594c 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -54,6 +54,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FILL_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill_n.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill_n.h
index a2660e8..c5f7e6e 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_fill_n.h
@@ -17,7 +17,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -43,6 +43,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FILL_N_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find.h
index 580c2a1..87f25d1 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -58,6 +58,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_end.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_end.h
index ea36f4d..2d46e8c 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_end.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_end.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -93,6 +93,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_END_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_first_of.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_first_of.h
index 9d66e75..5699583 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_first_of.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_first_of.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -96,6 +96,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_FIRST_OF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if.h
index 45ce6e4..6e2bd4c 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if.h
@@ -24,14 +24,14 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
template <class _Ip, class _Sp, class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI static constexpr
+_LIBCPP_HIDE_FROM_ABI constexpr
_Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
for (; __first != __last; ++__first) {
if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -66,6 +66,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if_not.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if_not.h
index 3dd1213..e60ee2b 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if_not.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_find_if_not.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -58,6 +58,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each.h
index 0c70c05..a72f779 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -73,6 +73,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FOR_EACH_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each_n.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each_n.h
index 261816a..daf0a5d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_for_each_n.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -61,6 +61,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_FOR_EACH_N_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate.h
index ae486ae..de0db16 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -68,6 +68,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate_n.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate_n.h
index e625e3a..122cd8d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_generate_n.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -57,6 +57,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_includes.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_includes.h
index 8438117..314a923 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_includes.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_includes.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -90,6 +90,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_inplace_merge.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_inplace_merge.h
index 88171a6..8f78975 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_inplace_merge.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_inplace_merge.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -80,6 +80,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap.h
index a16c075..9c77e0c 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -69,6 +69,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap_until.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap_until.h
index 8c8dac5..3b1fec7 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap_until.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_heap_until.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -70,6 +70,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_partitioned.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_partitioned.h
index b903953..6782717 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_partitioned.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_partitioned.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -76,6 +76,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_PARTITIONED_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_permutation.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_permutation.h
index b617500..95a0a82 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_permutation.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_permutation.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -84,6 +84,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_IS_PERMUTATION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted.h
index ce3032f..50c97ba 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -56,6 +56,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted_until.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted_until.h
index 17fc42e..f139d03 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted_until.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_is_sorted_until.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -71,6 +71,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_iterator_concept.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_iterator_concept.h
index 3ac6b31..9a92030 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_iterator_concept.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_iterator_concept.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -46,6 +46,6 @@
} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_lexicographical_compare.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_lexicographical_compare.h
index 2972e32..c51f4d7 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_lexicographical_compare.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_lexicographical_compare.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -93,6 +93,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_lower_bound.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_lower_bound.h
index 78cbb6d..7435639 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_lower_bound.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_lower_bound.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -61,6 +61,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_LOWER_BOUND_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_make_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_make_heap.h
index f25c7ab..7f92fa3 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_make_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_make_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -75,6 +75,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MAKE_HEAP_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_max.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_max.h
index 55aef99..2fd2970 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_max.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_max.h
@@ -20,6 +20,7 @@
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_trivially_copyable.h>
#include <__utility/move.h>
#include <initializer_list>
@@ -27,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -40,7 +41,10 @@
template <class _Tp, class _Proj = identity,
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const {
+ const _Tp& operator()(_LIBCPP_LIFETIMEBOUND const _Tp& __a,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __b,
+ _Comp __comp = {},
+ _Proj __proj = {}) const {
return std::invoke(__comp, std::invoke(__proj, __a), std::invoke(__proj, __b)) ? __b : __a;
}
@@ -64,7 +68,7 @@
_LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
- if constexpr (forward_range<_Rp>) {
+ if constexpr (forward_range<_Rp> && !__is_cheap_to_copy<range_value_t<_Rp>>) {
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
return *ranges::__min_element_impl(std::move(__first), std::move(__last), __comp_lhs_rhs_swapped, __proj);
} else {
@@ -88,6 +92,6 @@
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17 &&
+#endif // _LIBCPP_STD_VER >= 20 &&
#endif // _LIBCPP___ALGORITHM_RANGES_MAX_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_max_element.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_max_element.h
index 490f320..39e86d3 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_max_element.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_max_element.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -56,6 +56,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MAX_ELEMENT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_merge.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_merge.h
index b36a05a..c5797b0 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_merge.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_merge.h
@@ -20,14 +20,14 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -137,6 +137,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MERGE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_min.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_min.h
index 0e31f57..5e941a1 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_min.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_min.h
@@ -20,13 +20,14 @@
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_trivially_copyable.h>
#include <initializer_list>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -39,7 +40,10 @@
template <class _Tp, class _Proj = identity,
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr
- const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const {
+ const _Tp& operator()(_LIBCPP_LIFETIMEBOUND const _Tp& __a,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __b,
+ _Comp __comp = {},
+ _Proj __proj = {}) const {
return std::invoke(__comp, std::invoke(__proj, __b), std::invoke(__proj, __a)) ? __b : __a;
}
@@ -58,10 +62,8 @@
range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
auto __first = ranges::begin(__r);
auto __last = ranges::end(__r);
-
_LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
-
- if constexpr (forward_range<_Rp>) {
+ if constexpr (forward_range<_Rp> && !__is_cheap_to_copy<range_value_t<_Rp>>) {
return *ranges::__min_element_impl(__first, __last, __comp, __proj);
} else {
range_value_t<_Rp> __result = *__first;
@@ -84,6 +86,6 @@
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17 &&
+#endif // _LIBCPP_STD_VER >= 20 &&
#endif // _LIBCPP___ALGORITHM_RANGES_MIN_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_min_element.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_min_element.h
index 1751874..4c58adb 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_min_element.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_min_element.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -32,7 +32,7 @@
// TODO(ranges): `ranges::min_element` can now simply delegate to `std::__min_element`.
template <class _Ip, class _Sp, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI static constexpr
+_LIBCPP_HIDE_FROM_ABI constexpr
_Ip __min_element_impl(_Ip __first, _Sp __last, _Comp& __comp, _Proj& __proj) {
if (__first == __last)
return __first;
@@ -69,6 +69,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax.h
index f82e005..86540cc 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax.h
@@ -13,11 +13,13 @@
#include <__algorithm/minmax_element.h>
#include <__assert>
#include <__concepts/copyable.h>
+#include <__concepts/same_as.h>
#include <__config>
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__functional/ranges_operations.h>
#include <__iterator/concepts.h>
+#include <__iterator/next.h>
#include <__iterator/projected.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
@@ -30,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -46,7 +48,10 @@
template <class _Type, class _Proj = identity,
indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<const _Type&>
- operator()(const _Type& __a, const _Type& __b, _Comp __comp = {}, _Proj __proj = {}) const {
+ operator()(_LIBCPP_LIFETIMEBOUND const _Type& __a,
+ _LIBCPP_LIFETIMEBOUND const _Type& __b,
+ _Comp __comp = {},
+ _Proj __proj = {}) const {
if (std::invoke(__comp, std::invoke(__proj, __b), std::invoke(__proj, __a)))
return {__b, __a};
return {__a, __b};
@@ -73,6 +78,18 @@
_LIBCPP_ASSERT(__first != __last, "range has to contain at least one element");
if constexpr (forward_range<_Range>) {
+ // Special-case the one element case. Avoid repeatedly initializing objects from the result of an iterator
+ // dereference when doing so might not be idempotent. The `if constexpr` avoids the extra branch in cases where
+ // it's not needed.
+ if constexpr (!same_as<remove_cvref_t<range_reference_t<_Range>>, _ValueT> ||
+ is_rvalue_reference_v<range_reference_t<_Range>>) {
+ if (ranges::next(__first) == __last) {
+ // During initialization, members are allowed to refer to already initialized members
+ // (see http://eel.is/c++draft/dcl.init.aggr#6)
+ minmax_result<_ValueT> __result = {*__first, __result.min};
+ return __result;
+ }
+ }
auto __result = std::__minmax_element_impl(__first, __last, __comp, __proj);
return {*__result.first, *__result.second};
} else {
@@ -83,6 +100,8 @@
std::invoke(__proj, std::forward<decltype(__b)>(__b)));
};
+ // During initialization, members are allowed to refer to already initialized members
+ // (see http://eel.is/c++draft/dcl.init.aggr#6)
ranges::minmax_result<_ValueT> __result = {*__first, __result.min};
if (__first == __last || ++__first == __last)
return __result;
@@ -129,6 +148,6 @@
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MINMAX_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax_element.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax_element.h
index 6699f96..cbf3505 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax_element.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_minmax_element.h
@@ -23,13 +23,12 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -67,6 +66,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MINMAX_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_mismatch.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_mismatch.h
index 4fd0517..098c415 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_mismatch.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_mismatch.h
@@ -27,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -78,7 +78,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_move.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_move.h
index 46a0970..5e06e90 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_move.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_move.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -66,6 +66,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MOVE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h
index d4e8eb1..95c2c66 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -68,6 +68,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_MOVE_BACKWARD_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_next_permutation.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_next_permutation.h
index 6c8e8e1..9ebab3e 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_next_permutation.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_next_permutation.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -68,6 +68,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_NEXT_PERMUTATION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_none_of.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_none_of.h
index b39e570..39940ad 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_none_of.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_none_of.h
@@ -22,7 +22,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -63,6 +63,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_NONE_OF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_nth_element.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_nth_element.h
index d9ec4f1..96bf33b 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_nth_element.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_nth_element.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -75,6 +75,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_NTH_ELEMENT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort.h
index 3ea0a7f..4562c35 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort.h
@@ -33,7 +33,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -73,6 +73,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort_copy.h
index 212db55..5401a37 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partial_sort_copy.h
@@ -30,7 +30,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -87,6 +87,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition.h
index 8b3aae5..de839de 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition.h
@@ -27,13 +27,12 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -78,6 +77,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_copy.h
index e7a9a34..a271428 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -20,13 +20,12 @@
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -93,6 +92,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_point.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_point.h
index 2bd118d..129ebb6 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_point.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_partition_point.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -83,6 +83,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_pop_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_pop_heap.h
index 65beec8..54ea97d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_pop_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_pop_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -76,6 +76,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_POP_HEAP_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_prev_permutation.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_prev_permutation.h
index 6866d90..bf06287 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_prev_permutation.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_prev_permutation.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -72,6 +72,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PREV_PERMUTATION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_push_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_push_heap.h
index a1f4347..6e65d11 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_push_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_push_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -75,6 +75,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_PUSH_HEAP_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove.h
index dd5c5fb..6dd48e0 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -59,6 +59,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy.h
index 2102228..a9a19c1 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -71,6 +71,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy_if.h
index 4fc6745..e6d043e 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_copy_if.h
@@ -29,7 +29,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -85,6 +85,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_if.h
index 1f17467..7507c21 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_remove_if.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -80,6 +80,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace.h
index 8b12bea..258e25d 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -69,6 +69,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy.h
index f87a236..79eaebb 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -86,6 +86,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy_if.h
index b8741ec..8ff2eba 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_copy_if.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -88,6 +88,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_if.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_if.h
index 65be3c7..2b7dda9 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_if.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_replace_if.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -72,6 +72,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_IF_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse.h
index e2a5d9a..801fccb 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse.h
@@ -22,7 +22,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -78,6 +78,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REVERSE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse_copy.h
index a84b1ad..c230399 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_reverse_copy.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -62,6 +62,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_REVERSE_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate.h
index 91ed402..99e6ca6 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -66,6 +66,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ROTATE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate_copy.h
index 52f403c..5b9321f 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_rotate_copy.h
@@ -23,7 +23,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -63,6 +63,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_ROTATE_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_sample.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_sample.h
index a37cb64..a5ff2d0 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_sample.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_sample.h
@@ -19,15 +19,15 @@
#include <__random/uniform_random_bit_generator.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -69,6 +69,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SAMPLE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_search.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_search.h
index 388d5af..6d3e318 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_search.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_search.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -130,6 +130,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SEARCH_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_search_n.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_search_n.h
index 56ec8f3..ed5ec34 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_search_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_search_n.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -112,6 +112,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SEARCH_N_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_difference.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_difference.h
index 607dd68..6b9af87 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_difference.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_difference.h
@@ -30,7 +30,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -102,5 +102,5 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_DIFFERENCE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_intersection.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_intersection.h
index aa9fd24..5848656 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_intersection.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_intersection.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -113,5 +113,5 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_INTERSECTION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_symmetric_difference.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_symmetric_difference.h
index bc4a906..f8bcf37 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_symmetric_difference.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_symmetric_difference.h
@@ -28,7 +28,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -113,5 +113,5 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_union.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_union.h
index f8cd45c..bc669cc 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_union.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_set_union.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -116,6 +116,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_shuffle.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_shuffle.h
index a2f2c0e..2f45fb0 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_shuffle.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_shuffle.h
@@ -23,15 +23,15 @@
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -66,6 +66,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort.h
index 32391df..60305b1 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -74,6 +74,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SORT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort_heap.h
index 9feb0f6..b40eef9 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_sort_heap.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -75,6 +75,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SORT_HEAP_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_partition.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_partition.h
index c3469f1..77bef85 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_partition.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_partition.h
@@ -26,15 +26,15 @@
#include <__ranges/concepts.h>
#include <__ranges/dangling.h>
#include <__ranges/subrange.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -83,6 +83,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_sort.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_sort.h
index d3c48dd..b823e3b 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_sort.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_stable_sort.h
@@ -31,7 +31,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -74,6 +74,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_SORT_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_swap_ranges.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_swap_ranges.h
index 552fd55..34124db 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_swap_ranges.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_swap_ranges.h
@@ -24,7 +24,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -63,6 +63,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_SWAP_RANGES_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_transform.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_transform.h
index c0981a0..1bba756 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_transform.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_transform.h
@@ -26,7 +26,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -165,6 +165,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_TRANSFORM_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique.h
index be427cc..9e05c09 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique.h
@@ -32,7 +32,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -74,6 +74,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique_copy.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique_copy.h
index 3ad47b0..2aaa879 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique_copy.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_unique_copy.h
@@ -33,7 +33,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -111,6 +111,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/ranges_upper_bound.h b/third_party/llvm-project/libcxx/include/__algorithm/ranges_upper_bound.h
index a134080..43ce89b 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/ranges_upper_bound.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/ranges_upper_bound.h
@@ -25,7 +25,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -70,6 +70,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UPPER_BOUND_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/rotate.h b/third_party/llvm-project/libcxx/include/__algorithm/rotate.h
index 8934ce0..7ed6f18 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/rotate.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/rotate.h
@@ -15,9 +15,9 @@
#include <__algorithm/swap_ranges.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_trivially_move_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/sample.h b/third_party/llvm-project/libcxx/include/__algorithm/sample.h
index f403ba6..7a05e45 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/sample.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/sample.h
@@ -16,8 +16,8 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__random/uniform_int_distribution.h>
+#include <__type_traits/common_type.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -88,7 +88,7 @@
__g, _PopIterCategory());
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _PopulationIterator, class _SampleIterator, class _Distance,
class _UniformRandomNumberGenerator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -103,7 +103,7 @@
std::move(__first), std::move(__last), std::move(__output_iter), __n, __g);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/search.h b/third_party/llvm-project/libcxx/include/__algorithm/search.h
index 93771be..c9012d7 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/search.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/search.h
@@ -14,12 +14,13 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/enable_if.h>
#include <__type_traits/is_callable.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -187,7 +188,7 @@
return std::search(__first1, __last1, __first2, __last2, __equal_to());
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _ForwardIterator, class _Searcher>
_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) {
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/search_n.h b/third_party/llvm-project/libcxx/include/__algorithm/search_n.h
index 60a0735..06962be 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/search_n.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/search_n.h
@@ -14,14 +14,15 @@
#include <__algorithm/iterator_operations.h>
#include <__config>
#include <__functional/identity.h>
+#include <__functional/invoke.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/concepts.h>
+#include <__type_traits/is_callable.h>
#include <__utility/convert_to_integral.h>
#include <__utility/pair.h>
-#include <type_traits> // __convert_to_integral
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/set_difference.h b/third_party/llvm-project/libcxx/include/__algorithm/set_difference.h
index cffdc8f..5a7d3bc 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/set_difference.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/set_difference.h
@@ -17,9 +17,9 @@
#include <__functional/identity.h>
#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
#include <__utility/pair.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/shift_left.h b/third_party/llvm-project/libcxx/include/__algorithm/shift_left.h
index 33f06d5..403317e 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/shift_left.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/shift_left.h
@@ -12,7 +12,6 @@
#include <__algorithm/move.h>
#include <__config>
#include <__iterator/iterator_traits.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -20,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _ForwardIterator>
inline _LIBCPP_INLINE_VISIBILITY constexpr
@@ -49,7 +48,7 @@
return _VSTD::move(__m, __last, __first);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/shift_right.h b/third_party/llvm-project/libcxx/include/__algorithm/shift_right.h
index 14bc761..751e690 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/shift_right.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/shift_right.h
@@ -15,7 +15,6 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__utility/swap.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -23,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _ForwardIterator>
inline _LIBCPP_INLINE_VISIBILITY constexpr
@@ -95,7 +94,7 @@
}
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/sort.h b/third_party/llvm-project/libcxx/include/__algorithm/sort.h
index a7d2d55..f870612 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/sort.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/sort.h
@@ -26,9 +26,8 @@
#include <__functional/operations.h>
#include <__functional/ranges_operations.h>
#include <__iterator/iterator_traits.h>
-#include <__memory/destruct_n.h>
-#include <__memory/unique_ptr.h>
#include <__type_traits/conditional.h>
+#include <__type_traits/disjunction.h>
#include <__type_traits/is_arithmetic.h>
#include <__utility/move.h>
#include <__utility/pair.h>
@@ -41,52 +40,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-// Wraps an algorithm policy tag and a comparator in a single struct, used to pass the policy tag around without
-// changing the number of template arguments (to keep the ABI stable). This is only used for the "range" policy tag.
-//
-// To create an object of this type, use `_WrapAlgPolicy<T, C>::type` -- see the specialization below for the rationale.
-template <class _PolicyT, class _CompT, class = void>
-struct _WrapAlgPolicy {
- using type = _WrapAlgPolicy;
-
- using _AlgPolicy = _PolicyT;
- using _Comp = _CompT;
- _Comp& __comp;
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- _WrapAlgPolicy(_Comp& __c) : __comp(__c) {}
-};
-
-// Specialization for the "classic" policy tag that avoids creating a struct and simply defines an alias for the
-// comparator. When unwrapping, a pristine comparator is always considered to have the "classic" tag attached. Passing
-// the pristine comparator where possible allows using template instantiations from the dylib.
-template <class _PolicyT, class _CompT>
-struct _WrapAlgPolicy<_PolicyT, _CompT, __enable_if_t<std::is_same<_PolicyT, _ClassicAlgPolicy>::value> > {
- using type = _CompT;
-};
-
-// Unwraps a pristine functor (e.g. `std::less`) as if it were wrapped using `_WrapAlgPolicy`. The policy tag is always
-// set to "classic".
-template <class _CompT>
-struct _UnwrapAlgPolicy {
- using _AlgPolicy = _ClassicAlgPolicy;
- using _Comp = _CompT;
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static
- _Comp __get_comp(_Comp __comp) { return __comp; }
-};
-
-// Unwraps a `_WrapAlgPolicy` struct.
-template <class... _Ts>
-struct _UnwrapAlgPolicy<_WrapAlgPolicy<_Ts...> > {
- using _Wrapped = _WrapAlgPolicy<_Ts...>;
- using _AlgPolicy = typename _Wrapped::_AlgPolicy;
- using _Comp = typename _Wrapped::_Comp;
-
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static
- _Comp __get_comp(_Wrapped& __w) { return __w.__comp; }
-};
-
// stable, 2-3 compares, 0-2 swaps
template <class _AlgPolicy, class _Compare, class _ForwardIterator>
@@ -130,65 +83,41 @@
template <class _AlgPolicy, class _Compare, class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI
-unsigned __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4,
+void __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4,
_Compare __c) {
using _Ops = _IterOps<_AlgPolicy>;
- unsigned __r = std::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
+ std::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
if (__c(*__x4, *__x3)) {
_Ops::iter_swap(__x3, __x4);
- ++__r;
if (__c(*__x3, *__x2)) {
_Ops::iter_swap(__x2, __x3);
- ++__r;
if (__c(*__x2, *__x1)) {
_Ops::iter_swap(__x1, __x2);
- ++__r;
}
}
}
- return __r;
}
// stable, 4-10 compares, 0-9 swaps
-template <class _WrappedComp, class _ForwardIterator>
-_LIBCPP_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
- _ForwardIterator __x4, _ForwardIterator __x5, _WrappedComp __wrapped_comp) {
- using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
- using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+template <class _AlgPolicy, class _Comp, class _ForwardIterator>
+_LIBCPP_HIDE_FROM_ABI void __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
+ _ForwardIterator __x4, _ForwardIterator __x5, _Comp __comp) {
using _Ops = _IterOps<_AlgPolicy>;
- using _Compare = typename _Unwrap::_Comp;
- _Compare __c = _Unwrap::__get_comp(__wrapped_comp);
-
- unsigned __r = std::__sort4<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __c);
- if (__c(*__x5, *__x4)) {
+ std::__sort4<_AlgPolicy, _Comp>(__x1, __x2, __x3, __x4, __comp);
+ if (__comp(*__x5, *__x4)) {
_Ops::iter_swap(__x4, __x5);
- ++__r;
- if (__c(*__x4, *__x3)) {
+ if (__comp(*__x4, *__x3)) {
_Ops::iter_swap(__x3, __x4);
- ++__r;
- if (__c(*__x3, *__x2)) {
+ if (__comp(*__x3, *__x2)) {
_Ops::iter_swap(__x2, __x3);
- ++__r;
- if (__c(*__x2, *__x1)) {
+ if (__comp(*__x2, *__x1)) {
_Ops::iter_swap(__x1, __x2);
- ++__r;
}
}
}
}
- return __r;
-}
-
-template <class _AlgPolicy, class _Compare, class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI unsigned __sort5_wrap_policy(
- _ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4, _ForwardIterator __x5,
- _Compare __c) {
- using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
- _WrappedComp __wrapped_comp(__c);
- return std::__sort5<_WrappedComp, _ForwardIterator>(
- std::move(__x1), std::move(__x2), std::move(__x3), std::move(__x4), std::move(__x5), __wrapped_comp);
}
// The comparator being simple is a prerequisite for using the branchless optimization.
@@ -200,7 +129,7 @@
struct __is_simple_comparator<less<_Tp>&> : true_type {};
template <class _Tp>
struct __is_simple_comparator<greater<_Tp>&> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
struct __is_simple_comparator<ranges::less&> : true_type {};
template <>
@@ -299,7 +228,8 @@
inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
__sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
_RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
- std::__sort5_wrap_policy<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __x5, __c);
+ std::__sort5<_AlgPolicy, _Compare, _RandomAccessIterator>(
+ std::move(__x1), std::move(__x2), std::move(__x3), std::move(__x4), std::move(__x5), __c);
}
// Assumes size > 0
@@ -344,7 +274,7 @@
// Sort the iterator range [__first, __last) using the comparator __comp using
// the insertion sort algorithm. Insertion sort has two loops, outer and inner.
-// The implementation below has not bounds check (unguarded) for the inner loop.
+// The implementation below has no bounds check (unguarded) for the inner loop.
// Assumes that there is an element in the position (__first - 1) and that each
// element in the input range is greater or equal to the element at __first - 1.
template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
@@ -370,16 +300,11 @@
}
}
-template <class _WrappedComp, class _RandomAccessIterator>
-_LIBCPP_HIDDEN bool __insertion_sort_incomplete(
- _RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) {
- using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
- using _AlgPolicy = typename _Unwrap::_AlgPolicy;
+template <class _AlgPolicy, class _Comp, class _RandomAccessIterator>
+_LIBCPP_HIDE_FROM_ABI bool __insertion_sort_incomplete(
+ _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
using _Ops = _IterOps<_AlgPolicy>;
- using _Compare = typename _Unwrap::_Comp;
- _Compare __comp = _Unwrap::__get_comp(__wrapped_comp);
-
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
switch (__last - __first) {
case 0:
@@ -390,21 +315,21 @@
_Ops::iter_swap(__first, __last);
return true;
case 3:
- std::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), --__last, __comp);
+ std::__sort3_maybe_branchless<_AlgPolicy, _Comp>(__first, __first + difference_type(1), --__last, __comp);
return true;
case 4:
- std::__sort4_maybe_branchless<_AlgPolicy, _Compare>(
+ std::__sort4_maybe_branchless<_AlgPolicy, _Comp>(
__first, __first + difference_type(1), __first + difference_type(2), --__last, __comp);
return true;
case 5:
- std::__sort5_maybe_branchless<_AlgPolicy, _Compare>(
+ std::__sort5_maybe_branchless<_AlgPolicy, _Comp>(
__first, __first + difference_type(1), __first + difference_type(2), __first + difference_type(3),
--__last, __comp);
return true;
}
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
_RandomAccessIterator __j = __first + difference_type(2);
- std::__sort3_maybe_branchless<_AlgPolicy, _Compare>(__first, __first + difference_type(1), __j, __comp);
+ std::__sort3_maybe_branchless<_AlgPolicy, _Comp>(__first, __first + difference_type(1), __j, __comp);
const unsigned __limit = 8;
unsigned __count = 0;
for (_RandomAccessIterator __i = __j + difference_type(1); __i != __last; ++__i) {
@@ -425,37 +350,6 @@
return true;
}
-template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
-_LIBCPP_HIDE_FROM_ABI
-void __insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
- typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) {
- using _Ops = _IterOps<_AlgPolicy>;
-
- typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
- if (__first1 != __last1) {
- __destruct_n __d(0);
- unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
- value_type* __last2 = __first2;
- ::new ((void*)__last2) value_type(_Ops::__iter_move(__first1));
- __d.template __incr<value_type>();
- for (++__last2; ++__first1 != __last1; ++__last2) {
- value_type* __j2 = __last2;
- value_type* __i2 = __j2;
- if (__comp(*__first1, *--__i2)) {
- ::new ((void*)__j2) value_type(std::move(*__i2));
- __d.template __incr<value_type>();
- for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
- *__j2 = std::move(*__i2);
- *__j2 = _Ops::__iter_move(__first1);
- } else {
- ::new ((void*)__j2) value_type(_Ops::__iter_move(__first1));
- __d.template __incr<value_type>();
- }
- }
- __h.release();
- }
-}
-
template <class _AlgPolicy, class _RandomAccessIterator>
inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos(
_RandomAccessIterator __first, _RandomAccessIterator __last, uint64_t& __left_bitset, uint64_t& __right_bitset) {
@@ -464,11 +358,11 @@
// Swap one pair on each iteration as long as both bitsets have at least one
// element for swapping.
while (__left_bitset != 0 && __right_bitset != 0) {
- difference_type tz_left = __libcpp_ctz(__left_bitset);
- __left_bitset = __libcpp_blsr(__left_bitset);
- difference_type tz_right = __libcpp_ctz(__right_bitset);
- __right_bitset = __libcpp_blsr(__right_bitset);
- _Ops::iter_swap(__first + tz_left, __last - tz_right);
+ difference_type __tz_left = __libcpp_ctz(__left_bitset);
+ __left_bitset = __libcpp_blsr(__left_bitset);
+ difference_type __tz_right = __libcpp_ctz(__right_bitset);
+ __right_bitset = __libcpp_blsr(__right_bitset);
+ _Ops::iter_swap(__first + __tz_left, __last - __tz_right);
}
}
@@ -533,9 +427,9 @@
// Record the comparison outcomes for the elements currently on the left side.
if (__left_bitset == 0) {
_RandomAccessIterator __iter = __first;
- for (int j = 0; j < __l_size; j++) {
+ for (int __j = 0; __j < __l_size; __j++) {
bool __comp_result = !__comp(*__iter, __pivot);
- __left_bitset |= (static_cast<uint64_t>(__comp_result) << j);
+ __left_bitset |= (static_cast<uint64_t>(__comp_result) << __j);
++__iter;
}
}
@@ -543,9 +437,9 @@
// side.
if (__right_bitset == 0) {
_RandomAccessIterator __iter = __lm1;
- for (int j = 0; j < __r_size; j++) {
+ for (int __j = 0; __j < __r_size; __j++) {
bool __comp_result = __comp(*__iter, __pivot);
- __right_bitset |= (static_cast<uint64_t>(__comp_result) << j);
+ __right_bitset |= (static_cast<uint64_t>(__comp_result) << __j);
--__iter;
}
}
@@ -565,9 +459,9 @@
while (__left_bitset != 0) {
difference_type __tz_left = __detail::__block_size - 1 - __libcpp_clz(__left_bitset);
__left_bitset &= (static_cast<uint64_t>(1) << __tz_left) - 1;
- _RandomAccessIterator it = __first + __tz_left;
- if (it != __lm1) {
- _Ops::iter_swap(it, __lm1);
+ _RandomAccessIterator __it = __first + __tz_left;
+ if (__it != __lm1) {
+ _Ops::iter_swap(__it, __lm1);
}
--__lm1;
}
@@ -578,9 +472,9 @@
while (__right_bitset != 0) {
difference_type __tz_right = __detail::__block_size - 1 - __libcpp_clz(__right_bitset);
__right_bitset &= (static_cast<uint64_t>(1) << __tz_right) - 1;
- _RandomAccessIterator it = __lm1 - __tz_right;
- if (it != __first) {
- _Ops::iter_swap(it, __first);
+ _RandomAccessIterator __it = __lm1 - __tz_right;
+ if (__it != __first) {
+ _Ops::iter_swap(__it, __first);
}
++__first;
}
@@ -862,10 +756,8 @@
// [__first, __i) < *__i and *__i <= [__i+1, __last)
// If we were given a perfect partition, see if insertion sort is quick...
if (__ret.second) {
- using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
- _WrappedComp __wrapped_comp(__comp);
- bool __fs = std::__insertion_sort_incomplete<_WrappedComp>(__first, __i, __wrapped_comp);
- if (std::__insertion_sort_incomplete<_WrappedComp>(__i + difference_type(1), __last, __wrapped_comp)) {
+ bool __fs = std::__insertion_sort_incomplete<_AlgPolicy, _Compare>(__first, __i, __comp);
+ if (std::__insertion_sort_incomplete<_AlgPolicy, _Compare>(__i + difference_type(1), __last, __comp)) {
if (__fs)
return;
__last = __i;
@@ -904,30 +796,8 @@
return __log2;
}
-template <class _WrappedComp, class _RandomAccessIterator>
-_LIBCPP_HIDDEN void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) {
- typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- difference_type __depth_limit = 2 * std::__log2i(__last - __first);
-
- using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
- using _AlgPolicy = typename _Unwrap::_AlgPolicy;
- using _Compare = typename _Unwrap::_Comp;
- _Compare __comp = _Unwrap::__get_comp(__wrapped_comp);
- // Only use bitset partitioning for arithmetic types. We should also check
- // that the default comparator is in use so that we are sure that there are no
- // branches in the comparator.
- std::__introsort<_AlgPolicy,
- _Compare,
- _RandomAccessIterator,
- __use_branchless_sort<_Compare, _RandomAccessIterator>::value>(
- __first, __last, __comp, __depth_limit);
-}
-
-template <class _Compare, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY void __sort(_Tp** __first, _Tp** __last, __less<_Tp*>&) {
- __less<uintptr_t> __comp;
- std::__sort<__less<uintptr_t>&, uintptr_t*>((uintptr_t*)__first, (uintptr_t*)__last, __comp);
-}
+template <class _Comp, class _RandomAccessIterator>
+void __sort(_RandomAccessIterator, _RandomAccessIterator, _Comp);
extern template _LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -947,40 +817,83 @@
extern template _LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
extern template _LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
-#endif
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
+template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
+__sort_dispatch(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
+ difference_type __depth_limit = 2 * std::__log2i(__last - __first);
-extern template _LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
+ // Only use bitset partitioning for arithmetic types. We should also check
+ // that the default comparator is in use so that we are sure that there are no
+ // branches in the comparator.
+ std::__introsort<_AlgPolicy,
+ _Comp&,
+ _RandomAccessIterator,
+ __use_branchless_sort<_Comp, _RandomAccessIterator>::value>(
+ __first, __last, __comp, __depth_limit);
+}
+
+template <class _Type, class... _Options>
+using __is_any_of = _Or<is_same<_Type, _Options>...>;
+
+template <class _Type>
+using __sort_is_specialized_in_library = __is_any_of<
+ _Type,
+ char,
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ wchar_t,
+#endif
+ signed char,
+ unsigned char,
+ short,
+ unsigned short,
+ int,
+ unsigned int,
+ long,
+ unsigned long,
+ long long,
+ unsigned long long,
+ float,
+ double,
+ long double>;
+
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, __less<_Type>& __comp) {
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<_Type>&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+
+#if _LIBCPP_STD_VER >= 14
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<>&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, ranges::less&) {
+ __less<_Type> __comp;
+ std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
+}
+#endif
template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
std::__debug_randomize_range<_AlgPolicy>(__first, __last);
- using _Comp_ref = __comp_ref_type<_Comp>;
if (__libcpp_is_constant_evaluated()) {
- std::__partial_sort<_AlgPolicy>(__first, __last, __last, __comp);
-
+ std::__partial_sort<_AlgPolicy>(
+ std::__unwrap_iter(__first), std::__unwrap_iter(__last), std::__unwrap_iter(__last), __comp);
} else {
- using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Comp_ref>::type;
- _Comp_ref __comp_ref(__comp);
- _WrappedComp __wrapped_comp(__comp_ref);
- std::__sort<_WrappedComp>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __wrapped_comp);
+ std::__sort_dispatch<_AlgPolicy>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
}
}
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/sort_heap.h b/third_party/llvm-project/libcxx/include/__algorithm/sort_heap.h
index 8249407..0dc9acc 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/sort_heap.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/sort_heap.h
@@ -15,8 +15,9 @@
#include <__algorithm/pop_heap.h>
#include <__config>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/is_copy_assignable.h>
+#include <__type_traits/is_copy_constructible.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/stable_partition.h b/third_party/llvm-project/libcxx/include/__algorithm/stable_partition.h
index a49de6d..3b68bd3 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/stable_partition.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/stable_partition.h
@@ -21,7 +21,6 @@
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/stable_sort.h b/third_party/llvm-project/libcxx/include/__algorithm/stable_sort.h
index 8e70978..0c9daa2 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/stable_sort.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/stable_sort.h
@@ -19,10 +19,10 @@
#include <__memory/destruct_n.h>
#include <__memory/temporary_buffer.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <new>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,6 +30,37 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
+_LIBCPP_HIDE_FROM_ABI
+void __insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
+ typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) {
+ using _Ops = _IterOps<_AlgPolicy>;
+
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
+ if (__first1 != __last1) {
+ __destruct_n __d(0);
+ unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
+ value_type* __last2 = __first2;
+ ::new ((void*)__last2) value_type(_Ops::__iter_move(__first1));
+ __d.template __incr<value_type>();
+ for (++__last2; ++__first1 != __last1; ++__last2) {
+ value_type* __j2 = __last2;
+ value_type* __i2 = __j2;
+ if (__comp(*__first1, *--__i2)) {
+ ::new ((void*)__j2) value_type(std::move(*__i2));
+ __d.template __incr<value_type>();
+ for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
+ *__j2 = std::move(*__i2);
+ *__j2 = _Ops::__iter_move(__first1);
+ } else {
+ ::new ((void*)__j2) value_type(_Ops::__iter_move(__first1));
+ __d.template __incr<value_type>();
+ }
+ }
+ __h.release();
+ }
+}
+
template <class _AlgPolicy, class _Compare, class _InputIterator1, class _InputIterator2>
_LIBCPP_HIDE_FROM_ABI void
__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/three_way_comp_ref_type.h b/third_party/llvm-project/libcxx/include/__algorithm/three_way_comp_ref_type.h
new file mode 100644
index 0000000..10396e0
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__algorithm/three_way_comp_ref_type.h
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
+#define _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__debug>
+#include <__utility/declval.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Comp>
+struct __debug_three_way_comp {
+ _Comp& __comp_;
+ _LIBCPP_HIDE_FROM_ABI constexpr __debug_three_way_comp(_Comp& __c) : __comp_(__c) {}
+
+ template <class _Tp, class _Up>
+ _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __x, _Up& __y) {
+ auto __r = __comp_(__x, __y);
+ __do_compare_assert(0, __y, __x, __r);
+ return __r;
+ }
+
+ template <class _LHS, class _RHS, class _Order>
+ _LIBCPP_HIDE_FROM_ABI constexpr inline void __do_compare_assert(int, _LHS& __l, _RHS& __r, _Order __o)
+ requires __comparison_category<decltype(std::declval<_Comp&>()(std::declval<_LHS&>(), std::declval<_RHS&>()))>
+ {
+ _Order __expected = __o;
+ if (__o == _Order::less)
+ __expected = _Order::greater;
+ if (__o == _Order::greater)
+ __expected = _Order::less;
+ _LIBCPP_DEBUG_ASSERT(__comp_(__l, __r) == __expected, "Comparator does not induce a strict weak ordering");
+ (void)__l;
+ (void)__r;
+ (void)__expected;
+ }
+
+ template <class _LHS, class _RHS, class _Order>
+ _LIBCPP_HIDE_FROM_ABI constexpr inline void __do_compare_assert(long, _LHS&, _RHS&, _Order) {}
+};
+
+// Pass the comparator by lvalue reference. Or in debug mode, using a
+// debugging wrapper that stores a reference.
+# ifndef _LIBCPP_ENABLE_DEBUG_MODE
+template <class _Comp>
+using __three_way_comp_ref_type = __debug_three_way_comp<_Comp>;
+# else
+template <class _Comp>
+using __three_way_comp_ref_type = _Comp&;
+# endif
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h b/third_party/llvm-project/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
index 1e86074..1f20399 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
@@ -11,13 +11,13 @@
#include <__config>
#include <__functional/invoke.h>
-#include <type_traits>
+#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -57,6 +57,6 @@
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/unwrap_iter.h b/third_party/llvm-project/libcxx/include/__algorithm/unwrap_iter.h
index 0f661e1..81f2942 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/unwrap_iter.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/unwrap_iter.h
@@ -64,6 +64,14 @@
return _Impl::__unwrap(__i);
}
+// Allow input_iterators to be passed to __unwrap_iter (but not __rewrap_iter)
+#if _LIBCPP_STD_VER >= 20
+template <class _Iter, __enable_if_t<!is_copy_constructible<_Iter>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI constexpr _Iter __unwrap_iter(_Iter __i) noexcept {
+ return __i;
+}
+#endif
+
template <class _OrigIter, class _Iter, class _Impl = __unwrap_iter_impl<_OrigIter> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
return _Impl::__rewrap(std::move(__orig_iter), std::move(__iter));
diff --git a/third_party/llvm-project/libcxx/include/__algorithm/unwrap_range.h b/third_party/llvm-project/libcxx/include/__algorithm/unwrap_range.h
index 2c5d23e..2c75c8f 100644
--- a/third_party/llvm-project/libcxx/include/__algorithm/unwrap_range.h
+++ b/third_party/llvm-project/libcxx/include/__algorithm/unwrap_range.h
@@ -28,7 +28,7 @@
// __unwrap_iter and __rewrap_iter don't work for this, because they assume that the iterator and sentinel have
// the same type. __unwrap_range tries to get two iterators and then forward to __unwrap_iter.
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter, class _Sent>
struct __unwrap_range_impl {
_LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __sent)
@@ -43,7 +43,7 @@
}
_LIBCPP_HIDE_FROM_ABI static constexpr auto
- __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter)
+ __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(std::move(__orig_iter))) __iter)
requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
{
return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
@@ -80,7 +80,7 @@
_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
return __unwrap_range_impl<_Iter, _Sent>::__rewrap(std::move(__orig_iter), std::move(__iter));
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR pair<_Unwrapped, _Unwrapped> __unwrap_range(_Iter __first, _Iter __last) {
return std::make_pair(std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last)));
@@ -90,7 +90,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__assert b/third_party/llvm-project/libcxx/include/__assert
index 9c0cd1b..e20ee50 100644
--- a/third_party/llvm-project/libcxx/include/__assert
+++ b/third_party/llvm-project/libcxx/include/__assert
@@ -17,39 +17,33 @@
# pragma GCC system_header
#endif
-// TODO: Remove in LLVM 17.
-#if defined(_LIBCPP_DEBUG)
-# error "Defining _LIBCPP_DEBUG is not supported anymore. Please use _LIBCPP_ENABLE_DEBUG_MODE instead."
-#endif
-
// Automatically enable assertions when the debug mode is enabled.
#if defined(_LIBCPP_ENABLE_DEBUG_MODE)
-# ifndef _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ENABLE_ASSERTIONS 1
-# endif
+# ifndef _LIBCPP_ENABLE_ASSERTIONS
+# define _LIBCPP_ENABLE_ASSERTIONS 1
+# endif
#endif
#ifndef _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
+# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
#endif
#if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1
-# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
+# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
#endif
#if _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ASSERT(expression, message) \
- (__builtin_expect(static_cast<bool>(expression), 1) ? \
- (void)0 : \
- _LIBCPP_VERBOSE_ABORT("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message))
+# define _LIBCPP_ASSERT(expression, message) \
+ (__builtin_expect(static_cast<bool>(expression), 1) \
+ ? (void)0 \
+ : _LIBCPP_VERBOSE_ABORT( \
+ "%s:%d: assertion %s failed: %s", __builtin_FILE(), __builtin_LINE(), #expression, message))
#elif !defined(_LIBCPP_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume)
-# define _LIBCPP_ASSERT(expression, message) \
- (_LIBCPP_DIAGNOSTIC_PUSH \
- _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wassume") \
- __builtin_assume(static_cast<bool>(expression)) \
- _LIBCPP_DIAGNOSTIC_POP)
+# define _LIBCPP_ASSERT(expression, message) \
+ (_LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wassume") \
+ __builtin_assume(static_cast<bool>(expression)) _LIBCPP_DIAGNOSTIC_POP)
#else
-# define _LIBCPP_ASSERT(expression, message) ((void)0)
+# define _LIBCPP_ASSERT(expression, message) ((void)0)
#endif
#endif // _LIBCPP___ASSERT
diff --git a/third_party/llvm-project/libcxx/include/__atomic/aliases.h b/third_party/llvm-project/libcxx/include/__atomic/aliases.h
new file mode 100644
index 0000000..806589b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/aliases.h
@@ -0,0 +1,116 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ALIASES_H
+#define _LIBCPP___ATOMIC_ALIASES_H
+
+#include <__atomic/atomic.h>
+#include <__atomic/atomic_lock_free.h>
+#include <__atomic/contention_t.h>
+#include <__atomic/is_always_lock_free.h>
+#include <__config>
+#include <__type_traits/conditional.h>
+#include <cstddef>
+#include <cstdint>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+using atomic_bool = atomic<bool>;
+using atomic_char = atomic<char>;
+using atomic_schar = atomic<signed char>;
+using atomic_uchar = atomic<unsigned char>;
+using atomic_short = atomic<short>;
+using atomic_ushort = atomic<unsigned short>;
+using atomic_int = atomic<int>;
+using atomic_uint = atomic<unsigned int>;
+using atomic_long = atomic<long>;
+using atomic_ulong = atomic<unsigned long>;
+using atomic_llong = atomic<long long>;
+using atomic_ullong = atomic<unsigned long long>;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+using atomic_char8_t = atomic<char8_t>;
+#endif
+using atomic_char16_t = atomic<char16_t>;
+using atomic_char32_t = atomic<char32_t>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using atomic_wchar_t = atomic<wchar_t>;
+#endif
+
+using atomic_int_least8_t = atomic<int_least8_t>;
+using atomic_uint_least8_t = atomic<uint_least8_t>;
+using atomic_int_least16_t = atomic<int_least16_t>;
+using atomic_uint_least16_t = atomic<uint_least16_t>;
+using atomic_int_least32_t = atomic<int_least32_t>;
+using atomic_uint_least32_t = atomic<uint_least32_t>;
+using atomic_int_least64_t = atomic<int_least64_t>;
+using atomic_uint_least64_t = atomic<uint_least64_t>;
+
+using atomic_int_fast8_t = atomic<int_fast8_t>;
+using atomic_uint_fast8_t = atomic<uint_fast8_t>;
+using atomic_int_fast16_t = atomic<int_fast16_t>;
+using atomic_uint_fast16_t = atomic<uint_fast16_t>;
+using atomic_int_fast32_t = atomic<int_fast32_t>;
+using atomic_uint_fast32_t = atomic<uint_fast32_t>;
+using atomic_int_fast64_t = atomic<int_fast64_t>;
+using atomic_uint_fast64_t = atomic<uint_fast64_t>;
+
+using atomic_int8_t = atomic< int8_t>;
+using atomic_uint8_t = atomic<uint8_t>;
+using atomic_int16_t = atomic< int16_t>;
+using atomic_uint16_t = atomic<uint16_t>;
+using atomic_int32_t = atomic< int32_t>;
+using atomic_uint32_t = atomic<uint32_t>;
+using atomic_int64_t = atomic< int64_t>;
+using atomic_uint64_t = atomic<uint64_t>;
+
+using atomic_intptr_t = atomic<intptr_t>;
+using atomic_uintptr_t = atomic<uintptr_t>;
+using atomic_size_t = atomic<size_t>;
+using atomic_ptrdiff_t = atomic<ptrdiff_t>;
+using atomic_intmax_t = atomic<intmax_t>;
+using atomic_uintmax_t = atomic<uintmax_t>;
+
+// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
+
+#ifdef __cpp_lib_atomic_is_always_lock_free
+# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
+#else
+# define _LIBCPP_CONTENTION_LOCK_FREE false
+#endif
+
+#if ATOMIC_LLONG_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long>;
+using __libcpp_unsigned_lock_free =
+ __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long>;
+#elif ATOMIC_INT_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int>;
+using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int>;
+#elif ATOMIC_SHORT_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short>;
+using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short>;
+#elif ATOMIC_CHAR_LOCK_FREE == 2
+using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char>;
+using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char>;
+#else
+// No signed/unsigned lock-free types
+# define _LIBCPP_NO_LOCK_FREE_TYPES
+#endif
+
+#if !defined(_LIBCPP_NO_LOCK_FREE_TYPES)
+using atomic_signed_lock_free = atomic<__libcpp_signed_lock_free>;
+using atomic_unsigned_lock_free = atomic<__libcpp_unsigned_lock_free>;
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ALIASES_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/atomic.h b/third_party/llvm-project/libcxx/include/__atomic/atomic.h
new file mode 100644
index 0000000..68df7f1
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/atomic.h
@@ -0,0 +1,664 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ATOMIC_H
+#define _LIBCPP___ATOMIC_ATOMIC_H
+
+#include <__atomic/atomic_base.h>
+#include <__atomic/check_memory_order.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__type_traits/is_function.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_pointer.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct atomic
+ : public __atomic_base<_Tp>
+{
+ using __base = __atomic_base<_Tp>;
+ using value_type = _Tp;
+ using difference_type = value_type;
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI
+ atomic() = default;
+#else
+ _LIBCPP_HIDE_FROM_ABI
+ atomic() _NOEXCEPT = default;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator=(_Tp __d) volatile _NOEXCEPT
+ {__base::store(__d); return __d;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator=(_Tp __d) _NOEXCEPT
+ {__base::store(__d); return __d;}
+
+ atomic& operator=(const atomic&) = delete;
+ atomic& operator=(const atomic&) volatile = delete;
+};
+
+// atomic<T*>
+
+template <class _Tp>
+struct atomic<_Tp*>
+ : public __atomic_base<_Tp*>
+{
+ using __base = __atomic_base<_Tp*>;
+ using value_type = _Tp*;
+ using difference_type = ptrdiff_t;
+
+ _LIBCPP_HIDE_FROM_ABI
+ atomic() _NOEXCEPT = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
+ {__base::store(__d); return __d;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator=(_Tp* __d) _NOEXCEPT
+ {__base::store(__d); return __d;}
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ // __atomic_fetch_add accepts function pointers, guard against them.
+ static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++(int) volatile _NOEXCEPT {return fetch_add(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++(int) _NOEXCEPT {return fetch_add(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--(int) volatile _NOEXCEPT {return fetch_sub(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--(int) _NOEXCEPT {return fetch_sub(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++() volatile _NOEXCEPT {return fetch_add(1) + 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator++() _NOEXCEPT {return fetch_add(1) + 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--() volatile _NOEXCEPT {return fetch_sub(1) - 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator--() _NOEXCEPT {return fetch_sub(1) - 1;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator+=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator+=(ptrdiff_t __op) _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp* operator-=(ptrdiff_t __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
+
+ atomic& operator=(const atomic&) = delete;
+ atomic& operator=(const atomic&) volatile = delete;
+};
+
+// atomic_is_lock_free
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->is_lock_free();
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->is_lock_free();
+}
+
+// atomic_init
+
+template <class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI
+void
+atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ std::__cxx_atomic_init(std::addressof(__o->__a_), __d);
+}
+
+template <class _Tp>
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI
+void
+atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ std::__cxx_atomic_init(std::addressof(__o->__a_), __d);
+}
+
+// atomic_store
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ __o->store(__d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ __o->store(__d);
+}
+
+// atomic_store_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+{
+ __o->store(__d, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void
+atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+{
+ __o->store(__d, __m);
+}
+
+// atomic_load
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->load();
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
+{
+ return __o->load();
+}
+
+// atomic_load_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->load(__m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->load(__m);
+}
+
+// atomic_exchange
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->exchange(__d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->exchange(__d);
+}
+
+// atomic_exchange_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+{
+ return __o->exchange(__d, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
+{
+ return __o->exchange(__d, __m);
+}
+
+// atomic_compare_exchange_weak
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_weak(*__e, __d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_weak(*__e, __d);
+}
+
+// atomic_compare_exchange_strong
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_strong(*__e, __d);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
+{
+ return __o->compare_exchange_strong(*__e, __d);
+}
+
+// atomic_compare_exchange_weak_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
+ typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_weak(*__e, __d, __s, __f);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_weak(*__e, __d, __s, __f);
+}
+
+// atomic_compare_exchange_strong_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_strong(*__e, __d, __s, __f);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool
+atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
+ typename atomic<_Tp>::value_type __d,
+ memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+{
+ return __o->compare_exchange_strong(*__e, __d, __s, __f);
+}
+
+// atomic_wait
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait(const volatile atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v) _NOEXCEPT
+{
+ return __o->wait(__v);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait(const atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v) _NOEXCEPT
+{
+ return __o->wait(__v);
+}
+
+// atomic_wait_explicit
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait_explicit(const volatile atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v,
+ memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->wait(__v, __m);
+}
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_wait_explicit(const atomic<_Tp>* __o,
+ typename atomic<_Tp>::value_type __v,
+ memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+{
+ return __o->wait(__v, __m);
+}
+
+// atomic_notify_one
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+
+// atomic_notify_all
+
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+template <class _Tp>
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+
+// atomic_fetch_add
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_add(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp
+atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_add(__op);
+}
+
+// atomic_fetch_add_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_add(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_add(__op, __m);
+}
+
+// atomic_fetch_sub
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_sub(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
+{
+ return __o->fetch_sub(__op);
+}
+
+// atomic_fetch_sub_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_sub(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_sub(__op, __m);
+}
+
+// atomic_fetch_and
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_and(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_and(__op);
+}
+
+// atomic_fetch_and_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_and(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_and(__op, __m);
+}
+
+// atomic_fetch_or
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_or(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_or(__op);
+}
+
+// atomic_fetch_or_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_or(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_or(__op, __m);
+}
+
+// atomic_fetch_xor
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_xor(__op);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
+{
+ return __o->fetch_xor(__op);
+}
+
+// atomic_fetch_xor_explicit
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_xor(__op, __m);
+}
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+typename enable_if
+<
+ is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
+ _Tp
+>::type
+atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
+{
+ return __o->fetch_xor(__op, __m);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/atomic_base.h b/third_party/llvm-project/libcxx/include/__atomic/atomic_base.h
new file mode 100644
index 0000000..7a9ba78
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/atomic_base.h
@@ -0,0 +1,232 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ATOMIC_BASE_H
+#define _LIBCPP___ATOMIC_ATOMIC_BASE_H
+
+#include <__atomic/atomic_sync.h>
+#include <__atomic/check_memory_order.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/is_always_lock_free.h>
+#include <__atomic/memory_order.h>
+#include <__availability>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_same.h>
+#include <version>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
+struct __atomic_base // false
+{
+ mutable __cxx_atomic_impl<_Tp> __a_;
+
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI
+ bool is_lock_free() const volatile _NOEXCEPT
+ {return __cxx_atomic_is_lock_free(sizeof(_Tp));}
+ _LIBCPP_HIDE_FROM_ABI
+ bool is_lock_free() const _NOEXCEPT
+ {return static_cast<__atomic_base const volatile*>(this)->is_lock_free();}
+ _LIBCPP_HIDE_FROM_ABI void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) {
+ std::__cxx_atomic_store(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) {
+ std::__cxx_atomic_store(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
+ return std::__cxx_atomic_load(std::addressof(__a_), __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) {
+ return std::__cxx_atomic_load(std::addressof(__a_), __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI
+ operator _Tp() const volatile _NOEXCEPT {return load();}
+ _LIBCPP_HIDE_FROM_ABI
+ operator _Tp() const _NOEXCEPT {return load();}
+ _LIBCPP_HIDE_FROM_ABI _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_exchange(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_exchange(std::addressof(__a_), __d, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) volatile _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) volatile _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __s, __f);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_weak(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_weak(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI bool
+ compare_exchange_strong(_Tp& __e, _Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_compare_exchange_strong(std::addressof(__a_), std::addressof(__e), __d, __m, __m);
+ }
+
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const
+ volatile _NOEXCEPT {
+ std::__cxx_atomic_wait(std::addressof(__a_), __v, __m);
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
+ wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
+ std::__cxx_atomic_wait(std::addressof(__a_), __v, __m);
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT {
+ std::__cxx_atomic_notify_one(std::addressof(__a_));
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT {
+ std::__cxx_atomic_notify_one(std::addressof(__a_));
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT {
+ std::__cxx_atomic_notify_all(std::addressof(__a_));
+ }
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT {
+ std::__cxx_atomic_notify_all(std::addressof(__a_));
+ }
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
+#else
+ _LIBCPP_HIDE_FROM_ABI
+ __atomic_base() _NOEXCEPT = default;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+ __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
+
+ __atomic_base(const __atomic_base&) = delete;
+};
+
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+template <class _Tp, bool __b>
+_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
+#endif
+
+// atomic<Integral>
+
+template <class _Tp>
+struct __atomic_base<_Tp, true>
+ : public __atomic_base<_Tp, false>
+{
+ using __base = __atomic_base<_Tp, false>;
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ __atomic_base() _NOEXCEPT = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
+
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_add(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_sub(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_and(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_and(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_or(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_or(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
+ return std::__cxx_atomic_fetch_xor(std::addressof(this->__a_), __op, __m);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
+ return std::__cxx_atomic_fetch_xor(std::addressof(this->__a_), __op, __m);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++(int) volatile _NOEXCEPT {return fetch_add(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++(int) _NOEXCEPT {return fetch_add(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--(int) volatile _NOEXCEPT {return fetch_sub(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--(int) _NOEXCEPT {return fetch_sub(_Tp(1));}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++() volatile _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator++() _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--() volatile _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator--() _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator+=(_Tp __op) _NOEXCEPT {return fetch_add(__op) + __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator-=(_Tp __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator&=(_Tp __op) _NOEXCEPT {return fetch_and(__op) & __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator|=(_Tp __op) _NOEXCEPT {return fetch_or(__op) | __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
+ _LIBCPP_HIDE_FROM_ABI
+ _Tp operator^=(_Tp __op) _NOEXCEPT {return fetch_xor(__op) ^ __op;}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_BASE_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/atomic_flag.h b/third_party/llvm-project/libcxx/include/__atomic/atomic_flag.h
new file mode 100644
index 0000000..46a6ad7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/atomic_flag.h
@@ -0,0 +1,231 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ATOMIC_FLAG_H
+#define _LIBCPP___ATOMIC_ATOMIC_FLAG_H
+
+#include <__atomic/atomic_sync.h>
+#include <__atomic/contention_t.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__chrono/duration.h>
+#include <__config>
+#include <__threading_support>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct atomic_flag
+{
+ __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_;
+
+ _LIBCPP_HIDE_FROM_ABI
+ bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
+
+ _LIBCPP_HIDE_FROM_ABI
+ bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
+ _LIBCPP_HIDE_FROM_ABI
+ void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
+
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_one() volatile _NOEXCEPT
+ {__cxx_atomic_notify_one(&__a_);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_one() _NOEXCEPT
+ {__cxx_atomic_notify_one(&__a_);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_all() volatile _NOEXCEPT
+ {__cxx_atomic_notify_all(&__a_);}
+ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
+ void notify_all() _NOEXCEPT
+ {__cxx_atomic_notify_all(&__a_);}
+
+#if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ atomic_flag() _NOEXCEPT : __a_(false) {}
+#else
+ _LIBCPP_HIDE_FROM_ABI
+ atomic_flag() _NOEXCEPT = default;
+#endif
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+ atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
+
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) volatile = delete;
+
+};
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test(const atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_explicit(const volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_explicit(const atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test_and_set();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
+{
+ return __o->test_and_set();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test_and_set(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+bool
+atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ return __o->test_and_set(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
+{
+ __o->clear();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
+{
+ __o->clear();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ __o->clear(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
+{
+ __o->clear(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT
+{
+ __o->wait(__v);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT
+{
+ __o->wait(__v);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait_explicit(const volatile atomic_flag* __o,
+ bool __v, memory_order __m) _NOEXCEPT
+{
+ __o->wait(__v, __m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_wait_explicit(const atomic_flag* __o,
+ bool __v, memory_order __m) _NOEXCEPT
+{
+ __o->wait(__v, __m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_one();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC
+void
+atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT
+{
+ __o->notify_all();
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_FLAG_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/atomic_init.h b/third_party/llvm-project/libcxx/include/__atomic/atomic_init.h
new file mode 100644
index 0000000..14310ae
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/atomic_init.h
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ATOMIC_INIT_H
+#define _LIBCPP___ATOMIC_ATOMIC_INIT_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#define ATOMIC_FLAG_INIT {false}
+#define ATOMIC_VAR_INIT(__v) {__v}
+
+#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
+# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1400
+# pragma clang deprecated(ATOMIC_VAR_INIT)
+# endif
+#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_INIT_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/atomic_lock_free.h b/third_party/llvm-project/libcxx/include/__atomic/atomic_lock_free.h
new file mode 100644
index 0000000..d607569
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/atomic_lock_free.h
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ATOMIC_LOCK_FREE_H
+#define _LIBCPP___ATOMIC_ATOMIC_LOCK_FREE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
+# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
+#endif
+# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
+#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
+# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
+# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE
+#endif
+# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+#endif
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_LOCK_FREE_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/atomic_sync.h b/third_party/llvm-project/libcxx/include/__atomic/atomic_sync.h
new file mode 100644
index 0000000..d55450b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/atomic_sync.h
@@ -0,0 +1,112 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_ATOMIC_SYNC_H
+#define _LIBCPP___ATOMIC_ATOMIC_SYNC_H
+
+#include <__atomic/contention_t.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__availability>
+#include <__chrono/duration.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__thread/poll_with_backoff.h>
+#include <__threading_support>
+#include <__type_traits/decay.h>
+#include <cstring>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t);
+
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*);
+_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
+
+template <class _Atp, class _Fn>
+struct __libcpp_atomic_wait_backoff_impl {
+ _Atp* __a;
+ _Fn __test_fn;
+ _LIBCPP_AVAILABILITY_SYNC
+ _LIBCPP_HIDE_FROM_ABI bool operator()(chrono::nanoseconds __elapsed) const
+ {
+ if(__elapsed > chrono::microseconds(64))
+ {
+ auto const __monitor = std::__libcpp_atomic_monitor(__a);
+ if(__test_fn())
+ return true;
+ std::__libcpp_atomic_wait(__a, __monitor);
+ }
+ else if(__elapsed > chrono::microseconds(4))
+ __libcpp_thread_yield();
+ else
+ {} // poll
+ return false;
+ }
+};
+
+template <class _Atp, class _Fn>
+_LIBCPP_AVAILABILITY_SYNC
+_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn)
+{
+ __libcpp_atomic_wait_backoff_impl<_Atp, __decay_t<_Fn> > __backoff_fn = {__a, __test_fn};
+ return std::__libcpp_thread_poll_with_backoff(__test_fn, __backoff_fn);
+}
+
+#else // _LIBCPP_HAS_NO_THREADS
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const volatile*) { }
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) { }
+template <class _Atp, class _Fn>
+_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
+{
+ return std::__libcpp_thread_poll_with_backoff(__test_fn, __spinning_backoff_policy());
+}
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+template <typename _Tp> _LIBCPP_HIDE_FROM_ABI
+bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
+ return std::memcmp(std::addressof(__lhs), std::addressof(__rhs), sizeof(_Tp)) == 0;
+}
+
+template <class _Atp, class _Tp>
+struct __cxx_atomic_wait_test_fn_impl {
+ _Atp* __a;
+ _Tp __val;
+ memory_order __order;
+ _LIBCPP_HIDE_FROM_ABI bool operator()() const
+ {
+ return !std::__cxx_nonatomic_compare_equal(std::__cxx_atomic_load(__a, __order), __val);
+ }
+};
+
+template <class _Atp, class _Tp>
+_LIBCPP_AVAILABILITY_SYNC
+_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order)
+{
+ __cxx_atomic_wait_test_fn_impl<_Atp, _Tp> __test_fn = {__a, __val, __order};
+ return std::__cxx_atomic_wait(__a, __test_fn);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_ATOMIC_SYNC_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/check_memory_order.h b/third_party/llvm-project/libcxx/include/__atomic/check_memory_order.h
new file mode 100644
index 0000000..d744312
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/check_memory_order.h
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H
+#define _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
+ _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
+ __m == memory_order_acquire || \
+ __m == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#define _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) \
+ _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || \
+ __m == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#define _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
+ _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || \
+ __f == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#endif // _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/contention_t.h b/third_party/llvm-project/libcxx/include/__atomic/contention_t.h
new file mode 100644
index 0000000..1d8d024
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/contention_t.h
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_CONTENTION_T_H
+#define _LIBCPP___ATOMIC_CONTENTION_T_H
+
+#include <__atomic/cxx_atomic_impl.h>
+#include <__config>
+#include <cstdint>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
+ using __cxx_contention_t = int32_t;
+#else
+ using __cxx_contention_t = int64_t;
+#endif // __linux__ || (_AIX && !__64BIT__)
+
+using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_CONTENTION_T_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/cxx_atomic_impl.h b/third_party/llvm-project/libcxx/include/__atomic/cxx_atomic_impl.h
new file mode 100644
index 0000000..167cee7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/cxx_atomic_impl.h
@@ -0,0 +1,831 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_CXX_ATOMIC_IMPL_H
+#define _LIBCPP___ATOMIC_CXX_ATOMIC_IMPL_H
+
+#include <__atomic/is_always_lock_free.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_assignable.h>
+#include <__type_traits/is_trivially_copyable.h>
+#include <__type_traits/remove_const.h>
+#include <cstddef>
+#include <cstring>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
+ defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
+
+// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
+// the default operator= in an object is not volatile, a byte-by-byte copy
+// is required.
+template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
+typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
+__cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
+ __a_value = __val;
+}
+template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
+typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
+__cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
+ volatile char* __to = reinterpret_cast<volatile char*>(std::addressof(__a_value));
+ volatile char* __end = __to + sizeof(_Tp);
+ volatile const char* __from = reinterpret_cast<volatile const char*>(std::addressof(__val));
+ while (__to != __end)
+ *__to++ = *__from++;
+}
+
+#endif
+
+#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
+
+template <typename _Tp>
+struct __cxx_atomic_base_impl {
+
+ _LIBCPP_HIDE_FROM_ABI
+#ifndef _LIBCPP_CXX03_LANG
+ __cxx_atomic_base_impl() _NOEXCEPT = default;
+#else
+ __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
+ : __a_value(value) {}
+ _Tp __a_value;
+};
+
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
+ (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
+ (__order == memory_order_release ? __ATOMIC_RELEASE:
+ (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
+ (__order == memory_order_acq_rel ? __ATOMIC_ACQ_REL:
+ __ATOMIC_CONSUME))));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
+ (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
+ (__order == memory_order_release ? __ATOMIC_RELAXED:
+ (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
+ (__order == memory_order_acq_rel ? __ATOMIC_ACQUIRE:
+ __ATOMIC_CONSUME))));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
+ __cxx_atomic_assign_volatile(__a->__a_value, __val);
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
+ __a->__a_value = __val;
+}
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_thread_fence(memory_order __order) {
+ __atomic_thread_fence(__to_gcc_order(__order));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_signal_fence(memory_order __order) {
+ __atomic_signal_fence(__to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
+ memory_order __order) {
+ __atomic_store(std::addressof(__a->__a_value), std::addressof(__val), __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
+ memory_order __order) {
+ __atomic_store(std::addressof(__a->__a_value), std::addressof(__val), __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a,
+ memory_order __order) {
+ _Tp __ret;
+ __atomic_load(std::addressof(__a->__a_value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __order) {
+ _Tp __ret;
+ __atomic_load(std::addressof(__a->__a_value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __value, memory_order __order) {
+ _Tp __ret;
+ __atomic_exchange(
+ std::addressof(__a->__a_value), std::addressof(__value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value,
+ memory_order __order) {
+ _Tp __ret;
+ __atomic_exchange(
+ std::addressof(__a->__a_value), std::addressof(__value), std::addressof(__ret), __to_gcc_order(__order));
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(
+ volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
+ memory_order __success, memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ false,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(
+ __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
+ memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ false,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(
+ volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
+ memory_order __success, memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ true,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(
+ __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
+ memory_order __failure) {
+ return __atomic_compare_exchange(
+ std::addressof(__a->__a_value),
+ __expected,
+ std::addressof(__value),
+ true,
+ __to_gcc_order(__success),
+ __to_gcc_failure_order(__failure));
+}
+
+template <typename _Tp>
+struct __skip_amt { enum {value = 1}; };
+
+template <typename _Tp>
+struct __skip_amt<_Tp*> { enum {value = sizeof(_Tp)}; };
+
+// FIXME: Haven't figured out what the spec says about using arrays with
+// atomic_fetch_add. Force a failure rather than creating bad behavior.
+template <typename _Tp>
+struct __skip_amt<_Tp[]> { };
+template <typename _Tp, int n>
+struct __skip_amt<_Tp[n]> { };
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Td __delta, memory_order __order) {
+ return __atomic_fetch_add(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
+ memory_order __order) {
+ return __atomic_fetch_add(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Td __delta, memory_order __order) {
+ return __atomic_fetch_sub(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
+ memory_order __order) {
+ return __atomic_fetch_sub(std::addressof(__a->__a_value), __delta * __skip_amt<_Tp>::value, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_and(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_and(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_or(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
+ memory_order __order) {
+ return __atomic_fetch_or(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a,
+ _Tp __pattern, memory_order __order) {
+ return __atomic_fetch_xor(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
+ memory_order __order) {
+ return __atomic_fetch_xor(std::addressof(__a->__a_value), __pattern, __to_gcc_order(__order));
+}
+
+#define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0)
+
+#elif defined(_LIBCPP_HAS_C_ATOMIC_IMP)
+
+template <typename _Tp>
+struct __cxx_atomic_base_impl {
+
+ _LIBCPP_HIDE_FROM_ABI
+#ifndef _LIBCPP_CXX03_LANG
+ __cxx_atomic_base_impl() _NOEXCEPT = default;
+#else
+ __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT
+ : __a_value(__value) {}
+ _LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
+};
+
+#define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s)
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_thread_fence(memory_order __order) _NOEXCEPT {
+ __c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline
+void __cxx_atomic_signal_fence(memory_order __order) _NOEXCEPT {
+ __c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) _NOEXCEPT {
+ __c11_atomic_init(std::addressof(__a->__a_value), __val);
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) _NOEXCEPT {
+ __c11_atomic_init(std::addressof(__a->__a_value), __val);
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) _NOEXCEPT {
+ __c11_atomic_store(std::addressof(__a->__a_value), __val, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) _NOEXCEPT {
+ __c11_atomic_store(std::addressof(__a->__a_value), __val, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
+ using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
+ return __c11_atomic_load(
+ const_cast<__ptr_type>(std::addressof(__a->__a_value)), static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
+ using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
+ return __c11_atomic_load(
+ const_cast<__ptr_type>(std::addressof(__a->__a_value)), static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_exchange(
+ std::addressof(__a->__a_value), __value, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_exchange(
+ std::addressof(__a->__a_value), __value, static_cast<__memory_order_underlying_t>(__order));
+}
+
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
+ // Avoid switch statement to make this a constexpr.
+ return __order == memory_order_release ? memory_order_relaxed:
+ (__order == memory_order_acq_rel ? memory_order_acquire:
+ __order);
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_strong(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_strong(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_weak(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
+ return __c11_atomic_compare_exchange_weak(
+ std::addressof(__a->__a_value),
+ __expected,
+ __value,
+ static_cast<__memory_order_underlying_t>(__success),
+ static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_add(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_sub(
+ std::addressof(__a->__a_value), __delta, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_and(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_and(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_or(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_or(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_xor(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+template<class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
+ return __c11_atomic_fetch_xor(
+ std::addressof(__a->__a_value), __pattern, static_cast<__memory_order_underlying_t>(__order));
+}
+
+#endif // _LIBCPP_HAS_GCC_ATOMIC_IMP, _LIBCPP_HAS_C_ATOMIC_IMP
+
+#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+
+template<typename _Tp>
+struct __cxx_atomic_lock_impl {
+
+ _LIBCPP_HIDE_FROM_ABI
+ __cxx_atomic_lock_impl() _NOEXCEPT
+ : __a_value(), __a_lock(0) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit
+ __cxx_atomic_lock_impl(_Tp value) _NOEXCEPT
+ : __a_value(value), __a_lock(0) {}
+
+ _Tp __a_value;
+ mutable __cxx_atomic_base_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_lock;
+
+ _LIBCPP_HIDE_FROM_ABI void __lock() const volatile {
+ while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
+ /*spin*/;
+ }
+ _LIBCPP_HIDE_FROM_ABI void __lock() const {
+ while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
+ /*spin*/;
+ }
+ _LIBCPP_HIDE_FROM_ABI void __unlock() const volatile {
+ __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
+ }
+ _LIBCPP_HIDE_FROM_ABI void __unlock() const {
+ __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp __read() const volatile {
+ __lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a_value);
+ __unlock();
+ return __old;
+ }
+ _LIBCPP_HIDE_FROM_ABI _Tp __read() const {
+ __lock();
+ _Tp __old = __a_value;
+ __unlock();
+ return __old;
+ }
+};
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
+ __cxx_atomic_assign_volatile(__a->__a_value, __val);
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_init(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
+ __a->__a_value = __val;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
+ __a->__lock();
+ __cxx_atomic_assign_volatile(__a->__a_value, __val);
+ __a->__unlock();
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
+ __a->__lock();
+ __a->__a_value = __val;
+ __a->__unlock();
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const volatile __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
+ return __a->__read();
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_load(const __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
+ return __a->__read();
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, __value);
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value = __value;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ _Tp __temp;
+ __a->__lock();
+ __cxx_atomic_assign_volatile(__temp, __a->__a_value);
+ bool __ret = (std::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ __cxx_atomic_assign_volatile(__a->__a_value, __value);
+ else
+ __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
+ __a->__unlock();
+ return __ret;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ __a->__lock();
+ bool __ret = (std::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ std::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
+ else
+ std::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
+ __a->__unlock();
+ return __ret;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ _Tp __temp;
+ __a->__lock();
+ __cxx_atomic_assign_volatile(__temp, __a->__a_value);
+ bool __ret = (std::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ __cxx_atomic_assign_volatile(__a->__a_value, __value);
+ else
+ __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
+ __a->__unlock();
+ return __ret;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp* __expected, _Tp __value, memory_order, memory_order) {
+ __a->__lock();
+ bool __ret = (std::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
+ if(__ret)
+ std::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
+ else
+ std::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
+ __a->__unlock();
+ return __ret;
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old + __delta));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value += __delta;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a,
+ ptrdiff_t __delta, memory_order) {
+ __a->__lock();
+ _Tp* __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, __old + __delta);
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a,
+ ptrdiff_t __delta, memory_order) {
+ __a->__lock();
+ _Tp* __old = __a->__a_value;
+ __a->__a_value += __delta;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old - __delta));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp, typename _Td>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Td __delta, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value -= __delta;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old & __pattern));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value &= __pattern;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old | __pattern));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value |= __pattern;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old;
+ __cxx_atomic_assign_volatile(__old, __a->__a_value);
+ __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old ^ __pattern));
+ __a->__unlock();
+ return __old;
+}
+template <typename _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
+ _Tp __pattern, memory_order) {
+ __a->__lock();
+ _Tp __old = __a->__a_value;
+ __a->__a_value ^= __pattern;
+ __a->__unlock();
+ return __old;
+}
+
+template <typename _Tp,
+ typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
+ __cxx_atomic_base_impl<_Tp>,
+ __cxx_atomic_lock_impl<_Tp> >::type>
+#else
+template <typename _Tp,
+ typename _Base = __cxx_atomic_base_impl<_Tp> >
+#endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+struct __cxx_atomic_impl : public _Base {
+ static_assert(is_trivially_copyable<_Tp>::value,
+ "std::atomic<T> requires that 'T' be a trivially copyable type");
+
+ _LIBCPP_HIDE_FROM_ABI __cxx_atomic_impl() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT
+ : _Base(__value) {}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_CXX_ATOMIC_IMPL_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/fence.h b/third_party/llvm-project/libcxx/include/__atomic/fence.h
new file mode 100644
index 0000000..c62f38f
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/fence.h
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_FENCE_H
+#define _LIBCPP___ATOMIC_FENCE_H
+
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/memory_order.h>
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_thread_fence(memory_order __m) _NOEXCEPT
+{
+ __cxx_atomic_thread_fence(__m);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void
+atomic_signal_fence(memory_order __m) _NOEXCEPT
+{
+ __cxx_atomic_signal_fence(__m);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_FENCE_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/is_always_lock_free.h b/third_party/llvm-project/libcxx/include/__atomic/is_always_lock_free.h
new file mode 100644
index 0000000..fbbd437
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/is_always_lock_free.h
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_IS_ALWAYS_LOCK_FREE_H
+#define _LIBCPP___ATOMIC_IS_ALWAYS_LOCK_FREE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct __libcpp_is_always_lock_free {
+ // __atomic_always_lock_free is available in all Standard modes
+ static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_IS_ALWAYS_LOCK_FREE_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/kill_dependency.h b/third_party/llvm-project/libcxx/include/__atomic/kill_dependency.h
new file mode 100644
index 0000000..1bd5c8c
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/kill_dependency.h
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_KILL_DEPENDENCY_H
+#define _LIBCPP___ATOMIC_KILL_DEPENDENCY_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI
+_Tp kill_dependency(_Tp __y) _NOEXCEPT
+{
+ return __y;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_KILL_DEPENDENCY_H
diff --git a/third_party/llvm-project/libcxx/include/__atomic/memory_order.h b/third_party/llvm-project/libcxx/include/__atomic/memory_order.h
new file mode 100644
index 0000000..3671dc3
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__atomic/memory_order.h
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ATOMIC_MEMORY_ORDER_H
+#define _LIBCPP___ATOMIC_MEMORY_ORDER_H
+
+#include <__config>
+#include <__type_traits/is_same.h>
+#include <__type_traits/underlying_type.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Figure out what the underlying type for `memory_order` would be if it were
+// declared as an unscoped enum (accounting for -fshort-enums). Use this result
+// to pin the underlying type in C++20.
+enum __legacy_memory_order {
+ __mo_relaxed,
+ __mo_consume,
+ __mo_acquire,
+ __mo_release,
+ __mo_acq_rel,
+ __mo_seq_cst
+};
+
+using __memory_order_underlying_t = underlying_type<__legacy_memory_order>::type;
+
+#if _LIBCPP_STD_VER >= 20
+
+enum class memory_order : __memory_order_underlying_t {
+ relaxed = __mo_relaxed,
+ consume = __mo_consume,
+ acquire = __mo_acquire,
+ release = __mo_release,
+ acq_rel = __mo_acq_rel,
+ seq_cst = __mo_seq_cst
+};
+
+static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
+ "unexpected underlying type for std::memory_order");
+
+inline constexpr auto memory_order_relaxed = memory_order::relaxed;
+inline constexpr auto memory_order_consume = memory_order::consume;
+inline constexpr auto memory_order_acquire = memory_order::acquire;
+inline constexpr auto memory_order_release = memory_order::release;
+inline constexpr auto memory_order_acq_rel = memory_order::acq_rel;
+inline constexpr auto memory_order_seq_cst = memory_order::seq_cst;
+
+#else
+
+enum memory_order {
+ memory_order_relaxed = __mo_relaxed,
+ memory_order_consume = __mo_consume,
+ memory_order_acquire = __mo_acquire,
+ memory_order_release = __mo_release,
+ memory_order_acq_rel = __mo_acq_rel,
+ memory_order_seq_cst = __mo_seq_cst,
+};
+
+#endif // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ATOMIC_MEMORY_ORDER_H
diff --git a/third_party/llvm-project/libcxx/include/__availability b/third_party/llvm-project/libcxx/include/__availability
index 6dfca3f..3c4c5cc 100644
--- a/third_party/llvm-project/libcxx/include/__availability
+++ b/third_party/llvm-project/libcxx/include/__availability
@@ -39,17 +39,23 @@
//
// This mechanism is general in nature, and any vendor can add their markup to
// the library (see below). Whenever a new feature is added that requires support
-// in the shared library, a macro should be added below to mark this feature
-// as unavailable. When vendors decide to ship the feature as part of their
-// shared library, they can update the markup appropriately.
+// in the shared library, two macros are added below to allow marking the feature
+// as unavailable:
+// 1. A macro named `_LIBCPP_AVAILABILITY_HAS_NO_<feature>` which must be defined
+// exactly when compiling for a target that doesn't support the feature.
+// 2. A macro named `_LIBCPP_AVAILABILITY_<feature>`, which must always be defined
+// and must expand to the proper availability attribute for the platform.
+//
+// When vendors decide to ship the feature as part of their shared library, they
+// can update these macros appropriately for their platform, and the library will
+// use those to provide an optimal user experience.
//
// Furthermore, many features in the standard library have corresponding
-// feature-test macros. When a feature is made unavailable on some deployment
-// target, a macro should be defined to signal that it is unavailable. That
-// macro can then be picked up when feature-test macros are generated (see
-// generate_feature_test_macro_components.py) to make sure that feature-test
-// macros don't announce a feature as being implemented if it has been marked
-// as unavailable.
+// feature-test macros. The `_LIBCPP_AVAILABILITY_HAS_NO_<feature>` macros
+// are checked by the corresponding feature-test macros generated by
+// generate_feature_test_macro_components.py to ensure that the library
+// doesn't announce a feature as being implemented if it is unavailable on
+// the deployment target.
//
// Note that this mechanism is disabled by default in the "upstream" libc++.
// Availability annotations are only meaningful when shipping libc++ inside
@@ -83,9 +89,8 @@
// This controls the availability of std::shared_mutex and std::shared_timed_mutex,
// which were added to the dylib later.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
// These macros control the availability of std::bad_optional_access and
// other exception types. These were put in the shared library to prevent
@@ -95,16 +100,23 @@
// Note that when exceptions are disabled, the methods that normally throw
// these exceptions can be used even on older deployment targets, but those
// methods will abort instead of throwing.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS
# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+
+// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS
# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
+
+// # define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
// This controls the availability of std::uncaught_exceptions().
+// # define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS
# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
// This controls the availability of the sized version of ::operator delete,
// ::operator delete[], and their align_val_t variants, which were all added
// in C++17, and hence not present in early dylibs.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE
# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
// This controls the availability of the std::future_error exception.
@@ -112,73 +124,78 @@
// Note that when exceptions are disabled, the methods that normally throw
// std::future_error can be used even on older deployment targets, but those
// methods will abort instead of throwing.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR
# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
// This controls the availability of std::type_info's vtable.
// I can't imagine how using std::type_info can work at all if
// this isn't supported.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
// This controls the availability of std::locale::category members
// (e.g. std::locale::collate), which are defined in the dylib.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
// This controls the availability of atomic operations on std::shared_ptr
// (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
// lock table located in the dylib.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
// These macros control the availability of all parts of <filesystem> that
// depend on something in the dylib.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM
# define _LIBCPP_AVAILABILITY_FILESYSTEM
# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
// This controls the availability of floating-point std::to_chars functions.
// These overloads were added later than the integer overloads.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_TO_CHARS_FLOATING_POINT
# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT
// This controls the availability of the C++20 synchronization library,
// which requires shared library support for various operations
// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,
// <semaphore>, and notification functions on std::atomic.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_SYNC
# define _LIBCPP_AVAILABILITY_SYNC
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
-
- // This controls the availability of the C++20 format library.
- // The library is in development and not ABI stable yet. P2216 is
- // retroactively accepted in C++20. This paper contains ABI breaking
- // changes.
-# define _LIBCPP_AVAILABILITY_FORMAT
-// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
// This controls whether the library claims to provide a default verbose
// termination function, and consequently whether the headers will try
// to use it when the mechanism isn't overriden at compile-time.
-// # define _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+// # define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
+# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT
#elif defined(__APPLE__)
+ // shared_mutex and shared_timed_mutex
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX
+# endif
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
__attribute__((availability(macos,strict,introduced=10.12))) \
__attribute__((availability(ios,strict,introduced=10.0))) \
__attribute__((availability(tvos,strict,introduced=10.0))) \
__attribute__((availability(watchos,strict,introduced=3.0)))
-# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
-# endif
+ // bad_optional_access, bad_variant_access and bad_any_cast
// Note: bad_optional_access & friends were not introduced in the matching
// macOS and iOS versions, so the version mismatch between macOS and others
// is intended.
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_VARIANT_ACCESS
+# define _LIBCPP_AVAILABILITY_HAS_NO_BAD_ANY_CAST
+# endif
# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
__attribute__((availability(macos,strict,introduced=10.13))) \
__attribute__((availability(ios,strict,introduced=12.0))) \
@@ -189,33 +206,73 @@
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+ // uncaught_exceptions
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_UNCAUGHT_EXCEPTIONS
+# endif
# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
__attribute__((availability(macos,strict,introduced=10.12))) \
__attribute__((availability(ios,strict,introduced=10.0))) \
__attribute__((availability(tvos,strict,introduced=10.0))) \
__attribute__((availability(watchos,strict,introduced=3.0)))
+ // sized operator new and sized operator delete
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_SIZED_NEW_DELETE
+# endif
# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
__attribute__((availability(macos,strict,introduced=10.12))) \
__attribute__((availability(ios,strict,introduced=10.0))) \
__attribute__((availability(tvos,strict,introduced=10.0))) \
__attribute__((availability(watchos,strict,introduced=3.0)))
+ // future_error
+# if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 60000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_FUTURE_ERROR
+# endif
# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
__attribute__((availability(ios,strict,introduced=6.0)))
+ // type_info's vtable
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_TYPEINFO_VTABLE
+# endif
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
__attribute__((availability(macos,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+ // locale::category
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_LOCALE_CATEGORY
+# endif
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
__attribute__((availability(macos,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+ // atomic operations on shared_ptr
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 100900) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_ATOMIC_SHARED_PTR
+# endif
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
__attribute__((availability(macos,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+ // <filesystem>
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM
+# endif
# define _LIBCPP_AVAILABILITY_FILESYSTEM \
__attribute__((availability(macos,strict,introduced=10.15))) \
__attribute__((availability(ios,strict,introduced=13.0))) \
@@ -231,36 +288,39 @@
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop")
-# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
+
+ // std::to_chars(floating-point)
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130300) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 160300) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 160300) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90300)
+# define _LIBCPP_AVAILABILITY_HAS_NO_TO_CHARS_FLOATING_POINT
# endif
-
# define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT \
- __attribute__((unavailable))
+ __attribute__((availability(macos,strict,introduced=13.3))) \
+ __attribute__((availability(ios,strict,introduced=16.3))) \
+ __attribute__((availability(tvos,strict,introduced=16.3))) \
+ __attribute__((availability(watchos,strict,introduced=9.3)))
+ // c++20 synchronization library
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_SYNC
+# endif
# define _LIBCPP_AVAILABILITY_SYNC \
__attribute__((availability(macos,strict,introduced=11.0))) \
__attribute__((availability(ios,strict,introduced=14.0))) \
__attribute__((availability(tvos,strict,introduced=14.0))) \
__attribute__((availability(watchos,strict,introduced=7.0)))
-# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+
+ // __libcpp_verbose_abort
+# if 1 // TODO: Update once this is released
+# define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
# endif
-
-# define _LIBCPP_AVAILABILITY_FORMAT \
+# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT \
__attribute__((unavailable))
-# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
-
-# define _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
#else
@@ -270,10 +330,10 @@
#endif
-// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS.
+// Define availability attributes that depend on _LIBCPP_HAS_NO_EXCEPTIONS.
// Those are defined in terms of the availability attributes above, and
// should not be vendor-specific.
-#if defined(_LIBCPP_NO_EXCEPTIONS)
+#if defined(_LIBCPP_HAS_NO_EXCEPTIONS)
# define _LIBCPP_AVAILABILITY_FUTURE
# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
diff --git a/third_party/llvm-project/libcxx/include/__bit/bit_cast.h b/third_party/llvm-project/libcxx/include/__bit/bit_cast.h
index 2ca4120..3984246 100644
--- a/third_party/llvm-project/libcxx/include/__bit/bit_cast.h
+++ b/third_party/llvm-project/libcxx/include/__bit/bit_cast.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _ToType, class _FromType>
requires(sizeof(_ToType) == sizeof(_FromType) &&
@@ -29,7 +29,7 @@
return __builtin_bit_cast(_ToType, __from);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__bit/bit_ceil.h b/third_party/llvm-project/libcxx/include/__bit/bit_ceil.h
index a558d61..1332900 100644
--- a/third_party/llvm-project/libcxx/include/__bit/bit_ceil.h
+++ b/third_party/llvm-project/libcxx/include/__bit/bit_ceil.h
@@ -34,8 +34,8 @@
return _Tp{1} << __n;
else {
const unsigned __extra = numeric_limits<unsigned>::digits - numeric_limits<_Tp>::digits;
- const unsigned __retVal = 1u << (__n + __extra);
- return (_Tp)(__retVal >> __extra);
+ const unsigned __ret_val = 1u << (__n + __extra);
+ return (_Tp)(__ret_val >> __extra);
}
}
diff --git a/third_party/llvm-project/libcxx/include/__bit/byteswap.h b/third_party/llvm-project/libcxx/include/__bit/byteswap.h
index 6fa8d48..b290e80 100644
--- a/third_party/llvm-project/libcxx/include/__bit/byteswap.h
+++ b/third_party/llvm-project/libcxx/include/__bit/byteswap.h
@@ -13,7 +13,6 @@
#include <__concepts/arithmetic.h>
#include <__config>
#include <cstdint>
-#include <cstdlib>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -21,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <integral _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
@@ -48,7 +47,7 @@
}
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__bit_reference b/third_party/llvm-project/libcxx/include/__bit_reference
index 2665749..95188ff 100644
--- a/third_party/llvm-project/libcxx/include/__bit_reference
+++ b/third_party/llvm-project/libcxx/include/__bit_reference
@@ -19,8 +19,9 @@
#include <__iterator/iterator_traits.h>
#include <__memory/construct_at.h>
#include <__memory/pointer_traits.h>
+#include <__type_traits/conditional.h>
+#include <__utility/swap.h>
#include <cstring>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -75,7 +76,7 @@
return *this;
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr const __bit_reference& operator=(bool __x) const noexcept {
if (__x)
*__seg_ |= __mask_;
@@ -155,6 +156,8 @@
friend typename _Cp::__self;
friend class __bit_iterator<_Cp, true>;
public:
+ using __container = typename _Cp::__self;
+
_LIBCPP_INLINE_VISIBILITY
__bit_const_reference(const __bit_const_reference&) = default;
@@ -1135,7 +1138,7 @@
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __seg_(nullptr), __ctz_(0)
#endif
{}
diff --git a/third_party/llvm-project/libcxx/include/__charconv/chars_format.h b/third_party/llvm-project/libcxx/include/__charconv/chars_format.h
index 695bd87..0e781c0 100644
--- a/third_party/llvm-project/libcxx/include/__charconv/chars_format.h
+++ b/third_party/llvm-project/libcxx/include/__charconv/chars_format.h
@@ -19,58 +19,45 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-enum class _LIBCPP_ENUM_VIS chars_format
-{
- scientific = 0x1,
- fixed = 0x2,
- hex = 0x4,
- general = fixed | scientific
-};
+enum class _LIBCPP_ENUM_VIS chars_format { scientific = 0x1, fixed = 0x2, hex = 0x4, general = fixed | scientific };
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator~(chars_format __x) {
- return chars_format(~_VSTD::__to_underlying(__x));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator~(chars_format __x) {
+ return chars_format(~std::__to_underlying(__x));
}
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator&(chars_format __x, chars_format __y) {
- return chars_format(_VSTD::__to_underlying(__x) &
- _VSTD::__to_underlying(__y));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator&(chars_format __x, chars_format __y) {
+ return chars_format(std::__to_underlying(__x) & std::__to_underlying(__y));
}
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator|(chars_format __x, chars_format __y) {
- return chars_format(_VSTD::__to_underlying(__x) |
- _VSTD::__to_underlying(__y));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator|(chars_format __x, chars_format __y) {
+ return chars_format(std::__to_underlying(__x) | std::__to_underlying(__y));
}
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
-operator^(chars_format __x, chars_format __y) {
- return chars_format(_VSTD::__to_underlying(__x) ^
- _VSTD::__to_underlying(__y));
+inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator^(chars_format __x, chars_format __y) {
+ return chars_format(std::__to_underlying(__x) ^ std::__to_underlying(__y));
}
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
operator&=(chars_format& __x, chars_format __y) {
__x = __x & __y;
return __x;
}
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
operator|=(chars_format& __x, chars_format __y) {
__x = __x | __y;
return __x;
}
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
operator^=(chars_format& __x, chars_format __y) {
__x = __x ^ __y;
return __x;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__charconv/from_chars_integral.h b/third_party/llvm-project/libcxx/include/__charconv/from_chars_integral.h
new file mode 100644
index 0000000..990aa21
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__charconv/from_chars_integral.h
@@ -0,0 +1,239 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
+#define _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
+
+#include <__algorithm/copy_n.h>
+#include <__charconv/from_chars_result.h>
+#include <__charconv/traits.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__system_error/errc.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_unsigned.h>
+#include <__type_traits/make_unsigned.h>
+#include <limits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete;
+
+template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args) {
+ using __tl = numeric_limits<_Tp>;
+ decltype(std::__to_unsigned_like(__value)) __x;
+
+ bool __neg = (__first != __last && *__first == '-');
+ auto __r = __f(__neg ? __first + 1 : __first, __last, __x, __args...);
+ switch (__r.ec) {
+ case errc::invalid_argument:
+ return {__first, __r.ec};
+ case errc::result_out_of_range:
+ return __r;
+ default:
+ break;
+ }
+
+ if (__neg) {
+ if (__x <= std::__complement(std::__to_unsigned_like(__tl::min()))) {
+ __x = std::__complement(__x);
+ std::copy_n(std::addressof(__x), 1, std::addressof(__value));
+ return __r;
+ }
+ } else {
+ if (__x <= std::__to_unsigned_like(__tl::max())) {
+ __value = __x;
+ return __r;
+ }
+ }
+
+ return {__r.ptr, errc::result_out_of_range};
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool __in_pattern(_Tp __c) {
+ return '0' <= __c && __c <= '9';
+}
+
+struct _LIBCPP_HIDDEN __in_pattern_result {
+ bool __ok;
+ int __val;
+
+ explicit _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI operator bool() const { return __ok; }
+};
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI __in_pattern_result __in_pattern(_Tp __c, int __base) {
+ if (__base <= 10)
+ return {'0' <= __c && __c < '0' + __base, __c - '0'};
+ else if (std::__in_pattern(__c))
+ return {true, __c - '0'};
+ else if ('a' <= __c && __c < 'a' + __base - 10)
+ return {true, __c - 'a' + 10};
+ else
+ return {'A' <= __c && __c < 'A' + __base - 10, __c - 'A' + 10};
+}
+
+template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args) {
+ auto __find_non_zero = [](_It __firstit, _It __lastit) {
+ for (; __firstit != __lastit; ++__firstit)
+ if (*__firstit != '0')
+ break;
+ return __firstit;
+ };
+
+ auto __p = __find_non_zero(__first, __last);
+ if (__p == __last || !std::__in_pattern(*__p, __args...)) {
+ if (__p == __first)
+ return {__first, errc::invalid_argument};
+ else {
+ __value = 0;
+ return {__p, {}};
+ }
+ }
+
+ auto __r = __f(__p, __last, __value, __args...);
+ if (__r.ec == errc::result_out_of_range) {
+ for (; __r.ptr != __last; ++__r.ptr) {
+ if (!std::__in_pattern(*__r.ptr, __args...))
+ break;
+ }
+ }
+
+ return __r;
+}
+
+template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_atoi(const char* __first, const char* __last, _Tp& __value) {
+ using __tx = __itoa::__traits<_Tp>;
+ using __output_type = typename __tx::type;
+
+ return std::__subject_seq_combinator(
+ __first, __last, __value, [](const char* __f, const char* __l, _Tp& __val) -> from_chars_result {
+ __output_type __a, __b;
+ auto __p = __tx::__read(__f, __l, __a, __b);
+ if (__p == __l || !std::__in_pattern(*__p)) {
+ __output_type __m = numeric_limits<_Tp>::max();
+ if (__m >= __a && __m - __a >= __b) {
+ __val = __a + __b;
+ return {__p, {}};
+ }
+ }
+ return {__p, errc::result_out_of_range};
+ });
+}
+
+template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_atoi(const char* __first, const char* __last, _Tp& __value) {
+ using __t = decltype(std::__to_unsigned_like(__value));
+ return std::__sign_combinator(__first, __last, __value, __from_chars_atoi<__t>);
+}
+
+/*
+// Code used to generate __from_chars_log2f_lut.
+#include <cmath>
+#include <format>
+#include <iostream>
+
+int main() {
+ for (int i = 2; i <= 36; ++i)
+ std::cout << std::format("{},\n", log2f(i));
+}
+*/
+/// log2f table for bases [2, 36].
+inline constexpr float __from_chars_log2f_lut[35] = {
+ 1, 1.5849625, 2, 2.321928, 2.5849626, 2.807355, 3, 3.169925, 3.321928,
+ 3.4594316, 3.5849626, 3.7004397, 3.807355, 3.9068906, 4, 4.087463, 4.169925, 4.2479277,
+ 4.321928, 4.3923173, 4.4594316, 4.523562, 4.5849624, 4.643856, 4.70044, 4.7548876, 4.807355,
+ 4.857981, 4.9068904, 4.9541965, 5, 5.044394, 5.087463, 5.129283, 5.169925};
+
+template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_integral(const char* __first, const char* __last, _Tp& __value, int __base) {
+ if (__base == 10)
+ return std::__from_chars_atoi(__first, __last, __value);
+
+ return std::__subject_seq_combinator(
+ __first,
+ __last,
+ __value,
+ [](const char* __p, const char* __lastp, _Tp& __val, int __b) -> from_chars_result {
+ using __tl = numeric_limits<_Tp>;
+ // __base is always between 2 and 36 inclusive.
+ auto __digits = __tl::digits / __from_chars_log2f_lut[__b - 2];
+ _Tp __x = __in_pattern(*__p++, __b).__val, __y = 0;
+
+ for (int __i = 1; __p != __lastp; ++__i, ++__p) {
+ if (auto __c = __in_pattern(*__p, __b)) {
+ if (__i < __digits - 1)
+ __x = __x * __b + __c.__val;
+ else {
+ if (!__itoa::__mul_overflowed(__x, __b, __x))
+ ++__p;
+ __y = __c.__val;
+ break;
+ }
+ } else
+ break;
+ }
+
+ if (__p == __lastp || !__in_pattern(*__p, __b)) {
+ if (__tl::max() - __x >= __y) {
+ __val = __x + __y;
+ return {__p, {}};
+ }
+ }
+ return {__p, errc::result_out_of_range};
+ },
+ __base);
+}
+
+template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+__from_chars_integral(const char* __first, const char* __last, _Tp& __value, int __base) {
+ using __t = decltype(std::__to_unsigned_like(__value));
+ return std::__sign_combinator(__first, __last, __value, __from_chars_integral<__t>, __base);
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+from_chars(const char* __first, const char* __last, _Tp& __value) {
+ return std::__from_chars_atoi(__first, __last, __value);
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
+from_chars(const char* __first, const char* __last, _Tp& __value, int __base) {
+ _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
+ return std::__from_chars_integral(__first, __last, __value, __base);
+}
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H
diff --git a/third_party/llvm-project/libcxx/include/__charconv/from_chars_result.h b/third_party/llvm-project/libcxx/include/__charconv/from_chars_result.h
index 05ffe14..7eeb9ec 100644
--- a/third_party/llvm-project/libcxx/include/__charconv/from_chars_result.h
+++ b/third_party/llvm-project/libcxx/include/__charconv/from_chars_result.h
@@ -11,7 +11,7 @@
#define _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
#include <__config>
-#include <__errc>
+#include <__system_error/errc.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -19,18 +19,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_TYPE_VIS from_chars_result
-{
- const char* ptr;
- errc ec;
-# if _LIBCPP_STD_VER > 17
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
+struct _LIBCPP_TYPE_VIS from_chars_result {
+ const char* ptr;
+ errc ec;
+# if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
# endif
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__charconv/tables.h b/third_party/llvm-project/libcxx/include/__charconv/tables.h
index 9b82440..6b93536 100644
--- a/third_party/llvm-project/libcxx/include/__charconv/tables.h
+++ b/third_party/llvm-project/libcxx/include/__charconv/tables.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
namespace __itoa {
@@ -62,32 +62,41 @@
'f', 'd', 'f', 'e', 'f', 'f'};
inline constexpr uint32_t __pow10_32[10] = {
- UINT32_C(0), UINT32_C(10), UINT32_C(100), UINT32_C(1000), UINT32_C(10000),
- UINT32_C(100000), UINT32_C(1000000), UINT32_C(10000000), UINT32_C(100000000), UINT32_C(1000000000)};
+ UINT32_C(0),
+ UINT32_C(10),
+ UINT32_C(100),
+ UINT32_C(1000),
+ UINT32_C(10000),
+ UINT32_C(100000),
+ UINT32_C(1000000),
+ UINT32_C(10000000),
+ UINT32_C(100000000),
+ UINT32_C(1000000000)};
-inline constexpr uint64_t __pow10_64[20] = {UINT64_C(0),
- UINT64_C(10),
- UINT64_C(100),
- UINT64_C(1000),
- UINT64_C(10000),
- UINT64_C(100000),
- UINT64_C(1000000),
- UINT64_C(10000000),
- UINT64_C(100000000),
- UINT64_C(1000000000),
- UINT64_C(10000000000),
- UINT64_C(100000000000),
- UINT64_C(1000000000000),
- UINT64_C(10000000000000),
- UINT64_C(100000000000000),
- UINT64_C(1000000000000000),
- UINT64_C(10000000000000000),
- UINT64_C(100000000000000000),
- UINT64_C(1000000000000000000),
- UINT64_C(10000000000000000000)};
+inline constexpr uint64_t __pow10_64[20] = {
+ UINT64_C(0),
+ UINT64_C(10),
+ UINT64_C(100),
+ UINT64_C(1000),
+ UINT64_C(10000),
+ UINT64_C(100000),
+ UINT64_C(1000000),
+ UINT64_C(10000000),
+ UINT64_C(100000000),
+ UINT64_C(1000000000),
+ UINT64_C(10000000000),
+ UINT64_C(100000000000),
+ UINT64_C(1000000000000),
+ UINT64_C(10000000000000),
+ UINT64_C(100000000000000),
+ UINT64_C(1000000000000000),
+ UINT64_C(10000000000000000),
+ UINT64_C(100000000000000000),
+ UINT64_C(1000000000000000000),
+ UINT64_C(10000000000000000000)};
# ifndef _LIBCPP_HAS_NO_INT128
-inline constexpr int __pow10_128_offset = 0;
+inline constexpr int __pow10_128_offset = 0;
inline constexpr __uint128_t __pow10_128[40] = {
UINT64_C(0),
UINT64_C(10),
@@ -147,7 +156,7 @@
} // namespace __itoa
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__charconv/to_chars.h b/third_party/llvm-project/libcxx/include/__charconv/to_chars.h
new file mode 100644
index 0000000..8ef09af
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__charconv/to_chars.h
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CHARCONV_TO_CHARS
+#define _LIBCPP___CHARCONV_TO_CHARS
+
+#include <__charconv/to_chars_floating_point.h>
+#include <__charconv/to_chars_integral.h>
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___CHARCONV_TO_CHARS
diff --git a/third_party/llvm-project/libcxx/include/__charconv/to_chars_base_10.h b/third_party/llvm-project/libcxx/include/__charconv/to_chars_base_10.h
index fc7fb76..028ff33 100644
--- a/third_party/llvm-project/libcxx/include/__charconv/to_chars_base_10.h
+++ b/third_party/llvm-project/libcxx/include/__charconv/to_chars_base_10.h
@@ -25,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
namespace __itoa {
@@ -72,7 +72,8 @@
static_cast<uint32_t>(__value % 100000000));
}
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u32(char* __first, uint32_t __value) noexcept {
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
+__base_10_u32(char* __first, uint32_t __value) noexcept {
if (__value < 1000000) {
if (__value < 10000) {
if (__value < 100) {
@@ -107,7 +108,8 @@
return __itoa::__append10(__first, __value);
}
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u64(char* __buffer, uint64_t __value) noexcept {
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
+__base_10_u64(char* __buffer, uint64_t __value) noexcept {
if (__value <= UINT32_MAX)
return __itoa::__base_10_u32(__buffer, static_cast<uint32_t>(__value));
@@ -134,7 +136,8 @@
return __pow10_128[__exp - __pow10_128_offset];
}
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u128(char* __buffer, __uint128_t __value) noexcept {
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
+__base_10_u128(char* __buffer, __uint128_t __value) noexcept {
_LIBCPP_ASSERT(
__value > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
@@ -159,8 +162,7 @@
__value %= __itoa::__pow_10(29);
__buffer = __itoa::__append10(__buffer, static_cast<uint64_t>(__value / __itoa::__pow_10(19)));
__value %= __itoa::__pow_10(19);
- }
- else {
+ } else {
// step 2
// This version needs to determine the position of the leading non-zero digit.
__buffer = __base_10_u64(__buffer, static_cast<uint64_t>(__value / __itoa::__pow_10(19)));
@@ -176,7 +178,7 @@
# endif
} // namespace __itoa
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__charconv/to_chars_floating_point.h b/third_party/llvm-project/libcxx/include/__charconv/to_chars_floating_point.h
new file mode 100644
index 0000000..6ede36e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__charconv/to_chars_floating_point.h
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
+#define _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
+
+#include <__availability>
+#include <__charconv/chars_format.h>
+#include <__charconv/to_chars_result.h>
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, float __value);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, double __value);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, long double __value);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, float __value, chars_format __fmt);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, double __value, chars_format __fmt);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, long double __value, chars_format __fmt);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision);
+
+_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result
+to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
diff --git a/third_party/llvm-project/libcxx/include/__charconv/to_chars_integral.h b/third_party/llvm-project/libcxx/include/__charconv/to_chars_integral.h
new file mode 100644
index 0000000..6c726c0
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__charconv/to_chars_integral.h
@@ -0,0 +1,326 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CHARCONV_TO_CHARS_INTEGRAL_H
+#define _LIBCPP___CHARCONV_TO_CHARS_INTEGRAL_H
+
+#include <__algorithm/copy_n.h>
+#include <__bit/countl.h>
+#include <__charconv/tables.h>
+#include <__charconv/to_chars_base_10.h>
+#include <__charconv/to_chars_result.h>
+#include <__charconv/traits.h>
+#include <__config>
+#include <__system_error/errc.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/make_32_64_or_128_bit.h>
+#include <__type_traits/make_unsigned.h>
+#include <__utility/unreachable.h>
+#include <cstddef>
+#include <cstdint>
+#include <limits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+to_chars_result to_chars(char*, char*, bool, int = 10) = delete;
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type);
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, _Tp __value, true_type) {
+ auto __x = std::__to_unsigned_like(__value);
+ if (__value < 0 && __first != __last) {
+ *__first++ = '-';
+ __x = std::__complement(__x);
+ }
+
+ return std::__to_chars_itoa(__first, __last, __x, false_type());
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type) {
+ using __tx = __itoa::__traits<_Tp>;
+ auto __diff = __last - __first;
+
+ if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
+ return {__tx::__convert(__first, __value), errc(0)};
+ else
+ return {__last, errc::value_too_large};
+}
+
+# ifndef _LIBCPP_HAS_NO_INT128
+template <>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_itoa(char* __first, char* __last, __uint128_t __value, false_type) {
+ // When the value fits in 64-bits use the 64-bit code path. This reduces
+ // the number of expensive calculations on 128-bit values.
+ //
+ // NOTE the 128-bit code path requires this optimization.
+ if (__value <= numeric_limits<uint64_t>::max())
+ return __to_chars_itoa(__first, __last, static_cast<uint64_t>(__value), false_type());
+
+ using __tx = __itoa::__traits<__uint128_t>;
+ auto __diff = __last - __first;
+
+ if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
+ return {__tx::__convert(__first, __value), errc(0)};
+ else
+ return {__last, errc::value_too_large};
+}
+# endif
+
+template <class _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type);
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, true_type) {
+ auto __x = std::__to_unsigned_like(__value);
+ if (__value < 0 && __first != __last) {
+ *__first++ = '-';
+ __x = std::__complement(__x);
+ }
+
+ return std::__to_chars_integral(__first, __last, __x, __base, false_type());
+}
+
+namespace __itoa {
+
+template <unsigned _Base>
+struct _LIBCPP_HIDDEN __integral;
+
+template <>
+struct _LIBCPP_HIDDEN __integral<2> {
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+ // If value == 0 still need one digit. If the value != this has no
+ // effect since the code scans for the most significant bit set. (Note
+ // that __libcpp_clz doesn't work for 0.)
+ return numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1);
+ }
+
+ template <typename _Tp>
+ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result
+ __to_chars(char* __first, char* __last, _Tp __value) {
+ ptrdiff_t __cap = __last - __first;
+ int __n = __width(__value);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ const unsigned __divisor = 16;
+ while (__value > __divisor) {
+ unsigned __c = __value % __divisor;
+ __value /= __divisor;
+ __p -= 4;
+ std::copy_n(&__base_2_lut[4 * __c], 4, __p);
+ }
+ do {
+ unsigned __c = __value % 2;
+ __value /= 2;
+ *--__p = "01"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+ }
+};
+
+template <>
+struct _LIBCPP_HIDDEN __integral<8> {
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+ // If value == 0 still need one digit. If the value != this has no
+ // effect since the code scans for the most significat bit set. (Note
+ // that __libcpp_clz doesn't work for 0.)
+ return ((numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1)) + 2) / 3;
+ }
+
+ template <typename _Tp>
+ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result
+ __to_chars(char* __first, char* __last, _Tp __value) {
+ ptrdiff_t __cap = __last - __first;
+ int __n = __width(__value);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ unsigned __divisor = 64;
+ while (__value > __divisor) {
+ unsigned __c = __value % __divisor;
+ __value /= __divisor;
+ __p -= 2;
+ std::copy_n(&__base_8_lut[2 * __c], 2, __p);
+ }
+ do {
+ unsigned __c = __value % 8;
+ __value /= 8;
+ *--__p = "01234567"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+ }
+};
+
+template <>
+struct _LIBCPP_HIDDEN __integral<16> {
+ template <typename _Tp>
+ _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+ // If value == 0 still need one digit. If the value != this has no
+ // effect since the code scans for the most significat bit set. (Note
+ // that __libcpp_clz doesn't work for 0.)
+ return (numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1) + 3) / 4;
+ }
+
+ template <typename _Tp>
+ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result
+ __to_chars(char* __first, char* __last, _Tp __value) {
+ ptrdiff_t __cap = __last - __first;
+ int __n = __width(__value);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ unsigned __divisor = 256;
+ while (__value > __divisor) {
+ unsigned __c = __value % __divisor;
+ __value /= __divisor;
+ __p -= 2;
+ std::copy_n(&__base_16_lut[2 * __c], 2, __p);
+ }
+ if (__first != __last)
+ do {
+ unsigned __c = __value % 16;
+ __value /= 16;
+ *--__p = "0123456789abcdef"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+ }
+};
+
+} // namespace __itoa
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value) {
+ return __itoa::__integral<_Base>::__width(__value);
+}
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value) {
+ return std::__to_chars_integral_width<_Base>(static_cast<unsigned>(__value));
+}
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value) {
+ return __itoa::__integral<_Base>::__to_chars(__first, __last, __value);
+}
+
+template <unsigned _Base, typename _Tp, typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value) {
+ return std::__to_chars_integral<_Base>(__first, __last, static_cast<unsigned>(__value));
+}
+
+template <typename _Tp>
+_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value, unsigned __base) {
+ _LIBCPP_ASSERT(__value >= 0, "The function requires a non-negative value.");
+
+ unsigned __base_2 = __base * __base;
+ unsigned __base_3 = __base_2 * __base;
+ unsigned __base_4 = __base_2 * __base_2;
+
+ int __r = 0;
+ while (true) {
+ if (__value < __base)
+ return __r + 1;
+ if (__value < __base_2)
+ return __r + 2;
+ if (__value < __base_3)
+ return __r + 3;
+ if (__value < __base_4)
+ return __r + 4;
+
+ __value /= __base_4;
+ __r += 4;
+ }
+
+ __libcpp_unreachable();
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type) {
+ if (__base == 10) [[likely]]
+ return std::__to_chars_itoa(__first, __last, __value, false_type());
+
+ switch (__base) {
+ case 2:
+ return std::__to_chars_integral<2>(__first, __last, __value);
+ case 8:
+ return std::__to_chars_integral<8>(__first, __last, __value);
+ case 16:
+ return std::__to_chars_integral<16>(__first, __last, __value);
+ }
+
+ ptrdiff_t __cap = __last - __first;
+ int __n = std::__to_chars_integral_width(__value, __base);
+ if (__n > __cap)
+ return {__last, errc::value_too_large};
+
+ __last = __first + __n;
+ char* __p = __last;
+ do {
+ unsigned __c = __value % __base;
+ __value /= __base;
+ *--__p = "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
+ } while (__value != 0);
+ return {__last, errc(0)};
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, _Tp __value) {
+ using _Type = __make_32_64_or_128_bit_t<_Tp>;
+ static_assert(!is_same<_Type, void>::value, "unsupported integral type used in to_chars");
+ return std::__to_chars_itoa(__first, __last, static_cast<_Type>(__value), is_signed<_Tp>());
+}
+
+template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
+to_chars(char* __first, char* __last, _Tp __value, int __base) {
+ _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
+
+ using _Type = __make_32_64_or_128_bit_t<_Tp>;
+ return std::__to_chars_integral(__first, __last, static_cast<_Type>(__value), __base, is_signed<_Tp>());
+}
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CHARCONV_TO_CHARS_INTEGRAL_H
diff --git a/third_party/llvm-project/libcxx/include/__charconv/to_chars_result.h b/third_party/llvm-project/libcxx/include/__charconv/to_chars_result.h
index 2eb4098..67221b3 100644
--- a/third_party/llvm-project/libcxx/include/__charconv/to_chars_result.h
+++ b/third_party/llvm-project/libcxx/include/__charconv/to_chars_result.h
@@ -11,7 +11,7 @@
#define _LIBCPP___CHARCONV_TO_CHARS_RESULT_H
#include <__config>
-#include <__errc>
+#include <__system_error/errc.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -19,18 +19,17 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
-struct _LIBCPP_TYPE_VIS to_chars_result
-{
- char* ptr;
- errc ec;
-# if _LIBCPP_STD_VER > 17
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
+struct _LIBCPP_TYPE_VIS to_chars_result {
+ char* ptr;
+ errc ec;
+# if _LIBCPP_STD_VER >= 20
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
# endif
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__charconv/traits.h b/third_party/llvm-project/libcxx/include/__charconv/traits.h
new file mode 100644
index 0000000..505a0b1
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__charconv/traits.h
@@ -0,0 +1,199 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CHARCONV_TRAITS
+#define _LIBCPP___CHARCONV_TRAITS
+
+#include <__bit/countl.h>
+#include <__charconv/tables.h>
+#include <__charconv/to_chars_base_10.h>
+#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_unsigned.h>
+#include <cstdint>
+#include <limits>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+namespace __itoa {
+
+template <typename _Tp, typename = void>
+struct _LIBCPP_HIDDEN __traits_base;
+
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uint32_t)>> {
+ using type = uint32_t;
+
+ /// The width estimation using a log10 algorithm.
+ ///
+ /// The algorithm is based on
+ /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
+ /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+ /// function requires its input to have at least one bit set the value of
+ /// zero is set to one. This means the first element of the lookup table is
+ /// zero.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
+ auto __t = (32 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
+ return __t - (__v < __itoa::__pow10_32[__t]) + 1;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) {
+ return __itoa::__base_10_u32(__p, __v);
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_32)& __pow() {
+ return __itoa::__pow10_32;
+ }
+};
+
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(uint64_t)>> {
+ using type = uint64_t;
+
+ /// The width estimation using a log10 algorithm.
+ ///
+ /// The algorithm is based on
+ /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
+ /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+ /// function requires its input to have at least one bit set the value of
+ /// zero is set to one. This means the first element of the lookup table is
+ /// zero.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
+ auto __t = (64 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
+ return __t - (__v < __itoa::__pow10_64[__t]) + 1;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) {
+ return __itoa::__base_10_u64(__p, __v);
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_64)& __pow() {
+ return __itoa::__pow10_64;
+ }
+};
+
+# ifndef _LIBCPP_HAS_NO_INT128
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__uint128_t)> > {
+ using type = __uint128_t;
+
+ /// The width estimation using a log10 algorithm.
+ ///
+ /// The algorithm is based on
+ /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
+ /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+ /// function requires its input to have at least one bit set the value of
+ /// zero is set to one. This means the first element of the lookup table is
+ /// zero.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
+ _LIBCPP_ASSERT(
+ __v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
+ // There's always a bit set in the upper 64-bits.
+ auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
+ _LIBCPP_ASSERT(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
+ // __t is adjusted since the lookup table misses the lower entries.
+ return __t - (__v < __itoa::__pow10_128[__t - __itoa::__pow10_128_offset]) + 1;
+ }
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) {
+ return __itoa::__base_10_u128(__p, __v);
+ }
+
+ // TODO FMT This pow function should get an index.
+ // By moving this to its own header it can be reused by the pow function in to_chars_base_10.
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_128)& __pow() {
+ return __itoa::__pow10_128;
+ }
+};
+# endif
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
+__mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r) {
+ auto __c = __a * __b;
+ __r = __c;
+ return __c > numeric_limits<unsigned char>::max();
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
+__mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r) {
+ auto __c = __a * __b;
+ __r = __c;
+ return __c > numeric_limits<unsigned short>::max();
+}
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r) {
+ static_assert(is_unsigned<_Tp>::value, "");
+ return __builtin_mul_overflow(__a, __b, &__r);
+}
+
+template <typename _Tp, typename _Up>
+inline _LIBCPP_HIDE_FROM_ABI bool _LIBCPP_CONSTEXPR_SINCE_CXX23 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r) {
+ return __itoa::__mul_overflowed(__a, static_cast<_Tp>(__b), __r);
+}
+
+template <typename _Tp>
+struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp> {
+ static constexpr int digits = numeric_limits<_Tp>::digits10 + 1;
+ using __traits_base<_Tp>::__pow;
+ using typename __traits_base<_Tp>::type;
+
+ // precondition: at least one non-zero character available
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char const*
+ __read(char const* __p, char const* __ep, type& __a, type& __b) {
+ type __cprod[digits];
+ int __j = digits - 1;
+ int __i = digits;
+ do {
+ if (*__p < '0' || *__p > '9')
+ break;
+ __cprod[--__i] = *__p++ - '0';
+ } while (__p != __ep && __i != 0);
+
+ __a = __inner_product(__cprod + __i + 1, __cprod + __j, __pow() + 1, __cprod[__i]);
+ if (__itoa::__mul_overflowed(__cprod[__j], __pow()[__j - __i], __b))
+ --__p;
+ return __p;
+ }
+
+ template <typename _It1, typename _It2, class _Up>
+ static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Up
+ __inner_product(_It1 __first1, _It1 __last1, _It2 __first2, _Up __init) {
+ for (; __first1 < __last1; ++__first1, ++__first2)
+ __init = __init + *__first1 * *__first2;
+ return __init;
+ }
+};
+
+} // namespace __itoa
+
+template <typename _Tp>
+inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Tp __complement(_Tp __x) {
+ static_assert(is_unsigned<_Tp>::value, "cast to unsigned first");
+ return _Tp(~__x + 1);
+}
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CHARCONV_TRAITS
diff --git a/third_party/llvm-project/libcxx/include/__chrono/calendar.h b/third_party/llvm-project/libcxx/include/__chrono/calendar.h
index d3762a6..e14f96d 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/calendar.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/calendar.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -39,6 +39,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_CALENDAR_H
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/pair_like.h b/third_party/llvm-project/libcxx/include/__chrono/concepts.h
similarity index 60%
copy from third_party/llvm-project/libcxx/include/__tuple_dir/pair_like.h
copy to third_party/llvm-project/libcxx/include/__chrono/concepts.h
index 87407ad..61ec256 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/pair_like.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/concepts.h
@@ -1,3 +1,4 @@
+// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -6,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___TUPLE_PAIR_LIKE_H
-#define _LIBCPP___TUPLE_PAIR_LIKE_H
+#ifndef _LIBCPP___CHRONO_CONCEPTS_H
+#define _LIBCPP___CHRONO_CONCEPTS_H
+#include <__chrono/hh_mm_ss.h>
+#include <__chrono/time_point.h>
#include <__config>
-#include <__tuple_dir/tuple_like.h>
-#include <__tuple_dir/tuple_size.h>
-#include <__type_traits/remove_cvref.h>
+#include <__type_traits/is_specialization.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -23,10 +24,13 @@
#if _LIBCPP_STD_VER >= 20
template <class _Tp>
-concept __pair_like = __tuple_like<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;
+concept __is_hh_mm_ss = __is_specialization_v<_Tp, chrono::hh_mm_ss>;
+
+template <class _Tp>
+concept __is_time_point = __is_specialization_v<_Tp, chrono::time_point>;
#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___TUPLE_PAIR_LIKE_H
+#endif // _LIBCPP___CHRONO_CONCEPTS_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/convert_to_tm.h b/third_party/llvm-project/libcxx/include/__chrono/convert_to_tm.h
index 36846b3..95cde20 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/convert_to_tm.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/convert_to_tm.h
@@ -10,6 +10,7 @@
#ifndef _LIBCPP___CHRONO_CONVERT_TO_TM_H
#define _LIBCPP___CHRONO_CONVERT_TO_TM_H
+#include <__chrono/concepts.h>
#include <__chrono/day.h>
#include <__chrono/duration.h>
#include <__chrono/hh_mm_ss.h>
@@ -26,17 +27,22 @@
#include <__chrono/year_month_weekday.h>
#include <__concepts/same_as.h>
#include <__config>
+#include <__format/format_error.h>
#include <__memory/addressof.h>
#include <cstdint>
#include <ctime>
+#include <limits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Conerts a chrono date and weekday to a given _Tm type.
//
@@ -76,7 +82,25 @@
__result.tm_zone = "UTC";
# endif
- if constexpr (chrono::__is_duration<_ChronoT>::value) {
+ if constexpr (__is_time_point<_ChronoT>) {
+ if constexpr (same_as<typename _ChronoT::clock, chrono::system_clock>) {
+ chrono::sys_days __days = chrono::time_point_cast<chrono::days>(__value);
+ chrono::year_month_day __ymd{__days};
+
+ __result = std::__convert_to_tm<_Tm>(chrono::year_month_day{__ymd}, chrono::weekday{__days});
+
+ // TODO FMT D138826 has improvements for this part.
+ // TODO FMT Since this is identical for duration and system time it would be good to avoid code duplication.
+ uint64_t __sec =
+ chrono::duration_cast<chrono::seconds>(__value - chrono::time_point_cast<chrono::seconds>(__days)).count();
+ __sec %= 24 * 3600;
+ __result.tm_hour = __sec / 3600;
+ __sec %= 3600;
+ __result.tm_min = __sec / 60;
+ __result.tm_sec = __sec % 60;
+ } else
+ static_assert(sizeof(_ChronoT) == 0, "TODO: Add the missing clock specialization");
+ } else if constexpr (chrono::__is_duration<_ChronoT>::value) {
// [time.format]/6
// ... However, if a flag refers to a "time of day" (e.g. %H, %I, %p,
// etc.), then a specialization of duration is interpreted as the time of
@@ -114,14 +138,26 @@
} else if constexpr (same_as<_ChronoT, chrono::year_month_weekday> ||
same_as<_ChronoT, chrono::year_month_weekday_last>) {
return std::__convert_to_tm<_Tm>(chrono::year_month_day{static_cast<chrono::sys_days>(__value)}, __value.weekday());
+ } else if constexpr (__is_hh_mm_ss<_ChronoT>) {
+ __result.tm_sec = __value.seconds().count();
+ __result.tm_min = __value.minutes().count();
+ // In libc++ hours is stored as a long. The type in std::tm is an int. So
+ // the overflow can only occur when hour uses more bits than an int
+ // provides.
+ if constexpr (sizeof(std::chrono::hours::rep) > sizeof(__result.tm_hour))
+ if (__value.hours().count() > std::numeric_limits<decltype(__result.tm_hour)>::max())
+ std::__throw_format_error("Formatting hh_mm_ss, encountered an hour overflow");
+ __result.tm_hour = __value.hours().count();
} else
static_assert(sizeof(_ChronoT) == 0, "Add the missing type specialization");
return __result;
}
-#endif //if _LIBCPP_STD_VER > 17
+#endif // if _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___CHRONO_CONVERT_TO_TM_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/day.h b/third_party/llvm-project/libcxx/include/__chrono/day.h
index 35ecfcf..13a885c 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/day.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/day.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -79,6 +79,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_DAY_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/duration.h b/third_party/llvm-project/libcxx/include/__chrono/duration.h
index afcc38b..2c8d50a 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/duration.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/duration.h
@@ -10,6 +10,8 @@
#ifndef _LIBCPP___CHRONO_DURATION_H
#define _LIBCPP___CHRONO_DURATION_H
+#include <__compare/ordering.h>
+#include <__compare/three_way_comparable.h>
#include <__config>
#include <__type_traits/common_type.h>
#include <__type_traits/enable_if.h>
@@ -130,7 +132,7 @@
template <class _Rep>
struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Rep>
inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value;
#endif
@@ -144,7 +146,7 @@
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep min() _NOEXCEPT {return numeric_limits<_Rep>::lowest();}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _ToDuration, class _Rep, class _Period>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
typename enable_if
@@ -186,11 +188,11 @@
{
_ToDuration __lower = chrono::floor<_ToDuration>(__d);
_ToDuration __upper = __lower + _ToDuration{1};
- auto __lowerDiff = __d - __lower;
- auto __upperDiff = __upper - __d;
- if (__lowerDiff < __upperDiff)
+ auto __lower_diff = __d - __lower;
+ auto __upper_diff = __upper - __d;
+ if (__lower_diff < __upper_diff)
return __lower;
- if (__lowerDiff > __upperDiff)
+ if (__lower_diff > __upper_diff)
return __upper;
return __lower.count() & 1 ? __upper : __lower;
}
@@ -307,7 +309,7 @@
typedef duration<long long > seconds;
typedef duration< long, ratio< 60> > minutes;
typedef duration< long, ratio<3600> > hours;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef duration< int, ratio_multiply<ratio<24>, hours::period>> days;
typedef duration< int, ratio_multiply<ratio<7>, days::period>> weeks;
typedef duration< int, ratio_multiply<ratio<146097, 400>, days::period>> years;
@@ -343,6 +345,8 @@
return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
}
+#if _LIBCPP_STD_VER <= 17
+
// Duration !=
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
@@ -354,6 +358,8 @@
return !(__lhs == __rhs);
}
+#endif // _LIBCPP_STD_VER <= 17
+
// Duration <
template <class _LhsDuration, class _RhsDuration>
@@ -417,6 +423,20 @@
return !(__lhs < __rhs);
}
+#if _LIBCPP_STD_VER >= 20
+
+template<class _Rep1, class _Period1, class _Rep2, class _Period2>
+ requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
+_LIBCPP_HIDE_FROM_ABI
+constexpr auto operator<=>(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+{
+ using _Ct = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
+ return _Ct(__lhs).count() <=> _Ct(__rhs).count();
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
// Duration +
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
@@ -530,7 +550,7 @@
} // namespace chrono
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// Suffixes for duration literals [time.duration.literals]
inline namespace literals
{
@@ -609,7 +629,7 @@
using namespace literals::chrono_literals;
} // namespace chrono
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__chrono/file_clock.h b/third_party/llvm-project/libcxx/include/__chrono/file_clock.h
index ef62b83..7a4dce9 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/file_clock.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/file_clock.h
@@ -27,7 +27,7 @@
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -44,7 +44,7 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@@ -65,7 +65,7 @@
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_FUNC_VIS static time_point now() noexcept;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Duration>
_LIBCPP_HIDE_FROM_ABI
static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {
@@ -77,7 +77,7 @@
static chrono::file_time<_Duration> from_sys(const chrono::sys_time<_Duration>& __t) {
return chrono::file_time<_Duration>(__t.time_since_epoch());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // !_LIBCPP_CXX03_LANG
diff --git a/third_party/llvm-project/libcxx/include/__chrono/formatter.h b/third_party/llvm-project/libcxx/include/__chrono/formatter.h
index 2015783..e73b043 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/formatter.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/formatter.h
@@ -11,6 +11,7 @@
#define _LIBCPP___CHRONO_FORMATTER_H
#include <__chrono/calendar.h>
+#include <__chrono/concepts.h>
#include <__chrono/convert_to_tm.h>
#include <__chrono/day.h>
#include <__chrono/duration.h>
@@ -21,6 +22,7 @@
#include <__chrono/ostream.h>
#include <__chrono/parser_std_format_spec.h>
#include <__chrono/statically_widen.h>
+#include <__chrono/system_clock.h>
#include <__chrono/time_point.h>
#include <__chrono/weekday.h>
#include <__chrono/year.h>
@@ -50,7 +52,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
namespace __formatter {
@@ -75,13 +77,15 @@
// For tiny ratios it's not possible to convert a duration to a hh_mm_ss. This
// fails compile-time due to the limited precision of the ratio (64-bit is too
// small). Therefore a duration uses its own conversion.
-template <class _CharT, class _Tp>
- requires(chrono::__is_duration<_Tp>::value)
-_LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(const _Tp& __value, basic_stringstream<_CharT>& __sstr) {
+template <class _CharT, class _Rep, class _Period>
+_LIBCPP_HIDE_FROM_ABI void
+__format_sub_seconds(const chrono::duration<_Rep, _Period>& __value, basic_stringstream<_CharT>& __sstr) {
__sstr << std::use_facet<numpunct<_CharT>>(__sstr.getloc()).decimal_point();
+ using __duration = chrono::duration<_Rep, _Period>;
+
auto __fraction = __value - chrono::duration_cast<chrono::seconds>(__value);
- if constexpr (chrono::treat_as_floating_point_v<typename _Tp::rep>)
+ if constexpr (chrono::treat_as_floating_point_v<_Rep>)
// When the floating-point value has digits itself they are ignored based
// on the wording in [tab:time.format.spec]
// If the precision of the input cannot be exactly represented with
@@ -97,18 +101,43 @@
std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
_LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}.0f}"),
__fraction.count(),
- chrono::hh_mm_ss<_Tp>::fractional_width);
+ chrono::hh_mm_ss<__duration>::fractional_width);
else
std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
_LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}}"),
__fraction.count(),
- chrono::hh_mm_ss<_Tp>::fractional_width);
+ chrono::hh_mm_ss<__duration>::fractional_width);
+}
+
+template <class _CharT, __is_time_point _Tp>
+_LIBCPP_HIDE_FROM_ABI void __format_sub_seconds(const _Tp& __value, basic_stringstream<_CharT>& __sstr) {
+ __formatter::__format_sub_seconds(__value.time_since_epoch(), __sstr);
+}
+
+template <class _CharT, class _Duration>
+_LIBCPP_HIDE_FROM_ABI void
+__format_sub_seconds(const chrono::hh_mm_ss<_Duration>& __value, basic_stringstream<_CharT>& __sstr) {
+ __sstr << std::use_facet<numpunct<_CharT>>(__sstr.getloc()).decimal_point();
+ if constexpr (chrono::treat_as_floating_point_v<typename _Duration::rep>)
+ std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
+ _LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}.0f}"),
+ __value.subseconds().count(),
+ __value.fractional_width);
+ else
+ std::format_to(std::ostreambuf_iterator<_CharT>{__sstr},
+ _LIBCPP_STATICALLY_WIDEN(_CharT, "{:0{}}"),
+ __value.subseconds().count(),
+ __value.fractional_width);
}
template <class _Tp>
consteval bool __use_fraction() {
- if constexpr (chrono::__is_duration<_Tp>::value)
+ if constexpr (__is_time_point<_Tp>)
+ return chrono::hh_mm_ss<typename _Tp::duration>::fractional_width;
+ else if constexpr (chrono::__is_duration<_Tp>::value)
return chrono::hh_mm_ss<_Tp>::fractional_width;
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return _Tp::fractional_width;
else
return false;
}
@@ -169,7 +198,7 @@
if (__year < 1000 || __year > 9999)
__formatter::__format_century(__year, __sstr);
else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
} break;
case _CharT('j'):
@@ -180,7 +209,7 @@
// an intemediate step.
__sstr << chrono::duration_cast<chrono::days>(chrono::duration_cast<chrono::seconds>(__value)).count();
else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
break;
case _CharT('q'):
@@ -208,7 +237,7 @@
case _CharT('S'):
case _CharT('T'):
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
if constexpr (__use_fraction<_Tp>())
__formatter::__format_sub_seconds(__value, __sstr);
break;
@@ -252,7 +281,7 @@
if (__year < 1000)
__formatter::__format_year(__year, __sstr);
else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
} break;
case _CharT('F'): {
@@ -261,9 +290,14 @@
__formatter::__format_year(__year, __sstr);
__sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "-{:02}-{:02}"), __t.tm_mon + 1, __t.tm_mday);
} else
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
} break;
+ case _CharT('Z'):
+ // TODO FMT Add proper timezone support.
+ __sstr << _LIBCPP_STATICALLY_WIDEN(_CharT, "UTC");
+ break;
+
case _CharT('O'):
if constexpr (__use_fraction<_Tp>()) {
// Handle OS using the normal representation for the non-fractional
@@ -271,7 +305,7 @@
// fractional part should be formatted.
if (*(__it + 1) == 'S') {
++__it;
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
__formatter::__format_sub_seconds(__value, __sstr);
break;
}
@@ -281,7 +315,7 @@
++__it;
[[fallthrough]];
default:
- __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), __s, __it + 1);
+ __facet.put({__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
break;
}
} else {
@@ -292,7 +326,9 @@
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -322,13 +358,17 @@
return __value.weekday().ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.weekday().ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_name_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -358,13 +398,17 @@
return __value.weekday().ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.weekday().ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -394,13 +438,17 @@
return __value.ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr bool __month_name_ok(const _Tp& __value) {
- if constexpr (same_as<_Tp, chrono::day>)
+ if constexpr (__is_time_point<_Tp>)
+ return true;
+ else if constexpr (same_as<_Tp, chrono::day>)
return true;
else if constexpr (same_as<_Tp, chrono::month>)
return __value.ok();
@@ -430,6 +478,8 @@
return __value.month().ok();
else if constexpr (same_as<_Tp, chrono::year_month_weekday_last>)
return __value.month().ok();
+ else if constexpr (__is_hh_mm_ss<_Tp>)
+ return true;
else
static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
}
@@ -478,6 +528,29 @@
if (__specs.__chrono_.__month_name_ && !__formatter::__month_name_ok(__value))
std::__throw_format_error("formatting a month name from an invalid month number");
+ if constexpr (__is_hh_mm_ss<_Tp>) {
+ // Note this is a pedantic intepretation of the Standard. A hh_mm_ss
+ // is no longer a time_of_day and can store an arbitrary number of
+ // hours. A number of hours in a 12 or 24 hour clock can't represent
+ // 24 hours or more. The functions std::chrono::make12 and
+ // std::chrono::make24 reaffirm this view point.
+ //
+ // Interestingly this will be the only output stream function that
+ // throws.
+ //
+ // TODO FMT The wording probably needs to be adapted to
+ // - The displayed hours is hh_mm_ss.hours() % 24
+ // - It should probably allow %j in the same fashion as duration.
+ // - The stream formatter should change its output when hours >= 24
+ // - Write it as not valid,
+ // - or write the number of days.
+ if (__specs.__chrono_.__hour_ && __value.hours().count() > 23)
+ std::__throw_format_error("formatting a hour needs a valid value");
+
+ if (__value.is_negative())
+ __sstr << _CharT('-');
+ }
+
__formatter::__format_chrono_using_chrono_specs(__value, __sstr, __chrono_specs);
}
}
@@ -490,7 +563,7 @@
} // namespace __formatter
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_chrono {
+struct _LIBCPP_TEMPLATE_VIS __formatter_chrono {
public:
_LIBCPP_HIDE_FROM_ABI constexpr auto __parse(
basic_format_parse_context<_CharT>& __parse_ctx, __format_spec::__fields __fields, __format_spec::__flags __flags)
@@ -507,6 +580,17 @@
__format_spec::__parser_chrono<_CharT> __parser_;
};
+template <class _Duration, __fmt_char_type _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::sys_time<_Duration>, _CharT> : public __formatter_chrono<_CharT> {
+public:
+ using _Base = __formatter_chrono<_CharT>;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
+ -> decltype(__parse_ctx.begin()) {
+ return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__clock);
+ }
+};
+
template <class _Rep, class _Period, __fmt_char_type _CharT>
struct formatter<chrono::duration<_Rep, _Period>, _CharT> : public __formatter_chrono<_CharT> {
public:
@@ -530,7 +614,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::day, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::day, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -542,7 +626,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -554,7 +638,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -566,7 +650,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::weekday, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::weekday, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -578,7 +662,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::weekday_indexed, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::weekday_indexed, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -590,7 +674,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::weekday_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::weekday_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -602,7 +686,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_day, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_day, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -614,7 +698,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_day_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_day_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -626,7 +710,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_weekday, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_weekday, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -638,7 +722,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::month_weekday_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::month_weekday_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -650,7 +734,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -662,7 +746,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_day, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_day, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -674,7 +758,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_day_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_day_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -686,7 +770,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_weekday, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_weekday, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -698,7 +782,7 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<chrono::year_month_weekday_last, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<chrono::year_month_weekday_last, _CharT>
: public __formatter_chrono<_CharT> {
public:
using _Base = __formatter_chrono<_CharT>;
@@ -709,7 +793,17 @@
}
};
-#endif // if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+template <class _Duration, __fmt_char_type _CharT>
+struct formatter<chrono::hh_mm_ss<_Duration>, _CharT> : public __formatter_chrono<_CharT> {
+public:
+ using _Base = __formatter_chrono<_CharT>;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
+ -> decltype(__parse_ctx.begin()) {
+ return _Base::__parse(__parse_ctx, __format_spec::__fields_chrono, __format_spec::__flags::__time);
+ }
+};
+#endif // if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__chrono/hh_mm_ss.h b/third_party/llvm-project/libcxx/include/__chrono/hh_mm_ss.h
index fd61cbe..5bd452e 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/hh_mm_ss.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/hh_mm_ss.h
@@ -13,14 +13,14 @@
#include <__chrono/duration.h>
#include <__chrono/time_point.h>
#include <__config>
+#include <__type_traits/common_type.h>
#include <ratio>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -85,6 +85,7 @@
chrono::seconds __s_;
precision __f_;
};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(hh_mm_ss);
_LIBCPP_HIDE_FROM_ABI constexpr bool is_am(const hours& __h) noexcept { return __h >= hours( 0) && __h < hours(12); }
_LIBCPP_HIDE_FROM_ABI constexpr bool is_pm(const hours& __h) noexcept { return __h >= hours(12) && __h < hours(24); }
@@ -107,6 +108,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_HH_MM_SS_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/literals.h b/third_party/llvm-project/libcxx/include/__chrono/literals.h
index 50529bd..28ddc43 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/literals.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/literals.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -44,6 +44,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_LITERALS_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/month.h b/third_party/llvm-project/libcxx/include/__chrono/month.h
index e929f24..ad679e4 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/month.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/month.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -98,6 +98,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_MONTH_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/month_weekday.h b/third_party/llvm-project/libcxx/include/__chrono/month_weekday.h
index 01cdf76..802cbd7 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/month_weekday.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/month_weekday.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -101,6 +101,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_MONTH_WEEKDAY_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/monthday.h b/third_party/llvm-project/libcxx/include/__chrono/monthday.h
index c0ee3e4..961b71e 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/monthday.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/monthday.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -124,6 +124,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_MONTHDAY_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/ostream.h b/third_party/llvm-project/libcxx/include/__chrono/ostream.h
index 30a04bd..26df882 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/ostream.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/ostream.h
@@ -12,10 +12,12 @@
#include <__chrono/day.h>
#include <__chrono/duration.h>
+#include <__chrono/hh_mm_ss.h>
#include <__chrono/month.h>
#include <__chrono/month_weekday.h>
#include <__chrono/monthday.h>
#include <__chrono/statically_widen.h>
+#include <__chrono/system_clock.h>
#include <__chrono/weekday.h>
#include <__chrono/year.h>
#include <__chrono/year_month.h>
@@ -33,10 +35,16 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
namespace chrono {
+template <class _CharT, class _Traits, class _Duration>
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_time<_Duration> __tp) {
+ return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
+}
+
// Depending on the type the return is a const _CharT* or a basic_string<_CharT>
template <class _CharT, class _Period>
_LIBCPP_HIDE_FROM_ABI auto __units_suffix() {
@@ -92,7 +100,7 @@
}
template <class _CharT, class _Traits, class _Rep, class _Period>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const duration<_Rep, _Period>& __d) {
basic_ostringstream<_CharT, _Traits> __s;
__s.flags(__os.flags());
@@ -103,21 +111,19 @@
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
-operator<<(basic_ostream<_CharT, _Traits>& __os, const day& __d) {
- return __os
- << (__d.ok()
- ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
- // Note this error differs from the wording of the Standard. The
- // Standard wording doesn't work well on AIX or Windows. There
- // the formatted day seems to be either modulo 100 or completely
- // omitted. Judging by the wording this is valid.
- // TODO FMT Write a paper of file an LWG issue.
- : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"), static_cast<unsigned>(__d)));
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const day& __d) {
+ return __os << (__d.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
+ // Note this error differs from the wording of the Standard. The
+ // Standard wording doesn't work well on AIX or Windows. There
+ // the formatted day seems to be either modulo 100 or completely
+ // omitted. Judging by the wording this is valid.
+ // TODO FMT Write a paper of file an LWG issue.
+ : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"),
+ static_cast<unsigned>(__d)));
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month& __m) {
return __os << (__m.ok() ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%b}"), __m)
: std::format(__os.getloc(),
@@ -126,14 +132,14 @@
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year& __y) {
return __os << (__y.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%Y}"), __y)
: std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%Y} is not a valid year"), __y));
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday& __wd) {
return __os << (__wd.ok() ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%a}"), __wd)
: std::format(__os.getloc(), // TODO FMT Standard mandated locale isn't used.
@@ -142,7 +148,7 @@
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_indexed& __wdi) {
auto __i = __wdi.index();
return __os << (__i >= 1 && __i <= 5
@@ -154,13 +160,13 @@
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_last& __wdl) {
return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}[last]"), __wdl.weekday());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day& __md) {
// TODO FMT The Standard allows 30th of February to be printed.
// It would be nice to show an error message instead.
@@ -168,47 +174,47 @@
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day_last& __mdl) {
return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/last"), __mdl.month());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_weekday& __mwd) {
return __os << std::format(
__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), __mwd.month(), __mwd.weekday_indexed());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const month_weekday_last& __mwdl) {
return __os << std::format(
__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), __mwdl.month(), __mwdl.weekday_last());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month& __ym) {
return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}"), __ym.year(), __ym.month());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_day& __ymd) {
return __os << (__ymd.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%F}"), __ymd)
: std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%F} is not a valid date"), __ymd));
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_day_last& __ymdl) {
return __os << std::format(
__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}"), __ymdl.year(), __ymdl.month_day_last());
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday& __ymwd) {
return __os << std::format(
__os.getloc(),
@@ -219,7 +225,7 @@
}
template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday_last& __ymwdl) {
return __os << std::format(
__os.getloc(),
@@ -229,9 +235,15 @@
__ymwdl.weekday_last());
}
+template <class _CharT, class _Traits, class _Duration>
+_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, const hh_mm_ss<_Duration> __hms) {
+ return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%T}"), __hms);
+}
+
} // namespace chrono
-#endif //if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#endif // if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__chrono/parser_std_format_spec.h b/third_party/llvm-project/libcxx/include/__chrono/parser_std_format_spec.h
index dbcfe6d..27b8aa7 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/parser_std_format_spec.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/parser_std_format_spec.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
namespace __format_spec {
@@ -137,17 +137,19 @@
template <class _CharT>
class _LIBCPP_TEMPLATE_VIS __parser_chrono {
+ using _ConstIterator = typename basic_format_parse_context<_CharT>::const_iterator;
+
public:
_LIBCPP_HIDE_FROM_ABI constexpr auto
__parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields, __flags __flags)
-> decltype(__parse_ctx.begin()) {
- const _CharT* __begin = __parser_.__parse(__parse_ctx, __fields);
- const _CharT* __end = __parse_ctx.end();
+ _ConstIterator __begin = __parser_.__parse(__parse_ctx, __fields);
+ _ConstIterator __end = __parse_ctx.end();
if (__begin == __end)
return __begin;
- const _CharT* __last = __parse_chrono_specs(__begin, __end, __flags);
- __chrono_specs_ = basic_string_view<_CharT>{__begin, __last};
+ _ConstIterator __last = __parse_chrono_specs(__begin, __end, __flags);
+ __chrono_specs_ = basic_string_view<_CharT>{__begin, __last};
return __last;
}
@@ -156,8 +158,8 @@
basic_string_view<_CharT> __chrono_specs_;
private:
- _LIBCPP_HIDE_FROM_ABI constexpr const _CharT*
- __parse_chrono_specs(const _CharT* __begin, const _CharT* __end, __flags __flags) {
+ _LIBCPP_HIDE_FROM_ABI constexpr _ConstIterator
+ __parse_chrono_specs(_ConstIterator __begin, _ConstIterator __end, __flags __flags) {
_LIBCPP_ASSERT(__begin != __end,
"When called with an empty input the function will cause "
"undefined behavior by evaluating data not in the input");
@@ -190,7 +192,7 @@
/// \pre *__begin == '%'
/// \post __begin points at the end parsed conversion-spec
_LIBCPP_HIDE_FROM_ABI constexpr void
- __parse_conversion_spec(const _CharT*& __begin, const _CharT* __end, __flags __flags) {
+ __parse_conversion_spec(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
std::__throw_format_error("End of input while parsing the modifier chrono conversion-spec");
@@ -212,6 +214,7 @@
case _CharT('p'): // TODO FMT does the formater require an hour or a time?
case _CharT('H'):
case _CharT('I'):
+ __parser_.__hour_ = true;
__validate_hour(__flags);
break;
@@ -219,6 +222,7 @@
case _CharT('R'):
case _CharT('T'):
case _CharT('X'):
+ __parser_.__hour_ = true;
__format_spec::__validate_time(__flags);
break;
@@ -304,13 +308,14 @@
/// \pre *__begin == 'E'
/// \post __begin is incremented by one.
_LIBCPP_HIDE_FROM_ABI constexpr void
- __parse_modifier_E(const _CharT*& __begin, const _CharT* __end, __flags __flags) {
+ __parse_modifier_E(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
std::__throw_format_error("End of input while parsing the modifier E");
switch (*__begin) {
case _CharT('X'):
+ __parser_.__hour_ = true;
__format_spec::__validate_time(__flags);
break;
@@ -343,7 +348,7 @@
/// \pre *__begin == 'O'
/// \post __begin is incremented by one.
_LIBCPP_HIDE_FROM_ABI constexpr void
- __parse_modifier_O(const _CharT*& __begin, const _CharT* __end, __flags __flags) {
+ __parse_modifier_O(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
std::__throw_format_error("End of input while parsing the modifier O");
@@ -359,6 +364,7 @@
case _CharT('I'):
case _CharT('H'):
+ __parser_.__hour_ = true;
__format_spec::__validate_hour(__flags);
break;
@@ -403,7 +409,7 @@
} // namespace __format_spec
-#endif //_LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#endif //_LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__chrono/statically_widen.h b/third_party/llvm-project/libcxx/include/__chrono/statically_widen.h
index 360b6c2..cc1d586 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/statically_widen.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/statically_widen.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <__fmt_char_type _CharT>
@@ -45,7 +45,7 @@
# define _LIBCPP_STATICALLY_WIDEN(_CharT, __str) ::std::__statically_widen<_CharT>(__str)
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__chrono/system_clock.h b/third_party/llvm-project/libcxx/include/__chrono/system_clock.h
index 331db46..e8a41ce 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/system_clock.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/system_clock.h
@@ -38,7 +38,7 @@
static time_point from_time_t(time_t __t) _NOEXCEPT;
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Duration>
using sys_time = time_point<system_clock, _Duration>;
diff --git a/third_party/llvm-project/libcxx/include/__chrono/time_point.h b/third_party/llvm-project/libcxx/include/__chrono/time_point.h
index 8a8fa21..c148354 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/time_point.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/time_point.h
@@ -11,6 +11,8 @@
#define _LIBCPP___CHRONO_TIME_POINT_H
#include <__chrono/duration.h>
+#include <__compare/ordering.h>
+#include <__compare/three_way_comparable.h>
#include <__config>
#include <__type_traits/common_type.h>
#include <__type_traits/enable_if.h>
@@ -90,7 +92,7 @@
return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _ToDuration, class _Clock, class _Duration>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
typename enable_if
@@ -138,7 +140,7 @@
{
return __d >= __d.zero() ? +__d : -__d;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
// time_point ==
@@ -150,6 +152,8 @@
return __lhs.time_since_epoch() == __rhs.time_since_epoch();
}
+#if _LIBCPP_STD_VER <= 17
+
// time_point !=
template <class _Clock, class _Duration1, class _Duration2>
@@ -160,6 +164,8 @@
return !(__lhs == __rhs);
}
+#endif // _LIBCPP_STD_VER <= 17
+
// time_point <
template <class _Clock, class _Duration1, class _Duration2>
@@ -200,6 +206,16 @@
return !(__lhs < __rhs);
}
+#if _LIBCPP_STD_VER >= 20
+
+template <class _Clock, class _Duration1, three_way_comparable_with<_Duration1> _Duration2>
+_LIBCPP_HIDE_FROM_ABI constexpr auto
+operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
+ return __lhs.time_since_epoch() <=> __rhs.time_since_epoch();
+}
+
+#endif // _LIBCPP_STD_VER >= 20
+
// time_point operator+(time_point x, duration y);
template <class _Clock, class _Duration1, class _Rep2, class _Period2>
diff --git a/third_party/llvm-project/libcxx/include/__chrono/weekday.h b/third_party/llvm-project/libcxx/include/__chrono/weekday.h
index e0bc8a4..ed9530f 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/weekday.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/weekday.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -180,6 +180,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_WEEKDAY_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/year.h b/third_party/llvm-project/libcxx/include/__chrono/year.h
index 79ee8a0..d5251aa 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/year.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/year.h
@@ -22,7 +22,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -95,7 +95,7 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_POP_MACROS
diff --git a/third_party/llvm-project/libcxx/include/__chrono/year_month.h b/third_party/llvm-project/libcxx/include/__chrono/year_month.h
index 9f1e65c..7a6acff 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/year_month.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/year_month.h
@@ -20,7 +20,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -96,6 +96,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_YEAR_MONTH_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/year_month_day.h b/third_party/llvm-project/libcxx/include/__chrono/year_month_day.h
index b749014..4d64db3 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/year_month_day.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/year_month_day.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -302,6 +302,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_YEAR_MONTH_DAY_H
diff --git a/third_party/llvm-project/libcxx/include/__chrono/year_month_weekday.h b/third_party/llvm-project/libcxx/include/__chrono/year_month_weekday.h
index 6604dea..b667120 100644
--- a/third_party/llvm-project/libcxx/include/__chrono/year_month_weekday.h
+++ b/third_party/llvm-project/libcxx/include/__chrono/year_month_weekday.h
@@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -250,6 +250,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP___CHRONO_YEAR_MONTH_WEEKDAY_H
diff --git a/third_party/llvm-project/libcxx/include/__compare/common_comparison_category.h b/third_party/llvm-project/libcxx/include/__compare/common_comparison_category.h
index 06c4b28..5fad99b 100644
--- a/third_party/llvm-project/libcxx/include/__compare/common_comparison_category.h
+++ b/third_party/llvm-project/libcxx/include/__compare/common_comparison_category.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __comp_detail {
@@ -65,14 +65,14 @@
constexpr auto __get_comp_type() {
using _CCC = _ClassifyCompCategory;
constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...};
- constexpr _CCC _Cat = __comp_detail::__compute_comp_type(__type_kinds);
- if constexpr (_Cat == _None)
+ constexpr _CCC __cat = __comp_detail::__compute_comp_type(__type_kinds);
+ if constexpr (__cat == _None)
return void();
- else if constexpr (_Cat == _PartialOrd)
+ else if constexpr (__cat == _PartialOrd)
return partial_ordering::equivalent;
- else if constexpr (_Cat == _WeakOrd)
+ else if constexpr (__cat == _WeakOrd)
return weak_ordering::equivalent;
- else if constexpr (_Cat == _StrongOrd)
+ else if constexpr (__cat == _StrongOrd)
return strong_ordering::equivalent;
else
static_assert(_False, "unhandled case");
@@ -88,7 +88,7 @@
template<class... _Ts>
using common_comparison_category_t = typename common_comparison_category<_Ts...>::type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/compare_partial_order_fallback.h b/third_party/llvm-project/libcxx/include/__compare/compare_partial_order_fallback.h
index 06f03fe..fb2921e 100644
--- a/third_party/llvm-project/libcxx/include/__compare/compare_partial_order_fallback.h
+++ b/third_party/llvm-project/libcxx/include/__compare/compare_partial_order_fallback.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __compare_partial_order_fallback {
@@ -67,7 +67,7 @@
inline constexpr auto compare_partial_order_fallback = __compare_partial_order_fallback::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/compare_strong_order_fallback.h b/third_party/llvm-project/libcxx/include/__compare/compare_strong_order_fallback.h
index 8693868..d84d065 100644
--- a/third_party/llvm-project/libcxx/include/__compare/compare_strong_order_fallback.h
+++ b/third_party/llvm-project/libcxx/include/__compare/compare_strong_order_fallback.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __compare_strong_order_fallback {
@@ -64,7 +64,7 @@
inline constexpr auto compare_strong_order_fallback = __compare_strong_order_fallback::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/compare_three_way.h b/third_party/llvm-project/libcxx/include/__compare/compare_three_way.h
index fdbba04..2bc63a0 100644
--- a/third_party/llvm-project/libcxx/include/__compare/compare_three_way.h
+++ b/third_party/llvm-project/libcxx/include/__compare/compare_three_way.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct _LIBCPP_TEMPLATE_VIS compare_three_way
{
@@ -34,7 +34,7 @@
using is_transparent = void;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/compare_three_way_result.h b/third_party/llvm-project/libcxx/include/__compare/compare_three_way_result.h
index 8885d7e..632ebdc 100644
--- a/third_party/llvm-project/libcxx/include/__compare/compare_three_way_result.h
+++ b/third_party/llvm-project/libcxx/include/__compare/compare_three_way_result.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class, class, class>
struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result { };
@@ -37,7 +37,7 @@
template<class _Tp, class _Up = _Tp>
using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/compare_weak_order_fallback.h b/third_party/llvm-project/libcxx/include/__compare/compare_weak_order_fallback.h
index f434dcb..d3ba04a 100644
--- a/third_party/llvm-project/libcxx/include/__compare/compare_weak_order_fallback.h
+++ b/third_party/llvm-project/libcxx/include/__compare/compare_weak_order_fallback.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __compare_weak_order_fallback {
@@ -64,7 +64,7 @@
inline constexpr auto compare_weak_order_fallback = __compare_weak_order_fallback::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/is_eq.h b/third_party/llvm-project/libcxx/include/__compare/is_eq.h
index 4964892..9a82df1 100644
--- a/third_party/llvm-project/libcxx/include/__compare/is_eq.h
+++ b/third_party/llvm-project/libcxx/include/__compare/is_eq.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }
@@ -27,7 +27,7 @@
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/ordering.h b/third_party/llvm-project/libcxx/include/__compare/ordering.h
index ff148ab..c348f04 100644
--- a/third_party/llvm-project/libcxx/include/__compare/ordering.h
+++ b/third_party/llvm-project/libcxx/include/__compare/ordering.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// exposition only
enum class _LIBCPP_ENUM_VIS _OrdResult : signed char {
@@ -40,7 +40,7 @@
inline constexpr bool __one_of_v = (is_same_v<_Tp, _Args> || ...);
struct _CmpUnspecifiedParam {
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEVAL
+ _LIBCPP_HIDE_FROM_ABI constexpr
_CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {}
template<class _Tp, class = enable_if_t<!__one_of_v<_Tp, int, partial_ordering, weak_ordering, strong_ordering>>>
@@ -319,7 +319,7 @@
template <class _Tp>
concept __comparison_category = __one_of_v<_Tp, partial_ordering, weak_ordering, strong_ordering>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/partial_order.h b/third_party/llvm-project/libcxx/include/__compare/partial_order.h
index aee07eb..9cb76cc 100644
--- a/third_party/llvm-project/libcxx/include/__compare/partial_order.h
+++ b/third_party/llvm-project/libcxx/include/__compare/partial_order.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __partial_order {
@@ -67,7 +67,7 @@
inline constexpr auto partial_order = __partial_order::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/strong_order.h b/third_party/llvm-project/libcxx/include/__compare/strong_order.h
index 05856c2..b6e0cfa 100644
--- a/third_party/llvm-project/libcxx/include/__compare/strong_order.h
+++ b/third_party/llvm-project/libcxx/include/__compare/strong_order.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __strong_order {
@@ -130,7 +130,7 @@
inline constexpr auto strong_order = __strong_order::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/synth_three_way.h b/third_party/llvm-project/libcxx/include/__compare/synth_three_way.h
index 7d33898..6420d13 100644
--- a/third_party/llvm-project/libcxx/include/__compare/synth_three_way.h
+++ b/third_party/llvm-project/libcxx/include/__compare/synth_three_way.h
@@ -21,30 +21,36 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [expos.only.func]
-_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
- []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
- requires requires {
- { __t < __u } -> __boolean_testable;
- { __u < __t } -> __boolean_testable;
- }
- {
- if constexpr (three_way_comparable_with<_Tp, _Up>) {
- return __t <=> __u;
- } else {
- if (__t < __u) return weak_ordering::less;
- if (__u < __t) return weak_ordering::greater;
- return weak_ordering::equivalent;
- }
- };
+// TODO MODULES restore the lamba to match the Standard.
+// See https://github.com/llvm/llvm-project/issues/57222
+//_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
+// []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI constexpr auto __synth_three_way(const _Tp& __t, const _Up& __u)
+ requires requires {
+ { __t < __u } -> __boolean_testable;
+ { __u < __t } -> __boolean_testable;
+ }
+{
+ if constexpr (three_way_comparable_with<_Tp, _Up>) {
+ return __t <=> __u;
+ } else {
+ if (__t < __u)
+ return weak_ordering::less;
+ if (__u < __t)
+ return weak_ordering::greater;
+ return weak_ordering::equivalent;
+ }
+}
template <class _Tp, class _Up = _Tp>
using __synth_three_way_result = decltype(std::__synth_three_way(std::declval<_Tp&>(), std::declval<_Up&>()));
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/three_way_comparable.h b/third_party/llvm-project/libcxx/include/__compare/three_way_comparable.h
index 6c98916..2b77bc3 100644
--- a/third_party/llvm-project/libcxx/include/__compare/three_way_comparable.h
+++ b/third_party/llvm-project/libcxx/include/__compare/three_way_comparable.h
@@ -25,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class _Cat>
concept __compares_as =
@@ -52,7 +52,7 @@
{ __u <=> __t } -> __compares_as<_Cat>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__compare/weak_order.h b/third_party/llvm-project/libcxx/include/__compare/weak_order.h
index abb24e3..9cbc1d2 100644
--- a/third_party/llvm-project/libcxx/include/__compare/weak_order.h
+++ b/third_party/llvm-project/libcxx/include/__compare/weak_order.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [cmp.alg]
namespace __weak_order {
@@ -95,7 +95,7 @@
inline constexpr auto weak_order = __weak_order::__fn{};
} // namespace __cpo
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/arithmetic.h b/third_party/llvm-project/libcxx/include/__concepts/arithmetic.h
index 215b52a..91a0b18 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/arithmetic.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/arithmetic.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.arithmetic], arithmetic concepts
@@ -45,7 +45,7 @@
template <class _Tp>
concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/assignable.h b/third_party/llvm-project/libcxx/include/__concepts/assignable.h
index 91edd40..2dabae5 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/assignable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/assignable.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.assignable]
@@ -34,7 +34,7 @@
{ __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/boolean_testable.h b/third_party/llvm-project/libcxx/include/__concepts/boolean_testable.h
index a96bde7..8efb6e5 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/boolean_testable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/boolean_testable.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.booleantestable]
@@ -31,7 +31,7 @@
{ !_VSTD::forward<_Tp>(__t) } -> __boolean_testable_impl;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/class_or_enum.h b/third_party/llvm-project/libcxx/include/__concepts/class_or_enum.h
index c4d2f98..04c24bd 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/class_or_enum.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/class_or_enum.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Whether a type is a class type or enumeration type according to the Core wording.
@@ -33,7 +33,7 @@
template<class _Tp>
concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/common_reference_with.h b/third_party/llvm-project/libcxx/include/__concepts/common_reference_with.h
index cc92762..6ad0db2 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/common_reference_with.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/common_reference_with.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.commonref]
@@ -30,7 +30,7 @@
convertible_to<_Tp, common_reference_t<_Tp, _Up>> &&
convertible_to<_Up, common_reference_t<_Tp, _Up>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/common_with.h b/third_party/llvm-project/libcxx/include/__concepts/common_with.h
index 569a0ee..e159bcc 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/common_with.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/common_with.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.common]
@@ -43,7 +43,7 @@
add_lvalue_reference_t<const _Tp>,
add_lvalue_reference_t<const _Up>>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/constructible.h b/third_party/llvm-project/libcxx/include/__concepts/constructible.h
index 1d78eb5..6e3862c 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/constructible.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/constructible.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.constructible]
template<class _Tp, class... _Args>
@@ -49,7 +49,7 @@
constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> &&
constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/convertible_to.h b/third_party/llvm-project/libcxx/include/__concepts/convertible_to.h
index 2c1d267..20ee31b 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/convertible_to.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/convertible_to.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.convertible]
@@ -30,7 +30,7 @@
static_cast<_To>(std::declval<_From>());
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/copyable.h b/third_party/llvm-project/libcxx/include/__concepts/copyable.h
index c5d8a80..0d6dd50 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/copyable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/copyable.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.object]
@@ -32,7 +32,7 @@
assignable_from<_Tp&, const _Tp&> &&
assignable_from<_Tp&, const _Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/derived_from.h b/third_party/llvm-project/libcxx/include/__concepts/derived_from.h
index 0d3462d..1cbe458 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/derived_from.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/derived_from.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.derived]
@@ -28,7 +28,7 @@
is_base_of_v<_Bp, _Dp> &&
is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/destructible.h b/third_party/llvm-project/libcxx/include/__concepts/destructible.h
index ad3819d..8da9c37 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/destructible.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/destructible.h
@@ -18,14 +18,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.destructible]
template<class _Tp>
concept destructible = is_nothrow_destructible_v<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/different_from.h b/third_party/llvm-project/libcxx/include/__concepts/different_from.h
index 15fd8f0..5ef1467 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/different_from.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/different_from.h
@@ -19,12 +19,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class _Up>
concept __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/equality_comparable.h b/third_party/llvm-project/libcxx/include/__concepts/equality_comparable.h
index b865141..f106288 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/equality_comparable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/equality_comparable.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.equalitycomparable]
@@ -47,7 +47,7 @@
__make_const_lvalue_ref<_Up>>> &&
__weakly_equality_comparable_with<_Tp, _Up>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/invocable.h b/third_party/llvm-project/libcxx/include/__concepts/invocable.h
index ec39b7b..59eab01 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/invocable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/invocable.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.invocable]
@@ -33,7 +33,7 @@
template<class _Fn, class... _Args>
concept regular_invocable = invocable<_Fn, _Args...>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/movable.h b/third_party/llvm-project/libcxx/include/__concepts/movable.h
index 749b78a..f37d49f 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/movable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/movable.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concepts.object]
@@ -32,7 +32,7 @@
assignable_from<_Tp&, _Tp> &&
swappable<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/predicate.h b/third_party/llvm-project/libcxx/include/__concepts/predicate.h
index 7ae9783..b09183c 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/predicate.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/predicate.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.predicate]
@@ -28,7 +28,7 @@
concept predicate =
regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/regular.h b/third_party/llvm-project/libcxx/include/__concepts/regular.h
index d15728d..93fb701 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/regular.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/regular.h
@@ -19,14 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.object]
template<class _Tp>
concept regular = semiregular<_Tp> && equality_comparable<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/relation.h b/third_party/llvm-project/libcxx/include/__concepts/relation.h
index 7d5141c..218afef 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/relation.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/relation.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.relation]
@@ -37,7 +37,7 @@
template<class _Rp, class _Tp, class _Up>
concept strict_weak_order = relation<_Rp, _Tp, _Up>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/same_as.h b/third_party/llvm-project/libcxx/include/__concepts/same_as.h
index 554ebc3..b86cada 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/same_as.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/same_as.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.same]
@@ -28,7 +28,7 @@
template<class _Tp, class _Up>
concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/semiregular.h b/third_party/llvm-project/libcxx/include/__concepts/semiregular.h
index d15bb3b..ae2f3c6 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/semiregular.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/semiregular.h
@@ -19,14 +19,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.object]
template<class _Tp>
concept semiregular = copyable<_Tp> && default_initializable<_Tp>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/swappable.h b/third_party/llvm-project/libcxx/include/__concepts/swappable.h
index d91a7a1..340691d 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/swappable.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/swappable.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.swappable]
@@ -114,7 +114,7 @@
ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t));
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__concepts/totally_ordered.h b/third_party/llvm-project/libcxx/include/__concepts/totally_ordered.h
index f12d26b..350eff3 100644
--- a/third_party/llvm-project/libcxx/include/__concepts/totally_ordered.h
+++ b/third_party/llvm-project/libcxx/include/__concepts/totally_ordered.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [concept.totallyordered]
@@ -51,7 +51,7 @@
__make_const_lvalue_ref<_Up>>> &&
__partially_ordered_with<_Tp, _Up>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__condition_variable/condition_variable.h b/third_party/llvm-project/libcxx/include/__condition_variable/condition_variable.h
new file mode 100644
index 0000000..10b0662
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__condition_variable/condition_variable.h
@@ -0,0 +1,243 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H
+#define _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H
+
+#include <__chrono/steady_clock.h>
+#include <__chrono/system_clock.h>
+#include <__chrono/time_point.h>
+#include <__config>
+#include <__mutex/mutex.h>
+#include <__mutex/unique_lock.h>
+#include <__system_error/system_error.h>
+#include <__threading_support>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_floating_point.h>
+#include <__utility/move.h>
+#include <ratio>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+// enum class cv_status
+_LIBCPP_DECLARE_STRONG_ENUM(cv_status){no_timeout, timeout};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
+
+class _LIBCPP_TYPE_VIS condition_variable {
+ __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR condition_variable() _NOEXCEPT = default;
+
+# ifdef _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
+ ~condition_variable() = default;
+# else
+ ~condition_variable();
+# endif
+
+ condition_variable(const condition_variable&) = delete;
+ condition_variable& operator=(const condition_variable&) = delete;
+
+ void notify_one() _NOEXCEPT;
+ void notify_all() _NOEXCEPT;
+
+ void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
+ template <class _Predicate>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(unique_lock<mutex>& __lk, _Predicate __pred);
+
+ template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status
+ wait_until(unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t);
+
+ template <class _Clock, class _Duration, class _Predicate>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool
+ wait_until(unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred);
+
+ template <class _Rep, class _Period>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status
+ wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d);
+
+ template <class _Rep, class _Period, class _Predicate>
+ bool _LIBCPP_HIDE_FROM_ABI
+ wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred);
+
+ typedef __libcpp_condvar_t* native_handle_type;
+ _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__cv_; }
+
+private:
+ void
+ __do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
+# if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+ void
+ __do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<chrono::steady_clock, chrono::nanoseconds>) _NOEXCEPT;
+# endif
+ template <class _Clock>
+ void __do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT;
+};
+#endif // !_LIBCPP_HAS_NO_THREADS
+
+template <class _Rep, class _Period>
+inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<is_floating_point<_Rep>::value, chrono::nanoseconds>
+__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d) {
+ using namespace chrono;
+ using __ratio = ratio_divide<_Period, nano>;
+ using __ns_rep = nanoseconds::rep;
+ _Rep __result_float = __d.count() * __ratio::num / __ratio::den;
+
+ _Rep __result_max = numeric_limits<__ns_rep>::max();
+ if (__result_float >= __result_max) {
+ return nanoseconds::max();
+ }
+
+ _Rep __result_min = numeric_limits<__ns_rep>::min();
+ if (__result_float <= __result_min) {
+ return nanoseconds::min();
+ }
+
+ return nanoseconds(static_cast<__ns_rep>(__result_float));
+}
+
+template <class _Rep, class _Period>
+inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!is_floating_point<_Rep>::value, chrono::nanoseconds>
+__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d) {
+ using namespace chrono;
+ if (__d.count() == 0) {
+ return nanoseconds(0);
+ }
+
+ using __ratio = ratio_divide<_Period, nano>;
+ using __ns_rep = nanoseconds::rep;
+ __ns_rep __result_max = numeric_limits<__ns_rep>::max();
+ if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
+ return nanoseconds::max();
+ }
+
+ __ns_rep __result_min = numeric_limits<__ns_rep>::min();
+ if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
+ return nanoseconds::min();
+ }
+
+ __ns_rep __result = __d.count() * __ratio::num / __ratio::den;
+ if (__result == 0) {
+ return nanoseconds(1);
+ }
+
+ return nanoseconds(__result);
+}
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+template <class _Predicate>
+void condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred) {
+ while (!__pred())
+ wait(__lk);
+}
+
+template <class _Clock, class _Duration>
+cv_status condition_variable::wait_until(unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t) {
+ using namespace chrono;
+ using __clock_tp_ns = time_point<_Clock, nanoseconds>;
+
+ typename _Clock::time_point __now = _Clock::now();
+ if (__t <= __now)
+ return cv_status::timeout;
+
+ __clock_tp_ns __t_ns = __clock_tp_ns(std::__safe_nanosecond_cast(__t.time_since_epoch()));
+
+ __do_timed_wait(__lk, __t_ns);
+ return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
+}
+
+template <class _Clock, class _Duration, class _Predicate>
+bool condition_variable::wait_until(
+ unique_lock<mutex>& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred) {
+ while (!__pred()) {
+ if (wait_until(__lk, __t) == cv_status::timeout)
+ return __pred();
+ }
+ return true;
+}
+
+template <class _Rep, class _Period>
+cv_status condition_variable::wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d) {
+ using namespace chrono;
+ if (__d <= __d.zero())
+ return cv_status::timeout;
+ using __ns_rep = nanoseconds::rep;
+ steady_clock::time_point __c_now = steady_clock::now();
+
+# if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+ using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
+ __ns_rep __now_count_ns = std::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
+# else
+ using __clock_tp_ns = time_point<system_clock, nanoseconds>;
+ __ns_rep __now_count_ns = std::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
+# endif
+
+ __ns_rep __d_ns_count = std::__safe_nanosecond_cast(__d).count();
+
+ if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
+ __do_timed_wait(__lk, __clock_tp_ns::max());
+ } else {
+ __do_timed_wait(__lk, __clock_tp_ns(nanoseconds(__now_count_ns + __d_ns_count)));
+ }
+
+ return steady_clock::now() - __c_now < __d ? cv_status::no_timeout : cv_status::timeout;
+}
+
+template <class _Rep, class _Period, class _Predicate>
+inline bool
+condition_variable::wait_for(unique_lock<mutex>& __lk, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred) {
+ return wait_until(__lk, chrono::steady_clock::now() + __d, std::move(__pred));
+}
+
+# if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+inline void condition_variable::__do_timed_wait(
+ unique_lock<mutex>& __lk, chrono::time_point<chrono::steady_clock, chrono::nanoseconds> __tp) _NOEXCEPT {
+ using namespace chrono;
+ if (!__lk.owns_lock())
+ __throw_system_error(EPERM, "condition_variable::timed wait: mutex not locked");
+ nanoseconds __d = __tp.time_since_epoch();
+ timespec __ts;
+ seconds __s = duration_cast<seconds>(__d);
+ using __ts_sec = decltype(__ts.tv_sec);
+ const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max();
+ if (__s.count() < __ts_sec_max) {
+ __ts.tv_sec = static_cast<__ts_sec>(__s.count());
+ __ts.tv_nsec = (__d - __s).count();
+ } else {
+ __ts.tv_sec = __ts_sec_max;
+ __ts.tv_nsec = giga::num - 1;
+ }
+ int __ec = pthread_cond_clockwait(&__cv_, __lk.mutex()->native_handle(), CLOCK_MONOTONIC, &__ts);
+ if (__ec != 0 && __ec != ETIMEDOUT)
+ __throw_system_error(__ec, "condition_variable timed_wait failed");
+}
+# endif // _LIBCPP_HAS_COND_CLOCKWAIT
+
+template <class _Clock>
+inline void condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
+ chrono::time_point<_Clock, chrono::nanoseconds> __tp) _NOEXCEPT {
+ wait_for(__lk, __tp - _Clock::now());
+}
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H
diff --git a/third_party/llvm-project/libcxx/include/__config b/third_party/llvm-project/libcxx/include/__config
index 40c9deb..6716058 100644
--- a/third_party/llvm-project/libcxx/include/__config
+++ b/third_party/llvm-project/libcxx/include/__config
@@ -23,6 +23,7 @@
#endif
#if defined(__apple_build_version__)
+// Given AppleClang XX.Y.Z, _LIBCPP_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403)
# define _LIBCPP_COMPILER_CLANG_BASED
# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)
#elif defined(__clang__)
@@ -50,6 +51,7 @@
# define _LIBCPP_FREESTANDING
# endif
+// NOLINTBEGIN(libcpp-cpp-version-check)
# ifndef _LIBCPP_STD_VER
# if __cplusplus <= 201103L
# define _LIBCPP_STD_VER 11
@@ -64,6 +66,7 @@
# define _LIBCPP_STD_VER 23
# endif
# endif // _LIBCPP_STD_VER
+// NOLINTEND(libcpp-cpp-version-check)
# if defined(__ELF__)
# define _LIBCPP_OBJECT_FORMAT_ELF 1
@@ -134,6 +137,15 @@
# define _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
// According to the Standard, `bitset::operator[] const` returns bool
# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
+// Fix the implementation of CityHash used for std::hash<fundamental-type>.
+// This is an ABI break because `std::hash` will return a different result,
+// which means that hashing the same object in translation units built against
+// different versions of libc++ can return inconsistent results. This is especially
+// tricky since std::hash is used in the implementation of unordered containers.
+//
+// The incorrect implementation of CityHash has the problem that it drops some
+// bits on the floor.
+# define _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION
// Remove the base 10 implementation of std::to_chars from the dylib.
// The implementation moved to the header, but we still export the symbols from
// the dylib for backwards compatibility.
@@ -155,6 +167,12 @@
# if defined(__FreeBSD__)
# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
# endif
+// For XCOFF linkers, we have problems if we see a weak hidden version of a symbol
+// in user code (like you get with -fvisibility-inlines-hidden) and then a strong def
+// in the library, so we need to always rely on the library version.
+# if defined(_AIX)
+# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+# endif
# endif
# if defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_ABI_VERSION >= 2
@@ -172,6 +190,7 @@
# define _LIBCPP_TOSTRING2(x) #x
# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
+// NOLINTNEXTLINE(libcpp-cpp-version-check)
# if __cplusplus < 201103L
# define _LIBCPP_CXX03_LANG
# endif
@@ -439,7 +458,7 @@
# endif
# if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L
-# define _LIBCPP_NO_EXCEPTIONS
+# define _LIBCPP_HAS_NO_EXCEPTIONS
# endif
# define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
@@ -656,7 +675,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
-# if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \
_LIBCPP_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
# else
@@ -677,12 +696,6 @@
# define _LIBCPP_HAS_NO_INT128
# endif
-# ifndef __cpp_consteval
-# define _LIBCPP_CONSTEVAL _LIBCPP_CONSTEXPR
-# else
-# define _LIBCPP_CONSTEVAL consteval
-# endif
-
# if __has_attribute(__malloc__)
# define _LIBCPP_NOALIAS __attribute__((__malloc__))
# else
@@ -767,10 +780,10 @@
// Deprecations warnings are always enabled, except when users explicitly opt-out
// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
# if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# if __has_attribute(deprecated)
-# define _LIBCPP_DEPRECATED __attribute__((deprecated))
-# define _LIBCPP_DEPRECATED_(m) __attribute__((deprecated(m)))
-# elif _LIBCPP_STD_VER > 11
+# if __has_attribute(__deprecated__)
+# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
+# define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
+# elif _LIBCPP_STD_VER >= 14
# define _LIBCPP_DEPRECATED [[deprecated]]
# define _LIBCPP_DEPRECATED_(m) [[deprecated(m)]]
# else
@@ -788,19 +801,19 @@
# define _LIBCPP_DEPRECATED_IN_CXX11
# endif
-# if _LIBCPP_STD_VER > 11
+# if _LIBCPP_STD_VER >= 14
# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
# else
# define _LIBCPP_DEPRECATED_IN_CXX14
# endif
-# if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
# else
# define _LIBCPP_DEPRECATED_IN_CXX17
# endif
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
# else
# define _LIBCPP_DEPRECATED_IN_CXX20
@@ -830,37 +843,43 @@
# endif
# if _LIBCPP_STD_VER <= 11
-# define _LIBCPP_EXPLICIT_AFTER_CXX11
+# define _LIBCPP_EXPLICIT_SINCE_CXX14
# else
-# define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
+# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
# endif
-# if _LIBCPP_STD_VER > 11
+# if _LIBCPP_STD_VER >= 23
+# define _LIBCPP_EXPLICIT_SINCE_CXX23 explicit
+# else
+# define _LIBCPP_EXPLICIT_SINCE_CXX23
+# endif
+
+# if _LIBCPP_STD_VER >= 14
# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX14
# endif
-# if _LIBCPP_STD_VER > 14
+# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX17
# endif
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX20
# endif
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX23
# endif
# if __has_cpp_attribute(nodiscard)
-# define _LIBCPP_NODISCARD [[nodiscard]]
+# define _LIBCPP_NODISCARD [[__nodiscard__]]
# else
// We can't use GCC's [[gnu::warn_unused_result]] and
// __attribute__((warn_unused_result)), because GCC does not silence them via
@@ -876,7 +895,7 @@
# define _LIBCPP_NODISCARD_EXT
# endif
-# if _LIBCPP_STD_VER > 17 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
+# if _LIBCPP_STD_VER >= 20 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
# else
# define _LIBCPP_NODISCARD_AFTER_CXX17
@@ -895,7 +914,7 @@
// Try to find out if RTTI is disabled.
# if !defined(__cpp_rtti) || __cpp_rtti < 199711L
-# define _LIBCPP_NO_RTTI
+# define _LIBCPP_HAS_NO_RTTI
# endif
# ifndef _LIBCPP_WEAK
@@ -1042,7 +1061,7 @@
# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
# endif
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_CONSTINIT constinit
# elif __has_attribute(__require_constant_initialization__)
# define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
@@ -1179,7 +1198,7 @@
// [[msvc::no_unique_address]], this should be preferred though.
# define _LIBCPP_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
# elif __has_cpp_attribute(no_unique_address)
-# define _LIBCPP_NO_UNIQUE_ADDRESS [[no_unique_address]]
+# define _LIBCPP_NO_UNIQUE_ADDRESS [[__no_unique_address__]]
# else
# define _LIBCPP_NO_UNIQUE_ADDRESS /* nothing */
// Note that this can be replaced by #error as soon as clang-cl
@@ -1227,12 +1246,12 @@
// functions are declared by the C library.
# define _LIBCPP_HAS_NO_C8RTOMB_MBRTOC8
// GNU libc 2.36 and newer declare c8rtomb() and mbrtoc8() in C++ modes if
-// __cpp_char8_t is defined or if C2X extensions are enabled. Unfortunately,
-// determining the latter depends on internal GNU libc details. If the
-// __cpp_char8_t feature test macro is not defined, then a char8_t typedef
-// will be declared as well.
-# if defined(_LIBCPP_GLIBC_PREREQ) && defined(__GLIBC_USE)
-# if _LIBCPP_GLIBC_PREREQ(2, 36) && (defined(__cpp_char8_t) || __GLIBC_USE(ISOC2X))
+// __cpp_char8_t is defined or if C2X extensions are enabled. Determining
+// the latter depends on internal GNU libc details that are not appropriate
+// to depend on here, so any declarations present when __cpp_char8_t is not
+// defined are ignored.
+# if defined(_LIBCPP_GLIBC_PREREQ)
+# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
# undef _LIBCPP_HAS_NO_C8RTOMB_MBRTOC8
# endif
# endif
@@ -1242,13 +1261,25 @@
// macro is used to mark them as such, which suppresses the
// '-Wctad-maybe-unsupported' compiler warning when CTAD is used in user code
// with these classes.
-#if _LIBCPP_STD_VER >= 17
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
- template <class ..._Tag> \
- _ClassName(typename _Tag::__allow_ctad...) -> _ClassName<_Tag...>
-#else
-# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
-#endif
+# if _LIBCPP_STD_VER >= 17
+# ifdef _LIBCPP_COMPILER_CLANG_BASED
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
+ template <class... _Tag> \
+ [[maybe_unused]] _ClassName(typename _Tag::__allow_ctad...)->_ClassName<_Tag...>
+# else
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(ClassName) \
+ template <class... _Tag> \
+ ClassName(typename _Tag::__allow_ctad...)->ClassName<_Tag...>
+# endif
+# else
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
+# endif
+
+// TODO(varconst): currently, there are bugs in Clang's intrinsics when handling Objective-C++ `id`, so don't use
+// compiler intrinsics in the Objective-C++ mode.
+# ifdef __OBJC__
+# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
+# endif
#endif // __cplusplus
diff --git a/third_party/llvm-project/libcxx/include/__coroutine/coroutine_handle.h b/third_party/llvm-project/libcxx/include/__coroutine/coroutine_handle.h
index 0a6cc1c..8390b49 100644
--- a/third_party/llvm-project/libcxx/include/__coroutine/coroutine_handle.h
+++ b/third_party/llvm-project/libcxx/include/__coroutine/coroutine_handle.h
@@ -21,7 +21,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -198,6 +198,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // _LIBCPP___COROUTINE_COROUTINE_HANDLE_H
diff --git a/third_party/llvm-project/libcxx/include/__coroutine/coroutine_traits.h b/third_party/llvm-project/libcxx/include/__coroutine/coroutine_traits.h
index d513075..7122cc8 100644
--- a/third_party/llvm-project/libcxx/include/__coroutine/coroutine_traits.h
+++ b/third_party/llvm-project/libcxx/include/__coroutine/coroutine_traits.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -48,6 +48,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // _LIBCPP___COROUTINE_COROUTINE_TRAITS_H
diff --git a/third_party/llvm-project/libcxx/include/__coroutine/noop_coroutine_handle.h b/third_party/llvm-project/libcxx/include/__coroutine/noop_coroutine_handle.h
index 2993047..9b7802d 100644
--- a/third_party/llvm-project/libcxx/include/__coroutine/noop_coroutine_handle.h
+++ b/third_party/llvm-project/libcxx/include/__coroutine/noop_coroutine_handle.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -107,6 +107,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H
diff --git a/third_party/llvm-project/libcxx/include/__coroutine/trivial_awaitables.h b/third_party/llvm-project/libcxx/include/__coroutine/trivial_awaitables.h
index bbbae7a..0e4b08e 100644
--- a/third_party/llvm-project/libcxx/include/__coroutine/trivial_awaitables.h
+++ b/third_party/llvm-project/libcxx/include/__coroutine/trivial_awaitables.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -41,6 +41,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // __LIBCPP_STD_VER > 17
+#endif // __LIBCPP_STD_VER >= 20
#endif // __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
diff --git a/third_party/llvm-project/libcxx/include/__debug b/third_party/llvm-project/libcxx/include/__debug
index 140cc91..ccbfae7 100644
--- a/third_party/llvm-project/libcxx/include/__debug
+++ b/third_party/llvm-project/libcxx/include/__debug
@@ -98,8 +98,8 @@
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__dereferenceable(__j);
+ _Cont* __cp = static_cast<_Cont*>(__c_);
+ return __cp->__dereferenceable(__j);
}
template <class _Cont>
@@ -108,8 +108,8 @@
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__decrementable(__j);
+ _Cont* __cp = static_cast<_Cont*>(__c_);
+ return __cp->__decrementable(__j);
}
template <class _Cont>
@@ -118,8 +118,8 @@
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__addable(__j, __n);
+ _Cont* __cp = static_cast<_Cont*>(__c_);
+ return __cp->__addable(__j, __n);
}
template <class _Cont>
@@ -128,8 +128,8 @@
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
- _Cont* _Cp = static_cast<_Cont*>(__c_);
- return _Cp->__subscriptable(__j, __n);
+ _Cont* __cp = static_cast<_Cont*>(__c_);
+ return __cp->__subscriptable(__j, __n);
}
class _LIBCPP_TYPE_VIS __libcpp_db
diff --git a/third_party/llvm-project/libcxx/include/__exception/exception.h b/third_party/llvm-project/libcxx/include/__exception/exception.h
new file mode 100644
index 0000000..49a58dd
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__exception/exception.h
@@ -0,0 +1,91 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___EXCEPTION_EXCEPTION_H
+#define _LIBCPP___EXCEPTION_EXCEPTION_H
+
+#include <__config>
+
+// <vcruntime_exception.h> defines its own std::exception and std::bad_exception types,
+// which we use in order to be ABI-compatible with other STLs on Windows.
+#if defined(_LIBCPP_ABI_VCRUNTIME)
+# include <vcruntime_exception.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+
+#if defined(_LIBCPP_ABI_VCRUNTIME) && (!defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS != 0)
+// The std::exception class was already included above, but we're explicit about this condition here for clarity.
+
+#elif defined(_LIBCPP_ABI_VCRUNTIME) && _HAS_EXCEPTIONS == 0
+// However, <vcruntime_exception.h> does not define std::exception and std::bad_exception
+// when _HAS_EXCEPTIONS == 0.
+//
+// Since libc++ still wants to provide the std::exception hierarchy even when _HAS_EXCEPTIONS == 0
+// (after all those are simply types like any other), we define an ABI-compatible version
+// of the VCRuntime std::exception and std::bad_exception types in that mode.
+
+struct __std_exception_data {
+ char const* _What;
+ bool _DoFree;
+};
+
+class exception { // base of all library exceptions
+public:
+ exception() _NOEXCEPT : __data_() {}
+
+ explicit exception(char const* __message) _NOEXCEPT : __data_() {
+ __data_._What = __message;
+ __data_._DoFree = true;
+ }
+
+ exception(exception const&) _NOEXCEPT {}
+
+ exception& operator=(exception const&) _NOEXCEPT { return *this; }
+
+ virtual ~exception() _NOEXCEPT {}
+
+ virtual char const* what() const _NOEXCEPT { return __data_._What ? __data_._What : "Unknown exception"; }
+
+private:
+ __std_exception_data __data_;
+};
+
+class bad_exception : public exception {
+public:
+ bad_exception() _NOEXCEPT : exception("bad exception") {}
+};
+
+#else // !defined(_LIBCPP_ABI_VCRUNTIME)
+// On all other platforms, we define our own std::exception and std::bad_exception types
+// regardless of whether exceptions are turned on as a language feature.
+
+class _LIBCPP_EXCEPTION_ABI exception {
+public:
+ _LIBCPP_HIDE_FROM_ABI exception() _NOEXCEPT {}
+ _LIBCPP_HIDE_FROM_ABI exception(const exception&) _NOEXCEPT = default;
+
+ virtual ~exception() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
+};
+
+class _LIBCPP_EXCEPTION_ABI bad_exception : public exception {
+public:
+ _LIBCPP_HIDE_FROM_ABI bad_exception() _NOEXCEPT {}
+ ~bad_exception() _NOEXCEPT override;
+ const char* what() const _NOEXCEPT override;
+};
+#endif // !_LIBCPP_ABI_VCRUNTIME
+
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_EXCEPTION_H
diff --git a/third_party/llvm-project/libcxx/include/__exception/exception_ptr.h b/third_party/llvm-project/libcxx/include/__exception/exception_ptr.h
new file mode 100644
index 0000000..cac4a88
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__exception/exception_ptr.h
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
+#define _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
+
+#include <__config>
+#include <__exception/operations.h>
+#include <__memory/addressof.h>
+#include <cstddef>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+
+#ifndef _LIBCPP_ABI_MICROSOFT
+
+class _LIBCPP_TYPE_VIS exception_ptr {
+ void* __ptr_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI exception_ptr() _NOEXCEPT : __ptr_() {}
+ _LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
+
+ exception_ptr(const exception_ptr&) _NOEXCEPT;
+ exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
+ ~exception_ptr() _NOEXCEPT;
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __ptr_ != nullptr; }
+
+ friend _LIBCPP_HIDE_FROM_ABI bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+ return __x.__ptr_ == __y.__ptr_;
+ }
+
+ friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+ return !(__x == __y);
+ }
+
+ friend _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+ friend _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+};
+
+template <class _Ep>
+_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ try {
+ throw __e;
+ } catch (...) {
+ return current_exception();
+ }
+# else
+ ((void)__e);
+ std::abort();
+# endif
+}
+
+#else // _LIBCPP_ABI_MICROSOFT
+
+class _LIBCPP_TYPE_VIS exception_ptr {
+ _LIBCPP_DIAGNOSTIC_PUSH
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
+ void* __ptr1_;
+ void* __ptr2_;
+ _LIBCPP_DIAGNOSTIC_POP
+
+public:
+ exception_ptr() _NOEXCEPT;
+ exception_ptr(nullptr_t) _NOEXCEPT;
+ exception_ptr(const exception_ptr& __other) _NOEXCEPT;
+ exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
+ exception_ptr& operator=(nullptr_t) _NOEXCEPT;
+ ~exception_ptr() _NOEXCEPT;
+ explicit operator bool() const _NOEXCEPT;
+};
+
+_LIBCPP_FUNC_VIS bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+_LIBCPP_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void* __except, const void* __ptr);
+_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+
+// This is a built-in template function which automagically extracts the required
+// information.
+template <class _E>
+void* __GetExceptionInfo(_E);
+
+template <class _Ep>
+_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
+ return __copy_exception_ptr(std::addressof(__e), __GetExceptionInfo(__e));
+}
+
+#endif // _LIBCPP_ABI_MICROSOFT
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
diff --git a/third_party/llvm-project/libcxx/include/__exception/nested_exception.h b/third_party/llvm-project/libcxx/include/__exception/nested_exception.h
new file mode 100644
index 0000000..182c7dd
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__exception/nested_exception.h
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H
+#define _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H
+
+#include <__config>
+#include <__exception/exception_ptr.h>
+#include <__memory/addressof.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_base_of.h>
+#include <__type_traits/is_class.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_final.h>
+#include <__type_traits/is_polymorphic.h>
+#include <__utility/forward.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+
+class _LIBCPP_EXCEPTION_ABI nested_exception {
+ exception_ptr __ptr_;
+
+public:
+ nested_exception() _NOEXCEPT;
+ // nested_exception(const nested_exception&) noexcept = default;
+ // nested_exception& operator=(const nested_exception&) noexcept = default;
+ virtual ~nested_exception() _NOEXCEPT;
+
+ // access functions
+ _LIBCPP_NORETURN void rethrow_nested() const;
+ _LIBCPP_HIDE_FROM_ABI exception_ptr nested_ptr() const _NOEXCEPT { return __ptr_; }
+};
+
+template <class _Tp>
+struct __nested : public _Tp, public nested_exception {
+ _LIBCPP_HIDE_FROM_ABI explicit __nested(const _Tp& __t) : _Tp(__t) {}
+};
+
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+template <class _Tp, class _Up, bool>
+struct __throw_with_nested;
+
+template <class _Tp, class _Up>
+struct __throw_with_nested<_Tp, _Up, true> {
+ _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void __do_throw(_Tp&& __t) {
+ throw __nested<_Up>(std::forward<_Tp>(__t));
+ }
+};
+
+template <class _Tp, class _Up>
+struct __throw_with_nested<_Tp, _Up, false> {
+ _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void __do_throw(_Tp&& __t) { throw std::forward<_Tp>(__t); }
+};
+#endif
+
+template <class _Tp>
+_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI void throw_with_nested(_Tp&& __t) {
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ using _Up = __decay_t<_Tp>;
+ static_assert(is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
+ __throw_with_nested<_Tp,
+ _Up,
+ is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value &&
+ !__libcpp_is_final<_Up>::value>::__do_throw(std::forward<_Tp>(__t));
+#else
+ ((void)__t);
+ // FIXME: Make this abort
+#endif
+}
+
+template <class _From, class _To>
+struct __can_dynamic_cast
+ : _BoolConstant< is_polymorphic<_From>::value &&
+ (!is_base_of<_To, _From>::value || is_convertible<const _From*, const _To*>::value)> {};
+
+template <class _Ep>
+inline _LIBCPP_HIDE_FROM_ABI void
+rethrow_if_nested(const _Ep& __e, __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value>* = 0) {
+ const nested_exception* __nep = dynamic_cast<const nested_exception*>(std::addressof(__e));
+ if (__nep)
+ __nep->rethrow_nested();
+}
+
+template <class _Ep>
+inline _LIBCPP_HIDE_FROM_ABI void
+rethrow_if_nested(const _Ep&, __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value>* = 0) {}
+
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H
diff --git a/third_party/llvm-project/libcxx/include/__exception/operations.h b/third_party/llvm-project/libcxx/include/__exception/operations.h
new file mode 100644
index 0000000..e8c5ba6
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__exception/operations.h
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___EXCEPTION_OPERATIONS_H
+#define _LIBCPP___EXCEPTION_OPERATIONS_H
+
+#include <__availability>
+#include <__config>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
+ defined(_LIBCPP_BUILDING_LIBRARY)
+using unexpected_handler = void (*)();
+_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
+_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
+#endif
+
+using terminate_handler = void (*)();
+_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
+_LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
+
+class _LIBCPP_TYPE_VIS exception_ptr;
+
+_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_OPERATIONS_H
diff --git a/third_party/llvm-project/libcxx/include/__exception/terminate.h b/third_party/llvm-project/libcxx/include/__exception/terminate.h
new file mode 100644
index 0000000..d8dd964
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__exception/terminate.h
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___EXCEPTION_TERMINATE_H
+#define _LIBCPP___EXCEPTION_TERMINATE_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+namespace std { // purposefully not using versioning namespace
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
+} // namespace std
+
+#endif // _LIBCPP___EXCEPTION_TERMINATE_H
diff --git a/third_party/llvm-project/libcxx/include/__expected/bad_expected_access.h b/third_party/llvm-project/libcxx/include/__expected/bad_expected_access.h
index 361eab4..e7a568c 100644
--- a/third_party/llvm-project/libcxx/include/__expected/bad_expected_access.h
+++ b/third_party/llvm-project/libcxx/include/__expected/bad_expected_access.h
@@ -10,10 +10,9 @@
#define _LIBCPP___EXPECTED_BAD_EXPECTED_ACCESS_H
#include <__config>
+#include <__exception/exception.h>
#include <__utility/move.h>
-#include <exception>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/third_party/llvm-project/libcxx/include/__expected/expected.h b/third_party/llvm-project/libcxx/include/__expected/expected.h
index e1f590c..3ff8fbc 100644
--- a/third_party/llvm-project/libcxx/include/__expected/expected.h
+++ b/third_party/llvm-project/libcxx/include/__expected/expected.h
@@ -49,7 +49,7 @@
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/swap.h>
-#include <cstdlib> // for std::abort
+#include <__verbose_abort>
#include <initializer_list>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -64,11 +64,11 @@
template <class _Err, class _Arg>
_LIBCPP_HIDE_FROM_ABI void __throw_bad_expected_access(_Arg&& __arg) {
-# ifndef _LIBCPP_NO_EXCEPTIONS
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_expected_access<_Err>(std::forward<_Arg>(__arg));
# else
(void)__arg;
- std::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_expected_access was thrown in -fno-exceptions mode");
# endif
}
@@ -292,7 +292,8 @@
"be reverted to the previous state in case an exception is thrown during the assignment.");
_T2 __tmp(std::move(__oldval));
std::destroy_at(std::addressof(__oldval));
- __exception_guard __trans([&] { std::construct_at(std::addressof(__oldval), std::move(__tmp)); });
+ auto __trans =
+ std::__make_exception_guard([&] { std::construct_at(std::addressof(__oldval), std::move(__tmp)); });
std::construct_at(std::addressof(__newval), std::forward<_Args>(__args)...);
__trans.__complete();
}
@@ -451,7 +452,7 @@
if constexpr (is_nothrow_move_constructible_v<_Err>) {
_Err __tmp(std::move(__with_err.__union_.__unex_));
std::destroy_at(std::addressof(__with_err.__union_.__unex_));
- __exception_guard __trans([&] {
+ auto __trans = std::__make_exception_guard([&] {
std::construct_at(std::addressof(__with_err.__union_.__unex_), std::move(__tmp));
});
std::construct_at(std::addressof(__with_err.__union_.__val_), std::move(__with_val.__union_.__val_));
@@ -464,7 +465,7 @@
"that it can be reverted to the previous state in case an exception is thrown during swap.");
_Tp __tmp(std::move(__with_val.__union_.__val_));
std::destroy_at(std::addressof(__with_val.__union_.__val_));
- __exception_guard __trans([&] {
+ auto __trans = std::__make_exception_guard([&] {
std::construct_at(std::addressof(__with_val.__union_.__val_), std::move(__tmp));
});
std::construct_at(std::addressof(__with_val.__union_.__unex_), std::move(__with_err.__union_.__unex_));
diff --git a/third_party/llvm-project/libcxx/include/__expected/unexpected.h b/third_party/llvm-project/libcxx/include/__expected/unexpected.h
index 075963a..75a057b 100644
--- a/third_party/llvm-project/libcxx/include/__expected/unexpected.h
+++ b/third_party/llvm-project/libcxx/include/__expected/unexpected.h
@@ -64,8 +64,8 @@
_LIBCPP_HIDE_FROM_ABI constexpr unexpected(unexpected&&) = default;
template <class _Error = _Err>
- requires(!is_same_v<remove_cvref_t<_Error>, unexpected> && //
- !is_same_v<remove_cvref_t<_Error>, in_place_t> && //
+ requires(!is_same_v<remove_cvref_t<_Error>, unexpected> && //
+ !is_same_v<remove_cvref_t<_Error>, in_place_t> && //
is_constructible_v<_Err, _Error>)
_LIBCPP_HIDE_FROM_ABI constexpr explicit unexpected(_Error&& __error) //
noexcept(is_nothrow_constructible_v<_Err, _Error>) // strengthened
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/directory_entry.h b/third_party/llvm-project/libcxx/include/__filesystem/directory_entry.h
index b17eaaa..111dcbd 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/directory_entry.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/directory_entry.h
@@ -12,8 +12,8 @@
#include <__availability>
#include <__chrono/time_point.h>
+#include <__compare/ordering.h>
#include <__config>
-#include <__errc>
#include <__filesystem/file_status.h>
#include <__filesystem/file_time_type.h>
#include <__filesystem/file_type.h>
@@ -21,11 +21,12 @@
#include <__filesystem/operations.h>
#include <__filesystem/path.h>
#include <__filesystem/perms.h>
+#include <__system_error/errc.h>
+#include <__system_error/error_code.h>
+#include <__utility/move.h>
#include <__utility/unreachable.h>
#include <cstdint>
-#include <cstdlib>
#include <iosfwd>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/directory_iterator.h b/third_party/llvm-project/libcxx/include/__filesystem/directory_iterator.h
index 5ff2f01..d74c8be 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/directory_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/directory_iterator.h
@@ -20,8 +20,9 @@
#include <__memory/shared_ptr.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
+#include <__system_error/error_code.h>
+#include <__utility/move.h>
#include <cstddef>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -148,7 +149,7 @@
_LIBCPP_END_NAMESPACE_FILESYSTEM
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
_LIBCPP_AVAILABILITY_FILESYSTEM
@@ -158,7 +159,7 @@
_LIBCPP_AVAILABILITY_FILESYSTEM
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::directory_iterator> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP_CXX03_LANG
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/filesystem_error.h b/third_party/llvm-project/libcxx/include/__filesystem/filesystem_error.h
index effe699..7860fc4 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/filesystem_error.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/filesystem_error.h
@@ -14,11 +14,13 @@
#include <__config>
#include <__filesystem/path.h>
#include <__memory/shared_ptr.h>
+#include <__system_error/error_code.h>
+#include <__system_error/system_error.h>
#include <__utility/forward.h>
+#include <__verbose_abort>
#include <iosfwd>
#include <new>
-#include <system_error>
-#include <type_traits>
+#include <string>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -86,13 +88,13 @@
template <class... _Args>
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
void __throw_filesystem_error(_Args&&... __args) {
throw filesystem_error(_VSTD::forward<_Args>(__args)...);
}
#else
void __throw_filesystem_error(_Args&&...) {
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("filesystem_error was thrown in -fno-exceptions mode");
}
#endif
_LIBCPP_AVAILABILITY_FILESYSTEM_POP
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/operations.h b/third_party/llvm-project/libcxx/include/__filesystem/operations.h
index f48d301..6bf58d8 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/operations.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/operations.h
@@ -21,8 +21,8 @@
#include <__filesystem/perm_options.h>
#include <__filesystem/perms.h>
#include <__filesystem/space_info.h>
+#include <__system_error/error_code.h>
#include <cstdint>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/path.h b/third_party/llvm-project/libcxx/include/__filesystem/path.h
index 4e6912f..0ab66d2 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/path.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/path.h
@@ -14,12 +14,17 @@
#include <__algorithm/replace_copy.h>
#include <__availability>
#include <__config>
+#include <__functional/unary_function.h>
+#include <__fwd/hash.h>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/iterator_traits.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/remove_const.h>
+#include <__type_traits/remove_pointer.h>
#include <cstddef>
#include <string>
#include <string_view>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# include <iomanip> // for quoted
@@ -139,7 +144,7 @@
}
};
-template <class _Source, class _DS = typename decay<_Source>::type,
+template <class _Source, class _DS = __decay_t<_Source>,
class _UnqualPtrType =
__remove_const_t<__remove_pointer_t<_DS> >,
bool _IsCharPtr = is_pointer<_DS>::value&&
@@ -1086,6 +1091,17 @@
_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <>
+struct _LIBCPP_AVAILABILITY_FILESYSTEM hash<_VSTD_FS::path> : __unary_function<_VSTD_FS::path, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t operator()(_VSTD_FS::path const& __p) const noexcept {
+ return _VSTD_FS::hash_value(__p);
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
#endif // _LIBCPP_CXX03_LANG
#endif // _LIBCPP___FILESYSTEM_PATH_H
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/recursive_directory_iterator.h b/third_party/llvm-project/libcxx/include/__filesystem/recursive_directory_iterator.h
index b20d201..ac40dc8 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/recursive_directory_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/recursive_directory_iterator.h
@@ -19,8 +19,9 @@
#include <__memory/shared_ptr.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
+#include <__system_error/error_code.h>
+#include <__utility/move.h>
#include <cstddef>
-#include <system_error>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -168,7 +169,7 @@
_LIBCPP_END_NAMESPACE_FILESYSTEM
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
_LIBCPP_AVAILABILITY_FILESYSTEM
@@ -178,7 +179,7 @@
_LIBCPP_AVAILABILITY_FILESYSTEM
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::recursive_directory_iterator> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP_CXX03_LANG
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/space_info.h b/third_party/llvm-project/libcxx/include/__filesystem/space_info.h
index d0747e3..25fcb9a 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/space_info.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/space_info.h
@@ -29,7 +29,7 @@
uintmax_t free;
uintmax_t available;
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const space_info&, const space_info&) = default;
# endif
};
diff --git a/third_party/llvm-project/libcxx/include/__filesystem/u8path.h b/third_party/llvm-project/libcxx/include/__filesystem/u8path.h
index d35faa1..ebc1159 100644
--- a/third_party/llvm-project/libcxx/include/__filesystem/u8path.h
+++ b/third_party/llvm-project/libcxx/include/__filesystem/u8path.h
@@ -15,7 +15,6 @@
#include <__config>
#include <__filesystem/path.h>
#include <string>
-#include <type_traits>
// Only required on Windows for __widen_from_utf8, and included conservatively
// because it requires support for localization.
diff --git a/third_party/llvm-project/libcxx/include/__format/buffer.h b/third_party/llvm-project/libcxx/include/__format/buffer.h
index ddfe767..0f669ba 100644
--- a/third_party/llvm-project/libcxx/include/__format/buffer.h
+++ b/third_party/llvm-project/libcxx/include/__format/buffer.h
@@ -27,10 +27,11 @@
#include <__iterator/incrementable_traits.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
+#include <__type_traits/add_pointer.h>
#include <__utility/move.h>
#include <cstddef>
#include <string_view>
-#include <type_traits>
#include <vector>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -42,7 +43,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
@@ -564,7 +565,7 @@
} // namespace __format
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/concepts.h b/third_party/llvm-project/libcxx/include/__format/concepts.h
index fe4a7b9..62552f8 100644
--- a/third_party/llvm-project/libcxx/include/__format/concepts.h
+++ b/third_party/llvm-project/libcxx/include/__format/concepts.h
@@ -18,7 +18,6 @@
#include <__type_traits/is_specialization.h>
#include <__utility/pair.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
/// The character type specializations of \ref formatter.
template <class _CharT>
@@ -56,7 +55,7 @@
{ __cf.format(__t, __fc) } -> same_as<__fmt_iter_for<_CharT>>;
};
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Tp, class _CharT>
concept formattable = __formattable<_Tp, _CharT>;
@@ -66,12 +65,11 @@
// TODO FMT Add a test to validate we fail when using that concept after P2165
// has been implemented.
template <class _Tp>
-concept __fmt_pair_like = __is_specialization_v<_Tp, pair> ||
- // Use a requires since tuple_size_v may fail to instantiate,
- (__is_specialization_v<_Tp, tuple> && requires { tuple_size_v<_Tp> == 2; });
+concept __fmt_pair_like =
+ __is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
-# endif //_LIBCPP_STD_VER > 20
-#endif //_LIBCPP_STD_VER > 17
+# endif //_LIBCPP_STD_VER >= 23
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/container_adaptor.h b/third_party/llvm-project/libcxx/include/__format/container_adaptor.h
index 62b6981..5b95f60 100644
--- a/third_party/llvm-project/libcxx/include/__format/container_adaptor.h
+++ b/third_party/llvm-project/libcxx/include/__format/container_adaptor.h
@@ -19,12 +19,16 @@
#include <__format/concepts.h>
#include <__format/formatter.h>
#include <__format/range_default_formatter.h>
+#include <__ranges/all.h>
+#include <__ranges/ref_view.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/maybe_const.h>
#include <queue>
#include <stack>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// [container.adaptors.format] only specifies the library should provide the
// formatter specializations, not which header should provide them.
@@ -33,10 +37,11 @@
// adaptor headers. To use the format functions users already include <format>.
template <class _Adaptor, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_container_adaptor {
+struct _LIBCPP_TEMPLATE_VIS __formatter_container_adaptor {
private:
- using __maybe_const_adaptor = __fmt_maybe_const<_Adaptor, _CharT>;
- formatter<typename _Adaptor::container_type, _CharT> __underlying_;
+ using __maybe_const_container = __fmt_maybe_const<typename _Adaptor::container_type, _CharT>;
+ using __maybe_const_adaptor = __maybe_const<is_const_v<__maybe_const_container>, _Adaptor>;
+ formatter<ranges::ref_view<__maybe_const_container>, _CharT> __underlying_;
public:
template <class _ParseContext>
@@ -52,18 +57,18 @@
};
template <class _CharT, class _Tp, formattable<_CharT> _Container>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<queue<_Tp, _Container>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<queue<_Tp, _Container>, _CharT>
: public __formatter_container_adaptor<queue<_Tp, _Container>, _CharT> {};
template <class _CharT, class _Tp, class _Container, class _Compare>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<priority_queue<_Tp, _Container, _Compare>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<priority_queue<_Tp, _Container, _Compare>, _CharT>
: public __formatter_container_adaptor<priority_queue<_Tp, _Container, _Compare>, _CharT> {};
template <class _CharT, class _Tp, formattable<_CharT> _Container>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<stack<_Tp, _Container>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<stack<_Tp, _Container>, _CharT>
: public __formatter_container_adaptor<stack<_Tp, _Container>, _CharT> {};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/enable_insertable.h b/third_party/llvm-project/libcxx/include/__format/enable_insertable.h
index 71b4252..86ef94a 100644
--- a/third_party/llvm-project/libcxx/include/__format/enable_insertable.h
+++ b/third_party/llvm-project/libcxx/include/__format/enable_insertable.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
@@ -28,7 +28,7 @@
} // namespace __format
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/escaped_output_table.h b/third_party/llvm-project/libcxx/include/__format/escaped_output_table.h
index bd2994b..222847e 100644
--- a/third_party/llvm-project/libcxx/include/__format/escaped_output_table.h
+++ b/third_party/llvm-project/libcxx/include/__format/escaped_output_table.h
@@ -72,7 +72,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
namespace __escaped_output_table {
@@ -1031,7 +1031,7 @@
} // namespace __escaped_output_table
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h b/third_party/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h
index 1ffcfeb..bd6d39f 100644
--- a/third_party/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h
+++ b/third_party/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h
@@ -73,7 +73,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __extended_grapheme_custer_property_boundary {
@@ -1654,7 +1654,7 @@
} // namespace __extended_grapheme_custer_property_boundary
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_arg.h b/third_party/llvm-project/libcxx/include/__format/format_arg.h
index 771a03f..7e37dd4 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_arg.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_arg.h
@@ -18,6 +18,7 @@
#include <__format/format_parse_context.h>
#include <__functional/invoke.h>
#include <__memory/addressof.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/unreachable.h>
#include <__variant/monostate.h>
@@ -30,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
/// The type stored in @ref basic_format_arg.
@@ -94,7 +95,7 @@
// This function is not user obervable, so it can directly use the non-standard
// types of the "variant". See __arg_t for more details.
template <class _Visitor, class _Context>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT decltype(auto)
+_LIBCPP_HIDE_FROM_ABI decltype(auto)
__visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
switch (__arg.__type_) {
case __format::__arg_t::__none:
@@ -224,7 +225,7 @@
};
template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg {
+class _LIBCPP_TEMPLATE_VIS basic_format_arg {
public:
class _LIBCPP_TEMPLATE_VIS handle;
@@ -276,7 +277,7 @@
// This function is user facing, so it must wrap the non-standard types of
// the "variant" in a handle to stay conforming. See __arg_t for more details.
template <class _Visitor, class _Context>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT decltype(auto)
+_LIBCPP_HIDE_FROM_ABI decltype(auto)
visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
switch (__arg.__type_) {
# ifndef _LIBCPP_HAS_NO_INT128
@@ -295,7 +296,7 @@
}
}
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_arg_store.h b/third_party/llvm-project/libcxx/include/__format/format_arg_store.h
index 6f4f4c3..b9a36e5 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_arg_store.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_arg_store.h
@@ -19,15 +19,16 @@
#include <__config>
#include <__format/concepts.h>
#include <__format/format_arg.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/extent.h>
+#include <__type_traits/is_same.h>
#include <__utility/forward.h>
-#include <cstring>
#include <string>
#include <string_view>
-#include <type_traits>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
@@ -142,21 +143,24 @@
//
// Note this version can't be constrained avoiding ambiguous overloads.
// That means it can be instantiated by disabled formatters. To solve this, a
-// constrained version for not formattable formatters is added. That overload
-// is marked as deleted to fail creating a storage type for disabled formatters.
+// constrained version for not formattable formatters is added.
template <class _Context, class _Tp>
consteval __arg_t __determine_arg_t() {
return __arg_t::__handle;
}
+// The overload for not formattable types allows triggering the static
+// assertion below.
template <class _Context, class _Tp>
requires(!__formattable<_Tp, typename _Context::char_type>)
-consteval __arg_t __determine_arg_t() = delete;
+consteval __arg_t __determine_arg_t() {
+ return __arg_t::__none;
+}
template <class _Context, class _Tp>
_LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __value) noexcept {
constexpr __arg_t __arg = __determine_arg_t<_Context, remove_cvref_t<_Tp>>();
- static_assert(__arg != __arg_t::__none);
+ static_assert(__arg != __arg_t::__none, "the supplied type is not formattable");
// Not all types can be used to directly initialize the
// __basic_format_arg_value. First handle all types needing adjustment, the
@@ -247,7 +251,7 @@
_Storage __storage;
};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_args.h b/third_party/llvm-project/libcxx/include/__format/format_args.h
index 8b8fbde..c2e7c96 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_args.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_args.h
@@ -24,10 +24,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args {
+class _LIBCPP_TEMPLATE_VIS basic_format_args {
public:
_LIBCPP_HIDE_FROM_ABI basic_format_args() noexcept = default;
@@ -71,9 +71,11 @@
const basic_format_arg<_Context>* __args_;
};
};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_args);
-#endif //_LIBCPP_STD_VER > 17
+template <class _Context, class... _Args>
+basic_format_args(__format_arg_store<_Context, _Args...>) -> basic_format_args<_Context>;
+
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_context.h b/third_party/llvm-project/libcxx/include/__format/format_context.h
index 85e00eb..521131d 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_context.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_context.h
@@ -37,11 +37,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _OutIt, class _CharT>
requires output_iterator<_OutIt, const _CharT&>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context;
+class _LIBCPP_TEMPLATE_VIS basic_format_context;
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
/**
@@ -80,7 +80,6 @@
class
// clang-format off
_LIBCPP_TEMPLATE_VIS
- _LIBCPP_AVAILABILITY_FORMAT
_LIBCPP_PREFERRED_NAME(format_context)
_LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wformat_context))
// clang-format on
@@ -162,7 +161,7 @@
// Here the width of an element in input is determined dynamically.
// Note when the top-level element has no width the retargeting is not needed.
template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT
+class _LIBCPP_TEMPLATE_VIS
basic_format_context<typename __format::__retarget_buffer<_CharT>::__iterator, _CharT> {
public:
using iterator = typename __format::__retarget_buffer<_CharT>::__iterator;
@@ -216,7 +215,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_context);
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_error.h b/third_party/llvm-project/libcxx/include/__format/format_error.h
index 002d1a4..5f9b7da 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_error.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_error.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
public:
@@ -40,7 +40,7 @@
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
__throw_format_error(const char* __s) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw format_error(__s);
#else
(void)__s;
@@ -48,7 +48,7 @@
#endif
}
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_functions.h b/third_party/llvm-project/libcxx/include/__format/format_functions.h
index 185148c..60b40cb 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_functions.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_functions.h
@@ -38,7 +38,9 @@
#include <__format/formatter_string.h>
#include <__format/parser_std_format_spec.h>
#include <__iterator/back_insert_iterator.h>
+#include <__iterator/concepts.h>
#include <__iterator/incrementable_traits.h>
+#include <__iterator/readable_traits.h> // iter_value_t
#include <__variant/monostate.h>
#include <array>
#include <string>
@@ -54,7 +56,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// TODO FMT Evaluate which templates should be external templates. This
// improves the efficiency of the header. However since the header is still
@@ -147,41 +149,44 @@
size_t __size_;
};
-_LIBCPP_HIDE_FROM_ABI
-constexpr void __compile_time_validate_integral(__arg_t __type) {
- switch (__type) {
- case __arg_t::__int:
- case __arg_t::__long_long:
- case __arg_t::__i128:
- case __arg_t::__unsigned:
- case __arg_t::__unsigned_long_long:
- case __arg_t::__u128:
- return;
-
- default:
- std::__throw_format_error("Argument isn't an integral type");
- }
-}
-
+// [format.string.std]/8
+// If { arg-idopt } is used in a width or precision, the value of the
+// corresponding formatting argument is used in its place. If the
+// corresponding formatting argument is not of standard signed or unsigned
+// integer type, or its value is negative for precision or non-positive for
+// width, an exception of type format_error is thrown.
+//
// _HasPrecision does the formatter have a precision?
template <class _CharT, class _Tp, bool _HasPrecision = false>
-_LIBCPP_HIDE_FROM_ABI constexpr void
-__compile_time_validate_argument(basic_format_parse_context<_CharT>& __parse_ctx,
- __compile_time_basic_format_context<_CharT>& __ctx) {
+_LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_validate_argument(
+ basic_format_parse_context<_CharT>& __parse_ctx, __compile_time_basic_format_context<_CharT>& __ctx) {
+ auto __validate_type = [](__arg_t __type) {
+ // LWG3720 originally allowed "signed or unsigned integer types", however
+ // the final version explicitly changed it to "*standard* signed or unsigned
+ // integer types". It's trivial to use 128-bit integrals in libc++'s
+ // implementation, but other implementations may not implement it.
+ // (Using a width or precision, that does not fit in 64-bits, sounds very
+ // unlikely in real world code.)
+ switch (__type) {
+ case __arg_t::__int:
+ case __arg_t::__long_long:
+ case __arg_t::__unsigned:
+ case __arg_t::__unsigned_long_long:
+ return;
+
+ default:
+ std::__throw_format_error("Replacement argument isn't a standard signed or unsigned integer type");
+ }
+ };
+
formatter<_Tp, _CharT> __formatter;
__parse_ctx.advance_to(__formatter.parse(__parse_ctx));
- // [format.string.std]/7
- // ... If the corresponding formatting argument is not of integral type, or
- // its value is negative for precision or non-positive for width, an
- // exception of type format_error is thrown.
- //
- // Validate whether the arguments are integrals.
if (__formatter.__parser_.__width_as_arg_)
- __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__width_));
+ __validate_type(__ctx.arg(__formatter.__parser_.__width_));
if constexpr (_HasPrecision)
if (__formatter.__parser_.__precision_as_arg_)
- __format::__compile_time_validate_integral(__ctx.arg(__formatter.__parser_.__precision_));
+ __validate_type(__ctx.arg(__formatter.__parser_.__precision_));
}
// This function is not user facing, so it can directly use the non-standard types of the "variant".
@@ -236,21 +241,22 @@
std::__throw_format_error("Invalid argument");
}
-template <class _CharT, class _ParseCtx, class _Ctx>
-_LIBCPP_HIDE_FROM_ABI constexpr const _CharT*
-__handle_replacement_field(const _CharT* __begin, const _CharT* __end,
+template <contiguous_iterator _Iterator, class _ParseCtx, class _Ctx>
+_LIBCPP_HIDE_FROM_ABI constexpr _Iterator
+__handle_replacement_field(_Iterator __begin, _Iterator __end,
_ParseCtx& __parse_ctx, _Ctx& __ctx) {
+ using _CharT = iter_value_t<_Iterator>;
__format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __parse_ctx);
- bool __parse = *__r.__ptr == _CharT(':');
- switch (*__r.__ptr) {
+ bool __parse = *__r.__last == _CharT(':');
+ switch (*__r.__last) {
case _CharT(':'):
// The arg-id has a format-specifier, advance the input to the format-spec.
- __parse_ctx.advance_to(__r.__ptr + 1);
+ __parse_ctx.advance_to(__r.__last + 1);
break;
case _CharT('}'):
// The arg-id has no format-specifier.
- __parse_ctx.advance_to(__r.__ptr);
+ __parse_ctx.advance_to(__r.__last);
break;
default:
std::__throw_format_error("The replacement field arg-id should terminate at a ':' or '}'");
@@ -258,10 +264,12 @@
if constexpr (same_as<_Ctx, __compile_time_basic_format_context<_CharT>>) {
__arg_t __type = __ctx.arg(__r.__value);
- if (__type == __arg_t::__handle)
+ if (__type == __arg_t::__none)
+ std::__throw_format_error("Argument index out of bounds");
+ else if (__type == __arg_t::__handle)
__ctx.__handle(__r.__value).__parse(__parse_ctx);
- else
- __format::__compile_time_visit_format_arg(__parse_ctx, __ctx, __type);
+ else if (__parse)
+ __format::__compile_time_visit_format_arg(__parse_ctx, __ctx, __type);
} else
_VSTD::__visit_format_arg(
[&](auto __arg) {
@@ -291,8 +299,8 @@
using _CharT = typename _ParseCtx::char_type;
static_assert(same_as<typename _Ctx::char_type, _CharT>);
- const _CharT* __begin = __parse_ctx.begin();
- const _CharT* __end = __parse_ctx.end();
+ auto __begin = __parse_ctx.begin();
+ auto __end = __parse_ctx.end();
typename _Ctx::iterator __out_it = __ctx.out();
while (__begin != __end) {
switch (*__begin) {
@@ -339,7 +347,7 @@
_Context{__types_.data(), __handles_.data(), sizeof...(_Args)});
}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr basic_string_view<_CharT> get() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<_CharT> get() const noexcept {
return __str_;
}
@@ -404,21 +412,21 @@
// https://reviews.llvm.org/D110499#inline-1180704
// TODO FMT Evaluate whether we want to file a Clang bug report regarding this.
template <output_iterator<const char&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, string_view __fmt, format_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, wstring_view __fmt, wformat_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
}
#endif
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
_VSTD::make_format_args(__args...));
@@ -426,14 +434,17 @@
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
_VSTD::make_wformat_args(__args...));
}
#endif
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string
vformat(string_view __fmt, format_args __args) {
string __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
@@ -441,7 +452,10 @@
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring
vformat(wstring_view __fmt, wformat_args __args) {
wstring __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
@@ -450,14 +464,14 @@
#endif
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string format(format_string<_Args...> __fmt,
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string format(format_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::vformat(__fmt.get(), _VSTD::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat(__fmt.get(), _VSTD::make_wformat_args(__args...));
}
@@ -474,14 +488,14 @@
}
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wformat_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_wformat_args(__args...));
@@ -497,14 +511,14 @@
}
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
}
@@ -531,7 +545,7 @@
}
template <output_iterator<const char&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
_OutIt __out_it, locale __loc, string_view __fmt, format_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
__args);
@@ -539,7 +553,7 @@
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
_OutIt __out_it, locale __loc, wstring_view __fmt, wformat_args __args) {
return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
__args);
@@ -547,7 +561,7 @@
#endif
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
_VSTD::make_format_args(__args...));
@@ -555,14 +569,17 @@
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
_VSTD::make_wformat_args(__args...));
}
#endif
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string
vformat(locale __loc, string_view __fmt, format_args __args) {
string __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
@@ -571,7 +588,10 @@
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
+// fires too eagerly, see http://llvm.org/PR61563.
+template <class = void>
+_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring
vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
wstring __res;
_VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
@@ -581,7 +601,7 @@
#endif
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string format(locale __loc,
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string format(locale __loc,
format_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
@@ -590,7 +610,7 @@
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
_VSTD::make_wformat_args(__args...));
@@ -609,7 +629,7 @@
}
template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, format_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
@@ -618,7 +638,7 @@
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, wformat_string<_Args...> __fmt,
_Args&&... __args) {
return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
@@ -636,14 +656,14 @@
}
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
}
@@ -652,7 +672,7 @@
#endif // _LIBCPP_HAS_NO_LOCALIZATION
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_fwd.h b/third_party/llvm-project/libcxx/include/__format/format_fwd.h
index f7c72e2..120b2fc 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_fwd.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_fwd.h
@@ -20,19 +20,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg;
+class _LIBCPP_TEMPLATE_VIS basic_format_arg;
template <class _OutIt, class _CharT>
requires output_iterator<_OutIt, const _CharT&>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context;
+class _LIBCPP_TEMPLATE_VIS basic_format_context;
template <class _Tp, class _CharT = char>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter;
+struct _LIBCPP_TEMPLATE_VIS formatter;
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_parse_context.h b/third_party/llvm-project/libcxx/include/__format/format_parse_context.h
index 30e3a7d..79f53f7 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_parse_context.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_parse_context.h
@@ -12,6 +12,7 @@
#include <__config>
#include <__format/format_error.h>
+#include <__type_traits/is_constant_evaluated.h>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -20,10 +21,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context {
+class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
public:
using char_type = _CharT;
using const_iterator = typename basic_string_view<_CharT>::const_iterator;
@@ -58,6 +59,18 @@
if (__indexing_ == __unknown)
__indexing_ = __automatic;
+
+ // Throws an exception to make the expression a non core constant
+ // expression as required by:
+ // [format.parse.ctx]/8
+ // Remarks: Let cur-arg-id be the value of next_arg_id_ prior to this
+ // call. Call expressions where cur-arg-id >= num_args_ is true are not
+ // core constant expressions (7.7 [expr.const]).
+ // Note: the Throws clause [format.parse.ctx]/9 doesn't specify the
+ // behavior when id >= num_args_.
+ if (is_constant_evaluated() && __next_arg_id_ >= __num_args_)
+ std::__throw_format_error("Argument index outside the valid range");
+
return __next_arg_id_++;
}
_LIBCPP_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) {
@@ -93,7 +106,7 @@
using wformat_parse_context = basic_format_parse_context<wchar_t>;
#endif
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_string.h b/third_party/llvm-project/libcxx/include/__format/format_string.h
index d9caf86..bec3fe1 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_string.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_string.h
@@ -13,6 +13,8 @@
#include <__assert>
#include <__config>
#include <__format/format_error.h>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h> // iter_value_t
#include <cstddef>
#include <cstdint>
@@ -22,22 +24,22 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format {
-template <class _CharT>
+template <contiguous_iterator _Iterator>
struct _LIBCPP_TEMPLATE_VIS __parse_number_result {
- const _CharT* __ptr;
+ _Iterator __last;
uint32_t __value;
};
-template <class _CharT>
-__parse_number_result(const _CharT*, uint32_t) -> __parse_number_result<_CharT>;
+template <contiguous_iterator _Iterator>
+__parse_number_result(_Iterator, uint32_t) -> __parse_number_result<_Iterator>;
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_number(const _CharT* __begin, const _CharT* __end);
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_number(_Iterator __begin, _Iterator __end);
/**
* The maximum value of a numeric argument.
@@ -53,16 +55,16 @@
inline constexpr uint32_t __number_max = INT32_MAX;
namespace __detail {
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_zero(const _CharT* __begin, const _CharT*, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_zero(_Iterator __begin, _Iterator, auto& __parse_ctx) {
__parse_ctx.check_arg_id(0);
return {++__begin, 0}; // can never be larger than the maximum.
}
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_automatic(const _CharT* __begin, const _CharT*, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_automatic(_Iterator __begin, _Iterator, auto& __parse_ctx) {
size_t __value = __parse_ctx.next_arg_id();
_LIBCPP_ASSERT(__value <= __number_max,
"Compilers don't support this number of arguments");
@@ -70,10 +72,10 @@
return {__begin, uint32_t(__value)};
}
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
- __parse_number_result<_CharT> __r = __format::__parse_number(__begin, __end);
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_manual(_Iterator __begin, _Iterator __end, auto& __parse_ctx) {
+ __parse_number_result<_Iterator> __r = __format::__parse_number(__begin, __end);
__parse_ctx.check_arg_id(__r.__value);
return __r;
}
@@ -86,9 +88,10 @@
* The number is used for the 31-bit values @em width and @em precision. This
* allows a maximum value of 2147483647.
*/
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_number(const _CharT* __begin, const _CharT* __end_input) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_number(_Iterator __begin, _Iterator __end_input) {
+ using _CharT = iter_value_t<_Iterator>;
static_assert(__format::__number_max == INT32_MAX,
"The algorithm is implemented based on this value.");
/*
@@ -98,7 +101,7 @@
* - Does the value exceed width of an uint32_t? (Switching to uint64_t would
* have the same issue, but with a higher maximum.)
*/
- const _CharT* __end = __end_input - __begin > 9 ? __begin + 9 : __end_input;
+ _Iterator __end = __end_input - __begin > 9 ? __begin + 9 : __end_input;
uint32_t __value = *__begin - _CharT('0');
while (++__begin != __end) {
if (*__begin < _CharT('0') || *__begin > _CharT('9'))
@@ -134,9 +137,10 @@
* The parser will return a pointer beyond the last consumed character. This
* should be the closing '}' of the arg-id.
*/
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
-__parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
+__parse_arg_id(_Iterator __begin, _Iterator __end, auto& __parse_ctx) {
+ using _CharT = iter_value_t<_Iterator>;
switch (*__begin) {
case _CharT('0'):
return __detail::__parse_zero(__begin, __end, __parse_ctx);
@@ -156,7 +160,7 @@
} // namespace __format
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/format_to_n_result.h b/third_party/llvm-project/libcxx/include/__format/format_to_n_result.h
index f1ed9a0..6f30546 100644
--- a/third_party/llvm-project/libcxx/include/__format/format_to_n_result.h
+++ b/third_party/llvm-project/libcxx/include/__format/format_to_n_result.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _OutIt>
struct _LIBCPP_TEMPLATE_VIS format_to_n_result {
@@ -28,7 +28,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(format_to_n_result);
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter.h b/third_party/llvm-project/libcxx/include/__format/formatter.h
index 900a09a..172b2d5 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
/// The default formatter template.
///
@@ -32,13 +32,13 @@
/// - is_copy_assignable<F>, and
/// - is_move_assignable<F>.
template <class _Tp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter {
+struct _LIBCPP_TEMPLATE_VIS formatter {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr void __set_debug_format(_Tp& __formatter) {
@@ -46,8 +46,8 @@
__formatter.set_debug_format();
}
-# endif // _LIBCPP_STD_VER > 20
-#endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 23
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_bool.h b/third_party/llvm-project/libcxx/include/__format/formatter_bool.h
index 0d005a1..1fb7575 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_bool.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_bool.h
@@ -33,10 +33,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<bool, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<bool, _CharT> {
public:
_LIBCPP_HIDE_FROM_ABI constexpr auto
parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
@@ -71,7 +71,7 @@
__format_spec::__parser<_CharT> __parser_;
};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_char.h b/third_party/llvm-project/libcxx/include/__format/formatter_char.h
index 8a92e74..7d63c04 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_char.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_char.h
@@ -28,10 +28,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_char {
+struct _LIBCPP_TEMPLATE_VIS __formatter_char {
public:
_LIBCPP_HIDE_FROM_ABI constexpr auto
parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
@@ -44,7 +44,7 @@
if (__parser_.__type_ == __format_spec::__type::__default || __parser_.__type_ == __format_spec::__type::__char)
return __formatter::__format_char(__value, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
if (__parser_.__type_ == __format_spec::__type::__debug)
return __formatter::__format_escaped_char(__value, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
# endif
@@ -66,7 +66,7 @@
return format(static_cast<wchar_t>(__value), __ctx);
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr void set_debug_format() { __parser_.__type_ = __format_spec::__type::__debug; }
# endif
@@ -74,19 +74,19 @@
};
template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, char> : public __formatter_char<char> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<char, char> : public __formatter_char<char> {};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
+struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_floating_point.h b/third_party/llvm-project/libcxx/include/__format/formatter_floating_point.h
index a544b53..12c7e58 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_floating_point.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_floating_point.h
@@ -16,6 +16,9 @@
#include <__algorithm/min.h>
#include <__algorithm/rotate.h>
#include <__algorithm/transform.h>
+#include <__charconv/chars_format.h>
+#include <__charconv/to_chars_floating_point.h>
+#include <__charconv/to_chars_result.h>
#include <__concepts/arithmetic.h>
#include <__concepts/same_as.h>
#include <__config>
@@ -26,9 +29,12 @@
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
#include <__memory/allocator.h>
+#include <__system_error/errc.h>
+#include <__type_traits/conditional.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <charconv>
+#include <cmath>
+#include <cstddef>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
@@ -43,7 +49,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
@@ -404,7 +410,6 @@
// In fixed mode the algorithm truncates trailing spaces and possibly the
// radix point. There's no good guess for the position of the radix point
// therefore scan the output after the first digit.
-
__result.__radix_point = _VSTD::find(__first, __result.__last, '.');
}
}
@@ -665,7 +670,7 @@
if (__result.__exponent == __result.__last)
// if P > X >= -4, the conversion is with style f or F and precision P - 1 - X.
// By including the radix point it calculates P - (1 + X)
- __p -= __result.__radix_point - __buffer.begin();
+ __p -= __result.__radix_point - __result.__integral;
else
// otherwise, the conversion is with style e or E and precision P - 1.
--__p;
@@ -739,16 +744,16 @@
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<float, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<float, _CharT>
: public __formatter_floating_point<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<double, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<double, _CharT>
: public __formatter_floating_point<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long double, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<long double, _CharT>
: public __formatter_floating_point<_CharT> {};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_integer.h b/third_party/llvm-project/libcxx/include/__format/formatter_integer.h
index b4be9f9..0e14410 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_integer.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_integer.h
@@ -19,8 +19,8 @@
#include <__format/formatter_integral.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__type_traits/is_same.h>
#include <__type_traits/make_32_64_or_128_bit.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,10 +28,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
- struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_integer {
+ struct _LIBCPP_TEMPLATE_VIS __formatter_integer {
public:
_LIBCPP_HIDE_FROM_ABI constexpr auto
@@ -60,47 +60,47 @@
// Signed integral types.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<signed char, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<signed char, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<short, _CharT> : public __formatter_integer<_CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<short, _CharT> : public __formatter_integer<_CharT> {
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<int, _CharT> : public __formatter_integer<_CharT> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<int, _CharT> : public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long, _CharT> : public __formatter_integer<_CharT> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<long, _CharT> : public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long long, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<long long, _CharT>
: public __formatter_integer<_CharT> {};
# ifndef _LIBCPP_HAS_NO_INT128
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<__int128_t, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<__int128_t, _CharT>
: public __formatter_integer<_CharT> {};
# endif
// Unsigned integral types.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned char, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned char, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned short, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned short, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned long, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long, _CharT>
: public __formatter_integer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned long long, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<unsigned long long, _CharT>
: public __formatter_integer<_CharT> {};
# ifndef _LIBCPP_HAS_NO_INT128
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<__uint128_t, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<__uint128_t, _CharT>
: public __formatter_integer<_CharT> {};
# endif
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_integral.h b/third_party/llvm-project/libcxx/include/__format/formatter_integral.h
index fe3a063..80d2457 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_integral.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_integral.h
@@ -10,6 +10,9 @@
#ifndef _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
#define _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
+#include <__charconv/to_chars_integral.h>
+#include <__charconv/to_chars_result.h>
+#include <__charconv/traits.h>
#include <__concepts/arithmetic.h>
#include <__concepts/same_as.h>
#include <__config>
@@ -17,11 +20,13 @@
#include <__format/format_error.h>
#include <__format/formatter_output.h>
#include <__format/parser_std_format_spec.h>
+#include <__system_error/errc.h>
+#include <__type_traits/make_unsigned.h>
#include <__utility/unreachable.h>
#include <array>
-#include <charconv>
#include <limits>
#include <string>
+#include <string_view>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
@@ -36,7 +41,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
@@ -354,7 +359,7 @@
} // namespace __formatter
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_output.h b/third_party/llvm-project/libcxx/include/__format/formatter_output.h
index 4676925..f751d8a 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_output.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_output.h
@@ -12,7 +12,10 @@
#include <__algorithm/ranges_copy.h>
#include <__algorithm/ranges_fill_n.h>
+#include <__algorithm/ranges_for_each.h>
#include <__algorithm/ranges_transform.h>
+#include <__charconv/to_chars_integral.h>
+#include <__charconv/to_chars_result.h>
#include <__chrono/statically_widen.h>
#include <__concepts/same_as.h>
#include <__config>
@@ -23,10 +26,12 @@
#include <__format/parser_std_format_spec.h>
#include <__format/unicode.h>
#include <__iterator/back_insert_iterator.h>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h> // iter_value_t
+#include <__system_error/errc.h>
#include <__type_traits/make_unsigned.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <charconv>
#include <cstddef>
#include <string>
#include <string_view>
@@ -37,7 +42,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __formatter {
@@ -261,11 +266,11 @@
return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
}
-template <class _CharT, class _ParserCharT>
+template <contiguous_iterator _Iterator, class _ParserCharT>
_LIBCPP_HIDE_FROM_ABI auto
-__write(const _CharT* __first,
- const _CharT* __last,
- output_iterator<const _CharT&> auto __out_it,
+__write(_Iterator __first,
+ _Iterator __last,
+ output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
ptrdiff_t __size) -> decltype(__out_it) {
_LIBCPP_ASSERT(__first <= __last, "Not a valid range");
@@ -275,11 +280,11 @@
/// \overload
///
/// Calls the function above where \a __size = \a __last - \a __first.
-template <class _CharT, class _ParserCharT>
+template <contiguous_iterator _Iterator, class _ParserCharT>
_LIBCPP_HIDE_FROM_ABI auto
-__write(const _CharT* __first,
- const _CharT* __last,
- output_iterator<const _CharT&> auto __out_it,
+__write(_Iterator __first,
+ _Iterator __last,
+ output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs) -> decltype(__out_it) {
_LIBCPP_ASSERT(__first <= __last, "Not a valid range");
return __formatter::__write(__first, __last, _VSTD::move(__out_it), __specs, __last - __first);
@@ -359,7 +364,7 @@
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI int __truncate(basic_string_view<_CharT>& __str, int __precision) {
- __format_spec::__column_width_result<_CharT> __result =
+ __format_spec::__column_width_result __result =
__format_spec::__estimate_column_width(__str, __precision, __format_spec::__column_width_rounding::__down);
__str = basic_string_view<_CharT>{__str.begin(), __result.__last_};
return __result.__width_;
@@ -382,7 +387,7 @@
return __formatter::__write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size);
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
struct __nul_terminator {};
@@ -501,36 +506,17 @@
__unicode::__code_point_view<_CharT> __view{__values.begin(), __values.end()};
while (!__view.__at_end()) {
- const _CharT* __first = __view.__position();
- typename __unicode::__consume_p2286_result __result = __view.__consume_p2286();
- if (__result.__ill_formed_size == 0) {
- if (!__formatter::__is_escaped_sequence_written(__str, __result.__value, __mark))
+ auto __first = __view.__position();
+ typename __unicode::__consume_result __result = __view.__consume();
+ if (__result.__status == __unicode::__consume_result::__ok) {
+ if (!__formatter::__is_escaped_sequence_written(__str, __result.__code_point, __mark))
// 2.2.1.3 - Add the character
ranges::copy(__first, __view.__position(), std::back_insert_iterator(__str));
-
} else {
// 2.2.3 sequence of ill-formed code units
- // The number of code-units in __result.__value depends on the character type being used.
- if constexpr (sizeof(_CharT) == 1) {
- _LIBCPP_ASSERT(__result.__ill_formed_size == 1 || __result.__ill_formed_size == 4,
- "illegal number of invalid code units.");
- if (__result.__ill_formed_size == 1) // ill-formed, one code unit
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value & 0xff);
- else { // out of valid range, four code units
- // The code point was properly encoded, decode the value.
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value >> 18 | 0xf0);
- __formatter::__write_escape_ill_formed_code_unit(__str, (__result.__value >> 12 & 0x3f) | 0x80);
- __formatter::__write_escape_ill_formed_code_unit(__str, (__result.__value >> 6 & 0x3f) | 0x80);
- __formatter::__write_escape_ill_formed_code_unit(__str, (__result.__value & 0x3f) | 0x80);
- }
- } else if constexpr (sizeof(_CharT) == 2) {
- _LIBCPP_ASSERT(__result.__ill_formed_size == 1, "for UTF-16 at most one invalid code unit");
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value & 0xffff);
- } else {
- static_assert(sizeof(_CharT) == 4, "unsupported character width");
- _LIBCPP_ASSERT(__result.__ill_formed_size == 1, "for UTF-32 one code unit is one code point");
- __formatter::__write_escape_ill_formed_code_unit(__str, __result.__value);
- }
+ ranges::for_each(__first, __view.__position(), [&](_CharT __value) {
+ __formatter::__write_escape_ill_formed_code_unit(__str, __formatter::__to_char32(__value));
+ });
}
}
}
@@ -559,11 +545,11 @@
return __formatter::__write_string(basic_string_view{__str}, _VSTD::move(__out_it), __specs);
}
-# endif // _LIBCPP_STD_VER > 20
+# endif // _LIBCPP_STD_VER >= 23
} // namespace __formatter
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_pointer.h b/third_party/llvm-project/libcxx/include/__format/formatter_pointer.h
index 31b49e1..48d8372 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_pointer.h
@@ -27,13 +27,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
struct _LIBCPP_TEMPLATE_VIS __formatter_pointer {
public:
- constexpr __formatter_pointer() { __parser_.__alignment_ = __format_spec::__alignment::__right; }
-
_LIBCPP_HIDE_FROM_ABI constexpr auto
parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_pointer);
@@ -48,7 +46,7 @@
return __formatter::__format_integer(reinterpret_cast<uintptr_t>(__ptr), __ctx, __specs);
}
- __format_spec::__parser<_CharT> __parser_;
+ __format_spec::__parser<_CharT> __parser_{.__alignment_ = __format_spec::__alignment::__right};
};
// [format.formatter.spec]/2.4
@@ -57,16 +55,16 @@
// - template<> struct formatter<void*, charT>;
// - template<> struct formatter<const void*, charT>;
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<nullptr_t, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<nullptr_t, _CharT>
: public __formatter_pointer<_CharT> {};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<void*, _CharT> : public __formatter_pointer<_CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<void*, _CharT> : public __formatter_pointer<_CharT> {
};
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const void*, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<const void*, _CharT>
: public __formatter_pointer<_CharT> {};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_string.h b/third_party/llvm-project/libcxx/include/__format/formatter_string.h
index 606fb79..c14518b 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_string.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_string.h
@@ -27,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <__fmt_char_type _CharT>
struct _LIBCPP_TEMPLATE_VIS __formatter_string {
@@ -40,7 +40,7 @@
}
_LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT> __str, auto& __ctx) const -> decltype(__ctx.out()) {
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
if (__parser_.__type_ == __format_spec::__type::__debug)
return __formatter::__format_escaped_string(__str, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
# endif
@@ -48,7 +48,7 @@
return __formatter::__write_string(__str, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr void set_debug_format() { __parser_.__type_ = __format_spec::__type::__debug; }
# endif
@@ -57,7 +57,7 @@
// Formatter const char*.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT*, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<const _CharT*, _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
@@ -66,7 +66,7 @@
"prevented an invalid pointer.");
__format_spec::__parsed_specifications<_CharT> __specs = _Base::__parser_.__get_parsed_std_specifications(__ctx);
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
if (_Base::__parser_.__type_ == __format_spec::__type::__debug)
return __formatter::__format_escaped_string(basic_string_view<_CharT>{__str}, __ctx.out(), __specs);
# endif
@@ -95,7 +95,7 @@
// Formatter char*.
template <__fmt_char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_CharT*, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<_CharT*, _CharT>
: public formatter<const _CharT*, _CharT> {
using _Base = formatter<const _CharT*, _CharT>;
@@ -106,7 +106,7 @@
// Formatter char[].
template <__fmt_char_type _CharT, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_CharT[_Size], _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<_CharT[_Size], _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
@@ -115,20 +115,9 @@
}
};
-// Formatter const char[].
-template <__fmt_char_type _CharT, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT[_Size], _CharT>
- : public __formatter_string<_CharT> {
- using _Base = __formatter_string<_CharT>;
-
- _LIBCPP_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
- return _Base::format(basic_string_view<_CharT>(__str, _Size), __ctx);
- }
-};
-
// Formatter std::string.
template <__fmt_char_type _CharT, class _Traits, class _Allocator>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
@@ -141,7 +130,7 @@
// Formatter std::string_view.
template <__fmt_char_type _CharT, class _Traits>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string_view<_CharT, _Traits>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<basic_string_view<_CharT, _Traits>, _CharT>
: public __formatter_string<_CharT> {
using _Base = __formatter_string<_CharT>;
@@ -152,7 +141,7 @@
}
};
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/formatter_tuple.h b/third_party/llvm-project/libcxx/include/__format/formatter_tuple.h
index 82f5ada..9d6367b 100644
--- a/third_party/llvm-project/libcxx/include/__format/formatter_tuple.h
+++ b/third_party/llvm-project/libcxx/include/__format/formatter_tuple.h
@@ -14,6 +14,7 @@
#include <__availability>
#include <__chrono/statically_widen.h>
#include <__config>
+#include <__format/buffer.h>
#include <__format/concepts.h>
#include <__format/format_args.h>
#include <__format/format_context.h>
@@ -35,50 +36,55 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <__fmt_char_type _CharT, class _Tuple, formattable<_CharT>... _Args>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_tuple {
- _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) {
+struct _LIBCPP_TEMPLATE_VIS __formatter_tuple {
+ _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
__separator_ = __separator;
}
_LIBCPP_HIDE_FROM_ABI constexpr void
- set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) {
+ set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) noexcept {
__opening_bracket_ = __opening_bracket;
__closing_bracket_ = __closing_bracket;
}
template <class _ParseContext>
_LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __parse_ctx) {
- const _CharT* __begin = __parser_.__parse(__parse_ctx, __format_spec::__fields_tuple);
+ auto __begin = __parser_.__parse(__parse_ctx, __format_spec::__fields_tuple);
- // [format.tuple]/7
- // ... For each element e in underlying_, if e.set_debug_format()
- // is a valid expression, calls e.set_debug_format().
- // TODO FMT this can be removed when P2733 is accepted.
- std::__for_each_index_sequence(make_index_sequence<sizeof...(_Args)>(), [&]<size_t _Index> {
- std::__set_debug_format(std::get<_Index>(__underlying_));
- });
-
- const _CharT* __end = __parse_ctx.end();
- if (__begin == __end)
- return __begin;
-
- if (*__begin == _CharT('m')) {
- if constexpr (sizeof...(_Args) == 2) {
- set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ": "));
+ auto __end = __parse_ctx.end();
+ if (__begin != __end) {
+ if (*__begin == _CharT('m')) {
+ if constexpr (sizeof...(_Args) == 2) {
+ set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ": "));
+ set_brackets({}, {});
+ ++__begin;
+ } else
+ std::__throw_format_error("The format specifier m requires a pair or a two-element tuple");
+ } else if (*__begin == _CharT('n')) {
set_brackets({}, {});
++__begin;
- } else
- std::__throw_format_error("The format specifier m requires a pair or a two-element tuple");
- } else if (*__begin == _CharT('n')) {
- set_brackets({}, {});
- ++__begin;
+ }
}
if (__begin != __end && *__begin != _CharT('}'))
std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ __parse_ctx.advance_to(__begin);
+
+ // [format.tuple]/7
+ // ... For each element e in underlying_, if e.set_debug_format()
+ // is a valid expression, calls e.set_debug_format().
+ std::__for_each_index_sequence(make_index_sequence<sizeof...(_Args)>(), [&]<size_t _Index> {
+ auto& __formatter = std::get<_Index>(__underlying_);
+ __formatter.parse(__parse_ctx);
+ // Unlike the range_formatter we don't guard against evil parsers. Since
+ // this format-spec never has a format-spec for the underlying type
+ // adding the test would give additional overhead.
+ std::__set_debug_format(__formatter);
+ });
+
return __begin;
}
@@ -91,26 +97,25 @@
if (!__specs.__has_width())
return __format_tuple(__tuple, __ctx);
- basic_string<_CharT> __str;
-
- // Since the output is written to a different iterator a new context is
- // created. Since the underlying formatter uses the default formatting it
- // doesn't need a locale or the formatting arguments. So creating a new
- // context works.
- //
- // This solution works for this formatter, but it will not work for the
- // range_formatter. In that patch a generic solution is work in progress.
- // Once that is finished it can be used here. (The range_formatter will use
- // these features so it's easier to add it there and then port it.)
- //
- // TODO FMT Use formatting wrapping used in the range_formatter.
- basic_format_context __c = std::__format_context_create(
- back_insert_iterator{__str},
- basic_format_args<basic_format_context<back_insert_iterator<basic_string<_CharT>>, _CharT>>{});
+ // The size of the buffer needed is:
+ // - open bracket characters
+ // - close bracket character
+ // - n elements where every element may have a different size
+ // - (n -1) separators
+ // The size of the element is hard to predict, knowing the type helps but
+ // it depends on the format-spec. As an initial estimate we guess 6
+ // characters.
+ // Typically both brackets are 1 character and the separator is 2
+ // characters. Which means there will be
+ // (n - 1) * 2 + 1 + 1 = n * 2 character
+ // So estimate 8 times the range size as buffer.
+ __format::__retarget_buffer<_CharT> __buffer{8 * tuple_size_v<_Tuple>};
+ basic_format_context<typename __format::__retarget_buffer<_CharT>::__iterator, _CharT> __c{
+ __buffer.__make_output_iterator(), __ctx};
__format_tuple(__tuple, __c);
- return __formatter::__write_string_no_precision(basic_string_view{__str}, __ctx.out(), __specs);
+ return __formatter::__write_string_no_precision(basic_string_view{__buffer.__view()}, __ctx.out(), __specs);
}
template <class _FormatContext>
@@ -120,35 +125,7 @@
std::__for_each_index_sequence(make_index_sequence<sizeof...(_Args)>(), [&]<size_t _Index> {
if constexpr (_Index)
__ctx.advance_to(std::ranges::copy(__separator_, __ctx.out()).out);
-
- // During review Victor suggested to make the exposition only
- // __underlying_ member a local variable. Currently the Standard
- // requires nested debug-enabled formatter specializations not to
- // output escaped output. P2733 fixes that bug, once accepted the
- // code below can be used.
- // (Note when a paper allows parsing a tuple-underlying-spec the
- // exposition only member needs to be a class member. Earlier
- // revisions of P2286 proposed that, but this was not pursued,
- // due to time constrains and complexity of the matter.)
- // TODO FMT This can be updated after P2733 is accepted.
-# if 0
- // P2286 uses an exposition only member in the formatter
- // tuple<formatter<remove_cvref_t<_Args>, _CharT>...> __underlying_;
- // This was used in earlier versions of the paper since
- // __underlying_.parse(...) was called. This is no longer the case
- // so we can reduce the scope of the formatter.
- //
- // It does require the underlying's parse effect to be moved here too.
- using _Arg = tuple_element<_Index, decltype(__tuple)>;
- formatter<remove_cvref_t<_Args>, _CharT> __underlying;
-
- // [format.tuple]/7
- // ... For each element e in underlying_, if e.set_debug_format()
- // is a valid expression, calls e.set_debug_format().
- std::__set_debug_format(__underlying);
-# else
__ctx.advance_to(std::get<_Index>(__underlying_).format(std::get<_Index>(__tuple), __ctx));
-# endif
});
return std::ranges::copy(__closing_bracket_, __ctx.out()).out;
@@ -164,14 +141,14 @@
};
template <__fmt_char_type _CharT, formattable<_CharT>... _Args>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<pair<_Args...>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<pair<_Args...>, _CharT>
: public __formatter_tuple<_CharT, pair<_Args...>, _Args...> {};
template <__fmt_char_type _CharT, formattable<_CharT>... _Args>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<tuple<_Args...>, _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<tuple<_Args...>, _CharT>
: public __formatter_tuple<_CharT, tuple<_Args...>, _Args...> {};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/parser_std_format_spec.h b/third_party/llvm-project/libcxx/include/__format/parser_std_format_spec.h
index c03cec9..620ce4f 100644
--- a/third_party/llvm-project/libcxx/include/__format/parser_std_format_spec.h
+++ b/third_party/llvm-project/libcxx/include/__format/parser_std_format_spec.h
@@ -28,11 +28,13 @@
#include <__format/format_parse_context.h>
#include <__format/format_string.h>
#include <__format/unicode.h>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h> // iter_value_t
+#include <__type_traits/common_type.h>
+#include <__type_traits/is_trivially_copyable.h>
#include <__variant/monostate.h>
-#include <bit>
#include <cstdint>
#include <string_view>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -43,13 +45,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __format_spec {
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result< _CharT>
-__parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result<_Iterator>
+__parse_arg_id(_Iterator __begin, _Iterator __end, auto& __parse_ctx) {
+ using _CharT = iter_value_t<_Iterator>;
// This function is a wrapper to call the real parser. But it does the
// validation for the pre-conditions and post-conditions.
if (__begin == __end)
@@ -57,10 +60,10 @@
__format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __parse_ctx);
- if (__r.__ptr == __end || *__r.__ptr != _CharT('}'))
+ if (__r.__last == __end || *__r.__last != _CharT('}'))
std::__throw_format_error("Invalid arg-id");
- ++__r.__ptr;
+ ++__r.__last;
return __r;
}
@@ -78,22 +81,33 @@
return _VSTD::__visit_format_arg(
[](auto __arg) -> uint32_t {
using _Type = decltype(__arg);
- if constexpr (integral<_Type>) {
+ if constexpr (same_as<_Type, monostate>)
+ std::__throw_format_error("Argument index out of bounds");
+
+ // [format.string.std]/8
+ // If { arg-idopt } is used in a width or precision, the value of the
+ // corresponding formatting argument is used in its place. If the
+ // corresponding formatting argument is not of standard signed or unsigned
+ // integer type, or its value is negative for precision or non-positive for
+ // width, an exception of type format_error is thrown.
+ //
+ // When an integral is used in a format function, it is stored as one of
+ // the types checked below. Other integral types are promoted. For example,
+ // a signed char is stored as an int.
+ if constexpr (same_as<_Type, int> || same_as<_Type, unsigned int> || //
+ same_as<_Type, long long> || same_as<_Type, unsigned long long>) {
if constexpr (signed_integral<_Type>) {
if (__arg < 0)
std::__throw_format_error("A format-spec arg-id replacement shouldn't have a negative value");
}
using _CT = common_type_t<_Type, decltype(__format::__number_max)>;
- if (static_cast<_CT>(__arg) >
- static_cast<_CT>(__format::__number_max))
+ if (static_cast<_CT>(__arg) > static_cast<_CT>(__format::__number_max))
std::__throw_format_error("A format-spec arg-id replacement exceeds the maximum supported value");
return __arg;
- } else if constexpr (same_as<_Type, monostate>)
- std::__throw_format_error("Argument index out of bounds");
- else
- std::__throw_format_error("A format-spec arg-id replacement argument isn't an integral type");
+ } else
+ std::__throw_format_error("Replacement argument isn't a standard signed or unsigned integer type");
},
__format_arg);
}
@@ -116,7 +130,7 @@
// formatters use the colon to mark the beginning of the
// underlying-format-spec. To avoid parsing ambiguities these formatter
// specializations prohibit the use of the colon as a fill character.
- uint8_t __allow_colon_in_fill_ : 1 {false};
+ uint8_t __use_range_fill_ : 1 {false};
};
// By not placing this constant in the formatter class it's not duplicated for
@@ -137,9 +151,10 @@
inline constexpr __fields __fields_string{.__precision_ = true, .__type_ = true};
inline constexpr __fields __fields_pointer{.__type_ = true};
-# if _LIBCPP_STD_VER > 20
-inline constexpr __fields __fields_tuple{.__type_ = false, .__allow_colon_in_fill_ = true};
-inline constexpr __fields __fields_range{.__type_ = false, .__allow_colon_in_fill_ = true};
+# if _LIBCPP_STD_VER >= 23
+inline constexpr __fields __fields_tuple{.__use_range_fill_ = true};
+inline constexpr __fields __fields_range{.__use_range_fill_ = true};
+inline constexpr __fields __fields_fill_align_width{};
# endif
enum class _LIBCPP_ENUM_VIS __alignment : uint8_t {
@@ -196,6 +211,7 @@
struct __chrono {
__alignment __alignment_ : 3;
bool __locale_specific_form_ : 1;
+ bool __hour_ : 1;
bool __weekday_name_ : 1;
bool __weekday_ : 1;
bool __day_of_year_ : 1;
@@ -268,12 +284,12 @@
_LIBCPP_HIDE_FROM_ABI constexpr auto __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields)
-> decltype(__parse_ctx.begin()) {
- const _CharT* __begin = __parse_ctx.begin();
- const _CharT* __end = __parse_ctx.end();
+ auto __begin = __parse_ctx.begin();
+ auto __end = __parse_ctx.end();
if (__begin == __end)
return __begin;
- if (__parse_fill_align(__begin, __end, __fields.__allow_colon_in_fill_) && __begin == __end)
+ if (__parse_fill_align(__begin, __end, __fields.__use_range_fill_) && __begin == __end)
return __begin;
if (__fields.__sign_ && __parse_sign(__begin) && __begin == __end)
@@ -326,6 +342,7 @@
.__chrono_ =
__chrono{.__alignment_ = __alignment_,
.__locale_specific_form_ = __locale_specific_form_,
+ .__hour_ = __hour_,
.__weekday_name_ = __weekday_name_,
.__weekday_ = __weekday_,
.__day_of_year_ = __day_of_year_,
@@ -345,6 +362,8 @@
// These flags are only used for formatting chrono. Since the struct has
// padding space left it's added to this structure.
+ bool __hour_ : 1 {false};
+
bool __weekday_name_ : 1 {false};
bool __weekday_ : 1 {false};
@@ -353,7 +372,7 @@
bool __month_name_ : 1 {false};
- uint8_t __reserved_1_ : 3 {0};
+ uint8_t __reserved_1_ : 2 {0};
uint8_t __reserved_2_ : 6 {0};
// These two flags are only used internally and not part of the
// __parsed_specifications. Therefore put them at the end.
@@ -391,8 +410,8 @@
}
// range-fill and tuple-fill are identical
- _LIBCPP_HIDE_FROM_ABI constexpr bool
- __parse_fill_align(const _CharT*& __begin, const _CharT* __end, bool __use_range_fill) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
_LIBCPP_ASSERT(__begin != __end, "when called with an empty input the function will cause "
"undefined behavior by evaluating data not in the input");
if (__begin + 1 != __end) {
@@ -415,7 +434,8 @@
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_sign(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_sign(_Iterator& __begin) {
switch (*__begin) {
case _CharT('-'):
__sign_ = __sign::__minus;
@@ -433,7 +453,8 @@
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alternate_form(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alternate_form(_Iterator& __begin) {
if (*__begin != _CharT('#'))
return false;
@@ -442,7 +463,8 @@
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_zero_padding(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_zero_padding(_Iterator& __begin) {
if (*__begin != _CharT('0'))
return false;
@@ -452,7 +474,8 @@
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(const _CharT*& __begin, const _CharT* __end, auto& __parse_ctx) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(_Iterator& __begin, _Iterator __end, auto& __parse_ctx) {
if (*__begin == _CharT('0'))
std::__throw_format_error("A format-spec width field shouldn't have a leading zero");
@@ -460,7 +483,7 @@
__format::__parse_number_result __r = __format_spec::__parse_arg_id(++__begin, __end, __parse_ctx);
__width_as_arg_ = true;
__width_ = __r.__value;
- __begin = __r.__ptr;
+ __begin = __r.__last;
return true;
}
@@ -471,12 +494,12 @@
__width_ = __r.__value;
_LIBCPP_ASSERT(__width_ != 0, "A zero value isn't allowed and should be impossible, "
"due to validations in this function");
- __begin = __r.__ptr;
+ __begin = __r.__last;
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_precision(const _CharT*& __begin, const _CharT* __end,
- auto& __parse_ctx) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_precision(_Iterator& __begin, _Iterator __end, auto& __parse_ctx) {
if (*__begin != _CharT('.'))
return false;
@@ -488,7 +511,7 @@
__format::__parse_number_result __arg_id = __format_spec::__parse_arg_id(++__begin, __end, __parse_ctx);
__precision_as_arg_ = true;
__precision_ = __arg_id.__value;
- __begin = __arg_id.__ptr;
+ __begin = __arg_id.__last;
return true;
}
@@ -498,11 +521,12 @@
__format::__parse_number_result __r = __format::__parse_number(__begin, __end);
__precision_ = __r.__value;
__precision_as_arg_ = false;
- __begin = __r.__ptr;
+ __begin = __r.__last;
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_locale_specific_form(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_locale_specific_form(_Iterator& __begin) {
if (*__begin != _CharT('L'))
return false;
@@ -511,7 +535,8 @@
return true;
}
- _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(const _CharT*& __begin) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(_Iterator& __begin) {
// Determines the type. It does not validate whether the selected type is
// valid. Most formatters have optional fields that are only allowed for
// certain types. These parsers need to do validation after the type has
@@ -569,7 +594,7 @@
case 'x':
__type_ = __type::__hexadecimal_lower_case;
break;
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
case '?':
__type_ = __type::__debug;
break;
@@ -734,18 +759,18 @@
}
}
-template <class _CharT>
+template <contiguous_iterator _Iterator>
struct __column_width_result {
/// The number of output columns.
size_t __width_;
/// One beyond the last code unit used in the estimation.
///
/// This limits the original output to fit in the wanted number of columns.
- const _CharT* __last_;
+ _Iterator __last_;
};
-template <class _CharT>
-__column_width_result(size_t, const _CharT*) -> __column_width_result<_CharT>;
+template <contiguous_iterator _Iterator>
+__column_width_result(size_t, _Iterator) -> __column_width_result<_Iterator>;
/// Since a column width can be two it's possible that the requested column
/// width can't be achieved. Depending on the intended usage the policy can be
@@ -812,12 +837,13 @@
return __detail::__column_width_4(__c);
}
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width_grapheme_clustering(
- const _CharT* __first, const _CharT* __last, size_t __maximum, __column_width_rounding __rounding) noexcept {
+template <contiguous_iterator _Iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_Iterator> __estimate_column_width_grapheme_clustering(
+ _Iterator __first, _Iterator __last, size_t __maximum, __column_width_rounding __rounding) noexcept {
+ using _CharT = iter_value_t<_Iterator>;
__unicode::__extended_grapheme_cluster_view<_CharT> __view{__first, __last};
- __column_width_result<_CharT> __result{0, __first};
+ __column_width_result<_Iterator> __result{0, __first};
while (__result.__last_ != __last && __result.__width_ <= __maximum) {
typename __unicode::__extended_grapheme_cluster_view<_CharT>::__cluster __cluster = __view.__consume();
int __width = __detail::__column_width(__cluster.__code_point_);
@@ -884,8 +910,8 @@
/// \param __rounding Selects the rounding method.
/// \c __down result.__width_ <= __maximum
/// \c __up result.__width_ <= __maximum + 1
-template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width(
+template <class _CharT, class _Iterator = typename basic_string_view<_CharT>::const_iterator>
+_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_Iterator> __estimate_column_width(
basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding __rounding) noexcept {
// The width estimation is done in two steps:
// - Quickly process for the ASCII part. ASCII has the following properties
@@ -904,7 +930,7 @@
// need to scan one code unit beyond the requested precision. When this code
// unit is non-ASCII we omit the current code unit and let the Grapheme
// clustering algorithm do its work.
- const _CharT* __it = __str.begin();
+ auto __it = __str.begin();
if (__format_spec::__is_ascii(*__it)) {
do {
--__maximum;
@@ -932,7 +958,7 @@
}
# else // !defined(_LIBCPP_HAS_NO_UNICODE)
template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT>
+_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<typename basic_string_view<_CharT>::const_iterator>
__estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding) noexcept {
// When Unicode isn't supported assume ASCII and every code unit is one code
// point. In ASCII the estimated column width is always one. Thus there's no
@@ -945,7 +971,7 @@
} // namespace __format_spec
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/range_default_formatter.h b/third_party/llvm-project/libcxx/include/__format/range_default_formatter.h
index 774887b..3954f98 100644
--- a/third_party/llvm-project/libcxx/include/__format/range_default_formatter.h
+++ b/third_party/llvm-project/libcxx/include/__format/range_default_formatter.h
@@ -14,6 +14,7 @@
# pragma GCC system_header
#endif
+#include <__algorithm/ranges_copy.h>
#include <__availability>
#include <__chrono/statically_widen.h>
#include <__concepts/same_as.h>
@@ -21,7 +22,10 @@
#include <__format/concepts.h>
#include <__format/formatter.h>
#include <__format/range_formatter.h>
+#include <__iterator/back_insert_iterator.h>
#include <__ranges/concepts.h>
+#include <__ranges/data.h>
+#include <__ranges/size.h>
#include <__type_traits/remove_cvref.h>
#include <__utility/pair.h>
#include <string_view>
@@ -29,7 +33,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Rp, class _CharT>
concept __const_formattable_range =
@@ -83,40 +87,23 @@
return range_format::sequence;
}();
-// This is a non-standard work-around to fix instantiation of
-// formatter<const _CharT[N], _CharT>
-// const _CharT[N] satisfies the ranges::input_range concept.
-// remove_cvref_t<const _CharT[N]> is _CharT[N] so it does not satisfy the
-// requirement of the above specialization. Instead it will instantiate the
-// primary template, which is ill-formed.
-//
-// An alternative solution is to remove the offending formatter.
-//
-// https://godbolt.org/z/bqjhhaexx
-//
-// The removal is proposed in LWG3833, but use the work-around until the issue
-// has been adopted.
-// TODO FMT Implement LWG3833.
-template <class _CharT, size_t N>
-inline constexpr range_format format_kind<const _CharT[N]> = range_format::disabled;
-
template <range_format _Kp, ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter;
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter;
// Required specializations
template <ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<range_format::sequence, _Rp, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<range_format::sequence, _Rp, _CharT> {
private:
using __maybe_const_r = __fmt_maybe_const<_Rp, _CharT>;
range_formatter<remove_cvref_t<ranges::range_reference_t<__maybe_const_r>>, _CharT> __underlying_;
public:
- _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) {
+ _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
__underlying_.set_separator(__separator);
}
_LIBCPP_HIDE_FROM_ABI constexpr void
- set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) {
+ set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) noexcept {
__underlying_.set_brackets(__opening_bracket, __closing_bracket);
}
@@ -132,7 +119,7 @@
};
template <ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<range_format::map, _Rp, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<range_format::map, _Rp, _CharT> {
private:
using __maybe_const_map = __fmt_maybe_const<_Rp, _CharT>;
using __element_type = remove_cvref_t<ranges::range_reference_t<__maybe_const_map>>;
@@ -160,7 +147,7 @@
};
template <ranges::input_range _Rp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<range_format::set, _Rp, _CharT> {
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<range_format::set, _Rp, _CharT> {
private:
using __maybe_const_set = __fmt_maybe_const<_Rp, _CharT>;
using __element_type = remove_cvref_t<ranges::range_reference_t<__maybe_const_set>>;
@@ -185,16 +172,48 @@
template <range_format _Kp, ranges::input_range _Rp, class _CharT>
requires(_Kp == range_format::string || _Kp == range_format::debug_string)
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __range_default_formatter<_Kp, _Rp, _CharT> {
- __range_default_formatter() = delete; // TODO FMT Implement
+struct _LIBCPP_TEMPLATE_VIS __range_default_formatter<_Kp, _Rp, _CharT> {
+private:
+ // This deviates from the Standard, there the exposition only type is
+ // formatter<basic_string<charT>, charT> underlying_;
+ // Using a string_view allows the format function to avoid a copy of the
+ // input range when it is a contigious range.
+ formatter<basic_string_view<_CharT>, _CharT> __underlying_;
+
+public:
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) {
+ typename _ParseContext::iterator __i = __underlying_.parse(__ctx);
+ if constexpr (_Kp == range_format::debug_string)
+ __underlying_.set_debug_format();
+ return __i;
+ }
+
+ template <class _FormatContext>
+ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+ format(conditional_t<ranges::input_range<const _Rp>, const _Rp&, _Rp&> __range, _FormatContext& __ctx) const {
+ // When the range is contiguous use a basic_string_view instead to avoid a
+ // copy of the underlying data. The basic_string_view formatter
+ // specialization is the "basic" string formatter in libc++.
+ if constexpr (ranges::contiguous_range<_Rp> && std::ranges::sized_range<_Rp>)
+ return __underlying_.format(basic_string_view<_CharT>{ranges::data(__range), ranges::size(__range)}, __ctx);
+ else {
+ // P2106's from_range has not been implemented yet. Instead use a simple
+ // copy operation.
+ // TODO FMT use basic_string's "from_range" constructor.
+ // return __underlying_.format(basic_string<_CharT>{from_range, __range}, __ctx);
+ basic_string<_CharT> __str;
+ std::ranges::copy(__range, back_insert_iterator{__str});
+ return __underlying_.format(static_cast<basic_string_view<_CharT>>(__str), __ctx);
+ }
+ }
};
template <ranges::input_range _Rp, class _CharT>
requires(format_kind<_Rp> != range_format::disabled && formattable<ranges::range_reference_t<_Rp>, _CharT>)
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_Rp, _CharT>
- : __range_default_formatter<format_kind<_Rp>, _Rp, _CharT> {};
+struct _LIBCPP_TEMPLATE_VIS formatter<_Rp, _CharT> : __range_default_formatter<format_kind<_Rp>, _Rp, _CharT> {};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/range_formatter.h b/third_party/llvm-project/libcxx/include/__format/range_formatter.h
index 9ea61a7..0af233e 100644
--- a/third_party/llvm-project/libcxx/include/__format/range_formatter.h
+++ b/third_party/llvm-project/libcxx/include/__format/range_formatter.h
@@ -36,49 +36,78 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp, class _CharT = char>
requires same_as<remove_cvref_t<_Tp>, _Tp> && formattable<_Tp, _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT range_formatter {
- _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) {
+struct _LIBCPP_TEMPLATE_VIS range_formatter {
+ _LIBCPP_HIDE_FROM_ABI constexpr void set_separator(basic_string_view<_CharT> __separator) noexcept {
__separator_ = __separator;
}
_LIBCPP_HIDE_FROM_ABI constexpr void
- set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) {
+ set_brackets(basic_string_view<_CharT> __opening_bracket, basic_string_view<_CharT> __closing_bracket) noexcept {
__opening_bracket_ = __opening_bracket;
__closing_bracket_ = __closing_bracket;
}
- _LIBCPP_HIDE_FROM_ABI constexpr formatter<_Tp, _CharT>& underlying() { return __underlying_; }
- _LIBCPP_HIDE_FROM_ABI constexpr const formatter<_Tp, _CharT>& underlying() const { return __underlying_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr formatter<_Tp, _CharT>& underlying() noexcept { return __underlying_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr const formatter<_Tp, _CharT>& underlying() const noexcept { return __underlying_; }
template <class _ParseContext>
_LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __parse_ctx) {
- const _CharT* __begin = __parser_.__parse(__parse_ctx, __format_spec::__fields_range);
- const _CharT* __end = __parse_ctx.end();
- if (__begin == __end)
- return __begin;
+ auto __begin = __parser_.__parse(__parse_ctx, __format_spec::__fields_range);
+ auto __end = __parse_ctx.end();
+ // Note the cases where __begin == __end in this code only happens when the
+ // replacement-field has no terminating }, or when the parse is manually
+ // called with a format-spec. The former is an error and the latter means
+ // using a formatter without the format functions or print.
+ if (__begin == __end) [[unlikely]]
+ return __parse_empty_range_underlying_spec(__parse_ctx, __begin);
// The n field overrides a possible m type, therefore delay applying the
// effect of n until the type has been procesed.
bool __clear_brackets = (*__begin == _CharT('n'));
if (__clear_brackets) {
++__begin;
- if (__begin == __end) {
+ if (__begin == __end) [[unlikely]] {
// Since there is no more data, clear the brackets before returning.
set_brackets({}, {});
- return __begin;
+ return __parse_empty_range_underlying_spec(__parse_ctx, __begin);
}
}
__parse_type(__begin, __end);
if (__clear_brackets)
set_brackets({}, {});
- if (__begin == __end)
- return __begin;
+ if (__begin == __end) [[unlikely]]
+ return __parse_empty_range_underlying_spec(__parse_ctx, __begin);
bool __has_range_underlying_spec = *__begin == _CharT(':');
+ if (__has_range_underlying_spec) {
+ // range-underlying-spec:
+ // : format-spec
+ ++__begin;
+ } else if (__begin != __end && *__begin != _CharT('}'))
+ // When there is no underlaying range the current parse should have
+ // consumed the format-spec. If not, the not consumed input will be
+ // processed by the underlying. For example {:-} for a range in invalid,
+ // the sign field is not present. Without this check the underlying_ will
+ // get -} as input which my be valid.
+ std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+
+ __parse_ctx.advance_to(__begin);
+ __begin = __underlying_.parse(__parse_ctx);
+
+ // This test should not be required if __has_range_underlying_spec is false.
+ // However this test makes sure the underlying formatter left the parser in
+ // a valid state. (Note this is not a full protection against evil parsers.
+ // For example
+ // } this is test for the next argument {}
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
+ // could consume more than it should.
+ if (__begin != __end && *__begin != _CharT('}'))
+ std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+
if (__parser_.__type_ != __format_spec::__type::__default) {
// [format.range.formatter]/6
// If the range-type is s or ?s, then there shall be no n option and no
@@ -96,20 +125,6 @@
} else if (!__has_range_underlying_spec)
std::__set_debug_format(__underlying_);
- if (__has_range_underlying_spec) {
- // range-underlying-spec:
- // : format-spec
- ++__begin;
- if (__begin == __end)
- return __begin;
-
- __parse_ctx.advance_to(__begin);
- __begin = __underlying_.parse(__parse_ctx);
- }
-
- if (__begin != __end && *__begin != _CharT('}'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
-
return __begin;
}
@@ -211,7 +226,8 @@
__format_spec::__parser<_CharT> __parser_{.__alignment_ = __format_spec::__alignment::__left};
private:
- _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(const _CharT*& __begin, const _CharT* __end) {
+ template <contiguous_iterator _Iterator>
+ _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(_Iterator& __begin, _Iterator __end) {
switch (*__begin) {
case _CharT('m'):
if constexpr (__fmt_pair_like<_Tp>) {
@@ -242,13 +258,23 @@
}
}
+ template <class _ParseContext>
+ _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator
+ __parse_empty_range_underlying_spec(_ParseContext& __parse_ctx, typename _ParseContext::iterator __begin) {
+ __parse_ctx.advance_to(__begin);
+ [[maybe_unused]] typename _ParseContext::iterator __result = __underlying_.parse(__parse_ctx);
+ _LIBCPP_ASSERT(__result == __begin,
+ "the underlying's parse function should not advance the input beyond the end of the input");
+ return __begin;
+ }
+
formatter<_Tp, _CharT> __underlying_;
basic_string_view<_CharT> __separator_ = _LIBCPP_STATICALLY_WIDEN(_CharT, ", ");
basic_string_view<_CharT> __opening_bracket_ = _LIBCPP_STATICALLY_WIDEN(_CharT, "[");
basic_string_view<_CharT> __closing_bracket_ = _LIBCPP_STATICALLY_WIDEN(_CharT, "]");
};
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__format/unicode.h b/third_party/llvm-project/libcxx/include/__format/unicode.h
index 4327258..12aed50 100644
--- a/third_party/llvm-project/libcxx/include/__format/unicode.h
+++ b/third_party/llvm-project/libcxx/include/__format/unicode.h
@@ -11,11 +11,15 @@
#define _LIBCPP___FORMAT_UNICODE_H
#include <__assert>
+#include <__bit/countl.h>
+#include <__concepts/same_as.h>
#include <__config>
#include <__format/extended_grapheme_cluster_table.h>
+#include <__iterator/concepts.h>
+#include <__iterator/readable_traits.h> // iter_value_t
#include <__type_traits/make_unsigned.h>
#include <__utility/unreachable.h>
-#include <bit>
+#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -23,27 +27,32 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __unicode {
-# if _LIBCPP_STD_VER > 20
+// Helper struct for the result of a consume operation.
+//
+// The status value for a correct code point is 0. This allows a valid value to
+// be used without masking.
+// When the decoding fails it know the number of code units affected. For the
+// current use-cases that value is not needed, therefore it is not stored.
+// The escape routine needs the number of code units for both a valid and
+// invalid character and keeps track of it itself. Doing it in this result
+// unconditionally would give some overhead when the value is unneeded.
+struct __consume_result {
+ // When __status == __ok it contains the decoded code point.
+ // Else it contains the replacement character U+FFFD
+ char32_t __code_point : 31;
-/// The result of consuming a code point using P2286' semantics
-///
-/// TODO FMT Combine __consume and __consume_p2286 in one function.
-struct __consume_p2286_result {
- // A size of 0 means well formed. This to differenciate between
- // a valid code point and a code unit that's invalid like 0b11111xxx.
- int __ill_formed_size;
-
- // If well formed the consumed code point.
- // Otherwise the ill-formed code units as unsigned 8-bit values. They are
- // stored in reverse order, to make it easier to extract the values.
- char32_t __value;
+ enum : char32_t {
+ // Consumed a well-formed code point.
+ __ok = 0,
+ // Encountered invalid UTF-8
+ __error = 1
+ } __status : 1 {__ok};
};
-
-# endif // _LIBCPP_STD_VER > 20
+static_assert(sizeof(__consume_result) == sizeof(char32_t));
# ifndef _LIBCPP_HAS_NO_UNICODE
@@ -62,7 +71,39 @@
inline constexpr char32_t __replacement_character = U'\ufffd';
-_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(const char* __char, int __count) {
+// The error of a consume operation.
+//
+// This sets the code point to the replacement character. This code point does
+// not participate in the grapheme clustering, so grapheme clustering code can
+// ignore the error status and always use the code point.
+inline constexpr __consume_result __consume_result_error{__replacement_character, __consume_result::__error};
+
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __is_high_surrogate(char32_t __value) {
+ return __value >= 0xd800 && __value <= 0xdbff;
+}
+
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __is_low_surrogate(char32_t __value) {
+ return __value >= 0xdc00 && __value <= 0xdfff;
+}
+
+// https://www.unicode.org/glossary/#surrogate_code_point
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool __is_surrogate(char32_t __value) {
+ return __value >= 0xd800 && __value <= 0xdfff;
+}
+
+// https://www.unicode.org/glossary/#code_point
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool __is_code_point(char32_t __value) {
+ return __value <= 0x10ffff;
+}
+
+// https://www.unicode.org/glossary/#unicode_scalar_value
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool __is_scalar_value(char32_t __value) {
+ return __unicode::__is_code_point(__value) && !__unicode::__is_surrogate(__value);
+}
+
+template <contiguous_iterator _Iterator>
+ requires same_as<iter_value_t<_Iterator>, char>
+_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(_Iterator __char, int __count) {
do {
if ((*__char & 0b1000'0000) != 0b1000'0000)
return false;
@@ -82,68 +123,38 @@
/// UTF-8 specialization.
template <>
class __code_point_view<char> {
+ using _Iterator = basic_string_view<char>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const char* __first, const char* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(_Iterator __first, _Iterator __last)
: __first_(__first), __last_(__last) {}
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
- _LIBCPP_HIDE_FROM_ABI constexpr const char* __position() const noexcept { return __first_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
- _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
-
- // Based on the number of leading 1 bits the number of code units in the
- // code point can be determined. See
- // https://en.wikipedia.org/wiki/UTF-8#Encoding
- switch (_VSTD::countl_one(static_cast<unsigned char>(*__first_))) {
- case 0:
- return *__first_++;
-
- case 2:
- if (__last_ - __first_ < 2 || !__unicode::__is_continuation(__first_ + 1, 1)) [[unlikely]]
- break;
- else {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x1f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return __value;
- }
-
- case 3:
- if (__last_ - __first_ < 3 || !__unicode::__is_continuation(__first_ + 1, 2)) [[unlikely]]
- break;
- else {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x0f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return __value;
- }
-
- case 4:
- if (__last_ - __first_ < 4 || !__unicode::__is_continuation(__first_ + 1, 3)) [[unlikely]]
- break;
- else {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x07;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return __value;
- }
- }
- // An invalid number of leading ones can be garbage or a code unit in the
- // middle of a code point. By consuming one code unit the parser may get
- // "in sync" after a few code units.
- ++__first_;
- return __replacement_character;
- }
-
-# if _LIBCPP_STD_VER > 20
- _LIBCPP_HIDE_FROM_ABI constexpr __consume_p2286_result __consume_p2286() noexcept {
+ // https://www.unicode.org/versions/latest/ch03.pdf#G7404
+ // Based on Table 3-7, Well-Formed UTF-8 Byte Sequences
+ //
+ // Code Points First Byte Second Byte Third Byte Fourth Byte Remarks
+ // U+0000..U+007F 00..7F U+0000..U+007F 1 code unit range
+ // C0..C1 80..BF invalid overlong encoding
+ // U+0080..U+07FF C2..DF 80..BF U+0080..U+07FF 2 code unit range
+ // E0 80..9F 80..BF invalid overlong encoding
+ // U+0800..U+0FFF E0 A0..BF 80..BF U+0800..U+FFFF 3 code unit range
+ // U+1000..U+CFFF E1..EC 80..BF 80..BF
+ // U+D000..U+D7FF ED 80..9F 80..BF
+ // U+D800..U+DFFF ED A0..BF 80..BF invalid encoding of surrogate code point
+ // U+E000..U+FFFF EE..EF 80..BF 80..BF
+ // F0 80..8F 80..BF 80..BF invalid overlong encoding
+ // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF U+10000..U+10FFFF 4 code unit range
+ // U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF
+ // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF
+ // F4 90..BF 80..BF 80..BF U+110000.. invalid code point range
+ //
+ // Unlike other parsers, these invalid entries are tested after decoding.
+ // - The parser always needs to consume these code units
+ // - The code is optimized for well-formed UTF-8
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
_LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
// Based on the number of leading 1 bits the number of code units in the
@@ -151,64 +162,77 @@
// https://en.wikipedia.org/wiki/UTF-8#Encoding
switch (std::countl_one(static_cast<unsigned char>(*__first_))) {
case 0:
- return {0, static_cast<unsigned char>(*__first_++)};
+ return {static_cast<unsigned char>(*__first_++)};
- case 2:
- if (__last_ - __first_ < 2) [[unlikely]]
+ case 2: {
+ if (__last_ - __first_ < 2 || !__unicode::__is_continuation(__first_ + 1, 1)) [[unlikely]]
break;
- if (__unicode::__is_continuation(__first_ + 1, 1)) {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x1f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return {0, __value};
- }
- break;
+ char32_t __value = static_cast<unsigned char>(*__first_++) & 0x1f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- case 3:
- if (__last_ - __first_ < 3) [[unlikely]]
+ // These values should be encoded in 1 UTF-8 code unit.
+ if (__value < 0x0080) [[unlikely]]
+ return __consume_result_error;
+
+ return {__value};
+ }
+
+ case 3: {
+ if (__last_ - __first_ < 3 || !__unicode::__is_continuation(__first_ + 1, 2)) [[unlikely]]
break;
- if (__unicode::__is_continuation(__first_ + 1, 2)) {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x0f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- return {0, __value};
- }
- break;
+ char32_t __value = static_cast<unsigned char>(*__first_++) & 0x0f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- case 4:
- if (__last_ - __first_ < 4) [[unlikely]]
+ // These values should be encoded in 1 or 2 UTF-8 code units.
+ if (__value < 0x0800) [[unlikely]]
+ return __consume_result_error;
+
+ // A surrogate value is always encoded in 3 UTF-8 code units.
+ if (__unicode::__is_surrogate(__value)) [[unlikely]]
+ return __consume_result_error;
+
+ return {__value};
+ }
+
+ case 4: {
+ if (__last_ - __first_ < 4 || !__unicode::__is_continuation(__first_ + 1, 3)) [[unlikely]]
break;
- if (__unicode::__is_continuation(__first_ + 1, 3)) {
- char32_t __value = static_cast<unsigned char>(*__first_++) & 0x07;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- __value <<= 6;
- __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ char32_t __value = static_cast<unsigned char>(*__first_++) & 0x07;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
+ __value <<= 6;
+ __value |= static_cast<unsigned char>(*__first_++) & 0x3f;
- if (__value > 0x10FFFF) // Outside the valid Unicode range?
- return {4, __value};
+ // These values should be encoded in 1, 2, or 3 UTF-8 code units.
+ if (__value < 0x10000) [[unlikely]]
+ return __consume_result_error;
- return {0, __value};
- }
- break;
+ // A value too large is always encoded in 4 UTF-8 code units.
+ if (!__unicode::__is_code_point(__value)) [[unlikely]]
+ return __consume_result_error;
+
+ return {__value};
+ }
}
// An invalid number of leading ones can be garbage or a code unit in the
// middle of a code point. By consuming one code unit the parser may get
// "in sync" after a few code units.
- return {1, static_cast<unsigned char>(*__first_++)};
+ ++__first_;
+ return __consume_result_error;
}
-# endif // _LIBCPP_STD_VER > 20
private:
- const char* __first_;
- const char* __last_;
+ _Iterator __first_;
+ _Iterator __last_;
};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -225,75 +249,48 @@
/// - 4 UTF-32 (for example Linux)
template <>
class __code_point_view<wchar_t> {
+ using _Iterator = typename basic_string_view<wchar_t>::const_iterator;
+
public:
static_assert(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4, "sizeof(wchar_t) has a not implemented value");
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const wchar_t* __first, const wchar_t* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(_Iterator __first, _Iterator __last)
: __first_(__first), __last_(__last) {}
- _LIBCPP_HIDE_FROM_ABI constexpr const wchar_t* __position() const noexcept { return __first_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
- _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
_LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ char32_t __value = static_cast<char32_t>(*__first_++);
if constexpr (sizeof(wchar_t) == 2) {
- char32_t __result = *__first_++;
- // Is the code unit part of a surrogate pair? See
- // https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF
- if (__result >= 0xd800 && __result <= 0xDfff) {
- // Malformed Unicode.
- if (__first_ == __last_) [[unlikely]]
- return __replacement_character;
+ if (__unicode::__is_low_surrogate(__value)) [[unlikely]]
+ return __consume_result_error;
- __result -= 0xd800;
- __result <<= 10;
- __result += *__first_++ - 0xdc00;
- __result += 0x10000;
+ if (__unicode::__is_high_surrogate(__value)) {
+ if (__first_ == __last_ || !__unicode::__is_low_surrogate(static_cast<char32_t>(*__first_))) [[unlikely]]
+ return __consume_result_error;
+
+ __value -= 0xd800;
+ __value <<= 10;
+ __value += static_cast<char32_t>(*__first_++) - 0xdc00;
+ __value += 0x10000;
+
+ if (!__unicode::__is_code_point(__value)) [[unlikely]]
+ return __consume_result_error;
}
- return __result;
-
- } else if constexpr (sizeof(wchar_t) == 4) {
- char32_t __result = *__first_++;
- if (__result > 0x10FFFF) [[unlikely]]
- return __replacement_character;
- return __result;
} else {
- __libcpp_unreachable();
- }
- }
-
-# if _LIBCPP_STD_VER > 20
- _LIBCPP_HIDE_FROM_ABI constexpr __consume_p2286_result __consume_p2286() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
-
- char32_t __result = *__first_++;
- if constexpr (sizeof(wchar_t) == 2) {
- // https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF
- if (__is_surrogate_pair_high(__result)) {
- // Malformed Unicode.
- if (__first_ == __last_ || !__is_surrogate_pair_low(*(__first_ + 1))) [[unlikely]]
- return {1, __result};
-
- __result -= 0xd800;
- __result <<= 10;
- __result += *__first_++ - 0xdc00;
- __result += 0x10000;
- } else if (__is_surrogate_pair_low(__result))
- // A code point shouldn't start with the low surrogate pair
- return {1, __result};
- } else {
- if (__result > 0x10FFFF) [[unlikely]]
- return {1, __result};
+ if (!__unicode::__is_scalar_value(__value)) [[unlikely]]
+ return __consume_result_error;
}
- return {0, __result};
+ return {__value};
}
-# endif // _LIBCPP_STD_VER > 20
private:
- const wchar_t* __first_;
- const wchar_t* __last_;
+ _Iterator __first_;
+ _Iterator __last_;
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -384,10 +381,12 @@
/// Therefore only this code point is extracted.
template <class _CharT>
class __extended_grapheme_cluster_view {
+ using _Iterator = typename basic_string_view<_CharT>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(const _CharT* __first, const _CharT* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(_Iterator __first, _Iterator __last)
: __code_point_view_(__first, __last),
- __next_code_point_(__code_point_view_.__consume()),
+ __next_code_point_(__code_point_view_.__consume().__code_point),
__next_prop_(__extended_grapheme_custer_property_boundary::__get_property(__next_code_point_)) {}
struct __cluster {
@@ -401,13 +400,14 @@
///
/// It's expected the caller has the start position and thus can determine
/// the code unit range of the extended grapheme cluster.
- const _CharT* __last_;
+ _Iterator __last_;
};
_LIBCPP_HIDE_FROM_ABI constexpr __cluster __consume() {
_LIBCPP_ASSERT(
__next_prop_ != __extended_grapheme_custer_property_boundary::__property::__eot,
"can't move beyond the end of input");
+
char32_t __code_point = __next_code_point_;
if (!__code_point_view_.__at_end())
return {__code_point, __get_break()};
@@ -422,17 +422,17 @@
char32_t __next_code_point_;
__extended_grapheme_custer_property_boundary::__property __next_prop_;
- _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __get_break() {
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __get_break() {
bool __ri_break_allowed = true;
bool __has_extened_pictographic = false;
while (true) {
- const _CharT* __result = __code_point_view_.__position();
+ _Iterator __result = __code_point_view_.__position();
__extended_grapheme_custer_property_boundary::__property __prev = __next_prop_;
if (__code_point_view_.__at_end()) {
__next_prop_ = __extended_grapheme_custer_property_boundary::__property::__eot;
return __result;
}
- __next_code_point_ = __code_point_view_.__consume();
+ __next_code_point_ = __code_point_view_.__consume().__code_point;
__next_prop_ = __extended_grapheme_custer_property_boundary::__get_property(__next_code_point_);
__has_extened_pictographic |=
@@ -444,8 +444,8 @@
}
};
-template <class _CharT>
-__extended_grapheme_cluster_view(const _CharT*, const _CharT*) -> __extended_grapheme_cluster_view<_CharT>;
+template <contiguous_iterator _Iterator>
+__extended_grapheme_cluster_view(_Iterator, _Iterator) -> __extended_grapheme_cluster_view<iter_value_t<_Iterator>>;
# else // _LIBCPP_HAS_NO_UNICODE
@@ -453,36 +453,30 @@
// This makes it easier to write code agnostic of the _LIBCPP_HAS_NO_UNICODE define.
template <class _CharT>
class __code_point_view {
+ using _Iterator = typename basic_string_view<_CharT>::const_iterator;
+
public:
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const _CharT* __first, const _CharT* __last)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(_Iterator __first, _Iterator __last)
: __first_(__first), __last_(__last) {}
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
- _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __position() const noexcept { return __first_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
- _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
_LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
- return *__first_++;
+ return {static_cast<char32_t>(*__first_++)};
}
-# if _LIBCPP_STD_VER > 20
- _LIBCPP_HIDE_FROM_ABI constexpr __consume_p2286_result __consume_p2286() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
-
- return {0, std::make_unsigned_t<_CharT>(*__first_++)};
- }
-# endif // _LIBCPP_STD_VER > 20
-
private:
- const _CharT* __first_;
- const _CharT* __last_;
+ _Iterator __first_;
+ _Iterator __last_;
};
# endif // _LIBCPP_HAS_NO_UNICODE
} // namespace __unicode
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/bind.h b/third_party/llvm-project/libcxx/include/__functional/bind.h
index 297e4e5..71ca6bd 100644
--- a/third_party/llvm-project/libcxx/include/__functional/bind.h
+++ b/third_party/llvm-project/libcxx/include/__functional/bind.h
@@ -15,7 +15,6 @@
#include <__functional/weak_result_type.h>
#include <cstddef>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,9 +29,9 @@
is_bind_expression<__remove_cvref_t<_Tp> >
> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
-inline constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
+inline constexpr bool is_bind_expression_v = is_bind_expression<_Tp>::value;
#endif
template<class _Tp>
@@ -42,9 +41,9 @@
is_placeholder<__remove_cvref_t<_Tp> >
> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
-inline constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
+inline constexpr int is_placeholder_v = is_placeholder<_Tp>::value;
#endif
namespace placeholders
@@ -132,8 +131,8 @@
>::type
__mu(_Ti&, _Uj& __uj)
{
- const size_t _Indx = is_placeholder<_Ti>::value - 1;
- return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj));
+ const size_t __indx = is_placeholder<_Ti>::value - 1;
+ return _VSTD::forward<typename tuple_element<__indx, _Uj>::type>(_VSTD::get<__indx>(__uj));
}
template <class _Ti, class _Uj>
@@ -264,11 +263,11 @@
}
template<class _Fp, class ..._BoundArgs>
-class __bind : public __weak_result_type<typename decay<_Fp>::type>
+class __bind : public __weak_result_type<__decay_t<_Fp> >
{
protected:
- typedef typename decay<_Fp>::type _Fd;
- typedef tuple<typename decay<_BoundArgs>::type...> _Td;
+ using _Fd = __decay_t<_Fp>;
+ typedef tuple<__decay_t<_BoundArgs>...> _Td;
private:
_Fd __f_;
_Td __bound_args_;
diff --git a/third_party/llvm-project/libcxx/include/__functional/bind_back.h b/third_party/llvm-project/libcxx/include/__functional/bind_back.h
index f0a6e49..544315d 100644
--- a/third_party/llvm-project/libcxx/include/__functional/bind_back.h
+++ b/third_party/llvm-project/libcxx/include/__functional/bind_back.h
@@ -16,7 +16,6 @@
#include <__utility/forward.h>
#include <__utility/integer_sequence.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <size_t _NBound, class = make_index_sequence<_NBound>>
struct __bind_back_op;
@@ -57,7 +56,7 @@
-> decltype( __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)))
{ return __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/bind_front.h b/third_party/llvm-project/libcxx/include/__functional/bind_front.h
index 22fb3a6..109a83c 100644
--- a/third_party/llvm-project/libcxx/include/__functional/bind_front.h
+++ b/third_party/llvm-project/libcxx/include/__functional/bind_front.h
@@ -14,7 +14,6 @@
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct __bind_front_op {
template <class ..._Args>
@@ -51,7 +50,7 @@
return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/boyer_moore_searcher.h b/third_party/llvm-project/libcxx/include/__functional/boyer_moore_searcher.h
index a675089..1e2d861 100644
--- a/third_party/llvm-project/libcxx/include/__functional/boyer_moore_searcher.h
+++ b/third_party/llvm-project/libcxx/include/__functional/boyer_moore_searcher.h
@@ -25,7 +25,7 @@
#include <unordered_map>
#include <vector>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
@@ -310,6 +310,6 @@
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
diff --git a/third_party/llvm-project/libcxx/include/__functional/compose.h b/third_party/llvm-project/libcxx/include/__functional/compose.h
index 25213f2..168131e 100644
--- a/third_party/llvm-project/libcxx/include/__functional/compose.h
+++ b/third_party/llvm-project/libcxx/include/__functional/compose.h
@@ -14,7 +14,6 @@
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct __compose_op {
template<class _Fn1, class _Fn2, class ..._Args>
@@ -45,7 +44,7 @@
-> decltype( __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)))
{ return __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/default_searcher.h b/third_party/llvm-project/libcxx/include/__functional/default_searcher.h
index e4151e5..222b4c6 100644
--- a/third_party/llvm-project/libcxx/include/__functional/default_searcher.h
+++ b/third_party/llvm-project/libcxx/include/__functional/default_searcher.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// default searcher
template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
@@ -50,7 +50,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(default_searcher);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/function.h b/third_party/llvm-project/libcxx/include/__functional/function.h
index ca79d33..70ae6d1 100644
--- a/third_party/llvm-project/libcxx/include/__functional/function.h
+++ b/third_party/llvm-project/libcxx/include/__functional/function.h
@@ -12,6 +12,7 @@
#include <__assert>
#include <__config>
+#include <__exception/exception.h>
#include <__functional/binary_function.h>
#include <__functional/invoke.h>
#include <__functional/unary_function.h>
@@ -23,15 +24,17 @@
#include <__memory/builtin_new_allocator.h>
#include <__memory/compressed_pair.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/aligned_storage.h>
+#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__type_traits/is_trivially_destructible.h>
#include <__type_traits/strip_signature.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/piecewise_construct.h>
#include <__utility/swap.h>
-#include <exception>
+#include <__verbose_abort>
#include <new>
#include <tuple>
-#include <type_traits>
#include <typeinfo>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -68,10 +71,10 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_function_call()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_function_call();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_function_call was thrown in -fno-exceptions mode");
#endif
}
@@ -268,10 +271,10 @@
virtual void destroy() _NOEXCEPT = 0;
virtual void destroy_deallocate() _NOEXCEPT = 0;
virtual _Rp operator()(_ArgTypes&& ...) = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
virtual const void* target(const type_info&) const _NOEXCEPT = 0;
virtual const std::type_info& target_type() const _NOEXCEPT = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
};
// __func implements __base for a given functor type.
@@ -305,10 +308,10 @@
virtual void destroy() _NOEXCEPT;
virtual void destroy_deallocate() _NOEXCEPT;
virtual _Rp operator()(_ArgTypes&&... __arg);
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
virtual const void* target(const type_info&) const _NOEXCEPT;
virtual const std::type_info& target_type() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
};
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
@@ -356,7 +359,7 @@
return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
}
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
const void*
@@ -374,7 +377,7 @@
return typeid(_Fp);
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
// __value_func creates a value-type from a __func.
@@ -427,7 +430,7 @@
}
template <class _Fp,
- class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
+ class = typename enable_if<!is_same<__decay_t<_Fp>, __value_func>::value>::type>
_LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
: __value_func(_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {}
@@ -553,7 +556,7 @@
_LIBCPP_INLINE_VISIBILITY
explicit operator bool() const _NOEXCEPT { return __f_ != nullptr; }
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
_LIBCPP_INLINE_VISIBILITY
const std::type_info& target_type() const _NOEXCEPT
{
@@ -569,7 +572,7 @@
return nullptr;
return (const _Tp*)__f_->target(typeid(_Tp));
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
};
// Storage for a functor object, to be used with __policy to manage copy and
@@ -614,15 +617,15 @@
_LIBCPP_INLINE_VISIBILITY
static const __policy* __create_empty()
{
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
- true,
-#ifndef _LIBCPP_NO_RTTI
- &typeid(void)
+ static const _LIBCPP_CONSTEXPR __policy __policy = {nullptr, nullptr,
+ true,
+#ifndef _LIBCPP_HAS_NO_RTTI
+ &typeid(void)
#else
- nullptr
+ nullptr
#endif
};
- return &__policy_;
+ return &__policy;
}
private:
@@ -640,30 +643,30 @@
template <typename _Fun>
_LIBCPP_INLINE_VISIBILITY static const __policy*
__choose_policy(/* is_small = */ false_type) {
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+ static const _LIBCPP_CONSTEXPR __policy __policy = {
&__large_clone<_Fun>, &__large_destroy<_Fun>, false,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
&typeid(typename _Fun::_Target)
#else
nullptr
#endif
};
- return &__policy_;
+ return &__policy;
}
template <typename _Fun>
_LIBCPP_INLINE_VISIBILITY static const __policy*
__choose_policy(/* is_small = */ true_type)
{
- static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+ static const _LIBCPP_CONSTEXPR __policy __policy = {
nullptr, nullptr, false,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
&typeid(typename _Fun::_Target)
#else
nullptr
#endif
};
- return &__policy_;
+ return &__policy;
}
};
@@ -770,7 +773,7 @@
}
}
- template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type>
+ template <class _Fp, class = typename enable_if<!is_same<__decay_t<_Fp>, __policy_func>::value>::type>
_LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f)
: __policy_(__policy::__create_empty()) {
typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun;
@@ -861,7 +864,7 @@
return !__policy_->__is_null;
}
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
_LIBCPP_INLINE_VISIBILITY
const std::type_info& target_type() const _NOEXCEPT
{
@@ -878,7 +881,7 @@
else
return reinterpret_cast<const _Tp*>(&__buf_.__small);
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
};
#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME)
@@ -945,7 +948,7 @@
return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
}
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
virtual const void* target(type_info const& __ti) const _NOEXCEPT {
if (__ti == typeid(__func::__block_type))
return &__f_;
@@ -955,7 +958,7 @@
virtual const std::type_info& target_type() const _NOEXCEPT {
return typeid(__func::__block_type);
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
};
#endif // _LIBCPP_HAS_EXTENSION_BLOCKS
@@ -1026,7 +1029,7 @@
function& operator=(const function&);
function& operator=(function&&) _NOEXCEPT;
function& operator=(nullptr_t) _NOEXCEPT;
- template<class _Fp, class = _EnableIfLValueCallable<typename decay<_Fp>::type>>
+ template<class _Fp, class = _EnableIfLValueCallable<__decay_t<_Fp>>>
function& operator=(_Fp&&);
~function();
@@ -1056,12 +1059,12 @@
// function invocation:
_Rp operator()(_ArgTypes...) const;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
// function target access:
const std::type_info& target_type() const _NOEXCEPT;
template <typename _Tp> _Tp* target() _NOEXCEPT;
template <typename _Tp> const _Tp* target() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
};
#if _LIBCPP_STD_VER >= 17
@@ -1156,7 +1159,7 @@
return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
}
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
template<class _Rp, class ..._ArgTypes>
const std::type_info&
@@ -1181,7 +1184,7 @@
return __f_.template target<_Tp>();
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
diff --git a/third_party/llvm-project/libcxx/include/__functional/hash.h b/third_party/llvm-project/libcxx/include/__functional/hash.h
index dfd8ea2..fec7f75 100644
--- a/third_party/llvm-project/libcxx/include/__functional/hash.h
+++ b/third_party/llvm-project/libcxx/include/__functional/hash.h
@@ -13,7 +13,7 @@
#include <__functional/invoke.h>
#include <__functional/unary_function.h>
#include <__fwd/hash.h>
-#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple/sfinae_helpers.h>
#include <__type_traits/is_copy_constructible.h>
#include <__type_traits/is_default_constructible.h>
#include <__type_traits/is_enum.h>
@@ -35,7 +35,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_Size
__loadword(const void* __p)
{
@@ -53,50 +53,88 @@
template <class _Size>
struct __murmur2_or_cityhash<_Size, 32>
{
- inline _Size operator()(const void* __key, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ _Size operator()(const void* __key, _Size __len) const {
+ // murmur2
+ const _Size __m = 0x5bd1e995;
+ const _Size __r = 24;
+ _Size __h = __len;
+ const unsigned char* __data = static_cast<const unsigned char*>(__key);
+ for (; __len >= 4; __data += 4, __len -= 4)
+ {
+ _Size __k = std::__loadword<_Size>(__data);
+ __k *= __m;
+ __k ^= __k >> __r;
+ __k *= __m;
+ __h *= __m;
+ __h ^= __k;
+ }
+ switch (__len)
+ {
+ case 3:
+ __h ^= static_cast<_Size>(__data[2] << 16);
+ _LIBCPP_FALLTHROUGH();
+ case 2:
+ __h ^= static_cast<_Size>(__data[1] << 8);
+ _LIBCPP_FALLTHROUGH();
+ case 1:
+ __h ^= __data[0];
+ __h *= __m;
+ }
+ __h ^= __h >> 13;
+ __h *= __m;
+ __h ^= __h >> 15;
+ return __h;
+ }
};
-// murmur2
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
-{
- const _Size __m = 0x5bd1e995;
- const _Size __r = 24;
- _Size __h = __len;
- const unsigned char* __data = static_cast<const unsigned char*>(__key);
- for (; __len >= 4; __data += 4, __len -= 4)
- {
- _Size __k = std::__loadword<_Size>(__data);
- __k *= __m;
- __k ^= __k >> __r;
- __k *= __m;
- __h *= __m;
- __h ^= __k;
- }
- switch (__len)
- {
- case 3:
- __h ^= static_cast<_Size>(__data[2] << 16);
- _LIBCPP_FALLTHROUGH();
- case 2:
- __h ^= static_cast<_Size>(__data[1] << 8);
- _LIBCPP_FALLTHROUGH();
- case 1:
- __h ^= __data[0];
- __h *= __m;
- }
- __h ^= __h >> 13;
- __h *= __m;
- __h ^= __h >> 15;
- return __h;
-}
-
template <class _Size>
struct __murmur2_or_cityhash<_Size, 64>
{
- inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+ // cityhash64
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ _Size operator()(const void* __key, _Size __len) const {
+ const char* __s = static_cast<const char*>(__key);
+ if (__len <= 32) {
+ if (__len <= 16) {
+ return __hash_len_0_to_16(__s, __len);
+ } else {
+ return __hash_len_17_to_32(__s, __len);
+ }
+ } else if (__len <= 64) {
+ return __hash_len_33_to_64(__s, __len);
+ }
+
+ // For strings over 64 bytes we hash the end first, and then as we
+ // loop we keep 56 bytes of state: v, w, x, y, and z.
+ _Size __x = std::__loadword<_Size>(__s + __len - 40);
+ _Size __y = std::__loadword<_Size>(__s + __len - 16) +
+ std::__loadword<_Size>(__s + __len - 56);
+ _Size __z = __hash_len_16(std::__loadword<_Size>(__s + __len - 48) + __len,
+ std::__loadword<_Size>(__s + __len - 24));
+ pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
+ pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
+ __x = __x * __k1 + std::__loadword<_Size>(__s);
+
+ // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
+ __len = (__len - 1) & ~static_cast<_Size>(63);
+ do {
+ __x = __rotate(__x + __y + __v.first + std::__loadword<_Size>(__s + 8), 37) * __k1;
+ __y = __rotate(__y + __v.second + std::__loadword<_Size>(__s + 48), 42) * __k1;
+ __x ^= __w.second;
+ __y += __v.first + std::__loadword<_Size>(__s + 40);
+ __z = __rotate(__z + __w.first, 33) * __k1;
+ __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
+ __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
+ __y + std::__loadword<_Size>(__s + 16));
+ _VSTD::swap(__z, __x);
+ __s += 64;
+ __len -= 64;
+ } while (__len != 0);
+ return __hash_len_16(
+ __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
+ __hash_len_16(__v.second, __w.second) + __x);
+ }
private:
// Some primes between 2^63 and 2^64.
@@ -105,21 +143,23 @@
static const _Size __k2 = 0x9ae16a3b2f90404fULL;
static const _Size __k3 = 0xc949d7c7509e6557ULL;
+ _LIBCPP_HIDE_FROM_ABI
static _Size __rotate(_Size __val, int __shift) {
return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
}
+ _LIBCPP_HIDE_FROM_ABI
static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
return (__val >> __shift) | (__val << (64 - __shift));
}
+ _LIBCPP_HIDE_FROM_ABI
static _Size __shift_mix(_Size __val) {
return __val ^ (__val >> 47);
}
- static _Size __hash_len_16(_Size __u, _Size __v)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_16(_Size __u, _Size __v) {
const _Size __mul = 0x9ddfea08eb382d69ULL;
_Size __a = (__u ^ __v) * __mul;
__a ^= (__a >> 47);
@@ -129,9 +169,8 @@
return __b;
}
- static _Size __hash_len_0_to_16(const char* __s, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_0_to_16(const char* __s, _Size __len) {
if (__len > 8) {
const _Size __a = std::__loadword<_Size>(__s);
const _Size __b = std::__loadword<_Size>(__s + __len - 8);
@@ -140,7 +179,11 @@
if (__len >= 4) {
const uint32_t __a = std::__loadword<uint32_t>(__s);
const uint32_t __b = std::__loadword<uint32_t>(__s + __len - 4);
+#ifdef _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION
return __hash_len_16(__len + (static_cast<_Size>(__a) << 3), __b);
+#else
+ return __hash_len_16(__len + (__a << 3), __b);
+#endif
}
if (__len > 0) {
const unsigned char __a = static_cast<unsigned char>(__s[0]);
@@ -154,9 +197,8 @@
return __k2;
}
- static _Size __hash_len_17_to_32(const char *__s, _Size __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_17_to_32(const char *__s, _Size __len) {
const _Size __a = std::__loadword<_Size>(__s) * __k1;
const _Size __b = std::__loadword<_Size>(__s + 8);
const _Size __c = std::__loadword<_Size>(__s + __len - 8) * __k2;
@@ -167,9 +209,9 @@
// Return a 16-byte hash for 48 bytes. Quick and dirty.
// Callers do best to use "random-looking" values for a and b.
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
_Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
__a += __w;
__b = __rotate(__b + __a + __z, 21);
@@ -181,9 +223,9 @@
}
// Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
const char* __s, _Size __a, _Size __b)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
return __weak_hash_len_32_with_seeds(std::__loadword<_Size>(__s),
std::__loadword<_Size>(__s + 8),
@@ -194,9 +236,8 @@
}
// Return an 8-byte hash for 33 to 64 bytes.
- static _Size __hash_len_33_to_64(const char *__s, size_t __len)
- _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
- {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ static _Size __hash_len_33_to_64(const char *__s, size_t __len) {
_Size __z = std::__loadword<_Size>(__s + 24);
_Size __a = std::__loadword<_Size>(__s) +
(__len + std::__loadword<_Size>(__s + __len - 16)) * __k0;
@@ -221,53 +262,6 @@
}
};
-// cityhash64
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
-{
- const char* __s = static_cast<const char*>(__key);
- if (__len <= 32) {
- if (__len <= 16) {
- return __hash_len_0_to_16(__s, __len);
- } else {
- return __hash_len_17_to_32(__s, __len);
- }
- } else if (__len <= 64) {
- return __hash_len_33_to_64(__s, __len);
- }
-
- // For strings over 64 bytes we hash the end first, and then as we
- // loop we keep 56 bytes of state: v, w, x, y, and z.
- _Size __x = std::__loadword<_Size>(__s + __len - 40);
- _Size __y = std::__loadword<_Size>(__s + __len - 16) +
- std::__loadword<_Size>(__s + __len - 56);
- _Size __z = __hash_len_16(std::__loadword<_Size>(__s + __len - 48) + __len,
- std::__loadword<_Size>(__s + __len - 24));
- pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
- pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
- __x = __x * __k1 + std::__loadword<_Size>(__s);
-
- // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
- __len = (__len - 1) & ~static_cast<_Size>(63);
- do {
- __x = __rotate(__x + __y + __v.first + std::__loadword<_Size>(__s + 8), 37) * __k1;
- __y = __rotate(__y + __v.second + std::__loadword<_Size>(__s + 48), 42) * __k1;
- __x ^= __w.second;
- __y += __v.first + std::__loadword<_Size>(__s + 40);
- __z = __rotate(__z + __w.first, 33) * __k1;
- __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
- __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
- __y + std::__loadword<_Size>(__s + 16));
- _VSTD::swap(__z, __x);
- __s += 64;
- __len -= 64;
- } while (__len != 0);
- return __hash_len_16(
- __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
- __hash_len_16(__v.second, __w.second) + __x);
-}
-
template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
struct __scalar_hash;
@@ -275,7 +269,7 @@
struct __scalar_hash<_Tp, 0>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -293,7 +287,7 @@
struct __scalar_hash<_Tp, 1>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -310,7 +304,7 @@
struct __scalar_hash<_Tp, 2>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -331,7 +325,7 @@
struct __scalar_hash<_Tp, 3>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -353,7 +347,7 @@
struct __scalar_hash<_Tp, 4>
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
union
@@ -377,7 +371,7 @@
size_t second;
};
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_HIDE_FROM_ABI
inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
typedef __scalar_hash<_PairT> _HashT;
const _PairT __p = {__lhs, __rhs};
@@ -388,7 +382,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
: public __unary_function<_Tp*, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp* __v) const _NOEXCEPT
{
union
@@ -405,7 +399,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<bool>
: public __unary_function<bool, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -413,7 +407,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<char>
: public __unary_function<char, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -421,7 +415,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<signed char>
: public __unary_function<signed char, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -429,7 +423,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
: public __unary_function<unsigned char, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -438,7 +432,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<char8_t>
: public __unary_function<char8_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char8_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
#endif // !_LIBCPP_HAS_NO_CHAR8_T
@@ -447,7 +441,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<char16_t>
: public __unary_function<char16_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -455,7 +449,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<char32_t>
: public __unary_function<char32_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -464,7 +458,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
: public __unary_function<wchar_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -473,7 +467,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<short>
: public __unary_function<short, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -481,7 +475,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
: public __unary_function<unsigned short, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -489,7 +483,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<int>
: public __unary_function<int, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -497,7 +491,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
: public __unary_function<unsigned int, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -505,7 +499,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<long>
: public __unary_function<long, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -513,7 +507,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
: public __unary_function<unsigned long, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};
@@ -549,7 +543,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<float>
: public __scalar_hash<float>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(float __v) const _NOEXCEPT
{
// -0.0 and 0.0 should return same hash
@@ -563,7 +557,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<double>
: public __scalar_hash<double>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(double __v) const _NOEXCEPT
{
// -0.0 and 0.0 should return same hash
@@ -577,7 +571,7 @@
struct _LIBCPP_TEMPLATE_VIS hash<long double>
: public __scalar_hash<long double>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(long double __v) const _NOEXCEPT
{
// -0.0 and 0.0 should return same hash
@@ -627,7 +621,7 @@
struct _LIBCPP_TEMPLATE_VIS __enum_hash
: public __unary_function<_Tp, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(_Tp __v) const _NOEXCEPT
{
typedef typename underlying_type<_Tp>::type type;
@@ -646,13 +640,13 @@
{
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <>
struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
: public __unary_function<nullptr_t, size_t>
{
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
size_t operator()(nullptr_t) const _NOEXCEPT {
return 662607004ull;
}
@@ -673,7 +667,7 @@
is_default_constructible<_Hash>::value
>;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Type, class>
using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type;
diff --git a/third_party/llvm-project/libcxx/include/__functional/identity.h b/third_party/llvm-project/libcxx/include/__functional/identity.h
index 2fe3acc..421ba2f 100644
--- a/third_party/llvm-project/libcxx/include/__functional/identity.h
+++ b/third_party/llvm-project/libcxx/include/__functional/identity.h
@@ -11,6 +11,7 @@
#define _LIBCPP___FUNCTIONAL_IDENTITY_H
#include <__config>
+#include <__type_traits/integral_constant.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -19,6 +20,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _Tp>
+struct __is_identity : false_type {};
+
struct __identity {
template <class _Tp>
_LIBCPP_NODISCARD _LIBCPP_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT {
@@ -28,7 +32,10 @@
using is_transparent = void;
};
-#if _LIBCPP_STD_VER > 17
+template <>
+struct __is_identity<__identity> : true_type {};
+
+#if _LIBCPP_STD_VER >= 20
struct identity {
template<class _Tp>
@@ -39,7 +46,11 @@
using is_transparent = void;
};
-#endif // _LIBCPP_STD_VER > 17
+
+template <>
+struct __is_identity<identity> : true_type {};
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/invoke.h b/third_party/llvm-project/libcxx/include/__functional/invoke.h
index 48e6eac..82fd18d 100644
--- a/third_party/llvm-project/libcxx/include/__functional/invoke.h
+++ b/third_party/llvm-project/libcxx/include/__functional/invoke.h
@@ -266,8 +266,8 @@
};
template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
using __enable_if_bullet1 = typename enable_if
<
@@ -276,8 +276,8 @@
>::type;
template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type>
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0> >
using __enable_if_bullet2 = typename enable_if
<
is_member_function_pointer<_DecayFp>::value
@@ -285,8 +285,8 @@
>::type;
template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
using __enable_if_bullet3 = typename enable_if
<
@@ -296,8 +296,8 @@
>::type;
template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
using __enable_if_bullet4 = typename enable_if
<
@@ -306,8 +306,8 @@
>::type;
template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type>
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0> >
using __enable_if_bullet5 = typename enable_if
<
is_member_object_pointer<_DecayFp>::value
@@ -315,8 +315,8 @@
>::type;
template <class _Fp, class _A0,
- class _DecayFp = typename decay<_Fp>::type,
- class _DecayA0 = typename decay<_A0>::type,
+ class _DecayFp = __decay_t<_Fp>,
+ class _DecayA0 = __decay_t<_A0>,
class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
using __enable_if_bullet6 = typename enable_if
<
@@ -488,7 +488,7 @@
}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// is_invocable
@@ -539,7 +539,26 @@
return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
+
+#if _LIBCPP_STD_VER >= 23
+template <class _Result, class _Fn, class... _Args>
+ requires is_invocable_r_v<_Result, _Fn, _Args...>
+_LIBCPP_HIDE_FROM_ABI constexpr _Result
+invoke_r(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_r_v<_Result, _Fn, _Args...>) {
+ if constexpr (is_void_v<_Result>) {
+ static_cast<void>(std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...));
+ } else {
+ // TODO: Use reference_converts_from_temporary_v once implemented
+ // using _ImplicitInvokeResult = invoke_result_t<_Fn, _Args...>;
+ // static_assert(!reference_converts_from_temporary_v<_Result, _ImplicitInvokeResult>,
+ static_assert(true,
+ "Returning from invoke_r would bind a temporary object to the reference return type, "
+ "which would result in a dangling reference.");
+ return std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
+ }
+}
+#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/is_transparent.h b/third_party/llvm-project/libcxx/include/__functional/is_transparent.h
index c7a0ee9..c539a07 100644
--- a/third_party/llvm-project/libcxx/include/__functional/is_transparent.h
+++ b/third_party/llvm-project/libcxx/include/__functional/is_transparent.h
@@ -11,7 +11,8 @@
#define _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
#include <__config>
-#include <type_traits>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/void_t.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -19,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class, class = void>
struct __is_transparent : false_type {};
diff --git a/third_party/llvm-project/libcxx/include/__functional/mem_fn.h b/third_party/llvm-project/libcxx/include/__functional/mem_fn.h
index 8b51627..fe221dd 100644
--- a/third_party/llvm-project/libcxx/include/__functional/mem_fn.h
+++ b/third_party/llvm-project/libcxx/include/__functional/mem_fn.h
@@ -15,7 +15,6 @@
#include <__functional/invoke.h>
#include <__functional/weak_result_type.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__functional/not_fn.h b/third_party/llvm-project/libcxx/include/__functional/not_fn.h
index 79d9a87..f148a40 100644
--- a/third_party/llvm-project/libcxx/include/__functional/not_fn.h
+++ b/third_party/llvm-project/libcxx/include/__functional/not_fn.h
@@ -14,7 +14,6 @@
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
struct __not_fn_op {
template <class... _Args>
@@ -47,7 +46,7 @@
return __not_fn_t<decay_t<_Fn>>(_VSTD::forward<_Fn>(__f));
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/operations.h b/third_party/llvm-project/libcxx/include/__functional/operations.h
index 8a781ef..3d0c364 100644
--- a/third_party/llvm-project/libcxx/include/__functional/operations.h
+++ b/third_party/llvm-project/libcxx/include/__functional/operations.h
@@ -13,6 +13,8 @@
#include <__config>
#include <__functional/binary_function.h>
#include <__functional/unary_function.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/predicate_traits.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -23,7 +25,7 @@
// Arithmetic operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -38,7 +40,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(plus);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS plus<void>
{
@@ -52,7 +54,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -67,7 +69,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(minus);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS minus<void>
{
@@ -81,7 +83,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -96,7 +98,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(multiplies);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS multiplies<void>
{
@@ -110,7 +112,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -125,7 +127,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(divides);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS divides<void>
{
@@ -139,7 +141,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -154,7 +156,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(modulus);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS modulus<void>
{
@@ -168,7 +170,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -183,7 +185,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(negate);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS negate<void>
{
@@ -199,7 +201,7 @@
// Bitwise operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -214,7 +216,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_and);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS bit_and<void>
{
@@ -228,7 +230,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
struct _LIBCPP_TEMPLATE_VIS bit_not
: __unary_function<_Tp, _Tp>
@@ -252,7 +254,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -267,7 +269,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_or);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS bit_or<void>
{
@@ -281,7 +283,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -296,7 +298,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_xor);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
{
@@ -312,7 +314,7 @@
// Comparison operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -327,7 +329,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(equal_to);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS equal_to<void>
{
@@ -341,7 +343,15 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+template <class _Tp>
+struct __is_trivial_equality_predicate<equal_to<_Tp>, _Tp, _Tp> : true_type {};
+
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp>
+struct __is_trivial_equality_predicate<equal_to<>, _Tp, _Tp> : true_type {};
+#endif
+
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -356,7 +366,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(not_equal_to);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
{
@@ -370,7 +380,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -385,7 +395,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS less<void>
{
@@ -399,7 +409,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -414,7 +424,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(less_equal);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS less_equal<void>
{
@@ -428,7 +438,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -443,7 +453,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater_equal);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
{
@@ -457,7 +467,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -472,7 +482,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(greater);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS greater<void>
{
@@ -488,7 +498,7 @@
// Logical operations
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -503,7 +513,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_and);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS logical_and<void>
{
@@ -517,7 +527,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -532,7 +542,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_not);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS logical_not<void>
{
@@ -546,7 +556,7 @@
};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp = void>
#else
template <class _Tp>
@@ -561,7 +571,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(logical_or);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <>
struct _LIBCPP_TEMPLATE_VIS logical_or<void>
{
diff --git a/third_party/llvm-project/libcxx/include/__functional/perfect_forward.h b/third_party/llvm-project/libcxx/include/__functional/perfect_forward.h
index 9ffea1a..af89797 100644
--- a/third_party/llvm-project/libcxx/include/__functional/perfect_forward.h
+++ b/third_party/llvm-project/libcxx/include/__functional/perfect_forward.h
@@ -15,7 +15,6 @@
#include <__utility/forward.h>
#include <__utility/move.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -23,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Op, class _Indices, class... _BoundArgs>
struct __perfect_forward_impl;
@@ -87,7 +86,7 @@
template <class _Op, class ..._Args>
using __perfect_forward = __perfect_forward_impl<_Op, index_sequence_for<_Args...>, _Args...>;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/ranges_operations.h b/third_party/llvm-project/libcxx/include/__functional/ranges_operations.h
index 87081dd..77b6a6d 100644
--- a/third_party/llvm-project/libcxx/include/__functional/ranges_operations.h
+++ b/third_party/llvm-project/libcxx/include/__functional/ranges_operations.h
@@ -13,6 +13,8 @@
#include <__concepts/equality_comparable.h>
#include <__concepts/totally_ordered.h>
#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/predicate_traits.h>
#include <__utility/forward.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -21,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -93,7 +95,10 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+template <class _Lhs, class _Rhs>
+struct __is_trivial_equality_predicate<ranges::equal_to, _Lhs, _Rhs> : true_type {};
+
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__functional/reference_wrapper.h b/third_party/llvm-project/libcxx/include/__functional/reference_wrapper.h
index c377b64..2d382a3 100644
--- a/third_party/llvm-project/libcxx/include/__functional/reference_wrapper.h
+++ b/third_party/llvm-project/libcxx/include/__functional/reference_wrapper.h
@@ -55,12 +55,18 @@
template <class... _ArgTypes>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
typename __invoke_of<type&, _ArgTypes...>::type
- operator() (_ArgTypes&&... __args) const {
+ operator() (_ArgTypes&&... __args) const
+#if _LIBCPP_STD_VER >= 17
+ // Since is_nothrow_invocable requires C++17 LWG3764 is not backported
+ // to earlier versions.
+ noexcept(is_nothrow_invocable_v<_Tp&, _ArgTypes...>)
+#endif
+ {
return std::__invoke(get(), std::forward<_ArgTypes>(__args)...);
}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__functional/unwrap_ref.h b/third_party/llvm-project/libcxx/include/__functional/unwrap_ref.h
index da000d8..3abad73 100644
--- a/third_party/llvm-project/libcxx/include/__functional/unwrap_ref.h
+++ b/third_party/llvm-project/libcxx/include/__functional/unwrap_ref.h
@@ -30,7 +30,7 @@
template <class _Tp>
struct decay;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct unwrap_reference : __unwrap_reference<_Tp> { };
@@ -38,7 +38,7 @@
using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
template <class _Tp>
-struct unwrap_ref_decay : unwrap_reference<typename decay<_Tp>::type> { };
+struct unwrap_ref_decay : unwrap_reference<__decay_t<_Tp> > { };
template <class _Tp>
using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
@@ -46,10 +46,10 @@
template <class _Tp>
struct __unwrap_ref_decay
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
: unwrap_ref_decay<_Tp>
#else
- : __unwrap_reference<typename decay<_Tp>::type>
+ : __unwrap_reference<__decay_t<_Tp> >
#endif
{ };
diff --git a/third_party/llvm-project/libcxx/include/__fwd/get.h b/third_party/llvm-project/libcxx/include/__fwd/get.h
index ec1fab4..d043414 100644
--- a/third_party/llvm-project/libcxx/include/__fwd/get.h
+++ b/third_party/llvm-project/libcxx/include/__fwd/get.h
@@ -15,7 +15,7 @@
#include <__fwd/pair.h>
#include <__fwd/subrange.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_element.h>
+#include <__tuple/tuple_element.h>
#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/third_party/llvm-project/libcxx/include/__fwd/span.h b/third_party/llvm-project/libcxx/include/__fwd/span.h
index 943cb13..e9fa703 100644
--- a/third_party/llvm-project/libcxx/include/__fwd/span.h
+++ b/third_party/llvm-project/libcxx/include/__fwd/span.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
template <typename _Tp, size_t _Extent = dynamic_extent> class span;
diff --git a/third_party/llvm-project/libcxx/include/__hash_table b/third_party/llvm-project/libcxx/include/__hash_table
index f8896c8..e38a442 100644
--- a/third_party/llvm-project/libcxx/include/__hash_table
+++ b/third_party/llvm-project/libcxx/include/__hash_table
@@ -17,6 +17,7 @@
#include <__config>
#include <__debug>
#include <__functional/hash.h>
+#include <__functional/invoke.h>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include <__memory/allocator_traits.h>
@@ -25,6 +26,16 @@
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__type_traits/can_extract_key.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_const.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/pair.h>
@@ -32,7 +43,6 @@
#include <cmath>
#include <cstring>
#include <initializer_list>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -826,7 +836,7 @@
template <class> friend class __hash_map_node_destructor;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeType, class _Alloc>
struct __generic_container_node_destructor;
@@ -1121,7 +1131,7 @@
return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
_InsertReturnType __node_handle_insert_unique(_NodeHandle&& __nh);
@@ -1597,10 +1607,10 @@
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
const_iterator __i = __u.begin();
while (__cache != nullptr && __u.size() != 0)
{
@@ -1610,14 +1620,14 @@
__node_insert_multi(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
const_iterator __i = __u.begin();
@@ -1659,10 +1669,10 @@
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
@@ -1670,14 +1680,14 @@
__node_insert_unique(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
@@ -1699,10 +1709,10 @@
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
@@ -1710,14 +1720,14 @@
__node_insert_multi(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
@@ -2088,7 +2098,7 @@
return __r;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
@@ -2218,7 +2228,7 @@
__node_insert_multi_perform(__src_ptr, __pn);
}
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <bool _UniqueKeys>
diff --git a/third_party/llvm-project/libcxx/include/__iterator/access.h b/third_party/llvm-project/libcxx/include/__iterator/access.h
index 0b8d523..d7bcb33 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/access.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/access.h
@@ -69,7 +69,7 @@
return __c.end();
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Cp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
diff --git a/third_party/llvm-project/libcxx/include/__iterator/advance.h b/third_party/llvm-project/libcxx/include/__iterator/advance.h
index 154c273..4e852bb 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/advance.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/advance.h
@@ -23,7 +23,6 @@
#include <__utility/declval.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <cstdlib>
#include <limits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -69,7 +68,7 @@
_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.advance]
@@ -159,9 +158,9 @@
__a > 0 ? __a >= __b :
__a <= __b;
};
- if (const auto __M = __bound_sentinel - __i; __magnitude_geq(__n, __M)) {
+ if (const auto __m = __bound_sentinel - __i; __magnitude_geq(__n, __m)) {
(*this)(__i, __bound_sentinel);
- return __n - __M;
+ return __n - __m;
}
// Otherwise, equivalent to `ranges::advance(i, n)`.
@@ -196,7 +195,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/back_insert_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/back_insert_iterator.h
index 4c00a7e..dc656e3 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/back_insert_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/back_insert_iterator.h
@@ -36,7 +36,7 @@
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/third_party/llvm-project/libcxx/include/__iterator/bounded_iter.h b/third_party/llvm-project/libcxx/include/__iterator/bounded_iter.h
index 2682f2a..00231e0 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/bounded_iter.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/bounded_iter.h
@@ -42,7 +42,7 @@
using pointer = typename iterator_traits<_Iterator>::pointer;
using reference = typename iterator_traits<_Iterator>::reference;
using iterator_category = typename iterator_traits<_Iterator>::iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using iterator_concept = contiguous_iterator_tag;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__iterator/common_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/common_iterator.h
index f7883e2..aab04ce 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/common_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/common_iterator.h
@@ -25,6 +25,7 @@
#include <__iterator/iter_swap.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/readable_traits.h>
+#include <__memory/addressof.h>
#include <__type_traits/is_pointer.h>
#include <__utility/declval.h>
#include <variant>
@@ -35,7 +36,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Iter>
concept __can_use_postfix_proxy =
@@ -274,7 +275,7 @@
using reference = iter_reference_t<_Iter>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/concepts.h b/third_party/llvm-project/libcxx/include/__iterator/concepts.h
index d9d40a4..dd9e8d6 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/concepts.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/concepts.h
@@ -46,7 +46,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [iterator.concept.readable]
template<class _In>
@@ -293,7 +293,7 @@
// Note: indirectly_swappable is located in iter_swap.h to prevent a dependency cycle
// (both iter_swap and indirectly_swappable require indirectly_readable).
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/counted_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/counted_iterator.h
index 5fdbff4..ad69a5c 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/counted_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/counted_iterator.h
@@ -36,7 +36,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class>
struct __counted_iterator_concept {};
@@ -143,12 +143,12 @@
decltype(auto) operator++(int) {
_LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
--__count_;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try { return __current_++; }
catch(...) { ++__count_; throw; }
#else
return __current_++;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
_LIBCPP_HIDE_FROM_ABI
@@ -303,7 +303,7 @@
add_pointer_t<iter_reference_t<_Iter>>, void>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/data.h b/third_party/llvm-project/libcxx/include/__iterator/data.h
index 88eb752..f106807 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/data.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/data.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Cont> constexpr
_LIBCPP_INLINE_VISIBILITY
diff --git a/third_party/llvm-project/libcxx/include/__iterator/default_sentinel.h b/third_party/llvm-project/libcxx/include/__iterator/default_sentinel.h
index 669032a..d5fb2b6 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/default_sentinel.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/default_sentinel.h
@@ -18,12 +18,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct default_sentinel_t { };
inline constexpr default_sentinel_t default_sentinel{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/distance.h b/third_party/llvm-project/libcxx/include/__iterator/distance.h
index 681e20d..ebe5473 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/distance.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/distance.h
@@ -53,7 +53,7 @@
return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.distance]
@@ -101,7 +101,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/empty.h b/third_party/llvm-project/libcxx/include/__iterator/empty.h
index 748ca9e..2cd4c7a 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/empty.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/empty.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Cont>
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
@@ -37,7 +37,7 @@
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/front_insert_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/front_insert_iterator.h
index e278359..1ad5348 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/front_insert_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/front_insert_iterator.h
@@ -36,7 +36,7 @@
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/third_party/llvm-project/libcxx/include/__iterator/incrementable_traits.h b/third_party/llvm-project/libcxx/include/__iterator/incrementable_traits.h
index 3d06dc0..604e958 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/incrementable_traits.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/incrementable_traits.h
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [incrementable.traits]
template<class> struct incrementable_traits {};
@@ -71,7 +71,7 @@
incrementable_traits<remove_cvref_t<_Ip> >,
iterator_traits<remove_cvref_t<_Ip> > >::difference_type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/indirectly_comparable.h b/third_party/llvm-project/libcxx/include/__iterator/indirectly_comparable.h
index 868190f..e60ba25 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/indirectly_comparable.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/indirectly_comparable.h
@@ -21,13 +21,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _I1, class _I2, class _Rp, class _P1 = identity, class _P2 = identity>
concept indirectly_comparable =
indirect_binary_predicate<_Rp, projected<_I1, _P1>, projected<_I2, _P2>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/insert_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/insert_iterator.h
index ecaea61..5534854 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/insert_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/insert_iterator.h
@@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Container>
using __insert_iterator_iter_t = ranges::iterator_t<_Container>;
#else
@@ -46,7 +46,7 @@
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/third_party/llvm-project/libcxx/include/__iterator/istream_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/istream_iterator.h
index a056961..989902f 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/istream_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/istream_iterator.h
@@ -47,9 +47,9 @@
_Tp __value_;
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr istream_iterator(default_sentinel_t) : istream_iterator() {}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
{
if (!(*__in_stream_ >> __value_))
@@ -73,11 +73,11 @@
operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istream_iterator& __i, default_sentinel_t) {
return __i.__in_stream_ == nullptr;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _Tp, class _CharT, class _Traits, class _Distance>
diff --git a/third_party/llvm-project/libcxx/include/__iterator/istreambuf_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/istreambuf_iterator.h
index bc53a6a..e39fec6 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/istreambuf_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/istreambuf_iterator.h
@@ -67,10 +67,10 @@
}
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY constexpr istreambuf_iterator(default_sentinel_t) noexcept
: istreambuf_iterator() {}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
: __sbuf_(__s.rdbuf()) {}
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
@@ -93,11 +93,11 @@
_LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
{return __test_for_eof() == __b.__test_for_eof();}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istreambuf_iterator& __i, default_sentinel_t) {
return __i.__test_for_eof();
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _CharT, class _Traits>
diff --git a/third_party/llvm-project/libcxx/include/__iterator/iter_move.h b/third_party/llvm-project/libcxx/include/__iterator/iter_move.h
index a7d9413..78b1448 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/iter_move.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/iter_move.h
@@ -25,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [iterator.cust.move]
@@ -97,7 +97,7 @@
requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __can_reference; }
using iter_rvalue_reference_t = decltype(ranges::iter_move(std::declval<_Tp&>()));
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/iter_swap.h b/third_party/llvm-project/libcxx/include/__iterator/iter_swap.h
index d4c0dca..c78efaf 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/iter_swap.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/iter_swap.h
@@ -28,7 +28,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [iter.cust.swap]
@@ -106,7 +106,7 @@
ranges::iter_swap(__i2, __i1);
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/iterator_traits.h b/third_party/llvm-project/libcxx/include/__iterator/iterator_traits.h
index c9d8944..0318e4b 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/iterator_traits.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/iterator_traits.h
@@ -43,7 +43,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
using __with_reference = _Tp&;
@@ -62,7 +62,7 @@
template<__dereferenceable _Tp>
using iter_reference_t = decltype(*std::declval<_Tp&>());
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
struct _LIBCPP_TEMPLATE_VIS iterator_traits;
@@ -72,7 +72,7 @@
struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag : public random_access_iterator_tag {};
#endif
@@ -157,7 +157,7 @@
static const bool value = decltype(__test<_Tp>(nullptr))::value;
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// The `cpp17-*-iterator` exposition-only concepts have very similar names to the `Cpp17*Iterator` named requirements
// from `[iterator.cpp17]`. To avoid confusion between the two, the exposition-only concepts have been banished to
@@ -190,7 +190,7 @@
concept __cpp17_forward_iterator =
__cpp17_input_iterator<_Ip> &&
constructible_from<_Ip> &&
- is_lvalue_reference_v<iter_reference_t<_Ip>> &&
+ is_reference_v<iter_reference_t<_Ip>> &&
same_as<remove_cvref_t<iter_reference_t<_Ip>>,
typename indirectly_readable_traits<_Ip>::value_type> &&
requires(_Ip __i) {
@@ -381,7 +381,7 @@
using __primary_template = iterator_traits;
};
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template <class _Iter, bool> struct __iterator_traits {};
@@ -418,10 +418,10 @@
using __primary_template = iterator_traits;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _Tp>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires is_object_v<_Tp>
#endif
struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
@@ -431,7 +431,7 @@
typedef _Tp* pointer;
typedef _Tp& reference;
typedef random_access_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef contiguous_iterator_tag iterator_concept;
#endif
};
@@ -471,7 +471,7 @@
// Such iterators receive special "contiguous" optimizations in
// std::copy and std::sort.
//
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct __is_cpp17_contiguous_iterator : _Or<
__has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag>,
diff --git a/third_party/llvm-project/libcxx/include/__iterator/mergeable.h b/third_party/llvm-project/libcxx/include/__iterator/mergeable.h
index b9f2d08..494fda9 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/mergeable.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/mergeable.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Input1, class _Input2, class _Output,
class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
@@ -34,7 +34,7 @@
indirectly_copyable<_Input2, _Output> &&
indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/move_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/move_iterator.h
index fa806db..e3939cc 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/move_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/move_iterator.h
@@ -41,7 +41,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Iter, class = void>
struct __move_iter_category_base {};
@@ -59,18 +59,33 @@
concept __move_iter_comparable = requires {
{ std::declval<const _Iter&>() == std::declval<_Sent>() } -> convertible_to<bool>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
class _LIBCPP_TEMPLATE_VIS move_iterator
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
: public __move_iter_category_base<_Iter>
#endif
{
+ #if _LIBCPP_STD_VER >= 20
+private:
+ _LIBCPP_HIDE_FROM_ABI
+ static constexpr auto __get_iter_concept() {
+ if constexpr (random_access_iterator<_Iter>) {
+ return random_access_iterator_tag{};
+ } else if constexpr (bidirectional_iterator<_Iter>) {
+ return bidirectional_iterator_tag{};
+ } else if constexpr (forward_iterator<_Iter>) {
+ return forward_iterator_tag{};
+ } else {
+ return input_iterator_tag{};
+ }
+ }
+#endif // _LIBCPP_STD_VER >= 20
public:
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using iterator_type = _Iter;
- using iterator_concept = input_iterator_tag;
+ using iterator_concept = decltype(__get_iter_concept());
// iterator_category is inherited and not always present
using value_type = iter_value_t<_Iter>;
using difference_type = iter_difference_t<_Iter>;
@@ -93,7 +108,7 @@
__libcpp_remove_reference_t<__reference>&&,
__reference
>::type reference;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
explicit move_iterator(_Iter __i) : __current_(std::move(__i)) {}
@@ -104,7 +119,7 @@
_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
pointer operator->() const { return __current_; }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr
move_iterator() requires is_constructible_v<_Iter> : __current_() {}
@@ -171,7 +186,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
move_iterator operator++(int) { move_iterator __tmp(*this); ++__current_; return __tmp; }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
move_iterator& operator--() { --__current_; return *this; }
@@ -186,7 +201,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
move_iterator& operator-=(difference_type __n) { __current_ -= __n; return *this; }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<sentinel_for<_Iter> _Sent>
friend _LIBCPP_HIDE_FROM_ABI constexpr
bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y)
@@ -223,7 +238,7 @@
{
return ranges::iter_swap(__x.__current_, __y.__current_);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
private:
template<class _It2> friend class move_iterator;
@@ -276,7 +291,7 @@
return __x.base() >= __y.base();
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
inline _LIBCPP_HIDE_FROM_ABI constexpr
auto operator<=>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
@@ -284,7 +299,7 @@
{
return __x.base() <=> __y.base();
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
@@ -304,7 +319,7 @@
}
#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI constexpr
move_iterator<_Iter> operator+(iter_difference_t<_Iter> __n, const move_iterator<_Iter>& __x)
@@ -320,7 +335,7 @@
{
return move_iterator<_Iter>(__x.base() + __n);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template <class _Iter>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17
diff --git a/third_party/llvm-project/libcxx/include/__iterator/move_sentinel.h b/third_party/llvm-project/libcxx/include/__iterator/move_sentinel.h
index 0d7336a..5f16474 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/move_sentinel.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/move_sentinel.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <semiregular _Sent>
class _LIBCPP_TEMPLATE_VIS move_sentinel
@@ -52,7 +52,7 @@
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(move_sentinel);
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/next.h b/third_party/llvm-project/libcxx/include/__iterator/next.h
index 49970ae..2eb2c1f 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/next.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/next.h
@@ -35,7 +35,7 @@
return __x;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.next]
@@ -77,7 +77,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/ostream_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/ostream_iterator.h
index d16f5a2..025712b 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/ostream_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/ostream_iterator.h
@@ -34,7 +34,7 @@
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/third_party/llvm-project/libcxx/include/__iterator/ostreambuf_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/ostreambuf_iterator.h
index b75f7b6..898ef90 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/ostreambuf_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/ostreambuf_iterator.h
@@ -33,7 +33,7 @@
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/third_party/llvm-project/libcxx/include/__iterator/permutable.h b/third_party/llvm-project/libcxx/include/__iterator/permutable.h
index 28d193e..adf88f5 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/permutable.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/permutable.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iterator>
concept permutable =
@@ -28,7 +28,7 @@
indirectly_movable_storable<_Iterator, _Iterator> &&
indirectly_swappable<_Iterator, _Iterator>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/prev.h b/third_party/llvm-project/libcxx/include/__iterator/prev.h
index af1e1ba..8e9c4f2 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/prev.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/prev.h
@@ -34,7 +34,7 @@
return __x;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.iter.op.prev]
@@ -70,7 +70,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/projected.h b/third_party/llvm-project/libcxx/include/__iterator/projected.h
index 19c076b..e74e56d 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/projected.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/projected.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<indirectly_readable _It, indirectly_regular_unary_invocable<_It> _Proj>
struct projected {
@@ -34,7 +34,7 @@
using difference_type = iter_difference_t<_It>;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/readable_traits.h b/third_party/llvm-project/libcxx/include/__iterator/readable_traits.h
index 8f17757..fe4f0cd 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/readable_traits.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/readable_traits.h
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [readable.traits]
template<class> struct __cond_value_type {};
@@ -85,7 +85,7 @@
indirectly_readable_traits<remove_cvref_t<_Ip> >,
iterator_traits<remove_cvref_t<_Ip> > >::value_type;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/reverse_access.h b/third_party/llvm-project/libcxx/include/__iterator/reverse_access.h
index 79b599c..b8c5a07 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/reverse_access.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/reverse_access.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, size_t _Np>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
@@ -93,7 +93,7 @@
return _VSTD::rend(__c);
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/reverse_iterator.h b/third_party/llvm-project/libcxx/include/__iterator/reverse_iterator.h
index f272e03..8437064 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/reverse_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/reverse_iterator.h
@@ -63,10 +63,10 @@
_Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
static_assert(__is_cpp17_bidirectional_iterator<_Iter>::value || bidirectional_iterator<_Iter>,
"reverse_iterator<It> requires It to be a bidirectional iterator.");
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
protected:
_Iter current;
@@ -77,7 +77,7 @@
random_access_iterator_tag,
typename iterator_traits<_Iter>::iterator_category>;
using pointer = typename iterator_traits<_Iter>::pointer;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using iterator_concept = _If<random_access_iterator<_Iter>, random_access_iterator_tag, bidirectional_iterator_tag>;
using value_type = iter_value_t<_Iter>;
using difference_type = iter_difference_t<_Iter>;
@@ -144,7 +144,7 @@
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator*() const {_Iter __tmp = current; return *--__tmp;}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
constexpr pointer operator->() const
requires is_pointer_v<_Iter> || requires(const _Iter __i) { __i.operator->(); }
@@ -160,7 +160,7 @@
pointer operator->() const {
return std::addressof(operator*());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reverse_iterator& operator++() {--current; return *this;}
@@ -181,7 +181,7 @@
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator[](difference_type __n) const {return *(*this + __n);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI friend constexpr
iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i)
noexcept(is_nothrow_copy_constructible_v<_Iter> &&
@@ -200,18 +200,18 @@
auto __ytmp = __y.base();
ranges::iter_swap(--__xtmp, --__ytmp);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
};
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() == __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() == __y.base();
}
@@ -220,11 +220,11 @@
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() > __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() > __y.base();
}
@@ -233,11 +233,11 @@
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() != __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() != __y.base();
}
@@ -246,11 +246,11 @@
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() < __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() < __y.base();
}
@@ -259,11 +259,11 @@
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() <= __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() <= __y.base();
}
@@ -272,16 +272,16 @@
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
bool
operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires requires {
{ __x.base() >= __y.base() } -> convertible_to<bool>;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
{
return __x.base() >= __y.base();
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
_LIBCPP_HIDE_FROM_ABI constexpr
compare_three_way_result_t<_Iter1, _Iter2>
@@ -289,7 +289,7 @@
{
return __y.base() <=> __x.base();
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
@@ -318,13 +318,13 @@
return reverse_iterator<_Iter>(__x.base() - __n);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter1, class _Iter2>
requires (!sized_sentinel_for<_Iter1, _Iter2>)
inline constexpr bool disable_sized_sentinel_for<reverse_iterator<_Iter1>, reverse_iterator<_Iter2>> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
@@ -498,7 +498,7 @@
}
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <ranges::bidirectional_range _Range>
_LIBCPP_HIDE_FROM_ABI constexpr ranges::
subrange<reverse_iterator<ranges::iterator_t<_Range>>, reverse_iterator<ranges::iterator_t<_Range>>>
@@ -512,7 +512,7 @@
struct __unwrap_iter_impl<reverse_iterator<reverse_iterator<_Iter> >, __b>
: __unwrap_reverse_iter_impl<reverse_iterator, reverse_iterator, _Iter> {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter, bool __b>
struct __unwrap_iter_impl<reverse_iterator<__unconstrained_reverse_iterator<_Iter>>, __b>
@@ -526,7 +526,7 @@
struct __unwrap_iter_impl<__unconstrained_reverse_iterator<__unconstrained_reverse_iterator<_Iter>>, __b>
: __unwrap_reverse_iter_impl<__unconstrained_reverse_iterator, __unconstrained_reverse_iterator, _Iter> {};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/size.h b/third_party/llvm-project/libcxx/include/__iterator/size.h
index 1452bd1..625eeb1 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/size.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/size.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Cont>
_LIBCPP_INLINE_VISIBILITY
@@ -34,7 +34,7 @@
_LIBCPP_INLINE_VISIBILITY
constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Cont>
_LIBCPP_INLINE_VISIBILITY
constexpr auto ssize(const _Cont& __c)
@@ -52,7 +52,7 @@
_LIBCPP_DIAGNOSTIC_POP
#endif
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/sortable.h b/third_party/llvm-project/libcxx/include/__iterator/sortable.h
index bcf934f..d4d77d6 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/sortable.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/sortable.h
@@ -23,14 +23,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Iter, class _Comp = ranges::less, class _Proj = identity>
concept sortable =
permutable<_Iter> &&
indirect_strict_weak_order<_Comp, projected<_Iter, _Proj>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/unreachable_sentinel.h b/third_party/llvm-project/libcxx/include/__iterator/unreachable_sentinel.h
index d77cc99..91fd0a5 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/unreachable_sentinel.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/unreachable_sentinel.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
struct unreachable_sentinel_t {
template<weakly_incrementable _Iter>
@@ -31,7 +31,7 @@
inline constexpr unreachable_sentinel_t unreachable_sentinel{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__iterator/wrap_iter.h b/third_party/llvm-project/libcxx/include/__iterator/wrap_iter.h
index 16defc1..d0246ad 100644
--- a/third_party/llvm-project/libcxx/include/__iterator/wrap_iter.h
+++ b/third_party/llvm-project/libcxx/include/__iterator/wrap_iter.h
@@ -34,7 +34,7 @@
typedef typename iterator_traits<iterator_type>::pointer pointer;
typedef typename iterator_traits<iterator_type>::reference reference;
typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef contiguous_iterator_tag iterator_concept;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__locale b/third_party/llvm-project/libcxx/include/__locale
index e0ffa0c..b461831 100644
--- a/third_party/llvm-project/libcxx/include/__locale
+++ b/third_party/llvm-project/libcxx/include/__locale
@@ -14,6 +14,7 @@
#include <__config>
#include <cctype>
#include <cstdint>
+#include <cstdlib>
#include <locale.h>
#include <mutex>
#include <string>
@@ -927,6 +928,11 @@
}
template <class _CharT>
+_LIBCPP_HIDE_FROM_ABI bool isblank(_CharT __c, const locale& __loc) {
+ return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c);
+}
+
+template <class _CharT>
inline _LIBCPP_INLINE_VISIBILITY
_CharT
toupper(_CharT __c, const locale& __loc)
diff --git a/third_party/llvm-project/libcxx/include/__memory/aligned_alloc.h b/third_party/llvm-project/libcxx/include/__memory/aligned_alloc.h
new file mode 100644
index 0000000..786963c
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__memory/aligned_alloc.h
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_ALIGNED_ALLOC_H
+#define _LIBCPP___MEMORY_ALIGNED_ALLOC_H
+
+#include <__config>
+#include <cstddef>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+
+// Low-level helpers to call the aligned allocation and deallocation functions
+// on the target platform. This is used to implement libc++'s own memory
+// allocation routines -- if you need to allocate memory inside the library,
+// chances are that you want to use `__libcpp_allocate` instead.
+//
+// Returns the allocated memory, or `nullptr` on failure.
+inline _LIBCPP_HIDE_FROM_ABI
+void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
+# if defined(_LIBCPP_MSVCRT_LIKE)
+ return ::_aligned_malloc(__size, __alignment);
+# elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC)
+ // aligned_alloc() requires that __size is a multiple of __alignment,
+ // but for C++ [new.delete.general], only states "if the value of an
+ // alignment argument passed to any of these functions is not a valid
+ // alignment value, the behavior is undefined".
+ // To handle calls such as ::operator new(1, std::align_val_t(128)), we
+ // round __size up to the next multiple of __alignment.
+ size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
+ // Rounding up could have wrapped around to zero, so we have to add another
+ // max() ternary to the actual call site to avoid succeeded in that case.
+ return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
+# else
+ void* __result = nullptr;
+ (void)::posix_memalign(&__result, __alignment, __size);
+ // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
+ return __result;
+# endif
+}
+
+inline _LIBCPP_HIDE_FROM_ABI
+void __libcpp_aligned_free(void* __ptr) {
+#if defined(_LIBCPP_MSVCRT_LIKE)
+ ::_aligned_free(__ptr);
+#else
+ ::free(__ptr);
+#endif
+}
+
+#endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_ALIGNED_ALLOC_H
diff --git a/third_party/llvm-project/libcxx/include/__memory/allocate_at_least.h b/third_party/llvm-project/libcxx/include/__memory/allocate_at_least.h
index ef205f8..8d8ad07 100644
--- a/third_party/llvm-project/libcxx/include/__memory/allocate_at_least.h
+++ b/third_party/llvm-project/libcxx/include/__memory/allocate_at_least.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Pointer>
struct allocation_result {
_Pointer ptr;
@@ -55,7 +55,7 @@
return {__alloc.allocate(__n), __n};
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/allocator.h b/third_party/llvm-project/libcxx/include/__memory/allocator.h
index 54c9b78..244013c 100644
--- a/third_party/llvm-project/libcxx/include/__memory/allocator.h
+++ b/third_party/llvm-project/libcxx/include/__memory/allocator.h
@@ -11,6 +11,7 @@
#define _LIBCPP___MEMORY_ALLOCATOR_H
#include <__config>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator_traits.h>
#include <__type_traits/is_constant_evaluated.h>
@@ -116,7 +117,7 @@
}
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
allocation_result<_Tp*> allocate_at_least(size_t __n) {
return {allocate(__n), __n};
@@ -205,7 +206,7 @@
}
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
allocation_result<const _Tp*> allocate_at_least(size_t __n) {
return {allocate(__n), __n};
diff --git a/third_party/llvm-project/libcxx/include/__memory/allocator_arg_t.h b/third_party/llvm-project/libcxx/include/__memory/allocator_arg_t.h
index 15f8c98..9e2d8c6 100644
--- a/third_party/llvm-project/libcxx/include/__memory/allocator_arg_t.h
+++ b/third_party/llvm-project/libcxx/include/__memory/allocator_arg_t.h
@@ -25,9 +25,9 @@
struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+#if defined(_LIBCPP_BUILDING_LIBRARY)
extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
-#else
+#elif !defined(_LIBCPP_CXX03_LANG)
/* inline */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
#endif
diff --git a/third_party/llvm-project/libcxx/include/__memory/allocator_traits.h b/third_party/llvm-project/libcxx/include/__memory/allocator_traits.h
index 3a23b47..57f88a3 100644
--- a/third_party/llvm-project/libcxx/include/__memory/allocator_traits.h
+++ b/third_party/llvm-project/libcxx/include/__memory/allocator_traits.h
@@ -300,7 +300,7 @@
__enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static void construct(allocator_type&, _Tp* __p, _Args&&... __args) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
#else
::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
@@ -319,7 +319,7 @@
__enable_if_t<!__has_destroy<allocator_type, _Tp*>::value> >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static void destroy(allocator_type&, _Tp* __p) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_VSTD::destroy_at(__p);
#else
__p->~_Tp();
diff --git a/third_party/llvm-project/libcxx/include/__memory/assume_aligned.h b/third_party/llvm-project/libcxx/include/__memory/assume_aligned.h
index a1fd244..1f505f5 100644
--- a/third_party/llvm-project/libcxx/include/__memory/assume_aligned.h
+++ b/third_party/llvm-project/libcxx/include/__memory/assume_aligned.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <size_t _Np, class _Tp>
[[nodiscard]]
@@ -39,7 +39,7 @@
}
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/compressed_pair.h b/third_party/llvm-project/libcxx/include/__memory/compressed_pair.h
index 8093d7c..d5986da 100644
--- a/third_party/llvm-project/libcxx/include/__memory/compressed_pair.h
+++ b/third_party/llvm-project/libcxx/include/__memory/compressed_pair.h
@@ -13,7 +13,7 @@
#include <__config>
#include <__fwd/get.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_indices.h>
+#include <__tuple/tuple_indices.h>
#include <__type_traits/decay.h>
#include <__type_traits/dependent_type.h>
#include <__type_traits/enable_if.h>
@@ -46,7 +46,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_() {}
- template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value> >
+ template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
explicit __compressed_pair_elem(_Up&& __u) : __value_(std::forward<_Up>(__u)) {}
@@ -75,7 +75,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_type() {}
- template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value> >
+ template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
explicit __compressed_pair_elem(_Up&& __u) : __value_type(std::forward<_Up>(__u)) {}
diff --git a/third_party/llvm-project/libcxx/include/__memory/concepts.h b/third_party/llvm-project/libcxx/include/__memory/concepts.h
index 12d7bf8..9517a8f 100644
--- a/third_party/llvm-project/libcxx/include/__memory/concepts.h
+++ b/third_party/llvm-project/libcxx/include/__memory/concepts.h
@@ -26,7 +26,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -62,7 +62,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/construct_at.h b/third_party/llvm-project/libcxx/include/__memory/construct_at.h
index ffee002..fb146b7 100644
--- a/third_party/llvm-project/libcxx/include/__memory/construct_at.h
+++ b/third_party/llvm-project/libcxx/include/__memory/construct_at.h
@@ -30,19 +30,19 @@
// construct_at
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
_LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at");
- return ::new (_VSTD::__voidify(*__location)) _Tp(_VSTD::forward<_Args>(__args)...);
+ return ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
}
#endif
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
return std::construct_at(__location, std::forward<_Args>(__args)...);
#else
return _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at"),
@@ -66,12 +66,12 @@
__loc->~_Tp();
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, typename enable_if<is_array<_Tp>::value, int>::type = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __destroy_at(_Tp* __loc) {
_LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
- _VSTD::__destroy(_VSTD::begin(*__loc), _VSTD::end(*__loc));
+ std::__destroy(std::begin(*__loc), std::end(*__loc));
}
#endif
@@ -79,41 +79,51 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
_ForwardIterator __destroy(_ForwardIterator __first, _ForwardIterator __last) {
for (; __first != __last; ++__first)
- _VSTD::__destroy_at(_VSTD::addressof(*__first));
+ std::__destroy_at(std::addressof(*__first));
return __first;
}
-#if _LIBCPP_STD_VER > 14
+template <class _BidirectionalIterator>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+_BidirectionalIterator __reverse_destroy(_BidirectionalIterator __first, _BidirectionalIterator __last) {
+ while (__last != __first) {
+ --__last;
+ std::__destroy_at(std::addressof(*__last));
+ }
+ return __last;
+}
+
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void destroy_at(_Tp* __loc) {
- _VSTD::__destroy_at(__loc);
+ std::__destroy_at(__loc);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, enable_if_t<is_array_v<_Tp>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void destroy_at(_Tp* __loc) {
- _VSTD::__destroy_at(__loc);
+ std::__destroy_at(__loc);
}
#endif
template <class _ForwardIterator>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void destroy(_ForwardIterator __first, _ForwardIterator __last) {
- (void)_VSTD::__destroy(_VSTD::move(__first), _VSTD::move(__last));
+ (void)std::__destroy(std::move(__first), std::move(__last));
}
template <class _ForwardIterator, class _Size>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
for (; __n > 0; (void)++__first, --__n)
- _VSTD::__destroy_at(_VSTD::addressof(*__first));
+ std::__destroy_at(std::addressof(*__first));
return __first;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/pointer_traits.h b/third_party/llvm-project/libcxx/include/__memory/pointer_traits.h
index c4f20de..c33e7bd 100644
--- a/third_party/llvm-project/libcxx/include/__memory/pointer_traits.h
+++ b/third_party/llvm-project/libcxx/include/__memory/pointer_traits.h
@@ -200,7 +200,7 @@
_And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value
> >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename decay<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>::type
+__decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>
__to_address(const _Pointer& __p) _NOEXCEPT {
return __to_address_helper<_Pointer>::__call(__p);
}
@@ -223,7 +223,7 @@
}
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY constexpr
auto to_address(_Tp *__p) noexcept {
diff --git a/third_party/llvm-project/libcxx/include/__memory/ranges_construct_at.h b/third_party/llvm-project/libcxx/include/__memory/ranges_construct_at.h
index e63585d..9ded2fc 100644
--- a/third_party/llvm-project/libcxx/include/__memory/ranges_construct_at.h
+++ b/third_party/llvm-project/libcxx/include/__memory/ranges_construct_at.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
// construct_at
@@ -118,7 +118,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/ranges_uninitialized_algorithms.h b/third_party/llvm-project/libcxx/include/__memory/ranges_uninitialized_algorithms.h
index 15c78e2..bea5385 100644
--- a/third_party/llvm-project/libcxx/include/__memory/ranges_uninitialized_algorithms.h
+++ b/third_party/llvm-project/libcxx/include/__memory/ranges_uninitialized_algorithms.h
@@ -33,7 +33,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -312,7 +312,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/raw_storage_iterator.h b/third_party/llvm-project/libcxx/include/__memory/raw_storage_iterator.h
index 11971de..df7ef5a 100644
--- a/third_party/llvm-project/libcxx/include/__memory/raw_storage_iterator.h
+++ b/third_party/llvm-project/libcxx/include/__memory/raw_storage_iterator.h
@@ -39,7 +39,7 @@
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef ptrdiff_t difference_type;
#else
typedef void difference_type;
diff --git a/third_party/llvm-project/libcxx/include/__memory/shared_ptr.h b/third_party/llvm-project/libcxx/include/__memory/shared_ptr.h
index b77ce92..1d72eb6 100644
--- a/third_party/llvm-project/libcxx/include/__memory/shared_ptr.h
+++ b/third_party/llvm-project/libcxx/include/__memory/shared_ptr.h
@@ -29,17 +29,32 @@
#include <__memory/pointer_traits.h>
#include <__memory/uninitialized_algorithms.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/add_lvalue_reference.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/disjunction.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_bounded_array.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_unbounded_array.h>
+#include <__type_traits/nat.h>
+#include <__type_traits/negation.h>
+#include <__type_traits/remove_extent.h>
+#include <__type_traits/remove_reference.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
+#include <__verbose_abort>
#include <cstddef>
-#include <cstdlib> // abort
#include <iosfwd>
#include <new>
#include <stdexcept>
#include <typeinfo>
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-# include <atomic>
+# include <__atomic/memory_order.h>
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -118,10 +133,10 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_weak_ptr()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_weak_ptr();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_weak_ptr was thrown in -fno-exceptions mode");
#endif
}
@@ -219,7 +234,7 @@
__shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
: __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
const void* __get_deleter(const type_info&) const _NOEXCEPT override;
#endif
@@ -228,7 +243,7 @@
void __on_zero_shared_weak() _NOEXCEPT override;
};
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
template <class _Tp, class _Dp, class _Alloc>
const void*
@@ -237,7 +252,7 @@
return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
template <class _Tp, class _Dp, class _Alloc>
void
@@ -260,7 +275,10 @@
__a.deallocate(_PTraits::pointer_to(*this), 1);
}
-struct __default_initialize_tag {};
+// This tag is used to instantiate an allocator type. The various shared_ptr control blocks
+// detect that the allocator has been instantiated for this type and perform alternative
+// initialization/destruction based on that.
+struct __for_overwrite_tag {};
template <class _Tp, class _Alloc>
struct __shared_ptr_emplace
@@ -271,25 +289,20 @@
explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
: __storage_(_VSTD::move(__a))
{
-#if _LIBCPP_STD_VER > 17
- using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
- _TpAlloc __tmp(*__get_alloc());
- allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _VSTD::forward<_Args>(__args)...);
+#if _LIBCPP_STD_VER >= 20
+ if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
+ static_assert(sizeof...(_Args) == 0, "No argument should be provided to the control block when using _for_overwrite");
+ ::new ((void*)__get_elem()) _Tp;
+ } else {
+ using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
+ _TpAlloc __tmp(*__get_alloc());
+ allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _VSTD::forward<_Args>(__args)...);
+ }
#else
::new ((void*)__get_elem()) _Tp(_VSTD::forward<_Args>(__args)...);
#endif
}
-
-#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI
- explicit __shared_ptr_emplace(__default_initialize_tag, _Alloc __a)
- : __storage_(std::move(__a))
- {
- ::new ((void*)__get_elem()) _Tp;
- }
-#endif
-
_LIBCPP_HIDE_FROM_ABI
_Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
@@ -298,10 +311,14 @@
private:
void __on_zero_shared() _NOEXCEPT override {
-#if _LIBCPP_STD_VER > 17
- using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
- _TpAlloc __tmp(*__get_alloc());
- allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem());
+#if _LIBCPP_STD_VER >= 20
+ if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
+ __get_elem()->~_Tp();
+ } else {
+ using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
+ _TpAlloc __tmp(*__get_alloc());
+ allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem());
+ }
#else
__get_elem()->~_Tp();
#endif
@@ -367,13 +384,57 @@
template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
-template<class _Tp, class _Up>
+// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.general-6
+// A pointer type Y* is said to be compatible with a pointer type T*
+// when either Y* is convertible to T* or Y is U[N] and T is cv U[].
+#if _LIBCPP_STD_VER >= 17
+template <class _Yp, class _Tp>
+struct __bounded_convertible_to_unbounded : false_type {};
+
+template <class _Up, std::size_t _Np, class _Tp>
+struct __bounded_convertible_to_unbounded<_Up[_Np], _Tp>
+ : is_same<__remove_cv_t<_Tp>, _Up[]> {};
+
+template <class _Yp, class _Tp>
struct __compatible_with
-#if _LIBCPP_STD_VER > 14
- : is_convertible<remove_extent_t<_Tp>*, remove_extent_t<_Up>*> {};
+ : _Or<
+ is_convertible<_Yp*, _Tp*>,
+ __bounded_convertible_to_unbounded<_Yp, _Tp>
+ > {};
#else
- : is_convertible<_Tp*, _Up*> {};
-#endif // _LIBCPP_STD_VER > 14
+template <class _Yp, class _Tp>
+struct __compatible_with
+ : is_convertible<_Yp*, _Tp*> {};
+#endif // _LIBCPP_STD_VER >= 17
+
+// Constructors that take raw pointers have a different set of "compatible" constraints
+// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.const-9.1
+// - If T is an array type, then either T is U[N] and Y(*)[N] is convertible to T*,
+// or T is U[] and Y(*)[] is convertible to T*.
+// - If T is not an array type, then Y* is convertible to T*.
+#if _LIBCPP_STD_VER >= 17
+template <class _Yp, class _Tp, class = void>
+struct __raw_pointer_compatible_with : _And<
+ _Not<is_array<_Tp>>,
+ is_convertible<_Yp*, _Tp*>
+ > {};
+
+template <class _Yp, class _Up, std::size_t _Np>
+struct __raw_pointer_compatible_with<_Yp, _Up[_Np], __enable_if_t<
+ is_convertible<_Yp(*)[_Np], _Up(*)[_Np]>::value> >
+ : true_type {};
+
+template <class _Yp, class _Up>
+struct __raw_pointer_compatible_with<_Yp, _Up[], __enable_if_t<
+ is_convertible<_Yp(*)[], _Up(*)[]>::value> >
+ : true_type {};
+
+#else
+template <class _Yp, class _Tp>
+struct __raw_pointer_compatible_with
+ : is_convertible<_Yp*, _Tp*> {};
+#endif // _LIBCPP_STD_VER >= 17
+
template <class _Ptr, class = void>
struct __is_deletable : false_type { };
@@ -387,24 +448,24 @@
template <class _Dp, class _Pt,
class = decltype(std::declval<_Dp>()(std::declval<_Pt>()))>
-static true_type __well_formed_deleter_test(int);
+true_type __well_formed_deleter_test(int);
template <class, class>
-static false_type __well_formed_deleter_test(...);
+false_type __well_formed_deleter_test(...);
template <class _Dp, class _Pt>
struct __well_formed_deleter : decltype(std::__well_formed_deleter_test<_Dp, _Pt>(0)) {};
-template<class _Dp, class _Tp, class _Yp>
+template<class _Dp, class _Yp, class _Tp>
struct __shared_ptr_deleter_ctor_reqs
{
- static const bool value = __compatible_with<_Tp, _Yp>::value &&
+ static const bool value = __raw_pointer_compatible_with<_Yp, _Tp>::value &&
is_move_constructible<_Dp>::value &&
- __well_formed_deleter<_Dp, _Tp*>::value;
+ __well_formed_deleter<_Dp, _Yp*>::value;
};
#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
-# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))
#else
# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI
#endif
@@ -413,7 +474,7 @@
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
{
public:
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef weak_ptr<_Tp> weak_type;
typedef remove_extent_t<_Tp> element_type;
#else
@@ -439,7 +500,7 @@
template<class _Yp, class = __enable_if_t<
_And<
- __compatible_with<_Yp, _Tp>
+ __raw_pointer_compatible_with<_Yp, _Tp>
// In C++03 we get errors when trying to do SFINAE with the
// delete operator, so we always pretend that it's deletable.
// The same happens on GCC.
@@ -457,15 +518,15 @@
__enable_weak_this(__p, __p);
}
- template<class _Yp, class _Dp, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value> >
+ template<class _Yp, class _Dp, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value> >
_LIBCPP_HIDE_FROM_ABI
shared_ptr(_Yp* __p, _Dp __d)
: __ptr_(__p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
#ifndef _LIBCPP_CXX03_LANG
@@ -474,25 +535,25 @@
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#endif // not _LIBCPP_CXX03_LANG
__enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
- template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value> >
+ template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value> >
_LIBCPP_HIDE_FROM_ABI
shared_ptr(_Yp* __p, _Dp __d, _Alloc __a)
: __ptr_(__p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
@@ -506,14 +567,14 @@
#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = _VSTD::addressof(*__hold2.release());
__enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Dp>
@@ -521,10 +582,10 @@
shared_ptr(nullptr_t __p, _Dp __d)
: __ptr_(nullptr)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
#ifndef _LIBCPP_CXX03_LANG
@@ -532,14 +593,14 @@
#else
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#endif // not _LIBCPP_CXX03_LANG
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Dp, class _Alloc>
@@ -547,10 +608,10 @@
shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
: __ptr_(nullptr)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
@@ -563,14 +624,14 @@
_CntrlBlk(__p, __d, __a);
#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = _VSTD::addressof(*__hold2.release());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Yp>
@@ -646,13 +707,14 @@
template <class _Yp, class _Dp, class = __enable_if_t<
!is_lvalue_reference<_Dp>::value &&
+ __compatible_with<_Yp, _Tp>::value &&
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
> >
_LIBCPP_HIDE_FROM_ABI
shared_ptr(unique_ptr<_Yp, _Dp>&& __r)
: __ptr_(__r.get())
{
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
if (__ptr_ == nullptr)
__cntrl_ = nullptr;
else
@@ -668,13 +730,14 @@
template <class _Yp, class _Dp, class = void, class = __enable_if_t<
is_lvalue_reference<_Dp>::value &&
+ __compatible_with<_Yp, _Tp>::value &&
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
> >
_LIBCPP_HIDE_FROM_ABI
shared_ptr(unique_ptr<_Yp, _Dp>&& __r)
: __ptr_(__r.get())
{
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
if (__ptr_ == nullptr)
__cntrl_ = nullptr;
else
@@ -740,9 +803,10 @@
}
#endif
- template <class _Yp, class _Dp, class = __enable_if_t<
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
- > >
+ template <class _Yp, class _Dp, class = __enable_if_t<_And<
+ __compatible_with<_Yp, _Tp>,
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>
+ >::value> >
_LIBCPP_HIDE_FROM_ABI
shared_ptr<_Tp>& operator=(unique_ptr<_Yp, _Dp>&& __r)
{
@@ -764,7 +828,7 @@
}
template<class _Yp, class = __enable_if_t<
- __compatible_with<_Yp, _Tp>::value
+ __raw_pointer_compatible_with<_Yp, _Tp>::value
> >
_LIBCPP_HIDE_FROM_ABI
void reset(_Yp* __p)
@@ -773,8 +837,7 @@
}
template<class _Yp, class _Dp, class = __enable_if_t<
- __compatible_with<_Yp, _Tp>::value
- > >
+ __shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value> >
_LIBCPP_HIDE_FROM_ABI
void reset(_Yp* __p, _Dp __d)
{
@@ -782,8 +845,7 @@
}
template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<
- __compatible_with<_Yp, _Tp>::value
- > >
+ __shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value> >
_LIBCPP_HIDE_FROM_ABI
void reset(_Yp* __p, _Dp __d, _Alloc __a)
{
@@ -848,7 +910,7 @@
return __cntrl_ == __p.__cntrl_;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI
__add_lvalue_reference_t<element_type> operator[](ptrdiff_t __i) const
{
@@ -858,7 +920,7 @@
}
#endif
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
template <class _Dp>
_LIBCPP_HIDE_FROM_ABI
_Dp* __get_deleter() const _NOEXCEPT
@@ -867,7 +929,7 @@
? const_cast<void *>(__cntrl_->__get_deleter(typeid(_Dp)))
: nullptr);
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
template<class _Yp, class _CntrlBlk>
_LIBCPP_HIDE_FROM_ABI
@@ -928,7 +990,7 @@
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp>
shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
template<class _Tp, class _Dp>
@@ -963,12 +1025,9 @@
_LIBCPP_HIDE_FROM_ABI
shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a)
{
- using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;
- using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
- __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);
- ::new ((void*)_VSTD::addressof(*__guard.__get())) _ControlBlock(__default_initialize_tag{}, __a);
- auto __control_block = __guard.__release_ptr();
- return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _VSTD::addressof(*__control_block));
+ using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
+ _ForOverwriteAllocator __alloc(__a);
+ return std::allocate_shared<_Tp>(__alloc);
}
template<class _Tp, __enable_if_t<!is_array<_Tp>::value, int> = 0>
@@ -980,7 +1039,7 @@
#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <size_t _Alignment>
struct __sp_aligned_storage {
@@ -1000,26 +1059,25 @@
explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t __count, _Tp const& __arg)
: __alloc_(__alloc), __count_(__count)
{
- std::__uninitialized_allocator_fill_n(__alloc_, std::begin(__data_), __count_, __arg);
+ std::__uninitialized_allocator_fill_n_multidimensional(__alloc_, std::begin(__data_), __count_, __arg);
}
_LIBCPP_HIDE_FROM_ABI
explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t __count)
: __alloc_(__alloc), __count_(__count)
{
- std::__uninitialized_allocator_value_construct_n(__alloc_, std::begin(__data_), __count_);
- }
-
#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI
- explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t __count, __default_initialize_tag)
- : __alloc_(__alloc), __count_(__count)
- {
- // We are purposefully not using an allocator-aware default construction because the spec says so.
- // There's currently no way of expressing default initialization in an allocator-aware manner anyway.
- std::uninitialized_default_construct_n(std::begin(__data_), __count_);
- }
+ if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
+ // We are purposefully not using an allocator-aware default construction because the spec says so.
+ // There's currently no way of expressing default initialization in an allocator-aware manner anyway.
+ std::uninitialized_default_construct_n(std::begin(__data_), __count_);
+ } else {
+ std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::begin(__data_), __count_);
+ }
+#else
+ std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::begin(__data_), __count_);
#endif
+ }
// Returns the number of bytes required to store a control block followed by the given number
// of elements of _Tp, with the whole storage being aligned to a multiple of _Tp's alignment.
@@ -1042,8 +1100,17 @@
private:
void __on_zero_shared() _NOEXCEPT override {
+#if _LIBCPP_STD_VER >= 20
+ if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
+ std::__reverse_destroy(__data_, __data_ + __count_);
+ } else {
+ __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
+ std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + __count_);
+ }
+#else
__allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + __count_);
+#endif
}
void __on_zero_shared_weak() _NOEXCEPT override {
@@ -1096,30 +1163,40 @@
_LIBCPP_HIDE_FROM_ABI
explicit __bounded_array_control_block(_Alloc const& __alloc, _Tp const& __arg) : __alloc_(__alloc) {
- std::__uninitialized_allocator_fill_n(__alloc_, std::addressof(__data_[0]), _Count, __arg);
+ std::__uninitialized_allocator_fill_n_multidimensional(__alloc_, std::addressof(__data_[0]), _Count, __arg);
}
_LIBCPP_HIDE_FROM_ABI
explicit __bounded_array_control_block(_Alloc const& __alloc) : __alloc_(__alloc) {
- std::__uninitialized_allocator_value_construct_n(__alloc_, std::addressof(__data_[0]), _Count);
- }
-
#if _LIBCPP_STD_VER >= 20
- _LIBCPP_HIDE_FROM_ABI
- explicit __bounded_array_control_block(_Alloc const& __alloc, __default_initialize_tag) : __alloc_(__alloc) {
- // We are purposefully not using an allocator-aware default construction because the spec says so.
- // There's currently no way of expressing default initialization in an allocator-aware manner anyway.
- std::uninitialized_default_construct_n(std::addressof(__data_[0]), _Count);
- }
+ if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
+ // We are purposefully not using an allocator-aware default construction because the spec says so.
+ // There's currently no way of expressing default initialization in an allocator-aware manner anyway.
+ std::uninitialized_default_construct_n(std::addressof(__data_[0]), _Count);
+ } else {
+ std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::addressof(__data_[0]), _Count);
+ }
+#else
+ std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, std::addressof(__data_[0]), _Count);
#endif
+ }
_LIBCPP_HIDE_FROM_ABI_VIRTUAL
~__bounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_
private:
void __on_zero_shared() _NOEXCEPT override {
+#if _LIBCPP_STD_VER >= 20
+ if constexpr (is_same_v<typename _Alloc::value_type, __for_overwrite_tag>) {
+ std::__reverse_destroy(__data_, __data_ + _Count);
+ } else {
+ __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
+ std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + _Count);
+ }
+#else
__allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_);
std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + _Count);
+#endif
}
void __on_zero_shared_weak() _NOEXCEPT override {
@@ -1152,9 +1229,9 @@
return shared_ptr<_Array>::__create_with_control_block(__control_block->__get_data(), __control_block);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// bounded array variants
template<class _Tp, class _Alloc, class = __enable_if_t<is_bounded_array<_Tp>::value>>
@@ -1175,7 +1252,9 @@
_LIBCPP_HIDE_FROM_ABI
shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a)
{
- return std::__allocate_shared_bounded_array<_Tp>(__a, __default_initialize_tag{});
+ using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
+ _ForOverwriteAllocator __alloc(__a);
+ return std::__allocate_shared_bounded_array<_Tp>(__alloc);
}
template<class _Tp, class = __enable_if_t<is_bounded_array<_Tp>::value>>
@@ -1196,7 +1275,7 @@
_LIBCPP_HIDE_FROM_ABI
shared_ptr<_Tp> make_shared_for_overwrite()
{
- return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>(), __default_initialize_tag{});
+ return std::__allocate_shared_bounded_array<_Tp>(allocator<__for_overwrite_tag>());
}
// unbounded array variants
@@ -1218,7 +1297,9 @@
_LIBCPP_HIDE_FROM_ABI
shared_ptr<_Tp> allocate_shared_for_overwrite(const _Alloc& __a, size_t __n)
{
- return std::__allocate_shared_unbounded_array<_Tp>(__a, __n, __default_initialize_tag{});
+ using _ForOverwriteAllocator = __allocator_traits_rebind_t<_Alloc, __for_overwrite_tag>;
+ _ForOverwriteAllocator __alloc(__a);
+ return std::__allocate_shared_unbounded_array<_Tp>(__alloc, __n);
}
template<class _Tp, class = __enable_if_t<is_unbounded_array<_Tp>::value>>
@@ -1239,10 +1320,10 @@
_LIBCPP_HIDE_FROM_ABI
shared_ptr<_Tp> make_shared_for_overwrite(size_t __n)
{
- return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n, __default_initialize_tag{});
+ return std::__allocate_shared_unbounded_array<_Tp>(allocator<__for_overwrite_tag>(), __n);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1302,7 +1383,7 @@
#endif // _LIBCPP_STD_VER <= 17
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI strong_ordering
operator<=>(shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) noexcept
@@ -1411,7 +1492,7 @@
#endif // _LIBCPP_STD_VER <= 17
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp>
_LIBCPP_HIDE_FROM_ABI strong_ordering
operator<=>(shared_ptr<_Tp> const& __x, nullptr_t) noexcept
@@ -1465,7 +1546,7 @@
typename shared_ptr<_Tp>::element_type*>(__r.get()));
}
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
template<class _Dp, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1475,13 +1556,13 @@
return __p.template __get_deleter<_Dp>();
}
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
template<class _Tp>
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
{
public:
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef remove_extent_t<_Tp> element_type;
#else
typedef _Tp element_type;
@@ -1566,7 +1647,7 @@
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp>
weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
#endif
@@ -1742,7 +1823,7 @@
return __r;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp = void> struct owner_less;
#else
template <class _Tp> struct owner_less;
@@ -1779,7 +1860,7 @@
{return __x.owner_before(__y);}
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <>
struct _LIBCPP_TEMPLATE_VIS owner_less<void>
{
@@ -1825,7 +1906,7 @@
shared_ptr<_Tp const> shared_from_this() const
{return shared_ptr<const _Tp>(__weak_this_);}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
weak_ptr<_Tp> weak_from_this() _NOEXCEPT
{ return __weak_this_; }
@@ -1833,7 +1914,7 @@
_LIBCPP_INLINE_VISIBILITY
weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT
{ return __weak_this_; }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
template <class _Up> friend class shared_ptr;
};
diff --git a/third_party/llvm-project/libcxx/include/__memory/swap_allocator.h b/third_party/llvm-project/libcxx/include/__memory/swap_allocator.h
index c6e1751..90851cb 100644
--- a/third_party/llvm-project/libcxx/include/__memory/swap_allocator.h
+++ b/third_party/llvm-project/libcxx/include/__memory/swap_allocator.h
@@ -23,7 +23,7 @@
template <typename _Alloc>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc& __a1, _Alloc& __a2, true_type)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
@@ -39,7 +39,7 @@
template <typename _Alloc>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swap_allocator(_Alloc& __a1, _Alloc& __a2)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
diff --git a/third_party/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h b/third_party/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
index 63a45b2..d860cee 100644
--- a/third_party/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/third_party/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
@@ -58,12 +58,12 @@
__uninitialized_copy(_InputIterator __ifirst, _Sentinel1 __ilast,
_ForwardIterator __ofirst, _Sentinel2 __olast) {
_ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __ifirst != __ilast && __idx != __olast; ++__ifirst, (void)++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -90,12 +90,12 @@
__uninitialized_copy_n(_InputIterator __ifirst, _Size __n,
_ForwardIterator __ofirst, _Sentinel __olast) {
_ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0 && __idx != __olast; ++__ifirst, (void)++__idx, (void)--__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -121,13 +121,13 @@
_ForwardIterator __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
{
_ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -154,13 +154,13 @@
_ForwardIterator __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{
_ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -180,7 +180,7 @@
return _VSTD::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// uninitialized_default_construct
@@ -188,12 +188,12 @@
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -217,12 +217,12 @@
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -245,12 +245,12 @@
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -274,12 +274,12 @@
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -304,13 +304,13 @@
__uninitialized_move(_InputIterator __ifirst, _Sentinel1 __ilast,
_ForwardIterator __ofirst, _Sentinel2 __olast, _IterMove __iter_move) {
auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __ifirst != __ilast && __idx != __olast; ++__idx, (void)++__ifirst) {
::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -338,12 +338,12 @@
__uninitialized_move_n(_InputIterator __ifirst, _Size __n,
_ForwardIterator __ofirst, _Sentinel __olast, _IterMove __iter_move) {
auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0 && __idx != __olast; ++__idx, (void)++__ifirst, --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -410,7 +410,7 @@
// This function assumes that the allocator is bound to the correct type.
template<class _Alloc, class _Tp>
_LIBCPP_HIDE_FROM_ABI
-constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc) {
+constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc) {
static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
"The allocator should already be rebound to the correct type");
@@ -421,12 +421,12 @@
_Tp& __array = *__loc;
// If an exception is thrown, destroy what we have constructed so far in reverse order.
- __exception_guard __guard([&]() {
+ auto __guard = std::__make_exception_guard([&]() {
std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
});
for (; __i != extent_v<_Tp>; ++__i) {
- std::__allocator_construct_at(__elem_alloc, std::addressof(__array[__i]));
+ std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]));
}
__guard.__complete();
} else {
@@ -446,13 +446,13 @@
// This function assumes that the allocator is bound to the correct type.
template<class _Alloc, class _Tp, class _Arg>
_LIBCPP_HIDE_FROM_ABI
-constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc, _Arg const& __arg) {
+constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* __loc, _Arg const& __arg) {
static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
"The allocator should already be rebound to the correct type");
if constexpr (is_array_v<_Tp>) {
static_assert(is_array_v<_Arg>,
- "Provided non-array initialization argument to __allocator_construct_at when "
+ "Provided non-array initialization argument to __allocator_construct_at_multidimensional when "
"trying to construct an array.");
using _Element = remove_extent_t<_Tp>;
@@ -461,11 +461,11 @@
_Tp& __array = *__loc;
// If an exception is thrown, destroy what we have constructed so far in reverse order.
- __exception_guard __guard([&]() {
+ auto __guard = std::__make_exception_guard([&]() {
std::__allocator_destroy_multidimensional(__elem_alloc, __array, __array + __i);
});
for (; __i != extent_v<_Tp>; ++__i) {
- std::__allocator_construct_at(__elem_alloc, std::addressof(__array[__i]), __arg[__i]);
+ std::__allocator_construct_at_multidimensional(__elem_alloc, std::addressof(__array[__i]), __arg[__i]);
}
__guard.__complete();
} else {
@@ -481,38 +481,38 @@
// initialization using allocator_traits destruction. If the elements in the range are C-style
// arrays, they are initialized element-wise using allocator construction, and recursively so.
template<class _Alloc, class _BidirIter, class _Tp, class _Size = typename iterator_traits<_BidirIter>::difference_type>
-_LIBCPP_HIDE_FROM_ABI
-constexpr void __uninitialized_allocator_fill_n(_Alloc& __alloc, _BidirIter __it, _Size __n, _Tp const& __value) {
+_LIBCPP_HIDE_FROM_ABI constexpr void
+__uninitialized_allocator_fill_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n, _Tp const& __value) {
using _ValueType = typename iterator_traits<_BidirIter>::value_type;
__allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
_BidirIter __begin = __it;
// If an exception is thrown, destroy what we have constructed so far in reverse order.
- __exception_guard __guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
+ auto __guard = std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
for (; __n != 0; --__n, ++__it) {
- std::__allocator_construct_at(__value_alloc, std::addressof(*__it), __value);
+ std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it), __value);
}
__guard.__complete();
}
-// Same as __uninitialized_allocator_fill_n, but doesn't pass any initialization argument
+// Same as __uninitialized_allocator_fill_n_multidimensional, but doesn't pass any initialization argument
// to the allocator's construct method, which results in value initialization.
-template<class _Alloc, class _BidirIter, class _Size = typename iterator_traits<_BidirIter>::difference_type>
-_LIBCPP_HIDE_FROM_ABI
-constexpr void __uninitialized_allocator_value_construct_n(_Alloc& __alloc, _BidirIter __it, _Size __n) {
+template <class _Alloc, class _BidirIter, class _Size = typename iterator_traits<_BidirIter>::difference_type>
+_LIBCPP_HIDE_FROM_ABI constexpr void
+__uninitialized_allocator_value_construct_n_multidimensional(_Alloc& __alloc, _BidirIter __it, _Size __n) {
using _ValueType = typename iterator_traits<_BidirIter>::value_type;
__allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
_BidirIter __begin = __it;
// If an exception is thrown, destroy what we have constructed so far in reverse order.
- __exception_guard __guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
+ auto __guard = std::__make_exception_guard([&]() { std::__allocator_destroy_multidimensional(__value_alloc, __begin, __it); });
for (; __n != 0; --__n, ++__it) {
- std::__allocator_construct_at(__value_alloc, std::addressof(*__it));
+ std::__allocator_construct_at_multidimensional(__value_alloc, std::addressof(*__it));
}
__guard.__complete();
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
// Destroy all elements in [__first, __last) from left to right using allocator destruction.
template <class _Alloc, class _Iter, class _Sent>
@@ -600,7 +600,7 @@
auto __guard =
std::__make_exception_guard(_AllocatorDestroyRangeReverse<_Alloc, _Iter2>(__alloc, __destruct_first, __first2));
while (__first1 != __last1) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move_if_noexcept(*__first1));
#else
allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move(*__first1));
diff --git a/third_party/llvm-project/libcxx/include/__memory/unique_ptr.h b/third_party/llvm-project/libcxx/include/__memory/unique_ptr.h
index 9cdbda8..b30f8b2 100644
--- a/third_party/llvm-project/libcxx/include/__memory/unique_ptr.h
+++ b/third_party/llvm-project/libcxx/include/__memory/unique_ptr.h
@@ -115,7 +115,7 @@
};
#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
-# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((__trivial_abi__))
#else
# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI
#endif
@@ -556,7 +556,7 @@
operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _T1, class _D1, class _T2, class _D2>
requires three_way_comparable_with<typename unique_ptr<_T1, _D1>::pointer,
typename unique_ptr<_T2, _D2>::pointer>
@@ -650,7 +650,7 @@
return !(nullptr < __x);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _T1, class _D1>
requires three_way_comparable<
typename unique_ptr<_T1, _D1>::pointer> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23
@@ -660,7 +660,7 @@
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template<class _Tp>
struct __unique_if
@@ -697,7 +697,7 @@
typename __unique_if<_Tp>::__unique_array_known_bound
make_unique(_Args&&...) = delete;
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
#if _LIBCPP_STD_VER >= 20
diff --git a/third_party/llvm-project/libcxx/include/__memory/uses_allocator.h b/third_party/llvm-project/libcxx/include/__memory/uses_allocator.h
index fe89704..f82ac179 100644
--- a/third_party/llvm-project/libcxx/include/__memory/uses_allocator.h
+++ b/third_party/llvm-project/libcxx/include/__memory/uses_allocator.h
@@ -49,9 +49,9 @@
{
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Alloc>
-inline constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+inline constexpr bool uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__memory/uses_allocator_construction.h b/third_party/llvm-project/libcxx/include/__memory/uses_allocator_construction.h
index 0f63b08..c6eccd2 100644
--- a/third_party/llvm-project/libcxx/include/__memory/uses_allocator_construction.h
+++ b/third_party/llvm-project/libcxx/include/__memory/uses_allocator_construction.h
@@ -83,7 +83,7 @@
std::forward_as_tuple(std::forward<_Vp>(__v)));
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Pair, class _Alloc, class _Up, class _Vp, __enable_if_t<__is_std_pair<_Pair>, int> = 0>
_LIBCPP_HIDE_FROM_ABI constexpr auto
__uses_allocator_construction_args(const _Alloc& __alloc, pair<_Up, _Vp>& __pair) noexcept {
@@ -109,7 +109,7 @@
std::forward_as_tuple(std::get<1>(std::move(__pair))));
}
-# if _LIBCPP_STD_VER > 20
+# if _LIBCPP_STD_VER >= 23
template <class _Pair, class _Alloc, class _Up, class _Vp, __enable_if_t<__is_std_pair<_Pair>, int> = 0>
_LIBCPP_HIDE_FROM_ABI constexpr auto
__uses_allocator_construction_args(const _Alloc& __alloc, const pair<_Up, _Vp>&& __pair) noexcept {
diff --git a/third_party/llvm-project/libcxx/include/__memory_resource/memory_resource.h b/third_party/llvm-project/libcxx/include/__memory_resource/memory_resource.h
index 02fdd08..4f0e4e4 100644
--- a/third_party/llvm-project/libcxx/include/__memory_resource/memory_resource.h
+++ b/third_party/llvm-project/libcxx/include/__memory_resource/memory_resource.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -70,6 +70,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
diff --git a/third_party/llvm-project/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/third_party/llvm-project/libcxx/include/__memory_resource/monotonic_buffer_resource.h
index 5b0d246..9878471 100644
--- a/third_party/llvm-project/libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ b/third_party/llvm-project/libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -18,7 +18,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -115,6 +115,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
diff --git a/third_party/llvm-project/libcxx/include/__memory_resource/polymorphic_allocator.h b/third_party/llvm-project/libcxx/include/__memory_resource/polymorphic_allocator.h
index 2489502..c52adc4 100644
--- a/third_party/llvm-project/libcxx/include/__memory_resource/polymorphic_allocator.h
+++ b/third_party/llvm-project/libcxx/include/__memory_resource/polymorphic_allocator.h
@@ -26,7 +26,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -98,7 +98,7 @@
template <class _Type, class... _CtorArgs>
[[nodiscard]] _Type* new_object(_CtorArgs&&... __ctor_args) {
_Type* __ptr = allocate_object<_Type>();
- __exception_guard __guard([&] { deallocate_object(__ptr); });
+ auto __guard = std::__make_exception_guard([&] { deallocate_object(__ptr); });
construct(__ptr, std::forward<_CtorArgs>(__ctor_args)...);
__guard.__complete();
return __ptr;
@@ -217,7 +217,7 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_POP_MACROS
diff --git a/third_party/llvm-project/libcxx/include/__memory_resource/pool_options.h b/third_party/llvm-project/libcxx/include/__memory_resource/pool_options.h
index 11585a0..6ddd899 100644
--- a/third_party/llvm-project/libcxx/include/__memory_resource/pool_options.h
+++ b/third_party/llvm-project/libcxx/include/__memory_resource/pool_options.h
@@ -16,7 +16,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -33,6 +33,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_POOL_OPTIONS_H
diff --git a/third_party/llvm-project/libcxx/include/__memory_resource/synchronized_pool_resource.h b/third_party/llvm-project/libcxx/include/__memory_resource/synchronized_pool_resource.h
index 1877147..b86ba06 100644
--- a/third_party/llvm-project/libcxx/include/__memory_resource/synchronized_pool_resource.h
+++ b/third_party/llvm-project/libcxx/include/__memory_resource/synchronized_pool_resource.h
@@ -22,7 +22,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -89,6 +89,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
diff --git a/third_party/llvm-project/libcxx/include/__memory_resource/unsynchronized_pool_resource.h b/third_party/llvm-project/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
index 91d38aa..26e4bdf 100644
--- a/third_party/llvm-project/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+++ b/third_party/llvm-project/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
@@ -19,7 +19,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -101,6 +101,6 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
diff --git a/third_party/llvm-project/libcxx/include/__mutex/lock_guard.h b/third_party/llvm-project/libcxx/include/__mutex/lock_guard.h
new file mode 100644
index 0000000..c075512
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__mutex/lock_guard.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MUTEX_LOCK_GUARD_H
+#define _LIBCPP___MUTEX_LOCK_GUARD_H
+
+#include <__config>
+#include <__mutex/tag_types.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Mutex>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) lock_guard {
+public:
+ typedef _Mutex mutex_type;
+
+private:
+ mutex_type& __m_;
+
+public:
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI explicit lock_guard(mutex_type& __m)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
+ : __m_(__m) {
+ __m_.lock();
+ }
+
+ _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI lock_guard(mutex_type& __m, adopt_lock_t)
+ _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
+ : __m_(__m) {}
+ _LIBCPP_HIDE_FROM_ABI ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) { __m_.unlock(); }
+
+private:
+ lock_guard(lock_guard const&) = delete;
+ lock_guard& operator=(lock_guard const&) = delete;
+};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(lock_guard);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_LOCK_GUARD_H
diff --git a/third_party/llvm-project/libcxx/include/__mutex/mutex.h b/third_party/llvm-project/libcxx/include/__mutex/mutex.h
new file mode 100644
index 0000000..13def1e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__mutex/mutex.h
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MUTEX_MUTEX_H
+#define _LIBCPP___MUTEX_MUTEX_H
+
+#include <__config>
+#include <__threading_support>
+#include <__type_traits/is_nothrow_default_constructible.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex {
+ __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR mutex() = default;
+
+ mutex(const mutex&) = delete;
+ mutex& operator=(const mutex&) = delete;
+
+# if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
+ ~mutex() = default;
+# else
+ ~mutex() _NOEXCEPT;
+# endif
+
+ void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
+ bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
+ void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
+
+ typedef __libcpp_mutex_t* native_handle_type;
+ _LIBCPP_HIDE_FROM_ABI native_handle_type native_handle() { return &__m_; }
+};
+
+static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_MUTEX_H
diff --git a/third_party/llvm-project/libcxx/include/__mutex/tag_types.h b/third_party/llvm-project/libcxx/include/__mutex/tag_types.h
new file mode 100644
index 0000000..02cf007
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__mutex/tag_types.h
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MUTEX_TAG_TYPES_H
+#define _LIBCPP___MUTEX_TAG_TYPES_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct _LIBCPP_TYPE_VIS defer_lock_t {
+ explicit defer_lock_t() = default;
+};
+
+struct _LIBCPP_TYPE_VIS try_to_lock_t {
+ explicit try_to_lock_t() = default;
+};
+
+struct _LIBCPP_TYPE_VIS adopt_lock_t {
+ explicit adopt_lock_t() = default;
+};
+
+# if defined(_LIBCPP_BUILDING_LIBRARY)
+extern _LIBCPP_EXPORTED_FROM_ABI const defer_lock_t defer_lock;
+extern _LIBCPP_EXPORTED_FROM_ABI const try_to_lock_t try_to_lock;
+extern _LIBCPP_EXPORTED_FROM_ABI const adopt_lock_t adopt_lock;
+# elif !defined(_LIBCPP_CXX03_LANG)
+/* inline */ constexpr defer_lock_t defer_lock = defer_lock_t();
+/* inline */ constexpr try_to_lock_t try_to_lock = try_to_lock_t();
+/* inline */ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
+# endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_TAG_TYPES_H
diff --git a/third_party/llvm-project/libcxx/include/__mutex/unique_lock.h b/third_party/llvm-project/libcxx/include/__mutex/unique_lock.h
new file mode 100644
index 0000000..c27ce4b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__mutex/unique_lock.h
@@ -0,0 +1,173 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MUTEX_UNIQUE_LOCK_H
+#define _LIBCPP___MUTEX_UNIQUE_LOCK_H
+
+#include <__chrono/duration.h>
+#include <__chrono/time_point.h>
+#include <__config>
+#include <__memory/addressof.h>
+#include <__mutex/tag_types.h>
+#include <__system_error/system_error.h>
+#include <__utility/swap.h>
+#include <cerrno>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Mutex>
+class _LIBCPP_TEMPLATE_VIS unique_lock {
+public:
+ typedef _Mutex mutex_type;
+
+private:
+ mutex_type* __m_;
+ bool __owns_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
+ _LIBCPP_HIDE_FROM_ABI explicit unique_lock(mutex_type& __m) : __m_(std::addressof(__m)), __owns_(true) {
+ __m_->lock();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
+ : __m_(std::addressof(__m)),
+ __owns_(false) {}
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, try_to_lock_t)
+ : __m_(std::addressof(__m)), __owns_(__m.try_lock()) {}
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, adopt_lock_t) : __m_(std::addressof(__m)), __owns_(true) {}
+
+ template <class _Clock, class _Duration>
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
+ : __m_(std::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
+
+ template <class _Rep, class _Period>
+ _LIBCPP_HIDE_FROM_ABI unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
+ : __m_(std::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
+
+ _LIBCPP_HIDE_FROM_ABI ~unique_lock() {
+ if (__owns_)
+ __m_->unlock();
+ }
+
+ unique_lock(unique_lock const&) = delete;
+ unique_lock& operator=(unique_lock const&) = delete;
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) {
+ __u.__m_ = nullptr;
+ __u.__owns_ = false;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI unique_lock& operator=(unique_lock&& __u) _NOEXCEPT {
+ if (__owns_)
+ __m_->unlock();
+
+ __m_ = __u.__m_;
+ __owns_ = __u.__owns_;
+ __u.__m_ = nullptr;
+ __u.__owns_ = false;
+ return *this;
+ }
+
+ void lock();
+ bool try_lock();
+
+ template <class _Rep, class _Period>
+ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);
+
+ template <class _Clock, class _Duration>
+ bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
+
+ void unlock();
+
+ _LIBCPP_HIDE_FROM_ABI void swap(unique_lock& __u) _NOEXCEPT {
+ std::swap(__m_, __u.__m_);
+ std::swap(__owns_, __u.__owns_);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI mutex_type* release() _NOEXCEPT {
+ mutex_type* __m = __m_;
+ __m_ = nullptr;
+ __owns_ = false;
+ return __m;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI bool owns_lock() const _NOEXCEPT { return __owns_; }
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __owns_; }
+ _LIBCPP_HIDE_FROM_ABI mutex_type* mutex() const _NOEXCEPT { return __m_; }
+};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
+
+template <class _Mutex>
+void unique_lock<_Mutex>::lock() {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::lock: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::lock: already locked");
+ __m_->lock();
+ __owns_ = true;
+}
+
+template <class _Mutex>
+bool unique_lock<_Mutex>::try_lock() {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
+ __owns_ = __m_->try_lock();
+ return __owns_;
+}
+
+template <class _Mutex>
+template <class _Rep, class _Period>
+bool unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d) {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
+ __owns_ = __m_->try_lock_for(__d);
+ return __owns_;
+}
+
+template <class _Mutex>
+template <class _Clock, class _Duration>
+bool unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {
+ if (__m_ == nullptr)
+ __throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
+ if (__owns_)
+ __throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
+ __owns_ = __m_->try_lock_until(__t);
+ return __owns_;
+}
+
+template <class _Mutex>
+void unique_lock<_Mutex>::unlock() {
+ if (!__owns_)
+ __throw_system_error(EPERM, "unique_lock::unlock: not locked");
+ __m_->unlock();
+ __owns_ = false;
+}
+
+template <class _Mutex>
+inline _LIBCPP_HIDE_FROM_ABI void swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT {
+ __x.swap(__y);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP___MUTEX_UNIQUE_LOCK_H
diff --git a/third_party/llvm-project/libcxx/include/__mutex_base b/third_party/llvm-project/libcxx/include/__mutex_base
deleted file mode 100644
index 82d9fa6..0000000
--- a/third_party/llvm-project/libcxx/include/__mutex_base
+++ /dev/null
@@ -1,523 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___MUTEX_BASE
-#define _LIBCPP___MUTEX_BASE
-
-#include <__chrono/duration.h>
-#include <__chrono/steady_clock.h>
-#include <__chrono/system_clock.h>
-#include <__chrono/time_point.h>
-#include <__config>
-#include <__threading_support>
-#include <ratio>
-#include <system_error>
-#include <time.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
-class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
-{
- __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR mutex() = default;
-
- mutex(const mutex&) = delete;
- mutex& operator=(const mutex&) = delete;
-
-#if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
- ~mutex() = default;
-#else
- ~mutex() _NOEXCEPT;
-#endif
-
- void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
- bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
- void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
-
- typedef __libcpp_mutex_t* native_handle_type;
- _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
-};
-
-static_assert(is_nothrow_default_constructible<mutex>::value,
- "the default constructor for std::mutex must be nothrow");
-
-struct _LIBCPP_TYPE_VIS defer_lock_t { explicit defer_lock_t() = default; };
-struct _LIBCPP_TYPE_VIS try_to_lock_t { explicit try_to_lock_t() = default; };
-struct _LIBCPP_TYPE_VIS adopt_lock_t { explicit adopt_lock_t() = default; };
-
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-
-extern _LIBCPP_EXPORTED_FROM_ABI const defer_lock_t defer_lock;
-extern _LIBCPP_EXPORTED_FROM_ABI const try_to_lock_t try_to_lock;
-extern _LIBCPP_EXPORTED_FROM_ABI const adopt_lock_t adopt_lock;
-
-#else
-
-/* inline */ constexpr defer_lock_t defer_lock = defer_lock_t();
-/* inline */ constexpr try_to_lock_t try_to_lock = try_to_lock_t();
-/* inline */ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
-
-#endif
-
-template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable)
-lock_guard
-{
-public:
- typedef _Mutex mutex_type;
-
-private:
- mutex_type& __m_;
-public:
-
- _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY
- explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
- : __m_(__m) {__m_.lock();}
-
- _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY
- lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
- : __m_(__m) {}
- _LIBCPP_INLINE_VISIBILITY
- ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
-
-private:
- lock_guard(lock_guard const&) = delete;
- lock_guard& operator=(lock_guard const&) = delete;
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(lock_guard);
-
-template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS unique_lock
-{
-public:
- typedef _Mutex mutex_type;
-
-private:
- mutex_type* __m_;
- bool __owns_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
- _LIBCPP_INLINE_VISIBILITY
- explicit unique_lock(mutex_type& __m)
- : __m_(_VSTD::addressof(__m)), __owns_(true) {__m_->lock();}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
- : __m_(_VSTD::addressof(__m)), __owns_(false) {}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, try_to_lock_t)
- : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock()) {}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, adopt_lock_t)
- : __m_(_VSTD::addressof(__m)), __owns_(true) {}
- template <class _Clock, class _Duration>
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
- : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
- template <class _Rep, class _Period>
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
- : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
- _LIBCPP_INLINE_VISIBILITY
- ~unique_lock()
- {
- if (__owns_)
- __m_->unlock();
- }
-
- unique_lock(unique_lock const&) = delete;
- unique_lock& operator=(unique_lock const&) = delete;
-
- _LIBCPP_INLINE_VISIBILITY
- unique_lock(unique_lock&& __u) _NOEXCEPT
- : __m_(__u.__m_), __owns_(__u.__owns_)
- {__u.__m_ = nullptr; __u.__owns_ = false;}
- _LIBCPP_INLINE_VISIBILITY
- unique_lock& operator=(unique_lock&& __u) _NOEXCEPT
- {
- if (__owns_)
- __m_->unlock();
- __m_ = __u.__m_;
- __owns_ = __u.__owns_;
- __u.__m_ = nullptr;
- __u.__owns_ = false;
- return *this;
- }
-
- void lock();
- bool try_lock();
-
- template <class _Rep, class _Period>
- bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);
- template <class _Clock, class _Duration>
- bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
-
- void unlock();
-
- _LIBCPP_INLINE_VISIBILITY
- void swap(unique_lock& __u) _NOEXCEPT
- {
- _VSTD::swap(__m_, __u.__m_);
- _VSTD::swap(__owns_, __u.__owns_);
- }
- _LIBCPP_INLINE_VISIBILITY
- mutex_type* release() _NOEXCEPT
- {
- mutex_type* __m = __m_;
- __m_ = nullptr;
- __owns_ = false;
- return __m;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- bool owns_lock() const _NOEXCEPT {return __owns_;}
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT {return __owns_;}
- _LIBCPP_INLINE_VISIBILITY
- mutex_type* mutex() const _NOEXCEPT {return __m_;}
-};
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
-
-template <class _Mutex>
-void
-unique_lock<_Mutex>::lock()
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::lock: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::lock: already locked");
- __m_->lock();
- __owns_ = true;
-}
-
-template <class _Mutex>
-bool
-unique_lock<_Mutex>::try_lock()
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
- __owns_ = __m_->try_lock();
- return __owns_;
-}
-
-template <class _Mutex>
-template <class _Rep, class _Period>
-bool
-unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d)
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
- __owns_ = __m_->try_lock_for(__d);
- return __owns_;
-}
-
-template <class _Mutex>
-template <class _Clock, class _Duration>
-bool
-unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
-{
- if (__m_ == nullptr)
- __throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
- if (__owns_)
- __throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
- __owns_ = __m_->try_lock_until(__t);
- return __owns_;
-}
-
-template <class _Mutex>
-void
-unique_lock<_Mutex>::unlock()
-{
- if (!__owns_)
- __throw_system_error(EPERM, "unique_lock::unlock: not locked");
- __m_->unlock();
- __owns_ = false;
-}
-
-template <class _Mutex>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
- {__x.swap(__y);}
-
-//enum class cv_status
-_LIBCPP_DECLARE_STRONG_ENUM(cv_status)
-{
- no_timeout,
- timeout
-};
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
-
-class _LIBCPP_TYPE_VIS condition_variable
-{
- __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR condition_variable() _NOEXCEPT = default;
-
-#ifdef _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
- ~condition_variable() = default;
-#else
- ~condition_variable();
-#endif
-
- condition_variable(const condition_variable&) = delete;
- condition_variable& operator=(const condition_variable&) = delete;
-
- void notify_one() _NOEXCEPT;
- void notify_all() _NOEXCEPT;
-
- void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
- template <class _Predicate>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- void wait(unique_lock<mutex>& __lk, _Predicate __pred);
-
- template <class _Clock, class _Duration>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- cv_status
- wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t);
-
- template <class _Clock, class _Duration, class _Predicate>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- bool
- wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t,
- _Predicate __pred);
-
- template <class _Rep, class _Period>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- cv_status
- wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d);
-
- template <class _Rep, class _Period, class _Predicate>
- bool
- _LIBCPP_INLINE_VISIBILITY
- wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d,
- _Predicate __pred);
-
- typedef __libcpp_condvar_t* native_handle_type;
- _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
-
-private:
- void __do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
- void __do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<chrono::steady_clock, chrono::nanoseconds>) _NOEXCEPT;
-#endif
- template <class _Clock>
- void __do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT;
-};
-#endif // !_LIBCPP_HAS_NO_THREADS
-
-template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
-__enable_if_t<is_floating_point<_Rep>::value, chrono::nanoseconds>
-__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
-{
- using namespace chrono;
- using __ratio = ratio_divide<_Period, nano>;
- using __ns_rep = nanoseconds::rep;
- _Rep __result_float = __d.count() * __ratio::num / __ratio::den;
-
- _Rep __result_max = numeric_limits<__ns_rep>::max();
- if (__result_float >= __result_max) {
- return nanoseconds::max();
- }
-
- _Rep __result_min = numeric_limits<__ns_rep>::min();
- if (__result_float <= __result_min) {
- return nanoseconds::min();
- }
-
- return nanoseconds(static_cast<__ns_rep>(__result_float));
-}
-
-template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
-__enable_if_t<!is_floating_point<_Rep>::value, chrono::nanoseconds>
-__safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
-{
- using namespace chrono;
- if (__d.count() == 0) {
- return nanoseconds(0);
- }
-
- using __ratio = ratio_divide<_Period, nano>;
- using __ns_rep = nanoseconds::rep;
- __ns_rep __result_max = numeric_limits<__ns_rep>::max();
- if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
- return nanoseconds::max();
- }
-
- __ns_rep __result_min = numeric_limits<__ns_rep>::min();
- if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
- return nanoseconds::min();
- }
-
- __ns_rep __result = __d.count() * __ratio::num / __ratio::den;
- if (__result == 0) {
- return nanoseconds(1);
- }
-
- return nanoseconds(__result);
-}
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-template <class _Predicate>
-void
-condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred)
-{
- while (!__pred())
- wait(__lk);
-}
-
-template <class _Clock, class _Duration>
-cv_status
-condition_variable::wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t)
-{
- using namespace chrono;
- using __clock_tp_ns = time_point<_Clock, nanoseconds>;
-
- typename _Clock::time_point __now = _Clock::now();
- if (__t <= __now)
- return cv_status::timeout;
-
- __clock_tp_ns __t_ns = __clock_tp_ns(_VSTD::__safe_nanosecond_cast(__t.time_since_epoch()));
-
- __do_timed_wait(__lk, __t_ns);
- return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
-}
-
-template <class _Clock, class _Duration, class _Predicate>
-bool
-condition_variable::wait_until(unique_lock<mutex>& __lk,
- const chrono::time_point<_Clock, _Duration>& __t,
- _Predicate __pred)
-{
- while (!__pred())
- {
- if (wait_until(__lk, __t) == cv_status::timeout)
- return __pred();
- }
- return true;
-}
-
-template <class _Rep, class _Period>
-cv_status
-condition_variable::wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d)
-{
- using namespace chrono;
- if (__d <= __d.zero())
- return cv_status::timeout;
- using __ns_rep = nanoseconds::rep;
- steady_clock::time_point __c_now = steady_clock::now();
-
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
- using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
- __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
-#else
- using __clock_tp_ns = time_point<system_clock, nanoseconds>;
- __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
-#endif
-
- __ns_rep __d_ns_count = _VSTD::__safe_nanosecond_cast(__d).count();
-
- if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
- __do_timed_wait(__lk, __clock_tp_ns::max());
- } else {
- __do_timed_wait(__lk, __clock_tp_ns(nanoseconds(__now_count_ns + __d_ns_count)));
- }
-
- return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
- cv_status::timeout;
-}
-
-template <class _Rep, class _Period, class _Predicate>
-inline
-bool
-condition_variable::wait_for(unique_lock<mutex>& __lk,
- const chrono::duration<_Rep, _Period>& __d,
- _Predicate __pred)
-{
- return wait_until(__lk, chrono::steady_clock::now() + __d,
- _VSTD::move(__pred));
-}
-
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
-inline
-void
-condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<chrono::steady_clock, chrono::nanoseconds> __tp) _NOEXCEPT
-{
- using namespace chrono;
- if (!__lk.owns_lock())
- __throw_system_error(EPERM,
- "condition_variable::timed wait: mutex not locked");
- nanoseconds __d = __tp.time_since_epoch();
- timespec __ts;
- seconds __s = duration_cast<seconds>(__d);
- using __ts_sec = decltype(__ts.tv_sec);
- const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max();
- if (__s.count() < __ts_sec_max)
- {
- __ts.tv_sec = static_cast<__ts_sec>(__s.count());
- __ts.tv_nsec = (__d - __s).count();
- }
- else
- {
- __ts.tv_sec = __ts_sec_max;
- __ts.tv_nsec = giga::num - 1;
- }
- int __ec = pthread_cond_clockwait(&__cv_, __lk.mutex()->native_handle(), CLOCK_MONOTONIC, &__ts);
- if (__ec != 0 && __ec != ETIMEDOUT)
- __throw_system_error(__ec, "condition_variable timed_wait failed");
-}
-#endif // _LIBCPP_HAS_COND_CLOCKWAIT
-
-template <class _Clock>
-inline
-void
-condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
- chrono::time_point<_Clock, chrono::nanoseconds> __tp) _NOEXCEPT
-{
- wait_for(__lk, __tp - _Clock::now());
-}
-
-#endif // !_LIBCPP_HAS_NO_THREADS
-
-_LIBCPP_END_NAMESPACE_STD
-
-_LIBCPP_POP_MACROS
-
-#endif // _LIBCPP___MUTEX_BASE
diff --git a/third_party/llvm-project/libcxx/include/__node_handle b/third_party/llvm-project/libcxx/include/__node_handle
index bc49272..d9c2374 100644
--- a/third_party/llvm-project/libcxx/include/__node_handle
+++ b/third_party/llvm-project/libcxx/include/__node_handle
@@ -70,7 +70,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// Specialized in __tree & __hash_table for their _NodeType.
template <class _NodeType, class _Alloc>
@@ -247,7 +247,7 @@
_NodeType node;
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__numeric/accumulate.h b/third_party/llvm-project/libcxx/include/__numeric/accumulate.h
index 81fc0c2..823d501 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/accumulate.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/accumulate.h
@@ -25,7 +25,7 @@
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = _VSTD::move(__init) + *__first;
#else
__init = __init + *__first;
@@ -39,7 +39,7 @@
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
{
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = __binary_op(_VSTD::move(__init), *__first);
#else
__init = __binary_op(__init, *__first);
diff --git a/third_party/llvm-project/libcxx/include/__numeric/adjacent_difference.h b/third_party/llvm-project/libcxx/include/__numeric/adjacent_difference.h
index 57e2f5b..b3519fd 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/adjacent_difference.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/adjacent_difference.h
@@ -32,7 +32,7 @@
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
*__result = __val - _VSTD::move(__acc);
#else
*__result = __val - __acc;
@@ -56,7 +56,7 @@
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
*__result = __binary_op(__val, _VSTD::move(__acc));
#else
*__result = __binary_op(__val, __acc);
diff --git a/third_party/llvm-project/libcxx/include/__numeric/exclusive_scan.h b/third_party/llvm-project/libcxx/include/__numeric/exclusive_scan.h
index d02e126..676ff70 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/exclusive_scan.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/exclusive_scan.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
@@ -46,7 +46,7 @@
return _VSTD::exclusive_scan(__first, __last, __result, __init, _VSTD::plus<>());
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__numeric/gcd_lcm.h b/third_party/llvm-project/libcxx/include/__numeric/gcd_lcm.h
index 5a3f81b..7139a7e 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/gcd_lcm.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/gcd_lcm.h
@@ -28,7 +28,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __ct_abs;
diff --git a/third_party/llvm-project/libcxx/include/__numeric/inclusive_scan.h b/third_party/llvm-project/libcxx/include/__numeric/inclusive_scan.h
index e5bf5ac..bd96344 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/inclusive_scan.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/inclusive_scan.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
@@ -53,7 +53,7 @@
return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>());
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__numeric/inner_product.h b/third_party/llvm-project/libcxx/include/__numeric/inner_product.h
index e3d68c0..b360200 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/inner_product.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/inner_product.h
@@ -25,7 +25,7 @@
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = _VSTD::move(__init) + *__first1 * *__first2;
#else
__init = __init + *__first1 * *__first2;
@@ -40,7 +40,7 @@
_Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = __binary_op1(_VSTD::move(__init), __binary_op2(*__first1, *__first2));
#else
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
diff --git a/third_party/llvm-project/libcxx/include/__numeric/midpoint.h b/third_party/llvm-project/libcxx/include/__numeric/midpoint.h
index bac3642..5325f5e 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/midpoint.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/midpoint.h
@@ -33,7 +33,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp>
@@ -86,7 +86,7 @@
__a/2 + __b/2; // otherwise correctly rounded
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__numeric/partial_sum.h b/third_party/llvm-project/libcxx/include/__numeric/partial_sum.h
index 97cca58..94f65d7 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/partial_sum.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/partial_sum.h
@@ -31,7 +31,7 @@
*__result = __t;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__t = _VSTD::move(__t) + *__first;
#else
__t = __t + *__first;
@@ -54,7 +54,7 @@
*__result = __t;
for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__t = __binary_op(_VSTD::move(__t), *__first);
#else
__t = __binary_op(__t, *__first);
diff --git a/third_party/llvm-project/libcxx/include/__numeric/reduce.h b/third_party/llvm-project/libcxx/include/__numeric/reduce.h
index b64df05..9e710fc 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/reduce.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/reduce.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _Tp, class _BinaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp reduce(_InputIterator __first, _InputIterator __last,
_Tp __init, _BinaryOp __b) {
diff --git a/third_party/llvm-project/libcxx/include/__numeric/transform_exclusive_scan.h b/third_party/llvm-project/libcxx/include/__numeric/transform_exclusive_scan.h
index afbcdb8..3d5574c 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/transform_exclusive_scan.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/transform_exclusive_scan.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp,
class _BinaryOp, class _UnaryOp>
@@ -42,7 +42,7 @@
return __result;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__numeric/transform_inclusive_scan.h b/third_party/llvm-project/libcxx/include/__numeric/transform_inclusive_scan.h
index c050041..ee91689 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/transform_inclusive_scan.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/transform_inclusive_scan.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -51,7 +51,7 @@
return __result;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__numeric/transform_reduce.h b/third_party/llvm-project/libcxx/include/__numeric/transform_reduce.h
index d997521..39ec266 100644
--- a/third_party/llvm-project/libcxx/include/__numeric/transform_reduce.h
+++ b/third_party/llvm-project/libcxx/include/__numeric/transform_reduce.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(_InputIterator __first,
_InputIterator __last, _Tp __init,
diff --git a/third_party/llvm-project/libcxx/include/__random/clamp_to_integral.h b/third_party/llvm-project/libcxx/include/__random/clamp_to_integral.h
index 7d44ff9..c67d76d 100644
--- a/third_party/llvm-project/libcxx/include/__random/clamp_to_integral.h
+++ b/third_party/llvm-project/libcxx/include/__random/clamp_to_integral.h
@@ -12,7 +12,6 @@
#include <__config>
#include <cmath>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -44,8 +43,8 @@
_LIBCPP_INLINE_VISIBILITY
_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
using _Lim = numeric_limits<_IntT>;
- const _IntT _MaxVal = __max_representable_int_for_float<_IntT, _RealT>();
- if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) {
+ const _IntT __max_val = __max_representable_int_for_float<_IntT, _RealT>();
+ if (__r >= ::nextafter(static_cast<_RealT>(__max_val), INFINITY)) {
return _Lim::max();
} else if (__r <= _Lim::lowest()) {
return _Lim::min();
diff --git a/third_party/llvm-project/libcxx/include/__random/discard_block_engine.h b/third_party/llvm-project/libcxx/include/__random/discard_block_engine.h
index db33623..077f158 100644
--- a/third_party/llvm-project/libcxx/include/__random/discard_block_engine.h
+++ b/third_party/llvm-project/libcxx/include/__random/discard_block_engine.h
@@ -11,10 +11,12 @@
#include <__config>
#include <__random/is_seed_sequence.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
+#include <cstddef>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__random/generate_canonical.h b/third_party/llvm-project/libcxx/include/__random/generate_canonical.h
index 5fada6d..5f0aa6f 100644
--- a/third_party/llvm-project/libcxx/include/__random/generate_canonical.h
+++ b/third_party/llvm-project/libcxx/include/__random/generate_canonical.h
@@ -30,20 +30,20 @@
_LIBCPP_HIDE_FROM_ABI _RealType
generate_canonical(_URNG& __g)
{
- const size_t _Dt = numeric_limits<_RealType>::digits;
- const size_t __b = _Dt < __bits ? _Dt : __bits;
+ const size_t __dt = numeric_limits<_RealType>::digits;
+ const size_t __b = __dt < __bits ? __dt : __bits;
#ifdef _LIBCPP_CXX03_LANG
- const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
+ const size_t __log_r = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
#else
- const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
+ const size_t __log_r = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
#endif
- const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0);
- const _RealType _Rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
- _RealType __base = _Rp;
- _RealType _Sp = __g() - _URNG::min();
- for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp)
- _Sp += (__g() - _URNG::min()) * __base;
- return _Sp / __base;
+ const size_t __k = __b / __log_r + (__b % __log_r != 0) + (__b == 0);
+ const _RealType __rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
+ _RealType __base = __rp;
+ _RealType __sp = __g() - _URNG::min();
+ for (size_t __i = 1; __i < __k; ++__i, __base *= __rp)
+ __sp += (__g() - _URNG::min()) * __base;
+ return __sp / __base;
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__random/independent_bits_engine.h b/third_party/llvm-project/libcxx/include/__random/independent_bits_engine.h
index 151492a..2cd4096 100644
--- a/third_party/llvm-project/libcxx/include/__random/independent_bits_engine.h
+++ b/third_party/llvm-project/libcxx/include/__random/independent_bits_engine.h
@@ -12,10 +12,13 @@
#include <__config>
#include <__random/is_seed_sequence.h>
#include <__random/log2.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
+#include <cstddef>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -196,7 +199,7 @@
_UIntType
independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type)
{
- result_type _Sp = 0;
+ result_type __sp = 0;
for (size_t __k = 0; __k < __n0; ++__k)
{
_Engine_result_type __u;
@@ -204,7 +207,7 @@
{
__u = __e_() - _Engine::min();
} while (__u >= __y0);
- _Sp = static_cast<result_type>(__lshift<__w0>(_Sp) + (__u & __mask0));
+ __sp = static_cast<result_type>(__lshift<__w0>(__sp) + (__u & __mask0));
}
for (size_t __k = __n0; __k < __n; ++__k)
{
@@ -213,9 +216,9 @@
{
__u = __e_() - _Engine::min();
} while (__u >= __y1);
- _Sp = static_cast<result_type>(__lshift<__w0+1>(_Sp) + (__u & __mask1));
+ __sp = static_cast<result_type>(__lshift<__w0+1>(__sp) + (__u & __mask1));
}
- return _Sp;
+ return __sp;
}
template<class _Eng, size_t _Wp, class _UInt>
diff --git a/third_party/llvm-project/libcxx/include/__random/is_seed_sequence.h b/third_party/llvm-project/libcxx/include/__random/is_seed_sequence.h
index 3c82b27..06621c3 100644
--- a/third_party/llvm-project/libcxx/include/__random/is_seed_sequence.h
+++ b/third_party/llvm-project/libcxx/include/__random/is_seed_sequence.h
@@ -10,7 +10,9 @@
#define _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H
#include <__config>
-#include <type_traits>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__random/is_valid.h b/third_party/llvm-project/libcxx/include/__random/is_valid.h
index 1d65de0..113452b 100644
--- a/third_party/llvm-project/libcxx/include/__random/is_valid.h
+++ b/third_party/llvm-project/libcxx/include/__random/is_valid.h
@@ -10,8 +10,12 @@
#define _LIBCPP___RANDOM_IS_VALID_H
#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_unsigned.h>
+#include <__utility/declval.h>
#include <cstdint>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__random/linear_congruential_engine.h b/third_party/llvm-project/libcxx/include/__random/linear_congruential_engine.h
index 0d91f14..aa24a06 100644
--- a/third_party/llvm-project/libcxx/include/__random/linear_congruential_engine.h
+++ b/third_party/llvm-project/libcxx/include/__random/linear_congruential_engine.h
@@ -11,9 +11,11 @@
#include <__config>
#include <__random/is_seed_sequence.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_unsigned.h>
#include <cstdint>
#include <iosfwd>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__random/log2.h b/third_party/llvm-project/libcxx/include/__random/log2.h
index 72bf075..4ccd1dd 100644
--- a/third_party/llvm-project/libcxx/include/__random/log2.h
+++ b/third_party/llvm-project/libcxx/include/__random/log2.h
@@ -10,8 +10,8 @@
#define _LIBCPP___RANDOM_LOG2_H
#include <__config>
+#include <__type_traits/conditional.h>
#include <cstddef>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__random/mersenne_twister_engine.h b/third_party/llvm-project/libcxx/include/__random/mersenne_twister_engine.h
index 3a58e31..89df825 100644
--- a/third_party/llvm-project/libcxx/include/__random/mersenne_twister_engine.h
+++ b/third_party/llvm-project/libcxx/include/__random/mersenne_twister_engine.h
@@ -17,7 +17,6 @@
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -403,9 +402,9 @@
const size_t __j = (__i_ + 1) % __n;
const result_type __mask = __r == _Dt ? result_type(~0) :
(result_type(1) << __r) - result_type(1);
- const result_type _Yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
+ const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
const size_t __k = (__i_ + __m) % __n;
- __x_[__i_] = __x_[__k] ^ __rshift<1>(_Yp) ^ (__a * (_Yp & 1));
+ __x_[__i_] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d);
__i_ = __j;
__z ^= __lshift<__s>(__z) & __b;
diff --git a/third_party/llvm-project/libcxx/include/__random/normal_distribution.h b/third_party/llvm-project/libcxx/include/__random/normal_distribution.h
index b2ed47e..93f3d1f 100644
--- a/third_party/llvm-project/libcxx/include/__random/normal_distribution.h
+++ b/third_party/llvm-project/libcxx/include/__random/normal_distribution.h
@@ -133,30 +133,30 @@
normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
{
static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
- result_type _Up;
+ result_type __up;
if (__v_hot_)
{
__v_hot_ = false;
- _Up = __v_;
+ __up = __v_;
}
else
{
- uniform_real_distribution<result_type> _Uni(-1, 1);
+ uniform_real_distribution<result_type> __uni(-1, 1);
result_type __u;
result_type __v;
result_type __s;
do
{
- __u = _Uni(__g);
- __v = _Uni(__g);
+ __u = __uni(__g);
+ __v = __uni(__g);
__s = __u * __u + __v * __v;
} while (__s > 1 || __s == 0);
- result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
- __v_ = __v * _Fp;
+ result_type __fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
+ __v_ = __v * __fp;
__v_hot_ = true;
- _Up = __u * _Fp;
+ __up = __u * __fp;
}
- return _Up * __p.stddev() + __p.mean();
+ return __up * __p.stddev() + __p.mean();
}
template <class _CharT, class _Traits, class _RT>
@@ -189,16 +189,16 @@
__is.flags(_Istream::dec | _Istream::skipws);
result_type __mean;
result_type __stddev;
- result_type _Vp = 0;
- bool _V_hot = false;
- __is >> __mean >> __stddev >> _V_hot;
- if (_V_hot)
- __is >> _Vp;
+ result_type __vp = 0;
+ bool __v_hot = false;
+ __is >> __mean >> __stddev >> __v_hot;
+ if (__v_hot)
+ __is >> __vp;
if (!__is.fail())
{
__x.param(param_type(__mean, __stddev));
- __x.__v_hot_ = _V_hot;
- __x.__v_ = _Vp;
+ __x.__v_hot_ = __v_hot;
+ __x.__v_ = __vp;
}
return __is;
}
diff --git a/third_party/llvm-project/libcxx/include/__random/piecewise_linear_distribution.h b/third_party/llvm-project/libcxx/include/__random/piecewise_linear_distribution.h
index fc2eb47..0430b24 100644
--- a/third_party/llvm-project/libcxx/include/__random/piecewise_linear_distribution.h
+++ b/third_party/llvm-project/libcxx/include/__random/piecewise_linear_distribution.h
@@ -188,23 +188,23 @@
piecewise_linear_distribution<_RealType>::param_type::__init()
{
__areas_.assign(__densities_.size() - 1, result_type());
- result_type _Sp = 0;
+ result_type __sp = 0;
for (size_t __i = 0; __i < __areas_.size(); ++__i)
{
__areas_[__i] = (__densities_[__i+1] + __densities_[__i]) *
(__b_[__i+1] - __b_[__i]) * .5;
- _Sp += __areas_[__i];
+ __sp += __areas_[__i];
}
for (size_t __i = __areas_.size(); __i > 1;)
{
--__i;
- __areas_[__i] = __areas_[__i-1] / _Sp;
+ __areas_[__i] = __areas_[__i-1] / __sp;
}
__areas_[0] = 0;
for (size_t __i = 1; __i < __areas_.size(); ++__i)
__areas_[__i] += __areas_[__i-1];
for (size_t __i = 0; __i < __densities_.size(); ++__i)
- __densities_[__i] /= _Sp;
+ __densities_[__i] /= __sp;
}
template<class _RealType>
diff --git a/third_party/llvm-project/libcxx/include/__random/poisson_distribution.h b/third_party/llvm-project/libcxx/include/__random/poisson_distribution.h
index 334c610..2b39937 100644
--- a/third_party/llvm-project/libcxx/include/__random/poisson_distribution.h
+++ b/third_party/llvm-project/libcxx/include/__random/poisson_distribution.h
@@ -144,12 +144,12 @@
__d_ = 6 * __mean_ * __mean_;
__l_ = _VSTD::trunc(__mean_ - 1.1484);
__omega_ = .3989423 / __s_;
- double __b1_ = .4166667E-1 / __mean_;
- double __b2_ = .3 * __b1_ * __b1_;
- __c3_ = .1428571 * __b1_ * __b2_;
- __c2_ = __b2_ - 15. * __c3_;
- __c1_ = __b1_ - 6. * __b2_ + 45. * __c3_;
- __c0_ = 1. - __b1_ + 3. * __b2_ - 15. * __c3_;
+ double __b1 = .4166667E-1 / __mean_;
+ double __b2 = .3 * __b1 * __b1;
+ __c3_ = .1428571 * __b1 * __b2;
+ __c2_ = __b2 - 15. * __c3_;
+ __c1_ = __b1 - 6. * __b2 + 45. * __c3_;
+ __c0_ = 1. - __b1 + 3. * __b2 - 15. * __c3_;
__c_ = .1069 / __mean_;
}
}
diff --git a/third_party/llvm-project/libcxx/include/__random/seed_seq.h b/third_party/llvm-project/libcxx/include/__random/seed_seq.h
index 330537f..5c40d15 100644
--- a/third_party/llvm-project/libcxx/include/__random/seed_seq.h
+++ b/third_party/llvm-project/libcxx/include/__random/seed_seq.h
@@ -13,6 +13,7 @@
#include <__algorithm/fill.h>
#include <__algorithm/max.h>
#include <__config>
+#include <cstdint>
#include <initializer_list>
#include <vector>
diff --git a/third_party/llvm-project/libcxx/include/__random/shuffle_order_engine.h b/third_party/llvm-project/libcxx/include/__random/shuffle_order_engine.h
index 4a27289..e07f230 100644
--- a/third_party/llvm-project/libcxx/include/__random/shuffle_order_engine.h
+++ b/third_party/llvm-project/libcxx/include/__random/shuffle_order_engine.h
@@ -12,10 +12,13 @@
#include <__algorithm/equal.h>
#include <__config>
#include <__random/is_seed_sequence.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_convertible.h>
#include <__utility/move.h>
+#include <cstddef>
#include <cstdint>
#include <iosfwd>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -201,10 +204,10 @@
_LIBCPP_INLINE_VISIBILITY
result_type __evalf()
{
- const double _Fp = __d == 0 ?
+ const double __fp = __d == 0 ?
__n / (2. * 0x8000000000000000ull) :
__n / (double)__d;
- const size_t __j = static_cast<size_t>(_Fp * (__y_ - _Min));
+ const size_t __j = static_cast<size_t>(__fp * (__y_ - _Min));
__y_ = __v_[__j];
__v_[__j] = __e_();
return __y_;
@@ -262,16 +265,16 @@
typedef basic_istream<_CharT, _Traits> _Istream;
__is.flags(_Istream::dec | _Istream::skipws);
_Eng __e;
- result_type _Vp[_Kp+1];
+ result_type __vp[_Kp+1];
__is >> __e;
for (size_t __i = 0; __i < _Kp+1; ++__i)
- __is >> _Vp[__i];
+ __is >> __vp[__i];
if (!__is.fail())
{
__x.__e_ = __e;
for (size_t __i = 0; __i < _Kp; ++__i)
- __x.__v_[__i] = _Vp[__i];
- __x.__y_ = _Vp[_Kp];
+ __x.__v_[__i] = __vp[__i];
+ __x.__y_ = __vp[_Kp];
}
return __is;
}
diff --git a/third_party/llvm-project/libcxx/include/__random/subtract_with_carry_engine.h b/third_party/llvm-project/libcxx/include/__random/subtract_with_carry_engine.h
index b25ca84..9294cc2 100644
--- a/third_party/llvm-project/libcxx/include/__random/subtract_with_carry_engine.h
+++ b/third_party/llvm-project/libcxx/include/__random/subtract_with_carry_engine.h
@@ -18,7 +18,6 @@
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__random/uniform_int_distribution.h b/third_party/llvm-project/libcxx/include/__random/uniform_int_distribution.h
index b7db8a3..5415876 100644
--- a/third_party/llvm-project/libcxx/include/__random/uniform_int_distribution.h
+++ b/third_party/llvm-project/libcxx/include/__random/uniform_int_distribution.h
@@ -9,15 +9,16 @@
#ifndef _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
#define _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+#include <__bit/countl.h>
#include <__config>
#include <__random/is_valid.h>
#include <__random/log2.h>
-#include <bit>
+#include <__type_traits/conditional.h>
+#include <__type_traits/make_unsigned.h>
#include <cstddef>
#include <cstdint>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -120,8 +121,8 @@
_UIntType
__independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
{
- const size_t _WRt = numeric_limits<result_type>::digits;
- result_type _Sp = 0;
+ const size_t __w_rt = numeric_limits<result_type>::digits;
+ result_type __sp = 0;
for (size_t __k = 0; __k < __n0_; ++__k)
{
_Engine_result_type __u;
@@ -129,11 +130,11 @@
{
__u = __e_() - _Engine::min();
} while (__u >= __y0_);
- if (__w0_ < _WRt)
- _Sp <<= __w0_;
+ if (__w0_ < __w_rt)
+ __sp <<= __w0_;
else
- _Sp = 0;
- _Sp += __u & __mask0_;
+ __sp = 0;
+ __sp += __u & __mask0_;
}
for (size_t __k = __n0_; __k < __n_; ++__k)
{
@@ -142,13 +143,13 @@
{
__u = __e_() - _Engine::min();
} while (__u >= __y1_);
- if (__w0_ < _WRt - 1)
- _Sp <<= __w0_ + 1;
+ if (__w0_ < __w_rt - 1)
+ __sp <<= __w0_ + 1;
else
- _Sp = 0;
- _Sp += __u & __mask1_;
+ __sp = 0;
+ __sp += __u & __mask1_;
}
- return _Sp;
+ return __sp;
}
template<class _IntType = int>
@@ -234,22 +235,22 @@
static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
typedef __conditional_t<sizeof(result_type) <= sizeof(uint32_t), uint32_t, __make_unsigned_t<result_type> >
_UIntType;
- const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
- if (_Rp == 1)
+ const _UIntType __rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
+ if (__rp == 1)
return __p.a();
- const size_t _Dt = numeric_limits<_UIntType>::digits;
+ const size_t __dt = numeric_limits<_UIntType>::digits;
typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
- if (_Rp == 0)
- return static_cast<result_type>(_Eng(__g, _Dt)());
- size_t __w = _Dt - std::__countl_zero(_Rp) - 1;
- if ((_Rp & (numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
+ if (__rp == 0)
+ return static_cast<result_type>(_Eng(__g, __dt)());
+ size_t __w = __dt - std::__countl_zero(__rp) - 1;
+ if ((__rp & (numeric_limits<_UIntType>::max() >> (__dt - __w))) != 0)
++__w;
_Eng __e(__g, __w);
_UIntType __u;
do
{
__u = __e();
- } while (__u >= _Rp);
+ } while (__u >= __rp);
return static_cast<result_type>(__u + __p.a());
}
diff --git a/third_party/llvm-project/libcxx/include/__random/uniform_random_bit_generator.h b/third_party/llvm-project/libcxx/include/__random/uniform_random_bit_generator.h
index 84a30b0..ddb3158 100644
--- a/third_party/llvm-project/libcxx/include/__random/uniform_random_bit_generator.h
+++ b/third_party/llvm-project/libcxx/include/__random/uniform_random_bit_generator.h
@@ -13,7 +13,8 @@
#include <__concepts/invocable.h>
#include <__concepts/same_as.h>
#include <__config>
-#include <type_traits>
+#include <__functional/invoke.h>
+#include <__type_traits/integral_constant.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [rand.req.urng]
template<class _Gen>
@@ -36,7 +37,7 @@
requires bool_constant<(_Gen::min() < _Gen::max())>::value;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__random/uniform_real_distribution.h b/third_party/llvm-project/libcxx/include/__random/uniform_real_distribution.h
index b52b689..dd6d6b3 100644
--- a/third_party/llvm-project/libcxx/include/__random/uniform_real_distribution.h
+++ b/third_party/llvm-project/libcxx/include/__random/uniform_real_distribution.h
@@ -14,7 +14,6 @@
#include <__random/is_valid.h>
#include <iosfwd>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__ranges/access.h b/third_party/llvm-project/libcxx/include/__ranges/access.h
index e48a71a..502bd5e 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/access.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/access.h
@@ -29,7 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template <class _Tp>
@@ -223,7 +223,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/all.h b/third_party/llvm-project/libcxx/include/__ranges/all.h
index 511f7b3..ecf908d 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/all.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/all.h
@@ -18,10 +18,10 @@
#include <__ranges/owning_view.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/ref_view.h>
+#include <__type_traits/decay.h>
#include <__utility/auto_cast.h>
#include <__utility/declval.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -29,7 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges::views {
@@ -77,7 +77,7 @@
} // namespace ranges::views
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/common_view.h b/third_party/llvm-project/libcxx/include/__ranges/common_view.h
index 8d7ae58..8fc68ba 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/common_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/common_view.h
@@ -24,7 +24,6 @@
#include <__ranges/view_interface.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -32,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -130,7 +129,7 @@
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/concepts.h b/third_party/llvm-project/libcxx/include/__ranges/concepts.h
index e34c545..b87a714 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/concepts.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/concepts.h
@@ -37,7 +37,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -73,6 +73,9 @@
template <range _Rp>
using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>;
+ template <range _Rp>
+ using range_common_reference_t = iter_common_reference_t<iterator_t<_Rp>>;
+
// [range.sized]
template <class _Tp>
concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); };
@@ -140,7 +143,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/copyable_box.h b/third_party/llvm-project/libcxx/include/__ranges/copyable_box.h
index fb3d6e4..1973bbf 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/copyable_box.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/copyable_box.h
@@ -18,7 +18,6 @@
#include <__memory/construct_at.h>
#include <__utility/move.h>
#include <optional>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into
// a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state
@@ -173,7 +172,7 @@
};
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/counted.h b/third_party/llvm-project/libcxx/include/__ranges/counted.h
index 138aa0e..882f90b 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/counted.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/counted.h
@@ -19,10 +19,11 @@
#include <__iterator/iterator_traits.h>
#include <__memory/pointer_traits.h>
#include <__ranges/subrange.h>
+#include <__type_traits/decay.h>
#include <__utility/forward.h>
#include <__utility/move.h>
+#include <cstddef>
#include <span>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -30,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges::views {
@@ -75,7 +76,7 @@
} // namespace ranges::views
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/dangling.h b/third_party/llvm-project/libcxx/include/__ranges/dangling.h
index c104534..613084d 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/dangling.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/dangling.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
struct dangling {
@@ -35,7 +35,7 @@
// borrowed_subrange_t defined in <__ranges/subrange.h>
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/data.h b/third_party/llvm-project/libcxx/include/__ranges/data.h
index 0ac25b5..6c09908 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/data.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/data.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.prim.data]
@@ -105,7 +105,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/drop_view.h b/third_party/llvm-project/libcxx/include/__ranges/drop_view.h
index 8f3564a..87668c3 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/drop_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/drop_view.h
@@ -33,10 +33,15 @@
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -47,7 +52,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<view _View>
@@ -69,7 +74,7 @@
drop_view() requires default_initializable<_View> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr drop_view(_View __base, range_difference_t<_View> __count)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 drop_view(_View __base, range_difference_t<_View> __count)
: __count_(__count)
, __base_(std::move(__base))
{
@@ -255,12 +260,12 @@
{
// Introducing local variables avoids calculating `min` and `distance` twice (at the cost of diverging from the
// expression used in the `noexcept` clause and the return statement).
- auto dist = ranges::distance(__rng);
- auto clamped = std::min<_Dist>(dist, std::forward<_Np>(__n));
+ auto __dist = ranges::distance(__rng);
+ auto __clamped = std::min<_Dist>(__dist, std::forward<_Np>(__n));
return _RawRange(
- ranges::begin(__rng) + clamped,
+ ranges::begin(__rng) + __clamped,
ranges::end(__rng),
- std::__to_unsigned_like(dist - clamped)
+ std::__to_unsigned_like(__dist - __clamped)
);}
// [range.drop.overview]: the "otherwise" case.
@@ -299,7 +304,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/drop_while_view.h b/third_party/llvm-project/libcxx/include/__ranges/drop_while_view.h
index 7c28992..518feae 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/drop_while_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/drop_while_view.h
@@ -51,7 +51,7 @@
requires default_initializable<_View> && default_initializable<_Pred>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr drop_while_view(_View __base, _Pred __pred)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 drop_while_view(_View __base, _Pred __pred)
: __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
diff --git a/third_party/llvm-project/libcxx/include/__ranges/elements_view.h b/third_party/llvm-project/libcxx/include/__ranges/elements_view.h
index 3afd6dd..325e4c9 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/elements_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/elements_view.h
@@ -26,9 +26,9 @@
#include <__ranges/range_adaptor.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_like.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_like.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/maybe_const.h>
#include <__type_traits/remove_cv.h>
@@ -49,12 +49,6 @@
namespace ranges {
-template <class _View, size_t _Np, bool _Const>
-class __elements_view_iterator;
-
-template <class _View, size_t _Np, bool _Const>
-class __elements_view_sentinel;
-
template <class _Tp, size_t _Np>
concept __has_tuple_element = __tuple_like<_Tp> && _Np < tuple_size<_Tp>::value;
@@ -66,6 +60,13 @@
__has_tuple_element<remove_reference_t<range_reference_t<_View>>, _Np> &&
__returnable_element<range_reference_t<_View>, _Np>
class elements_view : public view_interface<elements_view<_View, _Np>> {
+private:
+ template <bool>
+ class __iterator;
+
+ template <bool>
+ class __sentinel;
+
public:
_LIBCPP_HIDE_FROM_ABI elements_view()
requires default_initializable<_View>
@@ -130,12 +131,6 @@
}
private:
- template <bool _Const>
- using __iterator = __elements_view_iterator<_View, _Np, _Const>;
-
- template <bool _Const>
- using __sentinel = __elements_view_sentinel<_View, _Np, _Const>;
-
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
};
@@ -160,13 +155,18 @@
using iterator_category = decltype(__get_iterator_category());
};
-template <class _View, size_t _Np, bool _Const>
-class __elements_view_iterator : public __elements_view_iterator_category_base<__maybe_const<_Const, _View>, _Np> {
- template <class, size_t, bool >
- friend class __elements_view_iterator;
+template <input_range _View, size_t _Np>
+ requires view<_View> && __has_tuple_element<range_value_t<_View>, _Np> &&
+ __has_tuple_element<remove_reference_t<range_reference_t<_View>>, _Np> &&
+ __returnable_element<range_reference_t<_View>, _Np>
+template <bool _Const>
+class elements_view<_View, _Np>::__iterator
+ : public __elements_view_iterator_category_base<__maybe_const<_Const, _View>, _Np> {
+ template <bool>
+ friend class __iterator;
- template <class, size_t, bool >
- friend class __elements_view_sentinel;
+ template <bool>
+ friend class __sentinel;
using _Base = __maybe_const<_Const, _View>;
@@ -198,14 +198,13 @@
using value_type = remove_cvref_t<tuple_element_t<_Np, range_value_t<_Base>>>;
using difference_type = range_difference_t<_Base>;
- _LIBCPP_HIDE_FROM_ABI __elements_view_iterator()
+ _LIBCPP_HIDE_FROM_ABI __iterator()
requires default_initializable<iterator_t<_Base>>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __elements_view_iterator(iterator_t<_Base> __current)
- : __current_(std::move(__current)) {}
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(iterator_t<_Base> __current) : __current_(std::move(__current)) {}
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator(__elements_view_iterator<_View, _Np, !_Const> __i)
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator(__iterator<!_Const> __i)
requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
: __current_(std::move(__i.__current_)) {}
@@ -215,44 +214,44 @@
_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return __get_element(__current_); }
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator& operator++() {
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
++__current_;
return *this;
}
_LIBCPP_HIDE_FROM_ABI constexpr void operator++(int) { ++__current_; }
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator operator++(int)
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int)
requires forward_range<_Base>
{
- auto temp = *this;
+ auto __temp = *this;
++__current_;
- return temp;
+ return __temp;
}
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator& operator--()
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--()
requires bidirectional_range<_Base>
{
--__current_;
return *this;
}
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator operator--(int)
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int)
requires bidirectional_range<_Base>
{
- auto temp = *this;
+ auto __temp = *this;
--__current_;
- return temp;
+ return __temp;
}
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator& operator+=(difference_type __n)
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n)
requires random_access_range<_Base>
{
__current_ += __n;
return *this;
}
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_iterator& operator-=(difference_type __n)
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __n)
requires random_access_range<_Base>
{
__current_ -= __n;
@@ -265,99 +264,91 @@
return __get_element(__current_ + __n);
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
requires equality_comparable<iterator_t<_Base>>
{
return __x.__current_ == __y.__current_;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator<(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __x.__current_ < __y.__current_;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator>(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __y < __x;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator<=(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return !(__y < __x);
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator>=(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return !(__x < __y);
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr auto
- operator<=>(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
{
return __x.__current_ <=> __y.__current_;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr __elements_view_iterator
- operator+(const __elements_view_iterator& __x, difference_type __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(const __iterator& __x, difference_type __y)
requires random_access_range<_Base>
{
- return __elements_view_iterator{__x} += __y;
+ return __iterator{__x} += __y;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr __elements_view_iterator
- operator+(difference_type __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __y + __x;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr __elements_view_iterator
- operator-(const __elements_view_iterator& __x, difference_type __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(const __iterator& __x, difference_type __y)
requires random_access_range<_Base>
{
- return __elements_view_iterator{__x} -= __y;
+ return __iterator{__x} -= __y;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
- operator-(const __elements_view_iterator& __x, const __elements_view_iterator& __y)
+ _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
{
return __x.__current_ - __y.__current_;
}
};
-template <class _View, size_t _Np, bool _Const>
-class __elements_view_sentinel {
+template <input_range _View, size_t _Np>
+ requires view<_View> && __has_tuple_element<range_value_t<_View>, _Np> &&
+ __has_tuple_element<remove_reference_t<range_reference_t<_View>>, _Np> &&
+ __returnable_element<range_reference_t<_View>, _Np>
+template <bool _Const>
+class elements_view<_View, _Np>::__sentinel {
private:
using _Base = __maybe_const<_Const, _View>;
_LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>();
- template <class, size_t, bool >
- friend class __elements_view_sentinel;
+ template <bool>
+ friend class __sentinel;
template <bool _AnyConst>
- _LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto)
- __get_current(const __elements_view_iterator<_View, _Np, _AnyConst>& __iter) {
+ _LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto) __get_current(const __iterator<_AnyConst>& __iter) {
return (__iter.__current_);
}
public:
- _LIBCPP_HIDE_FROM_ABI __elements_view_sentinel() = default;
+ _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __elements_view_sentinel(sentinel_t<_Base> __end)
- : __end_(std::move(__end)) {}
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}
- _LIBCPP_HIDE_FROM_ABI constexpr __elements_view_sentinel(__elements_view_sentinel<_View, _Np, !_Const> __other)
+ _LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __other)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__other.__end_)) {}
@@ -365,22 +356,21 @@
template <bool _OtherConst>
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(const __elements_view_iterator<_View, _Np, _OtherConst>& __x, const __elements_view_sentinel& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
return __get_current(__x) == __y.__end_;
}
template <bool _OtherConst>
requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
- operator-(const __elements_view_iterator<_View, _Np, _OtherConst>& __x, const __elements_view_sentinel& __y) {
+ operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
return __get_current(__x) - __y.__end_;
}
template <bool _OtherConst>
requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
- operator-(const __elements_view_sentinel& __x, const __elements_view_iterator<_View, _Np, _OtherConst>& __y) {
+ operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
return __x.__end_ - __get_current(__y);
}
};
diff --git a/third_party/llvm-project/libcxx/include/__ranges/empty.h b/third_party/llvm-project/libcxx/include/__ranges/empty.h
index 8a1c75c..64996f4 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/empty.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/empty.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.prim.empty]
@@ -75,7 +75,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/empty_view.h b/third_party/llvm-project/libcxx/include/__ranges/empty_view.h
index 58e69ac..bb445b4 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/empty_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/empty_view.h
@@ -13,7 +13,8 @@
#include <__config>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/view_interface.h>
-#include <type_traits>
+#include <__type_traits/is_object.h>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -21,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class _Tp>
@@ -46,7 +47,7 @@
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/enable_borrowed_range.h b/third_party/llvm-project/libcxx/include/__ranges/enable_borrowed_range.h
index 833d266..1d06833 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/enable_borrowed_range.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/enable_borrowed_range.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -33,7 +33,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/enable_view.h b/third_party/llvm-project/libcxx/include/__ranges/enable_view.h
index c85064b..0c1dff3 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/enable_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/enable_view.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -43,7 +43,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/filter_view.h b/third_party/llvm-project/libcxx/include/__ranges/filter_view.h
index f8633a3..28d08c8 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/filter_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/filter_view.h
@@ -35,7 +35,6 @@
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -43,18 +42,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
-
- template <input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
- requires view<_View> && is_object_v<_Pred>
- class __filter_view_iterator;
-
- template <input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
- requires view<_View> && is_object_v<_Pred>
- class __filter_view_sentinel;
-
template<input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
requires view<_View> && is_object_v<_Pred>
class filter_view : public view_interface<filter_view<_View, _Pred>> {
@@ -67,20 +57,15 @@
using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
_LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
- using __iterator = __filter_view_iterator<_View, _Pred>;
- using __sentinel = __filter_view_sentinel<_View, _Pred>;
-
- friend __iterator;
- friend __sentinel;
+ class __iterator;
+ class __sentinel;
public:
_LIBCPP_HIDE_FROM_ABI
filter_view() requires default_initializable<_View> && default_initializable<_Pred> = default;
- _LIBCPP_HIDE_FROM_ABI
- constexpr filter_view(_View __base, _Pred __pred)
- : __base_(std::move(__base)), __pred_(in_place, std::move(__pred))
- { }
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 filter_view(_View __base, _Pred __pred)
+ : __base_(std::move(__base)), __pred_(in_place, std::move(__pred)) {}
template<class _Vp = _View>
_LIBCPP_HIDE_FROM_ABI
@@ -131,13 +116,11 @@
template<input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
requires view<_View> && is_object_v<_Pred>
- class __filter_view_iterator : public __filter_iterator_category<_View> {
-
- using __filter_view = filter_view<_View, _Pred>;
+ class filter_view<_View, _Pred>::__iterator : public __filter_iterator_category<_View> {
public:
_LIBCPP_NO_UNIQUE_ADDRESS iterator_t<_View> __current_ = iterator_t<_View>();
- _LIBCPP_NO_UNIQUE_ADDRESS __filter_view* __parent_ = nullptr;
+ _LIBCPP_NO_UNIQUE_ADDRESS filter_view* __parent_ = nullptr;
using iterator_concept =
_If<bidirectional_range<_View>, bidirectional_iterator_tag,
@@ -149,10 +132,10 @@
using difference_type = range_difference_t<_View>;
_LIBCPP_HIDE_FROM_ABI
- __filter_view_iterator() requires default_initializable<iterator_t<_View>> = default;
+ __iterator() requires default_initializable<iterator_t<_View>> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr __filter_view_iterator(__filter_view& __parent, iterator_t<_View> __current)
+ constexpr __iterator(filter_view& __parent, iterator_t<_View> __current)
: __current_(std::move(__current)), __parent_(std::addressof(__parent))
{ }
@@ -171,7 +154,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __filter_view_iterator& operator++() {
+ constexpr __iterator& operator++() {
__current_ = ranges::find_if(std::move(++__current_), ranges::end(__parent_->__base_),
std::ref(*__parent_->__pred_));
return *this;
@@ -179,42 +162,42 @@
_LIBCPP_HIDE_FROM_ABI
constexpr void operator++(int) { ++*this; }
_LIBCPP_HIDE_FROM_ABI
- constexpr __filter_view_iterator operator++(int) requires forward_range<_View> {
+ constexpr __iterator operator++(int) requires forward_range<_View> {
auto __tmp = *this;
++*this;
return __tmp;
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __filter_view_iterator& operator--() requires bidirectional_range<_View> {
+ constexpr __iterator& operator--() requires bidirectional_range<_View> {
do {
--__current_;
} while (!std::invoke(*__parent_->__pred_, *__current_));
return *this;
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __filter_view_iterator operator--(int) requires bidirectional_range<_View> {
- auto tmp = *this;
+ constexpr __iterator operator--(int) requires bidirectional_range<_View> {
+ auto __tmp = *this;
--*this;
- return tmp;
+ return __tmp;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(__filter_view_iterator const& __x, __filter_view_iterator const& __y)
+ friend constexpr bool operator==(__iterator const& __x, __iterator const& __y)
requires equality_comparable<iterator_t<_View>>
{
return __x.__current_ == __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr range_rvalue_reference_t<_View> iter_move(__filter_view_iterator const& __it)
+ friend constexpr range_rvalue_reference_t<_View> iter_move(__iterator const& __it)
noexcept(noexcept(ranges::iter_move(__it.__current_)))
{
return ranges::iter_move(__it.__current_);
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr void iter_swap(__filter_view_iterator const& __x, __filter_view_iterator const& __y)
+ friend constexpr void iter_swap(__iterator const& __x, __iterator const& __y)
noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
requires indirectly_swappable<iterator_t<_View>>
{
@@ -224,17 +207,15 @@
template<input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
requires view<_View> && is_object_v<_Pred>
- class __filter_view_sentinel {
- using __filter_view = filter_view<_View, _Pred>;
-
+ class filter_view<_View, _Pred>::__sentinel {
public:
sentinel_t<_View> __end_ = sentinel_t<_View>();
_LIBCPP_HIDE_FROM_ABI
- __filter_view_sentinel() = default;
+ __sentinel() = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr explicit __filter_view_sentinel(__filter_view& __parent)
+ constexpr explicit __sentinel(filter_view& __parent)
: __end_(ranges::end(__parent.__base_))
{ }
@@ -242,7 +223,7 @@
constexpr sentinel_t<_View> base() const { return __end_; }
_LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(__filter_view_iterator<_View, _Pred> const& __x, __filter_view_sentinel const& __y) {
+ operator==(__iterator const& __x, __sentinel const& __y) {
return __x.__current_ == __y.__end_;
}
};
@@ -273,7 +254,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/iota_view.h b/third_party/llvm-project/libcxx/include/__ranges/iota_view.h
index 3654096..5713942 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/iota_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/iota_view.h
@@ -30,9 +30,12 @@
#include <__ranges/copyable_box.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_nothrow_copy_constructible.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -40,12 +43,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class _Int>
struct __get_wider_signed {
- static auto __call() {
+ consteval static auto __call() {
if constexpr (sizeof(_Int) < sizeof(short)) return type_identity<short>{};
else if constexpr (sizeof(_Int) < sizeof(int)) return type_identity<int>{};
else if constexpr (sizeof(_Int) < sizeof(long)) return type_identity<long>{};
@@ -83,14 +86,6 @@
{ __j - __j } -> convertible_to<_IotaDiffT<_Iter>>;
};
- template <weakly_incrementable _Start>
- requires copyable<_Start>
- struct __iota_view_iterator;
-
- template <weakly_incrementable _Start, semiregular _BoundSentinel>
- requires __weakly_equality_comparable_with<_Start, _BoundSentinel> && copyable<_Start>
- struct __iota_view_sentinel;
-
template<class>
struct __iota_iterator_category {};
@@ -102,9 +97,211 @@
template <weakly_incrementable _Start, semiregular _BoundSentinel = unreachable_sentinel_t>
requires __weakly_equality_comparable_with<_Start, _BoundSentinel> && copyable<_Start>
class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
+ struct __iterator : public __iota_iterator_category<_Start> {
+ friend class iota_view;
- using __iterator = __iota_view_iterator<_Start>;
- using __sentinel = __iota_view_sentinel<_Start, _BoundSentinel>;
+ using iterator_concept =
+ _If<__advanceable<_Start>, random_access_iterator_tag,
+ _If<__decrementable<_Start>, bidirectional_iterator_tag,
+ _If<incrementable<_Start>, forward_iterator_tag,
+ /*Else*/ input_iterator_tag>>>;
+
+ using value_type = _Start;
+ using difference_type = _IotaDiffT<_Start>;
+
+ _Start __value_ = _Start();
+
+ _LIBCPP_HIDE_FROM_ABI
+ __iterator() requires default_initializable<_Start> = default;
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) {
+ return __value_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator++() {
+ ++__value_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr void operator++(int) { ++*this; }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator operator++(int) requires incrementable<_Start> {
+ auto __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator--() requires __decrementable<_Start> {
+ --__value_;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator operator--(int) requires __decrementable<_Start> {
+ auto __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator+=(difference_type __n)
+ requires __advanceable<_Start>
+ {
+ if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) {
+ if (__n >= difference_type(0)) {
+ __value_ += static_cast<_Start>(__n);
+ } else {
+ __value_ -= static_cast<_Start>(-__n);
+ }
+ } else {
+ __value_ += __n;
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr __iterator& operator-=(difference_type __n)
+ requires __advanceable<_Start>
+ {
+ if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) {
+ if (__n >= difference_type(0)) {
+ __value_ -= static_cast<_Start>(__n);
+ } else {
+ __value_ += static_cast<_Start>(-__n);
+ }
+ } else {
+ __value_ -= __n;
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _Start operator[](difference_type __n) const
+ requires __advanceable<_Start>
+ {
+ return _Start(__value_ + __n);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
+ requires equality_comparable<_Start>
+ {
+ return __x.__value_ == __y.__value_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
+ requires totally_ordered<_Start>
+ {
+ return __x.__value_ < __y.__value_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
+ requires totally_ordered<_Start>
+ {
+ return __y < __x;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
+ requires totally_ordered<_Start>
+ {
+ return !(__y < __x);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
+ requires totally_ordered<_Start>
+ {
+ return !(__x < __y);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
+ requires totally_ordered<_Start> && three_way_comparable<_Start>
+ {
+ return __x.__value_ <=> __y.__value_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr __iterator operator+(__iterator __i, difference_type __n)
+ requires __advanceable<_Start>
+ {
+ __i += __n;
+ return __i;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr __iterator operator+(difference_type __n, __iterator __i)
+ requires __advanceable<_Start>
+ {
+ return __i + __n;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr __iterator operator-(__iterator __i, difference_type __n)
+ requires __advanceable<_Start>
+ {
+ __i -= __n;
+ return __i;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
+ requires __advanceable<_Start>
+ {
+ if constexpr (__integer_like<_Start>) {
+ if constexpr (__signed_integer_like<_Start>) {
+ return difference_type(difference_type(__x.__value_) - difference_type(__y.__value_));
+ }
+ if (__y.__value_ > __x.__value_) {
+ return difference_type(-difference_type(__y.__value_ - __x.__value_));
+ }
+ return difference_type(__x.__value_ - __y.__value_);
+ }
+ return __x.__value_ - __y.__value_;
+ }
+ };
+
+ struct __sentinel {
+ friend class iota_view;
+
+ private:
+ _BoundSentinel __bound_sentinel_ = _BoundSentinel();
+
+ public:
+ _LIBCPP_HIDE_FROM_ABI
+ __sentinel() = default;
+ constexpr explicit __sentinel(_BoundSentinel __bound_sentinel) : __bound_sentinel_(std::move(__bound_sentinel)) {}
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) {
+ return __x.__value_ == __y.__bound_sentinel_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr iter_difference_t<_Start> operator-(const __iterator& __x, const __sentinel& __y)
+ requires sized_sentinel_for<_BoundSentinel, _Start>
+ {
+ return __x.__value_ - __y.__bound_sentinel_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI
+ friend constexpr iter_difference_t<_Start> operator-(const __sentinel& __x, const __iterator& __y)
+ requires sized_sentinel_for<_BoundSentinel, _Start>
+ {
+ return -(__y - __x);
+ }
+ };
_Start __value_ = _Start();
_BoundSentinel __bound_sentinel_ = _BoundSentinel();
@@ -117,7 +314,7 @@
constexpr explicit iota_view(_Start __value) : __value_(std::move(__value)) { }
_LIBCPP_HIDE_FROM_ABI
- constexpr iota_view(type_identity_t<_Start> __value, type_identity_t<_BoundSentinel> __bound_sentinel)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(type_identity_t<_Start> __value, type_identity_t<_BoundSentinel> __bound_sentinel)
: __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) {
// Validate the precondition if possible.
if constexpr (totally_ordered_with<_Start, _BoundSentinel>) {
@@ -127,17 +324,17 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr iota_view(__iterator __first, __iterator __last)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __iterator __last)
requires same_as<_Start, _BoundSentinel>
: iota_view(std::move(__first.__value_), std::move(__last.__value_)) {}
_LIBCPP_HIDE_FROM_ABI
- constexpr iota_view(__iterator __first, _BoundSentinel __last)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, _BoundSentinel __last)
requires same_as<_BoundSentinel, unreachable_sentinel_t>
: iota_view(std::move(__first.__value_), std::move(__last)) {}
_LIBCPP_HIDE_FROM_ABI
- constexpr iota_view(__iterator __first, __sentinel __last)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 iota_view(__iterator __first, __sentinel __last)
requires(!same_as<_Start, _BoundSentinel> && !same_as<_Start, unreachable_sentinel_t>)
: iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}
@@ -185,224 +382,6 @@
template <class _Start, class _BoundSentinel>
inline constexpr bool enable_borrowed_range<iota_view<_Start, _BoundSentinel>> = true;
- template <weakly_incrementable _Start>
- requires copyable<_Start>
- struct __iota_view_iterator : public __iota_iterator_category<_Start> {
-
- template <weakly_incrementable _StartT, semiregular _BoundSentinelT>
- requires __weakly_equality_comparable_with<_StartT, _BoundSentinelT> && copyable<_StartT>
- friend class iota_view;
-
- using iterator_concept =
- _If<__advanceable<_Start>, random_access_iterator_tag,
- _If<__decrementable<_Start>, bidirectional_iterator_tag,
- _If<incrementable<_Start>, forward_iterator_tag,
- /*Else*/ input_iterator_tag>>>;
-
- using value_type = _Start;
- using difference_type = _IotaDiffT<_Start>;
-
- _Start __value_ = _Start();
-
- _LIBCPP_HIDE_FROM_ABI
- __iota_view_iterator() requires default_initializable<_Start> = default;
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr explicit __iota_view_iterator(_Start __value) : __value_(std::move(__value)) {}
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) {
- return __value_;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr __iota_view_iterator& operator++() {
- ++__value_;
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr void operator++(int) { ++*this; }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr __iota_view_iterator operator++(int) requires incrementable<_Start> {
- auto __tmp = *this;
- ++*this;
- return __tmp;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr __iota_view_iterator& operator--() requires __decrementable<_Start> {
- --__value_;
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr __iota_view_iterator operator--(int) requires __decrementable<_Start> {
- auto __tmp = *this;
- --*this;
- return __tmp;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr __iota_view_iterator& operator+=(difference_type __n)
- requires __advanceable<_Start>
- {
- if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) {
- if (__n >= difference_type(0)) {
- __value_ += static_cast<_Start>(__n);
- } else {
- __value_ -= static_cast<_Start>(-__n);
- }
- } else {
- __value_ += __n;
- }
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr __iota_view_iterator& operator-=(difference_type __n)
- requires __advanceable<_Start>
- {
- if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) {
- if (__n >= difference_type(0)) {
- __value_ -= static_cast<_Start>(__n);
- } else {
- __value_ += static_cast<_Start>(-__n);
- }
- } else {
- __value_ -= __n;
- }
- return *this;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- constexpr _Start operator[](difference_type __n) const
- requires __advanceable<_Start>
- {
- return _Start(__value_ + __n);
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires equality_comparable<_Start>
- {
- return __x.__value_ == __y.__value_;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator<(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires totally_ordered<_Start>
- {
- return __x.__value_ < __y.__value_;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator>(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires totally_ordered<_Start>
- {
- return __y < __x;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator<=(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires totally_ordered<_Start>
- {
- return !(__y < __x);
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator>=(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires totally_ordered<_Start>
- {
- return !(__x < __y);
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr auto operator<=>(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires totally_ordered<_Start> && three_way_comparable<_Start>
- {
- return __x.__value_ <=> __y.__value_;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr __iota_view_iterator operator+(__iota_view_iterator __i, difference_type __n)
- requires __advanceable<_Start>
- {
- __i += __n;
- return __i;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr __iota_view_iterator operator+(difference_type __n, __iota_view_iterator __i)
- requires __advanceable<_Start>
- {
- return __i + __n;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr __iota_view_iterator operator-(__iota_view_iterator __i, difference_type __n)
- requires __advanceable<_Start>
- {
- __i -= __n;
- return __i;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr difference_type operator-(const __iota_view_iterator& __x, const __iota_view_iterator& __y)
- requires __advanceable<_Start>
- {
- if constexpr (__integer_like<_Start>) {
- if constexpr (__signed_integer_like<_Start>) {
- return difference_type(difference_type(__x.__value_) - difference_type(__y.__value_));
- }
- if (__y.__value_ > __x.__value_) {
- return difference_type(-difference_type(__y.__value_ - __x.__value_));
- }
- return difference_type(__x.__value_ - __y.__value_);
- }
- return __x.__value_ - __y.__value_;
- }
- };
-
- template <weakly_incrementable _Start, semiregular _BoundSentinel>
- requires __weakly_equality_comparable_with<_Start, _BoundSentinel> && copyable<_Start>
- struct __iota_view_sentinel {
-
- template <weakly_incrementable _StartT, semiregular _BoundSentinelT>
- requires __weakly_equality_comparable_with<_StartT, _BoundSentinelT> && copyable<_StartT>
- friend class iota_view;
-
- using __iterator = __iota_view_iterator<_Start>;
-
- private:
- _BoundSentinel __bound_sentinel_ = _BoundSentinel();
-
- public:
- _LIBCPP_HIDE_FROM_ABI
- __iota_view_sentinel() = default;
- constexpr explicit __iota_view_sentinel(_BoundSentinel __bound_sentinel) : __bound_sentinel_(std::move(__bound_sentinel)) {}
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(const __iterator& __x, const __iota_view_sentinel& __y) {
- return __x.__value_ == __y.__bound_sentinel_;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr iter_difference_t<_Start> operator-(const __iterator& __x, const __iota_view_sentinel& __y)
- requires sized_sentinel_for<_BoundSentinel, _Start>
- {
- return __x.__value_ - __y.__bound_sentinel_;
- }
-
- _LIBCPP_HIDE_FROM_ABI
- friend constexpr iter_difference_t<_Start> operator-(const __iota_view_sentinel& __x, const __iterator& __y)
- requires sized_sentinel_for<_BoundSentinel, _Start>
- {
- return -(__y - __x);
- }
- };
-
namespace views {
namespace __iota {
struct __fn {
@@ -427,7 +406,7 @@
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/istream_view.h b/third_party/llvm-project/libcxx/include/__ranges/istream_view.h
index 69a9df3..66cd915 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/istream_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/istream_view.h
@@ -36,18 +36,10 @@
template <class _Val, class _CharT, class _Traits>
concept __stream_extractable = requires(basic_istream<_CharT, _Traits>& __is, _Val& __t) { __is >> __t; };
-template <movable _Val, class _CharT, class _Traits>
- requires default_initializable<_Val> && __stream_extractable<_Val, _CharT, _Traits>
-class __basic_istream_view_iterator;
-
template <movable _Val, class _CharT, class _Traits = char_traits<_CharT>>
requires default_initializable<_Val> && __stream_extractable<_Val, _CharT, _Traits>
class basic_istream_view : public view_interface<basic_istream_view<_Val, _CharT, _Traits>> {
- using __iterator = __basic_istream_view_iterator<_Val, _CharT, _Traits>;
-
- template <movable _ValueType, class _CharType, class _TraitsType>
- requires default_initializable<_ValueType> && __stream_extractable<_ValueType, _CharType, _TraitsType>
- friend class __basic_istream_view_iterator;
+ class __iterator;
public:
_LIBCPP_HIDE_FROM_ABI constexpr explicit basic_istream_view(basic_istream<_CharT, _Traits>& __stream)
@@ -67,23 +59,23 @@
template <movable _Val, class _CharT, class _Traits>
requires default_initializable<_Val> && __stream_extractable<_Val, _CharT, _Traits>
-class __basic_istream_view_iterator {
+class basic_istream_view<_Val, _CharT, _Traits>::__iterator {
public:
using iterator_concept = input_iterator_tag;
using difference_type = ptrdiff_t;
using value_type = _Val;
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __basic_istream_view_iterator(
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(
basic_istream_view<_Val, _CharT, _Traits>& __parent) noexcept
: __parent_(std::addressof(__parent)) {}
- __basic_istream_view_iterator(const __basic_istream_view_iterator&) = delete;
- _LIBCPP_HIDE_FROM_ABI __basic_istream_view_iterator(__basic_istream_view_iterator&&) = default;
+ __iterator(const __iterator&) = delete;
+ _LIBCPP_HIDE_FROM_ABI __iterator(__iterator&&) = default;
- __basic_istream_view_iterator& operator=(const __basic_istream_view_iterator&) = delete;
- _LIBCPP_HIDE_FROM_ABI __basic_istream_view_iterator& operator=(__basic_istream_view_iterator&&) = default;
+ __iterator& operator=(const __iterator&) = delete;
+ _LIBCPP_HIDE_FROM_ABI __iterator& operator=(__iterator&&) = default;
- _LIBCPP_HIDE_FROM_ABI __basic_istream_view_iterator& operator++() {
+ _LIBCPP_HIDE_FROM_ABI __iterator& operator++() {
*__parent_->__stream_ >> __parent_->__value_;
return *this;
}
@@ -92,7 +84,7 @@
_LIBCPP_HIDE_FROM_ABI _Val& operator*() const { return __parent_->__value_; }
- _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __basic_istream_view_iterator& __x, default_sentinel_t) {
+ _LIBCPP_HIDE_FROM_ABI friend bool operator==(const __iterator& __x, default_sentinel_t) {
return !*__x.__get_parent_stream();
}
diff --git a/third_party/llvm-project/libcxx/include/__ranges/join_view.h b/third_party/llvm-project/libcxx/include/__ranges/join_view.h
index 869540f..83145ff 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/join_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/join_view.h
@@ -22,6 +22,7 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/iterator_with_data.h>
#include <__iterator/segmented_iterator.h>
+#include <__memory/addressof.h>
#include <__ranges/access.h>
#include <__ranges/all.h>
#include <__ranges/concepts.h>
@@ -32,7 +33,6 @@
#include <__type_traits/maybe_const.h>
#include <__utility/forward.h>
#include <optional>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -40,7 +40,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+// Note: `join_view` is still marked experimental because there is an ABI-breaking change that affects `join_view` in
+// the pipeline (https://isocpp.org/files/papers/D2770R0.html).
+// TODO: make `join_view` non-experimental once D2770 is implemented.
+#if _LIBCPP_STD_VER >= 20 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
namespace ranges {
template<class>
@@ -66,14 +69,6 @@
>;
};
- template <input_range _View, bool _Const>
- requires view<_View> && input_range<range_reference_t<_View>>
- struct __join_view_iterator;
-
- template <input_range _View, bool _Const>
- requires view<_View> && input_range<range_reference_t<_View>>
- struct __join_view_sentinel;
-
template<input_range _View>
requires view<_View> && input_range<range_reference_t<_View>>
class join_view
@@ -81,19 +76,9 @@
private:
using _InnerRange = range_reference_t<_View>;
- template<bool _Const>
- using __iterator = __join_view_iterator<_View, _Const>;
+ template<bool> struct __iterator;
- template<bool _Const>
- using __sentinel = __join_view_sentinel<_View, _Const>;
-
- template <input_range _View2, bool _Const2>
- requires view<_View2> && input_range<range_reference_t<_View2>>
- friend struct __join_view_iterator;
-
- template <input_range _View2, bool _Const2>
- requires view<_View2> && input_range<range_reference_t<_View2>>
- friend struct __join_view_sentinel;
+ template<bool> struct __sentinel;
template <class>
friend struct std::__segmented_iterator_traits;
@@ -164,12 +149,12 @@
}
};
- template<input_range _View, bool _Const>
+ template<input_range _View>
requires view<_View> && input_range<range_reference_t<_View>>
- struct __join_view_sentinel {
- template<input_range _View2, bool>
- requires view<_View2> && input_range<range_reference_t<_View2>>
- friend struct __join_view_sentinel;
+ template<bool _Const>
+ struct join_view<_View>::__sentinel {
+ template<bool>
+ friend struct __sentinel;
private:
using _Parent = __maybe_const<_Const, join_view<_View>>;
@@ -178,37 +163,42 @@
public:
_LIBCPP_HIDE_FROM_ABI
- __join_view_sentinel() = default;
+ __sentinel() = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr explicit __join_view_sentinel(_Parent& __parent)
+ constexpr explicit __sentinel(_Parent& __parent)
: __end_(ranges::end(__parent.__base_)) {}
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_sentinel(__join_view_sentinel<_View, !_Const> __s)
+ constexpr __sentinel(__sentinel<!_Const> __s)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__s.__end_)) {}
template<bool _OtherConst>
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(const __join_view_iterator<_View, _OtherConst>& __x, const __join_view_sentinel& __y) {
+ friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
return __x.__outer_ == __y.__end_;
}
};
- template<input_range _View, bool _Const>
+ // https://reviews.llvm.org/D142811#inline-1383022
+ // To simplify the segmented iterator traits specialization,
+ // make the iterator `final`
+ template<input_range _View>
requires view<_View> && input_range<range_reference_t<_View>>
- struct __join_view_iterator
+ template<bool _Const>
+ struct join_view<_View>::__iterator final
: public __join_view_iterator_category<__maybe_const<_Const, _View>> {
- template<input_range _View2, bool>
- requires view<_View2> && input_range<range_reference_t<_View2>>
- friend struct __join_view_iterator;
+ template<bool>
+ friend struct __iterator;
template <class>
friend struct std::__segmented_iterator_traits;
+ static constexpr bool __is_join_view_iterator = true;
+
private:
using _Parent = __maybe_const<_Const, join_view<_View>>;
using _Base = __maybe_const<_Const, _View>;
@@ -243,7 +233,7 @@
__inner_.reset();
}
- _LIBCPP_HIDE_FROM_ABI constexpr __join_view_iterator(_Parent* __parent, _Outer __outer, _Inner __inner)
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator(_Parent* __parent, _Outer __outer, _Inner __inner)
: __outer_(std::move(__outer)), __inner_(std::move(__inner)), __parent_(__parent) {}
public:
@@ -264,17 +254,17 @@
range_difference_t<_Base>, range_difference_t<range_reference_t<_Base>>>;
_LIBCPP_HIDE_FROM_ABI
- __join_view_iterator() requires default_initializable<_Outer> = default;
+ __iterator() requires default_initializable<_Outer> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_iterator(_Parent& __parent, _Outer __outer)
+ constexpr __iterator(_Parent& __parent, _Outer __outer)
: __outer_(std::move(__outer))
, __parent_(std::addressof(__parent)) {
__satisfy();
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_iterator(__join_view_iterator<_View, !_Const> __i)
+ constexpr __iterator(__iterator<!_Const> __i)
requires _Const &&
convertible_to<iterator_t<_View>, _Outer> &&
convertible_to<iterator_t<_InnerRange>, _Inner>
@@ -295,7 +285,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_iterator& operator++() {
+ constexpr __iterator& operator++() {
auto&& __inner = [&]() -> auto&& {
if constexpr (__ref_is_glvalue)
return *__outer_;
@@ -315,7 +305,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_iterator operator++(int)
+ constexpr __iterator operator++(int)
requires __ref_is_glvalue &&
forward_range<_Base> &&
forward_range<range_reference_t<_Base>>
@@ -326,7 +316,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_iterator& operator--()
+ constexpr __iterator& operator--()
requires __ref_is_glvalue &&
bidirectional_range<_Base> &&
bidirectional_range<range_reference_t<_Base>> &&
@@ -345,7 +335,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __join_view_iterator operator--(int)
+ constexpr __iterator operator--(int)
requires __ref_is_glvalue &&
bidirectional_range<_Base> &&
bidirectional_range<range_reference_t<_Base>> &&
@@ -357,7 +347,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(const __join_view_iterator& __x, const __join_view_iterator& __y)
+ friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
requires __ref_is_glvalue &&
equality_comparable<iterator_t<_Base>> &&
equality_comparable<iterator_t<range_reference_t<_Base>>>
@@ -366,14 +356,14 @@
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr decltype(auto) iter_move(const __join_view_iterator& __i)
+ friend constexpr decltype(auto) iter_move(const __iterator& __i)
noexcept(noexcept(ranges::iter_move(*__i.__inner_)))
{
return ranges::iter_move(*__i.__inner_);
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr void iter_swap(const __join_view_iterator& __x, const __join_view_iterator& __y)
+ friend constexpr void iter_swap(const __iterator& __x, const __iterator& __y)
noexcept(noexcept(ranges::iter_swap(*__x.__inner_, *__y.__inner_)))
requires indirectly_swappable<_Inner>
{
@@ -401,12 +391,12 @@
} // namespace views
} // namespace ranges
-template <class _View, bool _Const>
- requires(ranges::common_range<typename ranges::__join_view_iterator<_View, _Const>::_Parent> &&
- __is_cpp17_random_access_iterator<typename ranges::__join_view_iterator<_View, _Const>::_Outer>::value &&
- __is_cpp17_random_access_iterator<typename ranges::__join_view_iterator<_View, _Const>::_Inner>::value)
-struct __segmented_iterator_traits<ranges::__join_view_iterator<_View, _Const>> {
- using _JoinViewIterator = ranges::__join_view_iterator<_View, _Const>;
+template <class _JoinViewIterator>
+ requires(_JoinViewIterator::__is_join_view_iterator &&
+ ranges::common_range<typename _JoinViewIterator::_Parent> &&
+ __is_cpp17_random_access_iterator<typename _JoinViewIterator::_Outer>::value &&
+ __is_cpp17_random_access_iterator<typename _JoinViewIterator::_Inner>::value)
+struct __segmented_iterator_traits<_JoinViewIterator> {
using __segment_iterator =
_LIBCPP_NODEBUG __iterator_with_data<typename _JoinViewIterator::_Outer, typename _JoinViewIterator::_Parent*>;
@@ -445,7 +435,7 @@
}
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // #if _LIBCPP_STD_VER >= 20 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/lazy_split_view.h b/third_party/llvm-project/libcxx/include/__ranges/lazy_split_view.h
index 3a95075..186a0af 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/lazy_split_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/lazy_split_view.h
@@ -12,6 +12,7 @@
#include <__algorithm/ranges_find.h>
#include <__algorithm/ranges_mismatch.h>
+#include <__assert>
#include <__concepts/constructible.h>
#include <__concepts/convertible_to.h>
#include <__concepts/derived_from.h>
@@ -34,10 +35,13 @@
#include <__ranges/single_view.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/maybe_const.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -45,7 +49,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -78,14 +82,14 @@
requires default_initializable<_View> && default_initializable<_Pattern> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr lazy_split_view(_View __base, _Pattern __pattern)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 lazy_split_view(_View __base, _Pattern __pattern)
: __base_(std::move(__base)), __pattern_(std::move(__pattern)) {}
template <input_range _Range>
requires constructible_from<_View, views::all_t<_Range>> &&
constructible_from<_Pattern, single_view<range_value_t<_Range>>>
_LIBCPP_HIDE_FROM_ABI
- constexpr lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
: __base_(views::all(std::forward<_Range>(__r)))
, __pattern_(views::single(std::move(__e))) {}
@@ -458,7 +462,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/non_propagating_cache.h b/third_party/llvm-project/libcxx/include/__ranges/non_propagating_cache.h
index d50c577..2e6e72f 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/non_propagating_cache.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/non_propagating_cache.h
@@ -16,7 +16,6 @@
#include <__memory/addressof.h>
#include <__utility/forward.h>
#include <optional>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
// __non_propagating_cache is a helper type that allows storing an optional value in it,
@@ -107,7 +106,7 @@
struct __empty_cache { };
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/owning_view.h b/third_party/llvm-project/libcxx/include/__ranges/owning_view.h
index e150f6d..cb1d0d5 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/owning_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/owning_view.h
@@ -20,8 +20,8 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -29,7 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<range _Rp>
@@ -76,7 +76,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/range_adaptor.h b/third_party/llvm-project/libcxx/include/__ranges/range_adaptor.h
index 37e4817..f8fd2f6 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/range_adaptor.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/range_adaptor.h
@@ -20,7 +20,6 @@
#include <__ranges/concepts.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// CRTP base that one can derive from in order to be considered a range adaptor closure
// by the library. When deriving from this class, a pipe operator will be provided to
@@ -70,7 +69,7 @@
{ return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); }
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/rbegin.h b/third_party/llvm-project/libcxx/include/__ranges/rbegin.h
index 26b4732..1ceb111 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/rbegin.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/rbegin.h
@@ -17,8 +17,11 @@
#include <__iterator/readable_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__ranges/access.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/auto_cast.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [ranges.access.rbegin]
@@ -124,7 +127,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/ref_view.h b/third_party/llvm-project/libcxx/include/__ranges/ref_view.h
index 1e5f746..be32b81 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/ref_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/ref_view.h
@@ -24,8 +24,9 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/is_object.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -33,7 +34,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<range _Range>
@@ -81,7 +82,7 @@
inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true;
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/rend.h b/third_party/llvm-project/libcxx/include/__ranges/rend.h
index d2987e9..7ee574c 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/rend.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/rend.h
@@ -18,8 +18,11 @@
#include <__iterator/reverse_iterator.h>
#include <__ranges/access.h>
#include <__ranges/rbegin.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/auto_cast.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -27,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// [range.access.rend]
@@ -128,7 +131,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/reverse_view.h b/third_party/llvm-project/libcxx/include/__ranges/reverse_view.h
index d7b1378..01d1b97 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/reverse_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/reverse_view.h
@@ -24,9 +24,10 @@
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -34,7 +35,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<view _View>
@@ -184,7 +185,7 @@
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/single_view.h b/third_party/llvm-project/libcxx/include/__ranges/single_view.h
index 5c4b918..ccab2c1 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/single_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/single_view.h
@@ -15,10 +15,12 @@
#include <__ranges/copyable_box.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_object.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -26,7 +28,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<copy_constructible _Tp>
@@ -95,7 +97,7 @@
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/size.h b/third_party/llvm-project/libcxx/include/__ranges/size.h
index 0ac8d63..f22dd1f 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/size.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/size.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class>
@@ -141,7 +141,7 @@
} // namespace __cpo
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/split_view.h b/third_party/llvm-project/libcxx/include/__ranges/split_view.h
index 9758ee9..a27ac4e 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/split_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/split_view.h
@@ -42,12 +42,6 @@
namespace ranges {
-template <class _View, class _Pattern>
-struct __split_view_iterator;
-
-template <class _View, class _Pattern>
-struct __split_view_sentinel;
-
template <forward_range _View, forward_range _Pattern>
requires view<_View> && view<_Pattern> &&
indirectly_comparable<iterator_t<_View>, iterator_t<_Pattern>, ranges::equal_to>
@@ -59,13 +53,13 @@
_Cache __cached_begin_ = _Cache();
template <class, class>
- friend struct __split_view_iterator;
+ friend struct __iterator;
template <class, class>
- friend struct __split_view_sentinel;
+ friend struct __sentinel;
- using __iterator = __split_view_iterator<_View, _Pattern>;
- using __sentinel = __split_view_sentinel<_View, _Pattern>;
+ struct __iterator;
+ struct __sentinel;
_LIBCPP_HIDE_FROM_ABI constexpr subrange<iterator_t<_View>> __find_next(iterator_t<_View> __it) {
auto [__begin, __end] = ranges::search(subrange(__it, ranges::end(__base_)), __pattern_);
@@ -81,13 +75,14 @@
requires default_initializable<_View> && default_initializable<_Pattern>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr split_view(_View __base, _Pattern __pattern)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 split_view(_View __base, _Pattern __pattern)
: __base_(std::move(__base)), __pattern_(std::move((__pattern))) {}
template <forward_range _Range>
requires constructible_from<_View, views::all_t<_Range>> &&
constructible_from<_Pattern, single_view<range_value_t<_Range>>>
- _LIBCPP_HIDE_FROM_ABI constexpr split_view(_Range&& __range, range_value_t<_Range> __elem)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23
+ split_view(_Range&& __range, range_value_t<_Range> __elem)
: __base_(views::all(std::forward<_Range>(__range))), __pattern_(views::single(std::move(__elem))) {}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
@@ -120,16 +115,17 @@
template <forward_range _Range>
split_view(_Range&&, range_value_t<_Range>) -> split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>;
-template <class _View, class _Pattern>
-struct __split_view_iterator {
+template <forward_range _View, forward_range _Pattern>
+ requires view<_View> && view<_Pattern> &&
+ indirectly_comparable<iterator_t<_View>, iterator_t<_Pattern>, ranges::equal_to>
+struct split_view<_View, _Pattern>::__iterator {
private:
- split_view<_View, _Pattern>* __parent_ = nullptr;
+ split_view* __parent_ = nullptr;
_LIBCPP_NO_UNIQUE_ADDRESS iterator_t<_View> __cur_ = iterator_t<_View>();
_LIBCPP_NO_UNIQUE_ADDRESS subrange<iterator_t<_View>> __next_ = subrange<iterator_t<_View>>();
bool __trailing_empty_ = false;
- template <class, class>
- friend struct __split_view_sentinel;
+ friend struct __sentinel;
public:
using iterator_concept = forward_iterator_tag;
@@ -137,9 +133,9 @@
using value_type = subrange<iterator_t<_View>>;
using difference_type = range_difference_t<_View>;
- _LIBCPP_HIDE_FROM_ABI __split_view_iterator() = default;
+ _LIBCPP_HIDE_FROM_ABI __iterator() = default;
- _LIBCPP_HIDE_FROM_ABI constexpr __split_view_iterator(
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator(
split_view<_View, _Pattern>& __parent, iterator_t<_View> __current, subrange<iterator_t<_View>> __next)
: __parent_(std::addressof(__parent)), __cur_(std::move(__current)), __next_(std::move(__next)) {}
@@ -147,7 +143,7 @@
_LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return {__cur_, __next_.begin()}; }
- _LIBCPP_HIDE_FROM_ABI constexpr __split_view_iterator& operator++() {
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
__cur_ = __next_.begin();
if (__cur_ != ranges::end(__parent_->__base_)) {
__cur_ = __next_.end();
@@ -163,36 +159,35 @@
return *this;
}
- _LIBCPP_HIDE_FROM_ABI constexpr __split_view_iterator operator++(int) {
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int) {
auto __tmp = *this;
++*this;
return __tmp;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(const __split_view_iterator& __x, const __split_view_iterator& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) {
return __x.__cur_ == __y.__cur_ && __x.__trailing_empty_ == __y.__trailing_empty_;
}
};
-template <class _View, class _Pattern>
-struct __split_view_sentinel {
+template <forward_range _View, forward_range _Pattern>
+ requires view<_View> && view<_Pattern> &&
+ indirectly_comparable<iterator_t<_View>, iterator_t<_Pattern>, ranges::equal_to>
+struct split_view<_View, _Pattern>::__sentinel {
private:
_LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_View> __end_ = sentinel_t<_View>();
- _LIBCPP_HIDE_FROM_ABI static constexpr bool
- __equals(const __split_view_iterator<_View, _Pattern>& __x, const __split_view_sentinel& __y) {
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __equals(const __iterator& __x, const __sentinel& __y) {
return __x.__cur_ == __y.__end_ && !__x.__trailing_empty_;
}
public:
- _LIBCPP_HIDE_FROM_ABI __split_view_sentinel() = default;
+ _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __split_view_sentinel(split_view<_View, _Pattern>& __parent)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(split_view<_View, _Pattern>& __parent)
: __end_(ranges::end(__parent.__base_)) {}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(const __split_view_iterator<_View, _Pattern>& __x, const __split_view_sentinel& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) {
return __equals(__x, __y);
}
};
diff --git a/third_party/llvm-project/libcxx/include/__ranges/subrange.h b/third_party/llvm-project/libcxx/include/__ranges/subrange.h
index 2d9e4cc..b41b5db 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/subrange.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/subrange.h
@@ -29,9 +29,9 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
-#include <__tuple_dir/pair_like.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/pair_like.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/conditional.h>
#include <__type_traits/decay.h>
#include <__type_traits/is_pointer.h>
@@ -48,7 +48,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
template<class _From, class _To>
@@ -284,7 +284,7 @@
using type = _Sp;
};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/take_view.h b/third_party/llvm-project/libcxx/include/__ranges/take_view.h
index bea3862..111e7e5 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/take_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/take_view.h
@@ -34,11 +34,14 @@
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/view_interface.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/maybe_const.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -49,7 +52,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -64,7 +67,8 @@
_LIBCPP_HIDE_FROM_ABI
take_view() requires default_initializable<_View> = default;
- _LIBCPP_HIDE_FROM_ABI constexpr take_view(_View __base, range_difference_t<_View> __count)
+ _LIBCPP_HIDE_FROM_ABI
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 take_view(_View __base, range_difference_t<_View> __count)
: __base_(std::move(__base)), __count_(__count) {
_LIBCPP_ASSERT(__count >= 0, "count has to be greater than or equal to zero");
}
@@ -334,7 +338,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/take_while_view.h b/third_party/llvm-project/libcxx/include/__ranges/take_while_view.h
index 59c0a4f..d1f1bfe 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/take_while_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/take_while_view.h
@@ -53,17 +53,11 @@
concept __take_while_const_is_range =
range<const _View> && indirect_unary_predicate<const _Pred, iterator_t<const _View>>;
-template <class, class, bool>
-class __take_while_view_sentinel;
-
template <view _View, class _Pred>
requires input_range<_View> && is_object_v<_Pred> && indirect_unary_predicate<const _Pred, iterator_t<_View>>
class take_while_view : public view_interface<take_while_view<_View, _Pred>> {
- template <class, class, bool>
- friend class __take_while_view_sentinel;
-
- template <bool _Const>
- using __sentinel = __take_while_view_sentinel<_View, _Pred, _Const>;
+ template <bool>
+ class __sentinel;
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
_LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Pred> __pred_;
@@ -73,7 +67,7 @@
requires default_initializable<_View> && default_initializable<_Pred>
= default;
- _LIBCPP_HIDE_FROM_ABI constexpr take_while_view(_View __base, _Pred __pred)
+ _LIBCPP_HIDE_FROM_ABI constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 take_while_view(_View __base, _Pred __pred)
: __base_(std::move(__base)), __pred_(std::in_place, std::move(__pred)) {}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
@@ -114,37 +108,37 @@
template <class _Range, class _Pred>
take_while_view(_Range&&, _Pred) -> take_while_view<views::all_t<_Range>, _Pred>;
-template <class _View, class _Pred, bool _Const>
-class __take_while_view_sentinel {
+template <view _View, class _Pred>
+ requires input_range<_View> && is_object_v<_Pred> && indirect_unary_predicate<const _Pred, iterator_t<_View>>
+template <bool _Const>
+class take_while_view<_View, _Pred>::__sentinel {
using _Base = __maybe_const<_Const, _View>;
sentinel_t<_Base> __end_ = sentinel_t<_Base>();
const _Pred* __pred_ = nullptr;
- template <class, class, bool>
- friend class __take_while_view_sentinel;
+ friend class __sentinel<!_Const>;
public:
- _LIBCPP_HIDE_FROM_ABI __take_while_view_sentinel() = default;
+ _LIBCPP_HIDE_FROM_ABI __sentinel() = default;
- _LIBCPP_HIDE_FROM_ABI constexpr explicit __take_while_view_sentinel(sentinel_t<_Base> __end, const _Pred* __pred)
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(sentinel_t<_Base> __end, const _Pred* __pred)
: __end_(std::move(__end)), __pred_(__pred) {}
- _LIBCPP_HIDE_FROM_ABI constexpr __take_while_view_sentinel(__take_while_view_sentinel<_View, _Pred, !_Const> __s)
+ _LIBCPP_HIDE_FROM_ABI constexpr __sentinel(__sentinel<!_Const> __s)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__s.__end_)), __pred_(__s.__pred_) {}
_LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Base> base() const { return __end_; }
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(const iterator_t<_Base>& __x, const __take_while_view_sentinel& __y) {
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const iterator_t<_Base>& __x, const __sentinel& __y) {
return __x == __y.__end_ || !std::invoke(*__y.__pred_, *__x);
}
template <bool _OtherConst = !_Const>
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI friend constexpr bool
- operator==(const iterator_t<__maybe_const<_OtherConst, _View>>& __x, const __take_while_view_sentinel& __y) {
+ operator==(const iterator_t<__maybe_const<_OtherConst, _View>>& __x, const __sentinel& __y) {
return __x == __y.__end_ || !std::invoke(*__y.__pred_, *__x);
}
};
diff --git a/third_party/llvm-project/libcxx/include/__ranges/transform_view.h b/third_party/llvm-project/libcxx/include/__ranges/transform_view.h
index 66d9e80..14bd400 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/transform_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/transform_view.h
@@ -35,7 +35,6 @@
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -43,7 +42,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -57,31 +56,11 @@
regular_invocable<_Fn&, range_reference_t<_View>> &&
__can_reference<invoke_result_t<_Fn&, range_reference_t<_View>>>;
-template <input_range _View, copy_constructible _Function, bool _IsConst>
- requires __transform_view_constraints<_View, _Function>
-class __transform_view_iterator;
-
-template <input_range _View, copy_constructible _Function, bool _IsConst>
- requires __transform_view_constraints<_View, _Function>
-class __transform_view_sentinel;
-
template<input_range _View, copy_constructible _Fn>
requires __transform_view_constraints<_View, _Fn>
class transform_view : public view_interface<transform_view<_View, _Fn>> {
-
- template <bool _IsConst>
- using __iterator = __transform_view_iterator<_View, _Fn, _IsConst>;
-
- template <bool _IsConst>
- using __sentinel = __transform_view_sentinel<_View, _Fn, _IsConst>;
-
- template <input_range _ViewType, copy_constructible _FunctionType, bool _IsConst>
- requires __transform_view_constraints<_ViewType, _FunctionType>
- friend class __transform_view_iterator;
-
- template <input_range _ViewType, copy_constructible _FunctionType, bool _IsConst>
- requires __transform_view_constraints<_ViewType, _FunctionType>
- friend class __transform_view_sentinel;
+ template<bool> class __iterator;
+ template<bool> class __sentinel;
_LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Fn> __func_;
_LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
@@ -92,7 +71,7 @@
requires default_initializable<_View> && default_initializable<_Fn> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr transform_view(_View __base, _Fn __func)
+ constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 transform_view(_View __base, _Fn __func)
: __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {}
_LIBCPP_HIDE_FROM_ABI
@@ -166,7 +145,7 @@
using _Cat = typename iterator_traits<iterator_t<_View>>::iterator_category;
using iterator_category = conditional_t<
- is_lvalue_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>,
+ is_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>,
conditional_t<
derived_from<_Cat, contiguous_iterator_tag>,
random_access_iterator_tag,
@@ -176,23 +155,22 @@
>;
};
-template<input_range _View, copy_constructible _Fn, bool _Const>
+template<input_range _View, copy_constructible _Fn>
requires __transform_view_constraints<_View, _Fn>
-class __transform_view_iterator
+template<bool _Const>
+class transform_view<_View, _Fn>::__iterator
: public __transform_view_iterator_category_base<_View, _Fn> {
- using _Parent = __maybe_const<_Const, transform_view<_View, _Fn>>;
+ using _Parent = __maybe_const<_Const, transform_view>;
using _Base = __maybe_const<_Const, _View>;
_Parent *__parent_ = nullptr;
- template<input_range _ViewType, copy_constructible _FunctionType, bool _IsConst>
- requires __transform_view_constraints<_ViewType, _FunctionType>
- friend class __transform_view_iterator;
+ template<bool>
+ friend class transform_view<_View, _Fn>::__iterator;
- template<input_range _ViewType, copy_constructible _FunctionType, bool _IsConst>
- requires __transform_view_constraints<_ViewType, _FunctionType>
- friend class __transform_view_sentinel;
+ template<bool>
+ friend class transform_view<_View, _Fn>::__sentinel;
public:
iterator_t<_Base> __current_ = iterator_t<_Base>();
@@ -202,17 +180,17 @@
using difference_type = range_difference_t<_Base>;
_LIBCPP_HIDE_FROM_ABI
- __transform_view_iterator() requires default_initializable<iterator_t<_Base>> = default;
+ __iterator() requires default_initializable<iterator_t<_Base>> = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator(_Parent& __parent, iterator_t<_Base> __current)
+ constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current)
: __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}
- // Note: `__i` should always be `__transform_view_iterator<false>`, but directly using
- // `__transform_view_iterator<false>` is ill-formed when `_Const` is false
+ // Note: `__i` should always be `__iterator<false>`, but directly using
+ // `__iterator<false>` is ill-formed when `_Const` is false
// (see http://wg21.link/class.copy.ctor#5).
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator(__transform_view_iterator<_View, _Fn, !_Const> __i)
+ constexpr __iterator(__iterator<!_Const> __i)
requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
: __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
@@ -234,7 +212,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator& operator++() {
+ constexpr __iterator& operator++() {
++__current_;
return *this;
}
@@ -243,7 +221,7 @@
constexpr void operator++(int) { ++__current_; }
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator operator++(int)
+ constexpr __iterator operator++(int)
requires forward_range<_Base>
{
auto __tmp = *this;
@@ -252,7 +230,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator& operator--()
+ constexpr __iterator& operator--()
requires bidirectional_range<_Base>
{
--__current_;
@@ -260,7 +238,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator operator--(int)
+ constexpr __iterator operator--(int)
requires bidirectional_range<_Base>
{
auto __tmp = *this;
@@ -269,7 +247,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator& operator+=(difference_type __n)
+ constexpr __iterator& operator+=(difference_type __n)
requires random_access_range<_Base>
{
__current_ += __n;
@@ -277,7 +255,7 @@
}
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_iterator& operator-=(difference_type __n)
+ constexpr __iterator& operator-=(difference_type __n)
requires random_access_range<_Base>
{
__current_ -= __n;
@@ -293,77 +271,77 @@
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
requires equality_comparable<iterator_t<_Base>>
{
return __x.__current_ == __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator<(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __x.__current_ < __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator>(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __x.__current_ > __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator<=(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __x.__current_ <= __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator>=(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base>
{
return __x.__current_ >= __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr auto operator<=>(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
{
return __x.__current_ <=> __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr __transform_view_iterator operator+(__transform_view_iterator __i, difference_type __n)
+ friend constexpr __iterator operator+(__iterator __i, difference_type __n)
requires random_access_range<_Base>
{
- return __transform_view_iterator{*__i.__parent_, __i.__current_ + __n};
+ return __iterator{*__i.__parent_, __i.__current_ + __n};
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr __transform_view_iterator operator+(difference_type __n, __transform_view_iterator __i)
+ friend constexpr __iterator operator+(difference_type __n, __iterator __i)
requires random_access_range<_Base>
{
- return __transform_view_iterator{*__i.__parent_, __i.__current_ + __n};
+ return __iterator{*__i.__parent_, __i.__current_ + __n};
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr __transform_view_iterator operator-(__transform_view_iterator __i, difference_type __n)
+ friend constexpr __iterator operator-(__iterator __i, difference_type __n)
requires random_access_range<_Base>
{
- return __transform_view_iterator{*__i.__parent_, __i.__current_ - __n};
+ return __iterator{*__i.__parent_, __i.__current_ - __n};
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr difference_type operator-(const __transform_view_iterator& __x, const __transform_view_iterator& __y)
+ friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
{
return __x.__current_ - __y.__current_;
}
_LIBCPP_HIDE_FROM_ABI
- friend constexpr decltype(auto) iter_move(const __transform_view_iterator& __i)
+ friend constexpr decltype(auto) iter_move(const __iterator& __i)
noexcept(noexcept(*__i))
{
if constexpr (is_lvalue_reference_v<decltype(*__i)>)
@@ -373,37 +351,33 @@
}
};
-template<input_range _View, copy_constructible _Fn, bool _Const>
+template<input_range _View, copy_constructible _Fn>
requires __transform_view_constraints<_View, _Fn>
-class __transform_view_sentinel {
- using _Parent = __maybe_const<_Const, transform_view<_View, _Fn>>;
+template<bool _Const>
+class transform_view<_View, _Fn>::__sentinel {
+ using _Parent = __maybe_const<_Const, transform_view>;
using _Base = __maybe_const<_Const, _View>;
- template <bool _IsConst>
- using __iterator = __transform_view_iterator<_View, _Fn, _IsConst>;
-
sentinel_t<_Base> __end_ = sentinel_t<_Base>();
- template<input_range _ViewType, copy_constructible _FunctionType, bool _IsConst>
- requires __transform_view_constraints<_ViewType, _FunctionType>
- friend class __transform_view_iterator;
+ template<bool>
+ friend class transform_view<_View, _Fn>::__iterator;
- template<input_range _ViewType, copy_constructible _FunctionType, bool _IsConst>
- requires __transform_view_constraints<_ViewType, _FunctionType>
- friend class __transform_view_sentinel;
+ template<bool>
+ friend class transform_view<_View, _Fn>::__sentinel;
public:
_LIBCPP_HIDE_FROM_ABI
- __transform_view_sentinel() = default;
+ __sentinel() = default;
_LIBCPP_HIDE_FROM_ABI
- constexpr explicit __transform_view_sentinel(sentinel_t<_Base> __end) : __end_(__end) {}
+ constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {}
- // Note: `__i` should always be `__transform_view_sentinel<false>`, but directly using
- // `__transform_view_sentinel<false>` is ill-formed when `_Const` is false
+ // Note: `__i` should always be `__sentinel<false>`, but directly using
+ // `__sentinel<false>` is ill-formed when `_Const` is false
// (see http://wg21.link/class.copy.ctor#5).
_LIBCPP_HIDE_FROM_ABI
- constexpr __transform_view_sentinel(__transform_view_sentinel<_View, _Fn, !_Const> __i)
+ constexpr __sentinel(__sentinel<!_Const> __i)
requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
: __end_(std::move(__i.__end_)) {}
@@ -413,7 +387,7 @@
template<bool _OtherConst>
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI
- friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __transform_view_sentinel& __y) {
+ friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
return __x.__current_ == __y.__end_;
}
@@ -421,7 +395,7 @@
requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI
friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
- operator-(const __iterator<_OtherConst>& __x, const __transform_view_sentinel& __y) {
+ operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
return __x.__current_ - __y.__end_;
}
@@ -429,7 +403,7 @@
requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
_LIBCPP_HIDE_FROM_ABI
friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>>
- operator-(const __transform_view_sentinel& __x, const __iterator<_OtherConst>& __y) {
+ operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
return __x.__end_ - __y.__current_;
}
};
@@ -460,7 +434,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/view_interface.h b/third_party/llvm-project/libcxx/include/__ranges/view_interface.h
index 5581eb9..0a14d0d 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/view_interface.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/view_interface.h
@@ -31,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -170,7 +170,7 @@
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/views.h b/third_party/llvm-project/libcxx/include/__ranges/views.h
index d40c64a..906c4e4 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/views.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/views.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace ranges {
@@ -28,7 +28,7 @@
namespace views = ranges::views;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__ranges/zip_view.h b/third_party/llvm-project/libcxx/include/__ranges/zip_view.h
index 5624726..b2067f6 100644
--- a/third_party/llvm-project/libcxx/include/__ranges/zip_view.h
+++ b/third_party/llvm-project/libcxx/include/__ranges/zip_view.h
@@ -30,11 +30,11 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -45,7 +45,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
namespace ranges {
@@ -77,7 +77,9 @@
template <class _Fun, class _Tuple>
_LIBCPP_HIDE_FROM_ABI constexpr void __tuple_for_each(_Fun&& __f, _Tuple&& __tuple) {
std::apply(
- [&]<class... _Types>(_Types&&... __elements) { (std::invoke(__f, std::forward<_Types>(__elements)), ...); },
+ [&]<class... _Types>(_Types&&... __elements) {
+ (static_cast<void>(std::invoke(__f, std::forward<_Types>(__elements))), ...);
+ },
std::forward<_Tuple>(__tuple));
}
@@ -503,7 +505,7 @@
} // namespace views
} // namespace ranges
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__split_buffer b/third_party/llvm-project/libcxx/include/__split_buffer
index 7d0beda..c4f1315 100644
--- a/third_party/llvm-project/libcxx/include/__split_buffer
+++ b/third_party/llvm-project/libcxx/include/__split_buffer
@@ -23,9 +23,18 @@
#include <__memory/compressed_pair.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
+#include <__type_traits/add_lvalue_reference.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <type_traits>
+#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -44,139 +53,165 @@
template <class _Tp, class _Allocator = allocator<_Tp> >
struct __split_buffer
{
-private:
- __split_buffer(const __split_buffer&);
- __split_buffer& operator=(const __split_buffer&);
public:
- typedef _Tp value_type;
- typedef _Allocator allocator_type;
- typedef __libcpp_remove_reference_t<allocator_type> __alloc_rr;
- typedef allocator_traits<__alloc_rr> __alloc_traits;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef typename __alloc_traits::size_type size_type;
- typedef typename __alloc_traits::difference_type difference_type;
- typedef typename __alloc_traits::pointer pointer;
- typedef typename __alloc_traits::const_pointer const_pointer;
- typedef pointer iterator;
- typedef const_pointer const_iterator;
+ using value_type = _Tp;
+ using allocator_type = _Allocator;
+ using __alloc_rr = __libcpp_remove_reference_t<allocator_type>;
+ using __alloc_traits = allocator_traits<__alloc_rr>;
+ using reference = value_type&;
+ using const_reference = const value_type&;
+ using size_type = typename __alloc_traits::size_type;
+ using difference_type = typename __alloc_traits::difference_type;
+ using pointer = typename __alloc_traits::pointer;
+ using const_pointer = typename __alloc_traits::const_pointer;
+ using iterator = pointer;
+ using const_iterator = const_pointer;
- pointer __first_;
- pointer __begin_;
- pointer __end_;
- __compressed_pair<pointer, allocator_type> __end_cap_;
+ pointer __first_;
+ pointer __begin_;
+ pointer __end_;
+ __compressed_pair<pointer, allocator_type> __end_cap_;
- typedef __add_lvalue_reference_t<allocator_type> __alloc_ref;
- typedef __add_lvalue_reference_t<allocator_type> __alloc_const_ref;
+ using __alloc_ref = __add_lvalue_reference_t<allocator_type>;
+ using __alloc_const_ref = __add_lvalue_reference_t<allocator_type>;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();}
+ __split_buffer(const __split_buffer&) = delete;
+ __split_buffer& operator=(const __split_buffer&) = delete;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- __split_buffer()
- _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- explicit __split_buffer(__alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- explicit __split_buffer(const __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer()
+ _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
+ : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __default_init_tag()) {}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
- _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
- _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value) ||
- !__alloc_traits::propagate_on_container_move_assignment::value);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(__alloc_rr& __a)
+ : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a) {}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {return __begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {return __begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {return __end_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {return __end_;}
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(const __alloc_rr& __a)
+ : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a) {}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void clear() _NOEXCEPT
- {__destruct_at_end(__begin_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const {return __end_ == __begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const {return static_cast<size_type>(__begin_ - __first_);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const {return static_cast<size_type>(__end_cap() - __end_);}
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() {return *__begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const {return *__begin_;}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() {return *(__end_ - 1);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const {return *(__end_ - 1);}
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
+ _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(const_reference __x);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(const_reference __x);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __x);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x);
- template <class... _Args>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() {__destruct_at_begin(__begin_+1);}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() {__destruct_at_end(__end_-1);}
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
+ _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
+ is_nothrow_move_assignable<allocator_type>::value) ||
+ !__alloc_traits::propagate_on_container_move_assignment::value);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);
- template <class _InputIter>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
- __construct_at_end(_InputIter __first, _InputIter __last);
- template <class _ForwardIterator>
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
- __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin)
- {__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_begin(pointer __new_begin, false_type);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_begin(pointer __new_begin, true_type);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr& __alloc() _NOEXCEPT { return __end_cap_.second(); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr& __alloc() const _NOEXCEPT {
+ return __end_cap_.second();
+ }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_end(pointer __new_last) _NOEXCEPT
- {__destruct_at_end(__new_last, false_type());}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT { return __end_cap_.first(); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const pointer& __end_cap() const _NOEXCEPT {
+ return __end_cap_.first();
+ }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
- __is_nothrow_swappable<__alloc_rr>::value);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __begin_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __begin_; }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __end_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __end_; }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const {
+ return static_cast<size_type>(__end_ - __begin_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const { return __end_ == __begin_; }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const {
+ return static_cast<size_type>(__end_cap() - __first_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const {
+ return static_cast<size_type>(__begin_ - __first_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const {
+ return static_cast<size_type>(__end_cap() - __end_);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() { return *__begin_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return *__begin_; }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() { return *(__end_ - 1); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const { return *(__end_ - 1); }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(const_reference __x);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(const_reference __x);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __x);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __x);
+
+ template <class... _Args>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() { __destruct_at_begin(__begin_ + 1); }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() { __destruct_at_end(__end_ - 1); }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);
+
+ template <class _InputIter>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
+ __construct_at_end(_InputIter __first, _InputIter __last);
+
+ template <class _ForwardIterator>
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
+ __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
+ __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin) {
+ __destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin, false_type);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin, true_type);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last) _NOEXCEPT {
+ __destruct_at_end(__new_last, false_type());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__alloc_rr>::value);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
private:
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __move_assign_alloc(__split_buffer& __c, true_type)
- _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
- {
- __alloc() = _VSTD::move(__c.__alloc());
- }
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
+ _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
+ __alloc() = _VSTD::move(__c.__alloc());
+ }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
- void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT
- {}
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {}
- struct _ConstructTransaction {
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT
- : __pos_(*__p), __end_(*__p + __n), __dest_(__p) {
- }
- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() {
- *__dest_ = __pos_;
- }
- pointer __pos_;
- const pointer __end_;
- private:
- pointer *__dest_;
- };
+ struct _ConstructTransaction {
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(
+ pointer* __p, size_type __n) _NOEXCEPT
+ : __pos_(*__p),
+ __end_(*__p + __n),
+ __dest_(__p) {}
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { *__dest_ = __pos_; }
+
+ pointer __pos_;
+ const pointer __end_;
+
+ private:
+ pointer* __dest_;
+ };
};
template <class _Tp, class _Allocator>
@@ -330,31 +365,6 @@
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
-inline
-__split_buffer<_Tp, _Allocator>::__split_buffer()
- _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
- : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __default_init_tag())
-{
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-inline
-__split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
- : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
-{
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-inline
-__split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
- : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
-{
-}
-
-template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
__split_buffer<_Tp, _Allocator>::~__split_buffer()
{
clear();
@@ -463,10 +473,10 @@
{
if (capacity() > size())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -475,12 +485,12 @@
_VSTD::swap(__begin_, __t.__begin_);
_VSTD::swap(__end_, __t.__end_);
_VSTD::swap(__end_cap(), __t.__end_cap());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
diff --git a/third_party/llvm-project/libcxx/include/__string/char_traits.h b/third_party/llvm-project/libcxx/include/__string/char_traits.h
index 622ee22..9d96242 100644
--- a/third_party/llvm-project/libcxx/include/__string/char_traits.h
+++ b/third_party/llvm-project/libcxx/include/__string/char_traits.h
@@ -18,11 +18,11 @@
#include <__config>
#include <__functional/hash.h>
#include <__iterator/iterator_traits.h>
+#include <__string/constexpr_c_functions.h>
#include <__type_traits/is_constant_evaluated.h>
#include <cstddef>
#include <cstdint>
#include <cstdio>
-#include <cstring>
#include <iosfwd>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -199,7 +199,7 @@
using off_type = streamoff;
using pos_type = streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
@@ -269,7 +269,7 @@
using off_type = streamoff;
using pos_type = streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
@@ -339,7 +339,7 @@
using off_type = streamoff;
using pos_type = u8streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
@@ -427,7 +427,7 @@
using off_type = streamoff;
using pos_type = u16streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
@@ -521,7 +521,7 @@
using off_type = streamoff;
using pos_type = u32streampos;
using state_type = mbstate_t;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
using comparison_category = strong_ordering;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__string/constexpr_c_functions.h b/third_party/llvm-project/libcxx/include/__string/constexpr_c_functions.h
new file mode 100644
index 0000000..500fa47
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__string/constexpr_c_functions.h
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___STRING_CONSTEXPR_C_FUNCTIONS_H
+#define _LIBCPP___STRING_CONSTEXPR_C_FUNCTIONS_H
+
+#include <__config>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__type_traits/is_equality_comparable.h>
+#include <__type_traits/is_same.h>
+#include <cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const char* __str) {
+ // GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
+#ifdef _LIBCPP_COMPILER_GCC
+ if (__libcpp_is_constant_evaluated()) {
+ size_t __i = 0;
+ for (; __str[__i] != '\0'; ++__i)
+ ;
+ return __i;
+ }
+#endif
+ return __builtin_strlen(__str);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int
+__constexpr_memcmp(const _Tp* __lhs, const _Up* __rhs, size_t __count) {
+ static_assert(__libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ "_Tp and _Up have to be trivially equality comparable");
+
+ if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCPP_COMPILER_CLANG_BASED
+ if (sizeof(_Tp) == 1 && !is_same<_Tp, bool>::value)
+ return __builtin_memcmp(__lhs, __rhs, __count);
+#endif
+
+ while (__count != 0) {
+ if (*__lhs < *__rhs)
+ return -1;
+ if (*__rhs < *__lhs)
+ return 1;
+
+ __count -= sizeof(_Tp);
+ ++__lhs;
+ ++__rhs;
+ }
+ return 0;
+ } else {
+ return __builtin_memcmp(__lhs, __rhs, __count);
+ }
+}
+
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const char*
+__constexpr_char_memchr(const char* __str, int __char, size_t __count) {
+#if __has_builtin(__builtin_char_memchr)
+ return __builtin_char_memchr(__str, __char, __count);
+#else
+ if (!__libcpp_is_constant_evaluated())
+ return static_cast<const char*>(__builtin_memchr(__str, __char, __count));
+ for (; __count; --__count) {
+ if (*__str == __char)
+ return __str;
+ ++__str;
+ }
+ return nullptr;
+#endif
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___STRING_CONSTEXPR_C_FUNCTIONS_H
diff --git a/third_party/llvm-project/libcxx/include/__errc b/third_party/llvm-project/libcxx/include/__system_error/errc.h
similarity index 100%
rename from third_party/llvm-project/libcxx/include/__errc
rename to third_party/llvm-project/libcxx/include/__system_error/errc.h
diff --git a/third_party/llvm-project/libcxx/include/__system_error/error_category.h b/third_party/llvm-project/libcxx/include/__system_error/error_category.h
new file mode 100644
index 0000000..5c6bb79
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__system_error/error_category.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H
+#define _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+class _LIBCPP_TYPE_VIS error_condition;
+class _LIBCPP_TYPE_VIS error_code;
+
+class _LIBCPP_HIDDEN __do_message;
+
+class _LIBCPP_TYPE_VIS error_category {
+public:
+ virtual ~error_category() _NOEXCEPT;
+
+#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
+ error_category() noexcept;
+#else
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 error_category() _NOEXCEPT = default;
+#endif
+ error_category(const error_category&) = delete;
+ error_category& operator=(const error_category&) = delete;
+
+ virtual const char* name() const _NOEXCEPT = 0;
+ virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
+ virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
+ virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
+ virtual string message(int __ev) const = 0;
+
+ _LIBCPP_HIDE_FROM_ABI bool operator==(const error_category& __rhs) const _NOEXCEPT { return this == &__rhs; }
+
+#if _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const error_category& __rhs) const noexcept {
+ return compare_three_way()(this, std::addressof(__rhs));
+ }
+
+#else // _LIBCPP_STD_VER >= 20
+
+ _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_category& __rhs) const _NOEXCEPT { return !(*this == __rhs); }
+
+ _LIBCPP_HIDE_FROM_ABI bool operator<(const error_category& __rhs) const _NOEXCEPT { return this < &__rhs; }
+
+#endif // _LIBCPP_STD_VER >= 20
+
+ friend class _LIBCPP_HIDDEN __do_message;
+};
+
+class _LIBCPP_HIDDEN __do_message : public error_category {
+public:
+ string message(int __ev) const override;
+};
+
+_LIBCPP_FUNC_VIS const error_category& generic_category() _NOEXCEPT;
+_LIBCPP_FUNC_VIS const error_category& system_category() _NOEXCEPT;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H
diff --git a/third_party/llvm-project/libcxx/include/__system_error/error_code.h b/third_party/llvm-project/libcxx/include/__system_error/error_code.h
new file mode 100644
index 0000000..3b19a68
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__system_error/error_code.h
@@ -0,0 +1,145 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H
+#define _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__functional/hash.h>
+#include <__functional/unary_function.h>
+#include <__system_error/errc.h>
+#include <__system_error/error_category.h>
+#include <__system_error/error_condition.h>
+#include <cstddef>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum : public false_type {};
+
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value;
+#endif
+
+namespace __adl_only {
+// Those cause ADL to trigger but they are not viable candidates,
+// so they are never actually selected.
+void make_error_code() = delete;
+} // namespace __adl_only
+
+class _LIBCPP_TYPE_VIS error_code {
+ int __val_;
+ const error_category* __cat_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}
+
+ _LIBCPP_HIDE_FROM_ABI error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {}
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI
+ error_code(_Ep __e, typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
+ using __adl_only::make_error_code;
+ *this = make_error_code(__e);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void assign(int __val, const error_category& __cat) _NOEXCEPT {
+ __val_ = __val;
+ __cat_ = &__cat;
+ }
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_code_enum<_Ep>::value, error_code& >::type
+ operator=(_Ep __e) _NOEXCEPT {
+ using __adl_only::make_error_code;
+ *this = make_error_code(__e);
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
+ __val_ = 0;
+ __cat_ = &system_category();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }
+
+ _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }
+
+ _LIBCPP_HIDE_FROM_ABI error_condition default_error_condition() const _NOEXCEPT {
+ return __cat_->default_error_condition(__val_);
+ }
+
+ string message() const;
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
+};
+
+inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(errc __e) _NOEXCEPT {
+ return error_code(static_cast<int>(__e), generic_category());
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_code& __x, const error_code& __y) _NOEXCEPT {
+ return __x.category() == __y.category() && __x.value() == __y.value();
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT {
+ return __x.category().equivalent(__x.value(), __y) || __y.category().equivalent(__x, __y.value());
+}
+
+#if _LIBCPP_STD_VER <= 17
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT {
+ return __y == __x;
+}
+#endif
+
+#if _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator<(const error_code& __x, const error_code& __y) _NOEXCEPT {
+ return __x.category() < __y.category() || (__x.category() == __y.category() && __x.value() < __y.value());
+}
+
+#else // _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI strong_ordering operator<=>(const error_code& __x, const error_code& __y) noexcept {
+ if (auto __c = __x.category() <=> __y.category(); __c != 0)
+ return __c;
+ return __x.value() <=> __y.value();
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<error_code> : public __unary_function<error_code, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t operator()(const error_code& __ec) const _NOEXCEPT {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H
diff --git a/third_party/llvm-project/libcxx/include/__system_error/error_condition.h b/third_party/llvm-project/libcxx/include/__system_error/error_condition.h
new file mode 100644
index 0000000..cefb499
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__system_error/error_condition.h
@@ -0,0 +1,131 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H
+#define _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H
+
+#include <__compare/ordering.h>
+#include <__config>
+#include <__functional/unary_function.h>
+#include <__system_error/errc.h>
+#include <__system_error/error_category.h>
+#include <cstddef>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum : public false_type {};
+
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
+#endif
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc> : true_type {};
+
+#ifdef _LIBCPP_CXX03_LANG
+template <>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc::__lx> : true_type {};
+#endif
+
+namespace __adl_only {
+// Those cause ADL to trigger but they are not viable candidates,
+// so they are never actually selected.
+void make_error_condition() = delete;
+} // namespace __adl_only
+
+class _LIBCPP_TYPE_VIS error_condition {
+ int __val_;
+ const error_category* __cat_;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}
+
+ _LIBCPP_HIDE_FROM_ABI error_condition(int __val, const error_category& __cat) _NOEXCEPT
+ : __val_(__val),
+ __cat_(&__cat) {}
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI
+ error_condition(_Ep __e, typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
+ using __adl_only::make_error_condition;
+ *this = make_error_condition(__e);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void assign(int __val, const error_category& __cat) _NOEXCEPT {
+ __val_ = __val;
+ __cat_ = &__cat;
+ }
+
+ template <class _Ep>
+ _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_condition_enum<_Ep>::value, error_condition& >::type
+ operator=(_Ep __e) _NOEXCEPT {
+ using __adl_only::make_error_condition;
+ *this = make_error_condition(__e);
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
+ __val_ = 0;
+ __cat_ = &generic_category();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI int value() const _NOEXCEPT { return __val_; }
+
+ _LIBCPP_HIDE_FROM_ABI const error_category& category() const _NOEXCEPT { return *__cat_; }
+ string message() const;
+
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
+};
+
+inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(errc __e) _NOEXCEPT {
+ return error_condition(static_cast<int>(__e), generic_category());
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
+ return __x.category() == __y.category() && __x.value() == __y.value();
+}
+
+#if _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
+ return !(__x == __y);
+}
+
+inline _LIBCPP_HIDE_FROM_ABI bool operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT {
+ return __x.category() < __y.category() || (__x.category() == __y.category() && __x.value() < __y.value());
+}
+
+#else // _LIBCPP_STD_VER <= 17
+
+inline _LIBCPP_HIDE_FROM_ABI strong_ordering
+operator<=>(const error_condition& __x, const error_condition& __y) noexcept {
+ if (auto __c = __x.category() <=> __y.category(); __c != 0)
+ return __c;
+ return __x.value() <=> __y.value();
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<error_condition> : public __unary_function<error_condition, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t operator()(const error_condition& __ec) const _NOEXCEPT {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H
diff --git a/third_party/llvm-project/libcxx/include/__system_error/system_error.h b/third_party/llvm-project/libcxx/include/__system_error/system_error.h
new file mode 100644
index 0000000..d199feb
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__system_error/system_error.h
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
+#define _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
+
+#include <__config>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <stdexcept>
+#include <string>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+class _LIBCPP_TYPE_VIS system_error : public runtime_error {
+ error_code __ec_;
+
+public:
+ system_error(error_code __ec, const string& __what_arg);
+ system_error(error_code __ec, const char* __what_arg);
+ system_error(error_code __ec);
+ system_error(int __ev, const error_category& __ecat, const string& __what_arg);
+ system_error(int __ev, const error_category& __ecat, const char* __what_arg);
+ system_error(int __ev, const error_category& __ecat);
+ system_error(const system_error&) _NOEXCEPT = default;
+ ~system_error() _NOEXCEPT override;
+
+ _LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
+
+private:
+ static string __init(const error_code&, string);
+};
+
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_system_error(int __ev, const char* __what_arg);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
diff --git a/third_party/llvm-project/libcxx/include/__threading_support b/third_party/llvm-project/libcxx/include/__threading_support
index dcf2763..08dfd73 100644
--- a/third_party/llvm-project/libcxx/include/__threading_support
+++ b/third_party/llvm-project/libcxx/include/__threading_support
@@ -259,21 +259,21 @@
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
{
- pthread_mutexattr_t attr;
- int __ec = pthread_mutexattr_init(&attr);
+ pthread_mutexattr_t __attr;
+ int __ec = pthread_mutexattr_init(&__attr);
if (__ec)
return __ec;
- __ec = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ __ec = pthread_mutexattr_settype(&__attr, PTHREAD_MUTEX_RECURSIVE);
if (__ec) {
- pthread_mutexattr_destroy(&attr);
+ pthread_mutexattr_destroy(&__attr);
return __ec;
}
- __ec = pthread_mutex_init(__m, &attr);
+ __ec = pthread_mutex_init(__m, &__attr);
if (__ec) {
- pthread_mutexattr_destroy(&attr);
+ pthread_mutexattr_destroy(&__attr);
return __ec;
}
- __ec = pthread_mutexattr_destroy(&attr);
+ __ec = pthread_mutexattr_destroy(&__attr);
if (__ec) {
pthread_mutex_destroy(__m);
return __ec;
@@ -380,8 +380,8 @@
__libcpp_thread_id __libcpp_thread_get_current_id()
{
- const __libcpp_thread_t thread = pthread_self();
- return __libcpp_thread_get_id(&thread);
+ const __libcpp_thread_t __current_thread = pthread_self();
+ return __libcpp_thread_get_id(&__current_thread);
}
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
@@ -643,6 +643,8 @@
_LIBCPP_INLINE_VISIBILITY
__thread_id(__libcpp_thread_id __id) : __id_(__id) {}
+ _LIBCPP_HIDE_FROM_ABI friend __libcpp_thread_id __get_underlying_id(const __thread_id __id) { return __id.__id_; }
+
friend __thread_id this_thread::get_id() _NOEXCEPT;
friend class _LIBCPP_TYPE_VIS thread;
friend struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>;
diff --git a/third_party/llvm-project/libcxx/include/__tree b/third_party/llvm-project/libcxx/include/__tree
index f5d9d59..8b2965a 100644
--- a/third_party/llvm-project/libcxx/include/__tree
+++ b/third_party/llvm-project/libcxx/include/__tree
@@ -18,6 +18,7 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/next.h>
+#include <__memory/addressof.h>
#include <__memory/allocator_traits.h>
#include <__memory/compressed_pair.h>
#include <__memory/pointer_traits.h>
@@ -375,7 +376,7 @@
{
_LIBCPP_ASSERT(__root != nullptr, "Root node should not be null");
_LIBCPP_ASSERT(__z != nullptr, "The node to remove should not be null");
- _LIBCPP_DEBUG_ASSERT(__tree_invariant(__root), "The tree invariants should hold");
+ _LIBCPP_DEBUG_ASSERT(std::__tree_invariant(__root), "The tree invariants should hold");
// __z will be removed from the tree. Client still needs to destruct/deallocate it
// __y is either __z, or if __z has two children, __tree_next(__z).
// __y will have at most one child.
@@ -818,7 +819,7 @@
template <class> friend class __map_node_destructor;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeType, class _Alloc>
struct __generic_container_node_destructor;
template <class _Tp, class _VoidPtr, class _Alloc>
@@ -849,7 +850,7 @@
typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __ptr_(nullptr)
#endif
{}
@@ -922,7 +923,7 @@
typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __ptr_(nullptr)
#endif
{}
@@ -1331,7 +1332,7 @@
_LIBCPP_INLINE_VISIBILITY iterator
__remove_node_pointer(__node_pointer) _NOEXCEPT;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
_InsertReturnType __node_handle_insert_unique(_NodeHandle&&);
@@ -2265,7 +2266,7 @@
return __r;
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Compare, class _Allocator>
template <class _NodeHandle, class _InsertReturnType>
_LIBCPP_INLINE_VISIBILITY
@@ -2422,7 +2423,7 @@
}
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/apply_cv.h b/third_party/llvm-project/libcxx/include/__tuple/apply_cv.h
similarity index 100%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/apply_cv.h
rename to third_party/llvm-project/libcxx/include/__tuple/apply_cv.h
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/make_tuple_types.h b/third_party/llvm-project/libcxx/include/__tuple/make_tuple_types.h
similarity index 93%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/make_tuple_types.h
rename to third_party/llvm-project/libcxx/include/__tuple/make_tuple_types.h
index 913ff9b..38e2547 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/make_tuple_types.h
+++ b/third_party/llvm-project/libcxx/include/__tuple/make_tuple_types.h
@@ -12,11 +12,11 @@
#include <__config>
#include <__fwd/array.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/apply_cv.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_indices.h>
-#include <__tuple_dir/tuple_size.h>
-#include <__tuple_dir/tuple_types.h>
+#include <__tuple/apply_cv.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_size.h>
+#include <__tuple/tuple_types.h>
#include <__type_traits/remove_cv.h>
#include <__type_traits/remove_reference.h>
#include <cstddef>
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/pair_like.h b/third_party/llvm-project/libcxx/include/__tuple/pair_like.h
similarity index 92%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/pair_like.h
rename to third_party/llvm-project/libcxx/include/__tuple/pair_like.h
index 87407ad..192682d 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/pair_like.h
+++ b/third_party/llvm-project/libcxx/include/__tuple/pair_like.h
@@ -10,8 +10,8 @@
#define _LIBCPP___TUPLE_PAIR_LIKE_H
#include <__config>
-#include <__tuple_dir/tuple_like.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_like.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/sfinae_helpers.h b/third_party/llvm-project/libcxx/include/__tuple/sfinae_helpers.h
similarity index 96%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/sfinae_helpers.h
rename to third_party/llvm-project/libcxx/include/__tuple/sfinae_helpers.h
index fcd65a0..589f450 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/sfinae_helpers.h
+++ b/third_party/llvm-project/libcxx/include/__tuple/sfinae_helpers.h
@@ -11,11 +11,11 @@
#include <__config>
#include <__fwd/tuple.h>
-#include <__tuple_dir/make_tuple_types.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_like_ext.h>
-#include <__tuple_dir/tuple_size.h>
-#include <__tuple_dir/tuple_types.h>
+#include <__tuple/make_tuple_types.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_like_ext.h>
+#include <__tuple/tuple_size.h>
+#include <__tuple/tuple_types.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_assignable.h>
@@ -134,7 +134,7 @@
};
#endif // !defined(_LIBCPP_CXX03_LANG)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <bool _CanCopy, bool _CanMove>
struct __sfinae_ctor_base {};
@@ -189,7 +189,7 @@
__sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
__sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_element.h b/third_party/llvm-project/libcxx/include/__tuple/tuple_element.h
similarity index 96%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/tuple_element.h
rename to third_party/llvm-project/libcxx/include/__tuple/tuple_element.h
index 06f49bf..478dd08 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_element.h
+++ b/third_party/llvm-project/libcxx/include/__tuple/tuple_element.h
@@ -10,8 +10,8 @@
#define _LIBCPP___TUPLE_TUPLE_ELEMENT_H
#include <__config>
-#include <__tuple_dir/tuple_indices.h>
-#include <__tuple_dir/tuple_types.h>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_types.h>
#include <__type_traits/add_const.h>
#include <__type_traits/add_cv.h>
#include <__type_traits/add_volatile.h>
@@ -81,7 +81,7 @@
typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <size_t _Ip, class ..._Tp>
using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element <_Ip, _Tp...>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_indices.h b/third_party/llvm-project/libcxx/include/__tuple/tuple_indices.h
similarity index 100%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/tuple_indices.h
rename to third_party/llvm-project/libcxx/include/__tuple/tuple_indices.h
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_like.h b/third_party/llvm-project/libcxx/include/__tuple/tuple_like.h
similarity index 100%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/tuple_like.h
rename to third_party/llvm-project/libcxx/include/__tuple/tuple_like.h
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_like_ext.h b/third_party/llvm-project/libcxx/include/__tuple/tuple_like_ext.h
similarity index 97%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/tuple_like_ext.h
rename to third_party/llvm-project/libcxx/include/__tuple/tuple_like_ext.h
index bf98696..36f5c48 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_like_ext.h
+++ b/third_party/llvm-project/libcxx/include/__tuple/tuple_like_ext.h
@@ -13,7 +13,7 @@
#include <__fwd/array.h>
#include <__fwd/pair.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_types.h>
+#include <__tuple/tuple_types.h>
#include <__type_traits/integral_constant.h>
#include <cstddef>
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_size.h b/third_party/llvm-project/libcxx/include/__tuple/tuple_size.h
similarity index 98%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/tuple_size.h
rename to third_party/llvm-project/libcxx/include/__tuple/tuple_size.h
index d551b22..26f9d97 100644
--- a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_size.h
+++ b/third_party/llvm-project/libcxx/include/__tuple/tuple_size.h
@@ -11,7 +11,7 @@
#include <__config>
#include <__fwd/tuple.h>
-#include <__tuple_dir/tuple_types.h>
+#include <__tuple/tuple_types.h>
#include <__type_traits/is_const.h>
#include <__type_traits/is_volatile.h>
#include <cstddef>
diff --git a/third_party/llvm-project/libcxx/include/__tuple_dir/tuple_types.h b/third_party/llvm-project/libcxx/include/__tuple/tuple_types.h
similarity index 100%
rename from third_party/llvm-project/libcxx/include/__tuple_dir/tuple_types.h
rename to third_party/llvm-project/libcxx/include/__tuple/tuple_types.h
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/add_const.h b/third_party/llvm-project/libcxx/include/__type_traits/add_const.h
index c616a13..44d4058 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/add_const.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/add_const.h
@@ -21,7 +21,7 @@
typedef _LIBCPP_NODEBUG const _Tp type;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using add_const_t = typename add_const<_Tp>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/add_cv.h b/third_party/llvm-project/libcxx/include/__type_traits/add_cv.h
index 8a85353..ee821b3 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/add_cv.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/add_cv.h
@@ -21,7 +21,7 @@
typedef _LIBCPP_NODEBUG const volatile _Tp type;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h b/third_party/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h
index daa5cb9..848cc21 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h
@@ -44,7 +44,7 @@
using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/add_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/add_pointer.h
index 9d0c201..1e74daf 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/add_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/add_pointer.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__add_pointer)
+#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer)
template <class _Tp>
using __add_pointer_t = __add_pointer(_Tp);
@@ -39,14 +39,14 @@
template <class _Tp>
using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;
-#endif // __has_builtin(__add_pointer)
+#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer)
template <class _Tp>
struct add_pointer {
using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using add_pointer_t = __add_pointer_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h b/third_party/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h
index 098e84c..a54aae7 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h
@@ -44,7 +44,7 @@
using type = __add_rvalue_reference_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp>
using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/add_volatile.h b/third_party/llvm-project/libcxx/include/__type_traits/add_volatile.h
index 73b1cb8..f4fc42f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/add_volatile.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/add_volatile.h
@@ -21,7 +21,7 @@
typedef _LIBCPP_NODEBUG volatile _Tp type;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/aligned_storage.h b/third_party/llvm-project/libcxx/include/__type_traits/aligned_storage.h
index c564d58..29938d2 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/aligned_storage.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/aligned_storage.h
@@ -93,7 +93,7 @@
};
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
@@ -102,15 +102,13 @@
#endif
-#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
-template <size_t _Len>\
-struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n>\
-{\
- struct _ALIGNAS(n) type\
- {\
- unsigned char __lx[(_Len + n - 1)/n * n];\
- };\
-}
+#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
+ template <size_t _Len> \
+ struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n> { \
+ struct _ALIGNAS(n) type { \
+ unsigned char __lx[(_Len + n - 1) / n * n]; \
+ }; \
+ }
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2);
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/aligned_union.h b/third_party/llvm-project/libcxx/include/__type_traits/aligned_union.h
index 2c64130..dd1515a 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/aligned_union.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/aligned_union.h
@@ -46,7 +46,7 @@
typedef typename aligned_storage<__len, alignment_value>::type type;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <size_t _Len, class... _Types>
using aligned_union_t _LIBCPP_DEPRECATED_IN_CXX23 = typename aligned_union<_Len, _Types...>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/alignment_of.h b/third_party/llvm-project/libcxx/include/__type_traits/alignment_of.h
index 45b4cbc..d7851ae 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/alignment_of.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/alignment_of.h
@@ -22,7 +22,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS alignment_of
: public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr size_t alignment_of_v = _LIBCPP_ALIGNOF(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/common_reference.h b/third_party/llvm-project/libcxx/include/__type_traits/common_reference.h
index f919586..59b3dfb 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/common_reference.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/common_reference.h
@@ -27,7 +27,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
// common_reference
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Let COND_RES(X, Y) be:
template <class _Xp, class _Yp>
using __cond_res =
@@ -181,7 +181,7 @@
// bullet 5 - Otherwise, there shall be no member `type`.
template <class...> struct common_reference {};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/common_type.h b/third_party/llvm-project/libcxx/include/__type_traits/common_type.h
index 6d2df6c..afd766f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/common_type.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/common_type.h
@@ -23,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Let COND_RES(X, Y) be:
template <class _Tp, class _Up>
using __cond_type = decltype(false ? std::declval<_Tp>() : std::declval<_Up>());
@@ -49,9 +49,9 @@
template <class _Tp, class _Up>
struct __common_type2_imp<_Tp, _Up, __void_t<decltype(true ? std::declval<_Tp>() : std::declval<_Up>())> >
{
- typedef _LIBCPP_NODEBUG typename decay<decltype(
+ typedef _LIBCPP_NODEBUG __decay_t<decltype(
true ? std::declval<_Tp>() : std::declval<_Up>()
- )>::type type;
+ )> type;
};
template <class, class = void>
@@ -109,9 +109,9 @@
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up>
: conditional<
- _IsSame<_Tp, typename decay<_Tp>::type>::value && _IsSame<_Up, typename decay<_Up>::type>::value,
+ _IsSame<_Tp, __decay_t<_Tp> >::value && _IsSame<_Up, __decay_t<_Up> >::value,
__common_type2_imp<_Tp, _Up>,
- common_type<typename decay<_Tp>::type, typename decay<_Up>::type>
+ common_type<__decay_t<_Tp>, __decay_t<_Up> >
>::type
{};
@@ -125,7 +125,7 @@
#undef _LIBCPP_OPTIONAL_PACK
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/conditional.h b/third_party/llvm-project/libcxx/include/__type_traits/conditional.h
index 6249812..5b5445a 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/conditional.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/conditional.h
@@ -44,7 +44,7 @@
using type _LIBCPP_NODEBUG = _Then;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <bool _Bp, class _IfRes, class _ElseRes>
using conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _IfRes, _ElseRes>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/conjunction.h b/third_party/llvm-project/libcxx/include/__type_traits/conjunction.h
index 0d95347..4bfa5a2 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/conjunction.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/conjunction.h
@@ -37,7 +37,7 @@
template <class... _Pred>
using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class...>
struct conjunction : true_type {};
@@ -51,7 +51,7 @@
template <class... _Args>
inline constexpr bool conjunction_v = conjunction<_Args...>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/decay.h b/third_party/llvm-project/libcxx/include/__type_traits/decay.h
index f45d33b..a32c140 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/decay.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/decay.h
@@ -27,9 +27,13 @@
#if __has_builtin(__decay)
template <class _Tp>
+using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
+
+template <class _Tp>
struct decay {
- using type _LIBCPP_NODEBUG = __decay(_Tp);
+ using type _LIBCPP_NODEBUG = __decay_t<_Tp>;
};
+
#else
template <class _Up, bool>
struct __decay {
@@ -60,10 +64,13 @@
public:
typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type;
};
+
+template <class _Tp>
+using __decay_t = typename decay<_Tp>::type;
#endif // __has_builtin(__decay)
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> using decay_t = typename decay<_Tp>::type;
+#if _LIBCPP_STD_VER >= 14
+template <class _Tp> using decay_t = __decay_t<_Tp>;
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/disjunction.h b/third_party/llvm-project/libcxx/include/__type_traits/disjunction.h
index 125f168..2c89528 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/disjunction.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/disjunction.h
@@ -43,7 +43,7 @@
template <class... _Args>
using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args>
struct disjunction : _Or<_Args...> {};
@@ -51,7 +51,7 @@
template <class... _Args>
inline constexpr bool disjunction_v = _Or<_Args...>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/enable_if.h b/third_party/llvm-project/libcxx/include/__type_traits/enable_if.h
index c5e8df4..4859981 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/enable_if.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/enable_if.h
@@ -22,7 +22,7 @@
template <bool _Bp, class _Tp = void> using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/extent.h b/third_party/llvm-project/libcxx/include/__type_traits/extent.h
index 0a4d84e..a031f5e 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/extent.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/extent.h
@@ -25,7 +25,7 @@
struct _LIBCPP_TEMPLATE_VIS extent
: integral_constant<size_t, __array_extent(_Tp, _Dim)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, unsigned _Ip = 0>
inline constexpr size_t extent_v = __array_extent(_Tp, _Ip);
#endif
@@ -43,7 +43,7 @@
template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, unsigned _Ip = 0>
inline constexpr size_t extent_v = extent<_Tp, _Ip>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h b/third_party/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h
index d6f75c9..aa45bbb 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
: public integral_constant<bool,
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/has_virtual_destructor.h b/third_party/llvm-project/libcxx/include/__type_traits/has_virtual_destructor.h
index e73a2b2..ae3137e 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/has_virtual_destructor.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/has_virtual_destructor.h
@@ -21,7 +21,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/integral_constant.h b/third_party/llvm-project/libcxx/include/__type_traits/integral_constant.h
index 2449d1a..0951ab5 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/integral_constant.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/integral_constant.h
@@ -25,7 +25,7 @@
typedef integral_constant type;
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
constexpr value_type operator ()() const _NOEXCEPT {return value;}
#endif
@@ -40,7 +40,7 @@
template <bool _Val>
using _BoolConstant _LIBCPP_NODEBUG = integral_constant<bool, _Val>;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <bool __b>
using bool_constant = integral_constant<bool, __b>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_abstract.h b/third_party/llvm-project/libcxx/include/__type_traits/is_abstract.h
index c74b328..5e886bb 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_abstract.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_abstract.h
@@ -21,7 +21,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_abstract
: public integral_constant<bool, __is_abstract(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_abstract_v = __is_abstract(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_aggregate.h b/third_party/llvm-project/libcxx/include/__type_traits/is_aggregate.h
index ea9de84..3b09420 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_aggregate.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_aggregate.h
@@ -18,7 +18,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
@@ -26,7 +26,7 @@
template <class _Tp>
inline constexpr bool is_aggregate_v = __is_aggregate(_Tp);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_arithmetic.h b/third_party/llvm-project/libcxx/include/__type_traits/is_arithmetic.h
index 6d631f4..03218c8 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_arithmetic.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_arithmetic.h
@@ -24,7 +24,7 @@
: public integral_constant<bool, is_integral<_Tp>::value ||
is_floating_point<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_array.h b/third_party/llvm-project/libcxx/include/__type_traits/is_array.h
index bc10590..8275176 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_array.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_array.h
@@ -26,7 +26,7 @@
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_array_v = __is_array(_Tp);
#endif
@@ -40,7 +40,7 @@
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]>
: public true_type {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_array_v = is_array<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_assignable.h
index 13cd682..3ee3e21 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_assignable.h
@@ -21,7 +21,7 @@
template<class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Arg>
inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Arg);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_base_of.h b/third_party/llvm-project/libcxx/include/__type_traits/is_base_of.h
index 0e6dec0..3338fff 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_base_of.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_base_of.h
@@ -22,7 +22,7 @@
struct _LIBCPP_TEMPLATE_VIS is_base_of
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Bp, class _Dp>
inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_bounded_array.h b/third_party/llvm-project/libcxx/include/__type_traits/is_bounded_array.h
index 27de9df..46da83a 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_bounded_array.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_bounded_array.h
@@ -22,7 +22,7 @@
template <class> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array : false_type {};
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array<_Tp[_Np]> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class> struct _LIBCPP_TEMPLATE_VIS is_bounded_array : false_type {};
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_class.h b/third_party/llvm-project/libcxx/include/__type_traits/is_class.h
index 031430f..62bf6d9 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_class.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_class.h
@@ -21,7 +21,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
: public integral_constant<bool, __is_class(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_class_v = __is_class(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_compound.h b/third_party/llvm-project/libcxx/include/__type_traits/is_compound.h
index 1395ed8..73d830c 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_compound.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_compound.h
@@ -24,7 +24,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_compound_v = __is_compound(_Tp);
#endif
@@ -34,7 +34,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_compound
: public integral_constant<bool, !is_fundamental<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_compound_v = is_compound<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_const.h b/third_party/llvm-project/libcxx/include/__type_traits/is_const.h
index 42b892c..fad3602 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_const.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_const.h
@@ -23,7 +23,7 @@
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_const_v = __is_const(_Tp);
#endif
@@ -33,7 +33,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_const_v = is_const<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_constant_evaluated.h b/third_party/llvm-project/libcxx/include/__type_traits/is_constant_evaluated.h
index ae903da..d6278f5 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_constant_evaluated.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_constant_evaluated.h
@@ -17,7 +17,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
inline constexpr bool is_constant_evaluated() noexcept {
return __builtin_is_constant_evaluated();
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_constructible.h
index cbe61b4..ebe7bfd 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_constructible.h
@@ -23,7 +23,7 @@
: public integral_constant<bool, __is_constructible(_Tp, _Args...)>
{ };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class ..._Args>
inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_convertible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_convertible.h
index 5f77fd4..873a64b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_convertible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_convertible.h
@@ -98,7 +98,7 @@
#endif // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _From, class _To>
inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_copy_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_copy_assignable.h
index b3a965f..245ae4b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_copy_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_copy_assignable.h
@@ -27,7 +27,7 @@
__is_assignable(__add_lvalue_reference_t<_Tp>,
__add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_copy_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_copy_constructible.h
index 053e159..07e2c93 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_copy_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_copy_constructible.h
@@ -26,7 +26,7 @@
bool,
__is_constructible(_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_default_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_default_constructible.h
index d2180c6..7bc21f5 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_default_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_default_constructible.h
@@ -23,7 +23,7 @@
: public integral_constant<bool, __is_constructible(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_default_constructible_v = __is_constructible(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_destructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_destructible.h
index 376d74d..d785b4b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_destructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_destructible.h
@@ -27,7 +27,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_destructible_v = __is_destructible(_Tp);
#endif
@@ -90,7 +90,7 @@
struct is_destructible<void>
: public false_type {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_destructible_v = is_destructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_empty.h b/third_party/llvm-project/libcxx/include/__type_traits/is_empty.h
index 042b4e6..46518e1 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_empty.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_empty.h
@@ -22,7 +22,7 @@
struct _LIBCPP_TEMPLATE_VIS is_empty
: public integral_constant<bool, __is_empty(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_empty_v = __is_empty(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_enum.h b/third_party/llvm-project/libcxx/include/__type_traits/is_enum.h
index 4c1db41..7b7221d 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_enum.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_enum.h
@@ -21,7 +21,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
: public integral_constant<bool, __is_enum(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_enum_v = __is_enum(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_equality_comparable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_equality_comparable.h
new file mode 100644
index 0000000..b7a7cd2
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_equality_comparable.h
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TYPE_TRAITS_IS_EQUAILITY_COMPARABLE_H
+#define _LIBCPP___TYPE_TRAITS_IS_EQUAILITY_COMPARABLE_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_integral.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp, class _Up, class = void>
+struct __is_equality_comparable : false_type {};
+
+template <class _Tp, class _Up>
+struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() == std::declval<_Up>())> > : true_type {
+};
+
+// A type is_trivially_equality_comparable if the expression `a == b` is equivalent to `std::memcmp(&a, &b, sizeof(T))`
+// (with `a` and `b` being of type `T`). There is no compiler built-in to check this, so we can only do this for known
+// types. In particular, these are the integral types and raw pointers.
+//
+// The following types are not trivially equality comparable:
+// floating-point types: different bit-patterns can compare equal. (e.g 0.0 and -0.0)
+// enums: The user is allowed to specialize operator== for enums
+// pointers that don't have the same type (ignoring cv-qualifiers): pointers to virtual bases are equality comparable,
+// but don't have the same bit-pattern. An exception to this is comparing to a void-pointer. There the bit-pattern is
+// always compared.
+
+template <class _Tp, class _Up>
+struct __libcpp_is_trivially_equality_comparable
+ : integral_constant<bool,
+ __is_equality_comparable<_Tp, _Up>::value && is_integral<_Tp>::value &&
+ is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value> {};
+
+// TODO: Use is_pointer_inverconvertible_base_of
+template <class _Tp, class _Up>
+struct __libcpp_is_trivially_equality_comparable<_Tp*, _Up*>
+ : integral_constant<
+ bool,
+ __is_equality_comparable<_Tp*, _Up*>::value &&
+ (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value || is_void<_Tp>::value || is_void<_Up>::value)> {
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_IS_EQUAILITY_COMPARABLE_H
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_final.h b/third_party/llvm-project/libcxx/include/__type_traits/is_final.h
index 74ced23..ad03b213 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_final.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_final.h
@@ -21,12 +21,12 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
__libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
is_final : public integral_constant<bool, __is_final(_Tp)> {};
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_final_v = __is_final(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_floating_point.h b/third_party/llvm-project/libcxx/include/__type_traits/is_floating_point.h
index 3928448..2789943 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_floating_point.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_floating_point.h
@@ -27,7 +27,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
: public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_function.h b/third_party/llvm-project/libcxx/include/__type_traits/is_function.h
index 53f34b3..f09f19a 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_function.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_function.h
@@ -33,7 +33,7 @@
#endif // __has_builtin(__is_function)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_function_v = is_function<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_fundamental.h b/third_party/llvm-project/libcxx/include/__type_traits/is_fundamental.h
index 46f81a1..8a1c814 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_fundamental.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_fundamental.h
@@ -25,7 +25,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_fundamental_v = __is_fundamental(_Tp);
#endif
@@ -37,7 +37,7 @@
__is_nullptr_t<_Tp>::value ||
is_arithmetic<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_integral.h b/third_party/llvm-project/libcxx/include/__type_traits/is_integral.h
index 4dcc191..c4803cb 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_integral.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_integral.h
@@ -50,7 +50,7 @@
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_integral_v = __is_integral(_Tp);
#endif
@@ -60,7 +60,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
: public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_integral_v = is_integral<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_literal_type.h b/third_party/llvm-project/libcxx/include/__type_traits/is_literal_type.h
index be01745..624fa5d 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_literal_type.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_literal_type.h
@@ -23,10 +23,10 @@
: public integral_constant<bool, __is_literal_type(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_DEPRECATED_IN_CXX17 inline constexpr bool is_literal_type_v = __is_literal_type(_Tp);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_member_function_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/is_member_function_pointer.h
index c28f359..72f84bd 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_member_function_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_member_function_pointer.h
@@ -42,7 +42,7 @@
struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
: _BoolConstant<__is_member_function_pointer(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Tp);
#endif
@@ -52,7 +52,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
: public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_func > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_function_pointer_v = is_member_function_pointer<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_member_object_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/is_member_object_pointer.h
index 5bab14b..bcdc651 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_member_object_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_member_object_pointer.h
@@ -24,7 +24,7 @@
struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
: _BoolConstant<__is_member_object_pointer(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Tp);
#endif
@@ -34,7 +34,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
: public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_object_pointer_v = is_member_object_pointer<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_member_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/is_member_pointer.h
index 904d845..5339fb0 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_member_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_member_pointer.h
@@ -24,7 +24,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
#endif
@@ -34,7 +34,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
: public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_move_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_move_assignable.h
index 3c7158b..8c4c820 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_move_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_move_assignable.h
@@ -26,7 +26,7 @@
bool,
__is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_move_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_move_constructible.h
index 667d104..d908e49 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_move_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_move_constructible.h
@@ -24,7 +24,7 @@
: public integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_assignable.h
index 0cd9d5d..4d17b9f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_assignable.h
@@ -22,7 +22,7 @@
struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
: public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Arg>
inline constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_Tp, _Arg);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_constructible.h
index 8919b79..a967bc8 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_constructible.h
@@ -68,7 +68,7 @@
#endif // __has_builtin(__is_nothrow_constructible)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class ..._Args>
inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_convertible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_convertible.h
index a8ca1c4..64f75e1 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_convertible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_convertible.h
@@ -24,13 +24,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _Tp>
-static void __test_noexcept(_Tp) noexcept;
+void __test_noexcept(_Tp) noexcept;
template<typename _Fm, typename _To>
-static bool_constant<noexcept(_VSTD::__test_noexcept<_To>(std::declval<_Fm>()))>
+bool_constant<noexcept(_VSTD::__test_noexcept<_To>(std::declval<_Fm>()))>
__is_nothrow_convertible_test();
template <typename _Fm, typename _To>
@@ -46,7 +46,7 @@
template <typename _Fm, typename _To>
inline constexpr bool is_nothrow_convertible_v = is_nothrow_convertible<_Fm, _To>::value;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
index 58f7d97..d11ec1c 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
@@ -28,7 +28,7 @@
__add_lvalue_reference_t<_Tp>,
__add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
index ce17334..de4e272 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
@@ -38,7 +38,7 @@
#endif // _LIBCPP_COMPILER_GCC
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_default_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_default_constructible.h
index 91bffa5..446808f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_default_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_default_constructible.h
@@ -22,7 +22,7 @@
: public integral_constant<bool, __is_nothrow_constructible(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_destructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_destructible.h
index 03ebf44..e842465 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_destructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_destructible.h
@@ -79,7 +79,7 @@
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_assignable.h
index 18dcc9b..7649a3f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_assignable.h
@@ -27,7 +27,7 @@
__is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_constructible.h
index ad8222a..21a22bb 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_nothrow_move_constructible.h
@@ -35,7 +35,7 @@
#endif // _LIBCPP_COMPILER_GCC
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_null_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/is_null_pointer.h
index 4864cee..3a94fce 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_null_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_null_pointer.h
@@ -26,15 +26,15 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
: public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
: public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
#endif
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_object.h b/third_party/llvm-project/libcxx/include/__type_traits/is_object.h
index 943f1a7..4d038c3 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_object.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_object.h
@@ -27,7 +27,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_object_v = __is_object(_Tp);
#endif
@@ -40,7 +40,7 @@
is_union<_Tp>::value ||
is_class<_Tp>::value > {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_object_v = is_object<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_pod.h b/third_party/llvm-project/libcxx/include/__type_traits/is_pod.h
index c1d00b2..851cbd1 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_pod.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_pod.h
@@ -21,7 +21,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
: public integral_constant<bool, __is_pod(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_pod_v = __is_pod(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/is_pointer.h
index 3c0ad04..51c628f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_pointer.h
@@ -24,7 +24,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_pointer_v = __is_pointer(_Tp);
#endif
@@ -45,7 +45,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
: public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<__remove_cv_t<_Tp> >::type> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_polymorphic.h b/third_party/llvm-project/libcxx/include/__type_traits/is_polymorphic.h
index 96da48a..21b3cdc 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_polymorphic.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_polymorphic.h
@@ -22,7 +22,7 @@
struct _LIBCPP_TEMPLATE_VIS is_polymorphic
: public integral_constant<bool, __is_polymorphic(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_polymorphic_v = __is_polymorphic(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_reference.h b/third_party/llvm-project/libcxx/include/__type_traits/is_reference.h
index 27ca2dd..3334c60 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_reference.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_reference.h
@@ -31,7 +31,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_reference_v = __is_reference(_Tp);
template <class _Tp>
@@ -52,7 +52,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&> : public true_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_reference_v = is_reference<_Tp>::value;
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_same.h b/third_party/llvm-project/libcxx/include/__type_traits/is_same.h
index 6fa0afb..c598f0d 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_same.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_same.h
@@ -21,7 +21,7 @@
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Up>
inline constexpr bool is_same_v = __is_same(_Tp, _Up);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_scalar.h b/third_party/llvm-project/libcxx/include/__type_traits/is_scalar.h
index b4dc70b..9892ae0 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_scalar.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_scalar.h
@@ -28,7 +28,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_scalar_v = __is_scalar(_Tp);
#endif
@@ -50,7 +50,7 @@
template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_scoped_enum.h b/third_party/llvm-project/libcxx/include/__type_traits/is_scoped_enum.h
index 85a4128..3f0fd58 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_scoped_enum.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_scoped_enum.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp, bool = is_enum_v<_Tp> >
struct __is_scoped_enum_helper : false_type {};
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_signed.h b/third_party/llvm-project/libcxx/include/__type_traits/is_signed.h
index aa42a4e..ebd3873 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_signed.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_signed.h
@@ -25,7 +25,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_signed_v = __is_signed(_Tp);
#endif
@@ -45,7 +45,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_signed_v = is_signed<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_specialization.h b/third_party/llvm-project/libcxx/include/__type_traits/is_specialization.h
index 0cc3667..9b75636 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_specialization.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_specialization.h
@@ -30,7 +30,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, template <class...> class _Template>
inline constexpr bool __is_specialization_v = false; // true if and only if _Tp is a specialization of _Template
@@ -38,7 +38,7 @@
template <template <class...> class _Template, class... _Args>
inline constexpr bool __is_specialization_v<_Template<_Args...>, _Template> = true;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_standard_layout.h b/third_party/llvm-project/libcxx/include/__type_traits/is_standard_layout.h
index 12c1712..aae533b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_standard_layout.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_standard_layout.h
@@ -22,7 +22,7 @@
: public integral_constant<bool, __is_standard_layout(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_swappable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_swappable.h
index 3821de1..5a78f47 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_swappable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_swappable.h
@@ -108,7 +108,7 @@
{
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Up>
struct _LIBCPP_TEMPLATE_VIS is_swappable_with
@@ -158,7 +158,7 @@
template <class _Tp>
inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivial.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivial.h
index 840770d..f439048 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivial.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivial.h
@@ -22,7 +22,7 @@
: public integral_constant<bool, __is_trivial(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivial_v = __is_trivial(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_assignable.h
index 9ef101f..c16d177 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_assignable.h
@@ -23,7 +23,7 @@
: integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)>
{ };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Arg>
inline constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_Tp, _Arg);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_constructible.h
index 4173e3b..a71a49b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_constructible.h
@@ -24,7 +24,7 @@
{
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp, class... _Args>
inline constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Tp, _Args...);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_assignable.h
index e6a4a35..b38ab7e 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_assignable.h
@@ -28,7 +28,7 @@
__add_lvalue_reference_t<_Tp>,
__add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_constructible.h
index 4bbb803..c6c96a0 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copy_constructible.h
@@ -23,7 +23,7 @@
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copyable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copyable.h
index ef118bf..a725a0b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copyable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_copyable.h
@@ -11,6 +11,7 @@
#include <__config>
#include <__type_traits/integral_constant.h>
+#include <cstdint>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -22,11 +23,16 @@
: public integral_constant<bool, __is_trivially_copyable(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
#endif
+#if _LIBCPP_STD_VER >= 20
+template <class _Tp>
+inline constexpr bool __is_cheap_to_copy = is_trivially_copyable_v<_Tp> && sizeof(_Tp) <= sizeof(std::intmax_t);
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_default_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_default_constructible.h
index 5c53bd5..2b64a69 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_default_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_default_constructible.h
@@ -22,7 +22,7 @@
: public integral_constant<bool, __is_trivially_constructible(_Tp)>
{};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_destructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_destructible.h
index 0239fca..e718af0 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_destructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_destructible.h
@@ -35,7 +35,7 @@
#endif // __has_builtin(__is_trivially_destructible)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_assignable.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_assignable.h
index 8f8876f..daf890b 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_assignable.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_assignable.h
@@ -26,7 +26,7 @@
bool,
__is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_constructible.h b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_constructible.h
index 151bb25..71e6f89 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_constructible.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_trivially_move_constructible.h
@@ -23,7 +23,7 @@
struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_unbounded_array.h b/third_party/llvm-project/libcxx/include/__type_traits/is_unbounded_array.h
index 11a1260..16bc62d 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_unbounded_array.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_unbounded_array.h
@@ -21,7 +21,7 @@
template <class> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array : false_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array<_Tp[]> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array : false_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_union.h b/third_party/llvm-project/libcxx/include/__type_traits/is_union.h
index 998aedd..6d2f47a 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_union.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_union.h
@@ -21,7 +21,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
: public integral_constant<bool, __is_union(_Tp)> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_union_v = __is_union(_Tp);
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_unsigned.h b/third_party/llvm-project/libcxx/include/__type_traits/is_unsigned.h
index 3d75409..d955106 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_unsigned.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_unsigned.h
@@ -25,7 +25,7 @@
template<class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_unsigned_v = __is_unsigned(_Tp);
#endif
@@ -45,7 +45,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_void.h b/third_party/llvm-project/libcxx/include/__type_traits/is_void.h
index d8ffdbd..7e8b8b6 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_void.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_void.h
@@ -25,7 +25,7 @@
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_void_v = __is_void(_Tp);
#endif
@@ -35,7 +35,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
: public is_same<__remove_cv_t<_Tp>, void> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_void_v = is_void<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/is_volatile.h b/third_party/llvm-project/libcxx/include/__type_traits/is_volatile.h
index fb92267..c020220 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/is_volatile.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/is_volatile.h
@@ -23,7 +23,7 @@
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> { };
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_volatile_v = __is_volatile(_Tp);
#endif
@@ -33,7 +33,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile : public false_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr bool is_volatile_v = is_volatile<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/make_32_64_or_128_bit.h b/third_party/llvm-project/libcxx/include/__type_traits/make_32_64_or_128_bit.h
index 87340ea..3059571 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/make_32_64_or_128_bit.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/make_32_64_or_128_bit.h
@@ -27,7 +27,7 @@
///
/// The restriction is the same as the integral version of to_char.
template <class _Tp>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
requires (is_signed_v<_Tp> || is_unsigned_v<_Tp> || is_same_v<_Tp, char>)
#endif
using __make_32_64_or_128_bit_t =
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/make_signed.h b/third_party/llvm-project/libcxx/include/__type_traits/make_signed.h
index bff8744..71383d0 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/make_signed.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/make_signed.h
@@ -77,7 +77,7 @@
using type _LIBCPP_NODEBUG = __make_signed_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using make_signed_t = __make_signed_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/make_unsigned.h b/third_party/llvm-project/libcxx/include/__type_traits/make_unsigned.h
index 33c3014..76d1889 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/make_unsigned.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/make_unsigned.h
@@ -79,7 +79,7 @@
using type _LIBCPP_NODEBUG = __make_unsigned_t<_Tp>;
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using make_unsigned_t = __make_unsigned_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/negation.h b/third_party/llvm-project/libcxx/include/__type_traits/negation.h
index b72f285..3a70ef1 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/negation.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/negation.h
@@ -21,12 +21,12 @@
template <class _Pred>
struct _Not : _BoolConstant<!_Pred::value> {};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
struct negation : _Not<_Tp> {};
template<class _Tp>
inline constexpr bool negation_v = !_Tp::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/noexcept_move_assign_container.h b/third_party/llvm-project/libcxx/include/__type_traits/noexcept_move_assign_container.h
index 35b0e51..65384d0 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/noexcept_move_assign_container.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/noexcept_move_assign_container.h
@@ -23,7 +23,7 @@
template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
struct __noexcept_move_assign_container : public integral_constant<bool,
_Traits::propagate_on_container_move_assignment::value
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
|| _Traits::is_always_equal::value
#else
&& is_nothrow_move_assignable<_Alloc>::value
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/predicate_traits.h b/third_party/llvm-project/libcxx/include/__type_traits/predicate_traits.h
new file mode 100644
index 0000000..872608e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/include/__type_traits/predicate_traits.h
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TYPE_TRAITS_PREDICATE_TRAITS
+#define _LIBCPP___TYPE_TRAITS_PREDICATE_TRAITS
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Pred, class _Lhs, class _Rhs>
+struct __is_trivial_equality_predicate : false_type {};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_PREDICATE_TRAITS
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/promote.h b/third_party/llvm-project/libcxx/include/__type_traits/promote.h
index c2af327..e01e778 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/promote.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/promote.h
@@ -13,7 +13,6 @@
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_same.h>
#include <__utility/declval.h>
-#include <cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/rank.h b/third_party/llvm-project/libcxx/include/__type_traits/rank.h
index 9950907..5f3fab8 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/rank.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/rank.h
@@ -36,7 +36,7 @@
#endif // __has_builtin(__array_rank)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr size_t rank_v = rank<_Tp>::value;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_all_extents.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
index 868cf10..f7e3225 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
@@ -38,7 +38,7 @@
using __remove_all_extents_t = typename remove_all_extents<_Tp>::type;
#endif // __has_builtin(__remove_all_extents)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_all_extents_t = __remove_all_extents_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_const.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_const.h
index dc56533..37f0609 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_const.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_const.h
@@ -33,7 +33,7 @@
using __remove_const_t = typename remove_const<_Tp>::type;
#endif // __has_builtin(__remove_const)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_const_t = __remove_const_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_cv.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_cv.h
index ea85e23..7eb8940 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_cv.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_cv.h
@@ -35,7 +35,7 @@
using __remove_cv_t = __remove_volatile_t<__remove_const_t<_Tp> >;
#endif // __has_builtin(__remove_cv)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_cv_t = __remove_cv_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_cvref.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_cvref.h
index e96cc65..f1111fd 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_cvref.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_cvref.h
@@ -31,7 +31,7 @@
template <class _Tp, class _Up>
struct __is_same_uncvref : _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> > {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct remove_cvref {
using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_extent.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_extent.h
index 79d6e57..65dfcdc 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_extent.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_extent.h
@@ -38,7 +38,7 @@
using __remove_extent_t = typename remove_extent<_Tp>::type;
#endif // __has_builtin(__remove_extent)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_extent_t = __remove_extent_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_pointer.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_pointer.h
index 33ddb71..8b3a9c7 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_pointer.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_pointer.h
@@ -17,7 +17,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __has_builtin(__remove_pointer)
+#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
template <class _Tp>
struct remove_pointer {
using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
@@ -34,9 +34,9 @@
template <class _Tp>
using __remove_pointer_t = typename remove_pointer<_Tp>::type;
-#endif // __has_builtin(__remove_pointer)
+#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_pointer_t = __remove_pointer_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_reference.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_reference.h
index b9a6974..1d510c2 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_reference.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_reference.h
@@ -35,7 +35,7 @@
using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
#endif // __has_builtin(__remove_reference_t)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_reference_t = __libcpp_remove_reference_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/remove_volatile.h b/third_party/llvm-project/libcxx/include/__type_traits/remove_volatile.h
index ed6d63b..cc9fb55 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/remove_volatile.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/remove_volatile.h
@@ -33,7 +33,7 @@
using __remove_volatile_t = typename remove_volatile<_Tp>::type;
#endif // __has_builtin(__remove_volatile)
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using remove_volatile_t = __remove_volatile_t<_Tp>;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/result_of.h b/third_party/llvm-project/libcxx/include/__type_traits/result_of.h
index 804173e..dff2828 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/result_of.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/result_of.h
@@ -29,9 +29,9 @@
{
};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/type_identity.h b/third_party/llvm-project/libcxx/include/__type_traits/type_identity.h
index 42e52b1..92f288f 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/type_identity.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/type_identity.h
@@ -23,7 +23,7 @@
template <class _Tp>
using __type_identity_t _LIBCPP_NODEBUG = typename __type_identity<_Tp>::type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp> struct type_identity { typedef _Tp type; };
template<class _Tp> using type_identity_t = typename type_identity<_Tp>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/underlying_type.h b/third_party/llvm-project/libcxx/include/__type_traits/underlying_type.h
index 1c8db64..6f52d67 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/underlying_type.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/underlying_type.h
@@ -32,7 +32,7 @@
template <class _Tp>
struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__type_traits/void_t.h b/third_party/llvm-project/libcxx/include/__type_traits/void_t.h
index 1ed4e43..2fe438c 100644
--- a/third_party/llvm-project/libcxx/include/__type_traits/void_t.h
+++ b/third_party/llvm-project/libcxx/include/__type_traits/void_t.h
@@ -17,7 +17,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class...> using void_t = void;
#endif
diff --git a/third_party/llvm-project/libcxx/include/__utility/as_const.h b/third_party/llvm-project/libcxx/include/__utility/as_const.h
index d4a72f4..b5c6091 100644
--- a/third_party/llvm-project/libcxx/include/__utility/as_const.h
+++ b/third_party/llvm-project/libcxx/include/__utility/as_const.h
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
diff --git a/third_party/llvm-project/libcxx/include/__utility/auto_cast.h b/third_party/llvm-project/libcxx/include/__utility/auto_cast.h
index 381ed0c..06715b3 100644
--- a/third_party/llvm-project/libcxx/include/__utility/auto_cast.h
+++ b/third_party/llvm-project/libcxx/include/__utility/auto_cast.h
@@ -17,6 +17,6 @@
# pragma GCC system_header
#endif
-#define _LIBCPP_AUTO_CAST(expr) static_cast<typename decay<decltype((expr))>::type>(expr)
+#define _LIBCPP_AUTO_CAST(expr) static_cast<::std::__decay_t<decltype((expr))> >(expr)
#endif // _LIBCPP___UTILITY_AUTO_CAST_H
diff --git a/third_party/llvm-project/libcxx/include/__utility/cmp.h b/third_party/llvm-project/libcxx/include/__utility/cmp.h
index d448a1d..7b7b901 100644
--- a/third_party/llvm-project/libcxx/include/__utility/cmp.h
+++ b/third_party/llvm-project/libcxx/include/__utility/cmp.h
@@ -28,7 +28,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _Tp, class... _Up>
struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {};
@@ -102,7 +102,7 @@
return _VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__utility/exception_guard.h b/third_party/llvm-project/libcxx/include/__utility/exception_guard.h
index 737d1a6..1db8f8a 100644
--- a/third_party/llvm-project/libcxx/include/__utility/exception_guard.h
+++ b/third_party/llvm-project/libcxx/include/__utility/exception_guard.h
@@ -41,7 +41,7 @@
// less common, especially one that tries to catch an exception through -fno-exceptions code.
//
// __exception_guard can help greatly simplify code that would normally be cluttered by
-// `#if _LIBCPP_NO_EXCEPTIONS`. For example:
+// `#if _LIBCPP_HAS_NO_EXCEPTIONS`. For example:
//
// template <class Iterator, class Size, class OutputIterator>
// Iterator uninitialized_copy_n(Iterator iter, Size n, OutputIterator out) {
@@ -58,27 +58,27 @@
// }
//
-#ifndef _LIBCPP_NO_EXCEPTIONS
template <class _Rollback>
-struct __exception_guard {
- __exception_guard() = delete;
+struct __exception_guard_exceptions {
+ __exception_guard_exceptions() = delete;
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __exception_guard(_Rollback __rollback)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __exception_guard_exceptions(_Rollback __rollback)
: __rollback_(std::move(__rollback)), __completed_(false) {}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __exception_guard(__exception_guard&& __other)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ __exception_guard_exceptions(__exception_guard_exceptions&& __other)
_NOEXCEPT_(is_nothrow_move_constructible<_Rollback>::value)
: __rollback_(std::move(__other.__rollback_)), __completed_(__other.__completed_) {
__other.__completed_ = true;
}
- __exception_guard(__exception_guard const&) = delete;
- __exception_guard& operator=(__exception_guard const&) = delete;
- __exception_guard& operator=(__exception_guard&&) = delete;
+ __exception_guard_exceptions(__exception_guard_exceptions const&) = delete;
+ __exception_guard_exceptions& operator=(__exception_guard_exceptions const&) = delete;
+ __exception_guard_exceptions& operator=(__exception_guard_exceptions&&) = delete;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __complete() _NOEXCEPT { __completed_ = true; }
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__exception_guard() {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__exception_guard_exceptions() {
if (!__completed_)
__rollback_();
}
@@ -87,36 +87,47 @@
_Rollback __rollback_;
bool __completed_;
};
-#else // _LIBCPP_NO_EXCEPTIONS
-template <class _Rollback>
-struct __exception_guard {
- __exception_guard() = delete;
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG explicit __exception_guard(_Rollback) {}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG __exception_guard(__exception_guard&& __other)
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_exceptions);
+
+template <class _Rollback>
+struct __exception_guard_noexceptions {
+ __exception_guard_noexceptions() = delete;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_NODEBUG explicit __exception_guard_noexceptions(_Rollback) {}
+
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG
+ __exception_guard_noexceptions(__exception_guard_noexceptions&& __other)
_NOEXCEPT_(is_nothrow_move_constructible<_Rollback>::value)
: __completed_(__other.__completed_) {
__other.__completed_ = true;
}
- __exception_guard(__exception_guard const&) = delete;
- __exception_guard& operator=(__exception_guard const&) = delete;
- __exception_guard& operator=(__exception_guard&&) = delete;
+ __exception_guard_noexceptions(__exception_guard_noexceptions const&) = delete;
+ __exception_guard_noexceptions& operator=(__exception_guard_noexceptions const&) = delete;
+ __exception_guard_noexceptions& operator=(__exception_guard_noexceptions&&) = delete;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG void __complete() _NOEXCEPT {
__completed_ = true;
}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG ~__exception_guard() {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG ~__exception_guard_noexceptions() {
_LIBCPP_ASSERT(__completed_, "__exception_guard not completed with exceptions disabled");
}
private:
bool __completed_ = false;
};
-#endif // _LIBCPP_NO_EXCEPTIONS
-_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard);
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_noexceptions);
+
+#ifdef _LIBCPP_HAS_NO_EXCEPTIONS
+template <class _Rollback>
+using __exception_guard = __exception_guard_noexceptions<_Rollback>;
+#else
+template <class _Rollback>
+using __exception_guard = __exception_guard_exceptions<_Rollback>;
+#endif
template <class _Rollback>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exception_guard(_Rollback __rollback) {
diff --git a/third_party/llvm-project/libcxx/include/__utility/exchange.h b/third_party/llvm-project/libcxx/include/__utility/exchange.h
index 8df71a1..4cc5e04 100644
--- a/third_party/llvm-project/libcxx/include/__utility/exchange.h
+++ b/third_party/llvm-project/libcxx/include/__utility/exchange.h
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template<class _T1, class _T2 = _T1>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
_T1 exchange(_T1& __obj, _T2&& __new_value)
@@ -31,7 +31,7 @@
__obj = _VSTD::forward<_T2>(__new_value);
return __old_value;
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__utility/forward_like.h b/third_party/llvm-project/libcxx/include/__utility/forward_like.h
index 7bb0d7d..ce11b64 100644
--- a/third_party/llvm-project/libcxx/include/__utility/forward_like.h
+++ b/third_party/llvm-project/libcxx/include/__utility/forward_like.h
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Ap, class _Bp>
using _CopyConst = _If<is_const_v<_Ap>, const _Bp, _Bp>;
@@ -39,7 +39,7 @@
return static_cast<_ForwardLike<_Tp, _Up>>(__ux);
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__utility/in_place.h b/third_party/llvm-project/libcxx/include/__utility/in_place.h
index a351845..c1c6a67 100644
--- a/third_party/llvm-project/libcxx/include/__utility/in_place.h
+++ b/third_party/llvm-project/libcxx/include/__utility/in_place.h
@@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
struct _LIBCPP_TYPE_VIS in_place_t {
explicit in_place_t() = default;
@@ -52,7 +52,7 @@
template <class _Tp>
using __is_inplace_index = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__utility/integer_sequence.h b/third_party/llvm-project/libcxx/include/__utility/integer_sequence.h
index 257b430..633b387 100644
--- a/third_party/llvm-project/libcxx/include/__utility/integer_sequence.h
+++ b/third_party/llvm-project/libcxx/include/__utility/integer_sequence.h
@@ -85,7 +85,7 @@
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template<class _Tp, _Tp... _Ip>
struct _LIBCPP_TEMPLATE_VIS integer_sequence
@@ -138,15 +138,15 @@
template<class... _Tp>
using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
// Executes __func for every element in an index_sequence.
template <size_t... _Index, class _Function>
_LIBCPP_HIDE_FROM_ABI constexpr void __for_each_index_sequence(index_sequence<_Index...>, _Function __func) {
(__func.template operator()<_Index>(), ...);
}
-# endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 20
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__utility/pair.h b/third_party/llvm-project/libcxx/include/__utility/pair.h
index 8151674..77baba9 100644
--- a/third_party/llvm-project/libcxx/include/__utility/pair.h
+++ b/third_party/llvm-project/libcxx/include/__utility/pair.h
@@ -15,13 +15,14 @@
#include <__functional/unwrap_ref.h>
#include <__fwd/get.h>
#include <__fwd/tuple.h>
-#include <__tuple_dir/sfinae_helpers.h>
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_indices.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_indices.h>
+#include <__tuple/tuple_size.h>
#include <__type_traits/common_reference.h>
#include <__type_traits/common_type.h>
#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
#include <__type_traits/is_assignable.h>
#include <__type_traits/is_constructible.h>
#include <__type_traits/is_convertible.h>
@@ -49,15 +50,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
template <class, class>
struct __non_trivially_copyable_base {
- _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI
__non_trivially_copyable_base() _NOEXCEPT {}
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
__non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
};
-#endif
template <class _T1, class _T2>
struct _LIBCPP_TEMPLATE_VIS pair
@@ -65,8 +64,8 @@
: private __non_trivially_copyable_base<_T1, _T2>
#endif
{
- typedef _T1 first_type;
- typedef _T2 second_type;
+ using first_type = _T1;
+ using second_type = _T2;
_T1 first;
_T2 second;
@@ -75,17 +74,17 @@
pair(pair&&) = default;
#ifdef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair() : first(), second() {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
template <class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
pair& operator=(pair const& __p) {
first = __p.first;
second = __p.second;
@@ -154,7 +153,7 @@
template <class _Tuple>
using _CheckTLC _LIBCPP_NODEBUG = __conditional_t<
__tuple_like_with_size<_Tuple, 2>::value
- && !is_same<typename decay<_Tuple>::type, pair>::value,
+ && !is_same<__decay_t<_Tuple>, pair>::value,
_CheckTupleLikeConstructor,
__check_tuple_constructor_fail
>;
@@ -162,7 +161,7 @@
template<bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::__enable_explicit_default()
>::type* = nullptr>
- explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
is_nothrow_default_constructible<second_type>::value)
: first(), second() {}
@@ -170,7 +169,7 @@
template<bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::__enable_implicit_default()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
is_nothrow_default_constructible<second_type>::value)
: first(), second() {}
@@ -178,7 +177,7 @@
template <bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_T1 const& __t1, _T2 const& __t2)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
is_nothrow_copy_constructible<second_type>::value)
@@ -187,41 +186,41 @@
template<bool _Dummy = true, typename enable_if<
_CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_T1 const& __t1, _T2 const& __t2)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
is_nothrow_copy_constructible<second_type>::value)
: first(__t1), second(__t2) {}
template <
-#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951
+#if _LIBCPP_STD_VER >= 23 // http://wg21.link/P1951
class _U1 = _T1, class _U2 = _T2,
#else
class _U1, class _U2,
#endif
typename enable_if<_CheckArgs::template __enable_explicit<_U1, _U2>()>::type* = nullptr
>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_U1&& __u1, _U2&& __u2)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
is_nothrow_constructible<second_type, _U2>::value))
- : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+ : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {}
template <
-#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951
+#if _LIBCPP_STD_VER >= 23 // http://wg21.link/P1951
class _U1 = _T1, class _U2 = _T2,
#else
class _U1, class _U2,
#endif
typename enable_if<_CheckArgs::template __enable_implicit<_U1, _U2>()>::type* = nullptr
>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_U1&& __u1, _U2&& __u2)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
is_nothrow_constructible<second_type, _U2>::value))
- : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+ : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _U1, class _U2, __enable_if_t<
_CheckArgs::template __is_pair_constructible<_U1&, _U2&>()
>* = nullptr>
@@ -235,7 +234,7 @@
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(pair<_U1, _U2> const& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
is_nothrow_constructible<second_type, _U2 const&>::value))
@@ -244,7 +243,7 @@
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(pair<_U1, _U2> const& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
is_nothrow_constructible<second_type, _U2 const&>::value))
@@ -253,22 +252,22 @@
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_explicit<_U1, _U2>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(pair<_U1, _U2>&&__p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
is_nothrow_constructible<second_type, _U2&&>::value))
- : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+ : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
template<class _U1, class _U2, typename enable_if<
_CheckArgs::template __enable_implicit<_U1, _U2>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(pair<_U1, _U2>&& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
is_nothrow_constructible<second_type, _U2&&>::value))
- : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+ : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _U1, class _U2, __enable_if_t<
_CheckArgs::template __is_pair_constructible<const _U1&&, const _U2&&>()
>* = nullptr>
@@ -283,21 +282,21 @@
template<class _Tuple, typename enable_if<
_CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_Tuple&& __p)
- : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
- second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+ : first(std::get<0>(std::forward<_Tuple>(__p))),
+ second(std::get<1>(std::forward<_Tuple>(__p))) {}
template<class _Tuple, typename enable_if<
_CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_Tuple&& __p)
- : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
- second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+ : first(std::get<0>(std::forward<_Tuple>(__p))),
+ second(std::get<1>(std::forward<_Tuple>(__p))) {}
template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair(piecewise_construct_t __pc,
tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
_NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
@@ -306,7 +305,7 @@
typename __make_tuple_indices<sizeof...(_Args1)>::type(),
typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair& operator=(__conditional_t<
is_copy_assignable<first_type>::value &&
is_copy_assignable<second_type>::value,
@@ -319,7 +318,7 @@
return *this;
}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair& operator=(__conditional_t<
is_move_assignable<first_type>::value &&
is_move_assignable<second_type>::value,
@@ -327,12 +326,12 @@
_NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
is_nothrow_move_assignable<second_type>::value)
{
- first = _VSTD::forward<first_type>(__p.first);
- second = _VSTD::forward<second_type>(__p.second);
+ first = std::forward<first_type>(__p.first);
+ second = std::forward<second_type>(__p.second);
return *this;
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
const pair& operator=(pair const& __p) const
noexcept(is_nothrow_copy_assignable_v<const first_type> &&
@@ -374,30 +373,30 @@
second = std::forward<_U2>(__p.second);
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
template <class _Tuple, typename enable_if<
_CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
>::type* = nullptr>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair& operator=(_Tuple&& __p) {
- first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
- second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
+ first = std::get<0>(std::forward<_Tuple>(__p));
+ second = std::get<1>(std::forward<_Tuple>(__p));
return *this;
}
-#endif
+#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
__is_nothrow_swappable<second_type>::value)
{
- using _VSTD::swap;
+ using std::swap;
swap(first, __p.first);
swap(second, __p.second);
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
void swap(const pair& __p) const
noexcept(__is_nothrow_swappable<const first_type>::value &&
@@ -412,88 +411,88 @@
#ifndef _LIBCPP_CXX03_LANG
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
pair(piecewise_construct_t,
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
__tuple_indices<_I1...>, __tuple_indices<_I2...>);
#endif
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _T1, class _T2>
pair(_T1, _T2) -> pair<_T1, _T2>;
#endif
// [pairs.spec], specialized algorithms
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator==(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return __x.first == __y.first && __x.second == __y.second;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
-template <class _T1, class _T2>
+template <class _T1, class _T2, class _U1, class _U2>
_LIBCPP_HIDE_FROM_ABI constexpr
common_comparison_category_t<
- __synth_three_way_result<_T1>,
- __synth_three_way_result<_T2> >
-operator<=>(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+ __synth_three_way_result<_T1, _U1>,
+ __synth_three_way_result<_T2, _U2> >
+operator<=>(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
- if (auto __c = _VSTD::__synth_three_way(__x.first, __y.first); __c != 0) {
+ if (auto __c = std::__synth_three_way(__x.first, __y.first); __c != 0) {
return __c;
}
- return _VSTD::__synth_three_way(__x.second, __y.second);
+ return std::__synth_three_way(__x.second, __y.second);
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator!=(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return !(__x == __y);
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator< (const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second);
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator> (const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return __y < __x;
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator>=(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return !(__x < __y);
}
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+template <class _T1, class _T2, class _U1, class _U2>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
bool
-operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
+operator<=(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
{
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _T1, class _T2, class _U1, class _U2, template<class> class _TQual, template<class> class _UQual>
requires requires { typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }
@@ -507,10 +506,10 @@
struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>;
};
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
typename enable_if
<
__is_swappable<_T1>::value &&
@@ -524,7 +523,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _T1, class _T2>
requires (__is_swappable<const _T1>::value &&
__is_swappable<const _T2>::value)
@@ -537,12 +536,12 @@
#endif
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
make_pair(_T1&& __t1, _T2&& __t2)
{
return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
- (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
+ (std::forward<_T1>(__t1), std::forward<_T2>(__t2));
}
template <class _T1, class _T2>
@@ -558,13 +557,13 @@
template <class _T1, class _T2>
struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
{
- typedef _LIBCPP_NODEBUG _T1 type;
+ using type _LIBCPP_NODEBUG = _T1;
};
template <class _T1, class _T2>
struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
{
- typedef _LIBCPP_NODEBUG _T2 type;
+ using type _LIBCPP_NODEBUG = _T2;
};
template <size_t _Ip> struct __get_pair;
@@ -574,27 +573,27 @@
{
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T1&
get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T1&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T1&&
- get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
+ get(pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<_T1>(__p.first);}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T1&&
- get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<const _T1>(__p.first);}
};
template <>
@@ -602,31 +601,31 @@
{
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T2&
get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T2&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
_T2&&
- get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
+ get(pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<_T2>(__p.second);}
template <class _T1, class _T2>
static
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const _T2&&
- get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return std::forward<const _T2>(__p.second);}
};
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(pair<_T1, _T2>& __p) _NOEXCEPT
{
@@ -634,7 +633,7 @@
}
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(const pair<_T1, _T2>& __p) _NOEXCEPT
{
@@ -642,79 +641,79 @@
}
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(pair<_T1, _T2>&& __p) _NOEXCEPT
{
- return __get_pair<_Ip>::get(_VSTD::move(__p));
+ return __get_pair<_Ip>::get(std::move(__p));
}
template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT
{
- return __get_pair<_Ip>::get(_VSTD::move(__p));
+ return __get_pair<_Ip>::get(std::move(__p));
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT
{
return __get_pair<0>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT
{
return __get_pair<0>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
{
- return __get_pair<0>::get(_VSTD::move(__p));
+ return __get_pair<0>::get(std::move(__p));
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT
{
- return __get_pair<0>::get(_VSTD::move(__p));
+ return __get_pair<0>::get(std::move(__p));
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
{
return __get_pair<1>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT
{
return __get_pair<1>::get(__p);
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
{
- return __get_pair<1>::get(_VSTD::move(__p));
+ return __get_pair<1>::get(std::move(__p));
}
template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
{
- return __get_pair<1>::get(_VSTD::move(__p));
+ return __get_pair<1>::get(std::move(__p));
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__utility/piecewise_construct.h b/third_party/llvm-project/libcxx/include/__utility/piecewise_construct.h
index 3cc86fe..071e207 100644
--- a/third_party/llvm-project/libcxx/include/__utility/piecewise_construct.h
+++ b/third_party/llvm-project/libcxx/include/__utility/piecewise_construct.h
@@ -18,9 +18,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
-#else
+
+#if defined(_LIBCPP_BUILDING_LIBRARY)
+extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;
+#elif !defined(_LIBCPP_CXX03_LANG)
/* inline */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
diff --git a/third_party/llvm-project/libcxx/include/__utility/to_underlying.h b/third_party/llvm-project/libcxx/include/__utility/to_underlying.h
index a194d3e..b70f70a 100644
--- a/third_party/llvm-project/libcxx/include/__utility/to_underlying.h
+++ b/third_party/llvm-project/libcxx/include/__utility/to_underlying.h
@@ -27,7 +27,7 @@
}
#endif // !_LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp>
_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY constexpr underlying_type_t<_Tp>
to_underlying(_Tp __val) noexcept {
diff --git a/third_party/llvm-project/libcxx/include/__utility/unreachable.h b/third_party/llvm-project/libcxx/include/__utility/unreachable.h
index d93e60b..bd1c6be 100644
--- a/third_party/llvm-project/libcxx/include/__utility/unreachable.h
+++ b/third_party/llvm-project/libcxx/include/__utility/unreachable.h
@@ -23,7 +23,7 @@
__builtin_unreachable();
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[noreturn]] _LIBCPP_HIDE_FROM_ABI inline void unreachable() { __libcpp_unreachable(); }
diff --git a/third_party/llvm-project/libcxx/include/__variant/monostate.h b/third_party/llvm-project/libcxx/include/__variant/monostate.h
index b3b4597..8fec340 100644
--- a/third_party/llvm-project/libcxx/include/__variant/monostate.h
+++ b/third_party/llvm-project/libcxx/include/__variant/monostate.h
@@ -21,19 +21,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
struct _LIBCPP_TEMPLATE_VIS monostate {};
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(monostate, monostate) noexcept { return true; }
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
return strong_ordering::equal;
}
-# else // _LIBCPP_STD_VER > 17
+# else // _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(monostate, monostate) noexcept { return false; }
@@ -45,7 +45,7 @@
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(monostate, monostate) noexcept { return true; }
-# endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 20
template <>
struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
@@ -57,7 +57,7 @@
}
};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/__verbose_abort b/third_party/llvm-project/libcxx/include/__verbose_abort
index a16d75d..048d9ff 100644
--- a/third_party/llvm-project/libcxx/include/__verbose_abort
+++ b/third_party/llvm-project/libcxx/include/__verbose_abort
@@ -21,7 +21,7 @@
// This function should never be called directly from the code -- it should only be called through
// the _LIBCPP_VERBOSE_ABORT macro.
-_LIBCPP_NORETURN _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2)
+_LIBCPP_NORETURN _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2)
void __libcpp_verbose_abort(const char *__format, ...);
// _LIBCPP_VERBOSE_ABORT(format, args...)
@@ -40,16 +40,19 @@
// Support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED until LLVM 18, but tell people
// to move to customizing _LIBCPP_VERBOSE_ABORT instead.
-# if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY) && defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
-# undef _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT) && defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
+# undef _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
# warning _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED is deprecated, please customize _LIBCPP_VERBOSE_ABORT instead
# endif
-# if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY)
-# define _LIBCPP_VERBOSE_ABORT(...) __builtin_abort()
+# if defined(_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT)
+// The decltype is there to suppress -Wunused warnings in this configuration.
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR void __use(const char*, ...) { }
+# define _LIBCPP_VERBOSE_ABORT(...) (decltype(::std::__use(__VA_ARGS__))(), __builtin_abort())
# else
# define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__)
# endif
+
#endif // !defined(_LIBCPP_VERBOSE_ABORT)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/algorithm b/third_party/llvm-project/libcxx/include/algorithm
index cb2d27c..9970a63 100644
--- a/third_party/llvm-project/libcxx/include/algorithm
+++ b/third_party/llvm-project/libcxx/include/algorithm
@@ -22,41 +22,41 @@
// [algorithms.results], algorithm result types
template <class I, class F>
- struct in_fun_result; // since C++20
+ struct in_fun_result; // since C++20
template <class I1, class I2>
- struct in_in_result; // since C++20
+ struct in_in_result; // since C++20
template <class I, class O>
- struct in_out_result; // since C++20
+ struct in_out_result; // since C++20
template <class I1, class I2, class O>
- struct in_in_out_result; // since C++20
+ struct in_in_out_result; // since C++20
template <class I, class O1, class O2>
- struct in_out_out_result; // since C++20
+ struct in_out_out_result; // since C++20
template <class I1, class I2>
- struct min_max_result; // since C++20
+ struct min_max_result; // since C++20
template <class I>
- struct in_found_result; // since C++20
+ struct in_found_result; // since C++20
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
- indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20
constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {});
template<forward_range R, class Proj = identity,
- indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> // since C++20
constexpr borrowed_iterator_t<R> min_element(R&& r, Comp comp = {}, Proj proj = {});
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
- constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
- constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr borrowed_iterator_t<R> ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I1, class I2>
using mismatch_result = in_in_result<I1, I2>;
@@ -64,86 +64,86 @@
template <input_iterator I1, sentinel_for<_I1> S1, input_iterator I2, sentinel_for<_I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
- constexpr mismatch_result<_I1, _I2>
- mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
+ constexpr mismatch_result<_I1, _I2> // since C++20
+ mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {})
template <input_range R1, input_range R2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
- mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
+ mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
- constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20
+ constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20
template<input_range R, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
constexpr borrowed_iterator_t<R>
- find(R&& r, const T& value, Proj proj = {}); // since C++20
+ find(R&& r, const T& value, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
- find_if(R&& r, Pred pred, Proj proj = {}); // since C++20
+ find_if(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
- find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20
+ find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20
template<class T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
template<copyable T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
constexpr range_value_t<R>
- min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
template<copyable T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
- constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
+ constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
constexpr range_value_t<R>
- max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I, class O>
- using unary_transform_result = in_out_result<I, O>; // since C++20
+ using unary_transform_result = in_out_result<I, O>; // since C++20
template<class I1, class I2, class O>
- using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20
+ using binary_transform_result = in_in_out_result<I1, I2, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
copy_constructible F, class Proj = identity>
requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>>
constexpr ranges::unary_transform_result<I, O>
- transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20
+ transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, copy_constructible F,
class Proj = identity>
requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>>
constexpr ranges::unary_transform_result<borrowed_iterator_t<R>, O>
- transform(R&& r, O result, F op, Proj proj = {}); // since C++20
+ transform(R&& r, O result, F op, Proj proj = {}); // since C++20
template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
weakly_incrementable O, copy_constructible F, class Proj1 = identity,
@@ -152,7 +152,7 @@
projected<I2, Proj2>>>
constexpr ranges::binary_transform_result<I1, I2, O>
transform(I1 first1, S1 last1, I2 first2, S2 last2, O result,
- F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, input_range R2, weakly_incrementable O,
copy_constructible F, class Proj1 = identity, class Proj2 = identity>
@@ -160,27 +160,27 @@
projected<iterator_t<R2>, Proj2>>>
constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
transform(R1&& r1, R2&& r2, O result,
- F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
constexpr iter_difference_t<I>
- count(I first, S last, const T& value, Proj proj = {}); // since C++20
+ count(I first, S last, const T& value, Proj proj = {}); // since C++20
template<input_range R, class T, class Proj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
constexpr range_difference_t<R>
- count(R&& r, const T& value, Proj proj = {}); // since C++20
+ count(R&& r, const T& value, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr iter_difference_t<I>
- count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr range_difference_t<R>
- count_if(R&& r, Pred pred, Proj proj = {}); // since C++20
+ count_if(R&& r, Pred pred, Proj proj = {}); // since C++20
template<class T>
using minmax_result = min_max_result<T>;
@@ -188,18 +188,18 @@
template<class T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
constexpr ranges::minmax_result<const T&>
- minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20
template<copyable T, class Proj = identity,
indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less>
constexpr ranges::minmax_result<T>
- minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
constexpr ranges::minmax_result<range_value_t<R>>
- minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I>
using minmax_element_result = min_max_result<I>;
@@ -207,18 +207,18 @@
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
constexpr ranges::minmax_element_result<I>
- minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
constexpr ranges::minmax_element_result<borrowed_iterator_t<R>>
- minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
+ minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I, class O>
- using copy_result = in_out_result<I, O>; // since C++20
+ using copy_result = in_out_result<I, O>; // since C++20
template<class I, class O>
- using copy_n_result = in_out_result<I, O>; // since C++20
+ using copy_n_result = in_out_result<I, O>; // since C++20
template<class I, class O>
using copy_if_result = in_out_result<I, O>; // since C++20
@@ -333,20 +333,20 @@
template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
- constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
- constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
- constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_range R, class Proj = identity,
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
constexpr borrowed_iterator_t<R>
- is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_iterator I, sentinel_for<I> S>
requires permutable<I>
@@ -399,15 +399,15 @@
template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F>
requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
- constexpr O generate(O first, S last, F gen); // Since C++20
+ constexpr O generate(O first, S last, F gen); // since C++20
template<class R, copy_constructible F>
requires invocable<F&> && output_range<R, invoke_result_t<F&>>
- constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // Since C++20
+ constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // since C++20
template<input_or_output_iterator O, copy_constructible F>
requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
- constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // Since C++20
+ constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // since C++20
template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
@@ -424,27 +424,27 @@
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
- constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
- constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<input_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
- constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I1, sentinel_for<I1> S1,
random_access_iterator I2, sentinel_for<I2> S2,
@@ -453,7 +453,7 @@
indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>>
constexpr partial_sort_copy_result<I1, I2>
partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last,
- Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, random_access_range R2, class Comp = ranges::less,
class Proj1 = identity, class Proj2 = identity>
@@ -463,7 +463,7 @@
projected<iterator_t<R2>, Proj2>>
constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
@@ -486,64 +486,64 @@
class Proj = identity>
requires sortable<I, Comp, Proj>
constexpr I
- ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20
+ ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<random_access_range R, class Comp = ranges::less, class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
constexpr borrowed_iterator_t<R>
- ranges::nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); // since C++20
+ ranges::nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
- indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
- constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
+ indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> // since C++20
+ constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr borrowed_iterator_t<R>
- upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
+ upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
constexpr I lower_bound(I first, S last, const T& value, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr borrowed_iterator_t<R>
- lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
+ lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
constexpr bool binary_search(I first, S last, const T& value, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<forward_range R, class T, class Proj = identity,
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
ranges::less>
constexpr bool binary_search(R&& r, const T& value, Comp comp = {},
- Proj proj = {}); // since C++20
+ Proj proj = {}); // since C++20
template<permutable I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr subrange<I>
- partition(I first, S last, Pred pred, Proj proj = {}); // Since C++20
+ partition(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires permutable<iterator_t<R>>
constexpr borrowed_subrange_t<R>
- partition(R&& r, Pred pred, Proj proj = {}); // Since C++20
+ partition(R&& r, Pred pred, Proj proj = {}); // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
requires permutable<I>
- subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // Since C++20
+ subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<bidirectional_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires permutable<iterator_t<R>>
- borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // Since C++20
+ borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // since C++20
template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
@@ -563,7 +563,7 @@
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_binary_predicate<projected<I, Proj>,
projected<I, Proj>> Pred = ranges::equal_to>
- constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C+20
+ constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_binary_predicate<projected<iterator_t<R>, Proj>,
@@ -604,7 +604,7 @@
projected<I2, Proj2>> Comp = ranges::less>
constexpr bool
ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2,
- Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, input_range R2, class Proj1 = identity,
class Proj2 = identity,
@@ -612,7 +612,7 @@
projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
constexpr bool
ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2>
requires indirectly_movable<I1, I2>
@@ -643,7 +643,7 @@
requires indirectly_copyable<I, O1> && indirectly_copyable<I, O2>
constexpr partition_copy_result<I, O1, O2>
partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O1, weakly_incrementable O2,
class Proj = identity,
@@ -651,16 +651,16 @@
requires indirectly_copyable<iterator_t<R>, O1> &&
indirectly_copyable<iterator_t<R>, O2>
constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2>
- partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // Since C++20
+ partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // since C++20
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
- constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // Since C++20
+ constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr borrowed_iterator_t<R>
- partition_point(R&& r, Pred pred, Proj proj = {}); // Since C++20
+ partition_point(R&& r, Pred pred, Proj proj = {}); // since C++20
template<class I1, class I2, class O>
using merge_result = in_in_out_result<I1, I2, O>; // since C++20
@@ -755,7 +755,7 @@
template<forward_range R>
requires permutable<iterator_t<R>>
- constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // Since C++20
+ constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // since C++20
template <class _InIter, class _OutIter>
using rotate_copy_result = in_out_result<_InIter, _OutIter>; // since C++20
@@ -774,23 +774,23 @@
requires (forward_iterator<I> || random_access_iterator<O>) &&
indirectly_copyable<I, O> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // Since C++20
+ O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // since C++20
template<input_range R, weakly_incrementable O, class Gen>
requires (forward_range<R> || random_access_iterator<O>) &&
indirectly_copyable<iterator_t<R>, O> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // Since C++20
+ O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // since C++20
template<random_access_iterator I, sentinel_for<I> S, class Gen>
requires permutable<I> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- I shuffle(I first, S last, Gen&& g); // Since C++20
+ I shuffle(I first, S last, Gen&& g); // since C++20
template<random_access_range R, class Gen>
requires permutable<iterator_t<R>> &&
uniform_random_bit_generator<remove_reference_t<Gen>>
- borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // Since C++20
+ borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // since C++20
template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2,
sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity,
@@ -798,14 +798,14 @@
projected<I2, Proj2>> Pred = ranges::equal_to>
constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2,
Pred pred = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<forward_range R1, forward_range R2,
class Proj1 = identity, class Proj2 = identity,
indirect_equivalence_relation<projected<iterator_t<R1>, Proj1>,
projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to>
constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2,
sentinel_for<I2> S2, class Pred = ranges::equal_to,
@@ -904,35 +904,35 @@
indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp =
ranges::less>
constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<input_range R1, input_range R2, class Proj1 = identity,
class Proj2 = identity,
indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {},
- Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
- I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less, class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
borrowed_iterator_t<R>
inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {},
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<permutable I, sentinel_for<I> S, class Proj = identity,
indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
- constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // Since C++20
+ constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // since C++20
template<forward_range R, class Proj = identity,
indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
requires permutable<iterator_t<R>>
constexpr borrowed_subrange_t<R>
- unique(R&& r, C comp = {}, Proj proj = {}); // Since C++20
+ unique(R&& r, C comp = {}, Proj proj = {}); // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity,
indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
@@ -941,7 +941,7 @@
(input_iterator<O> && same_as<iter_value_t<I>, iter_value_t<O>>) ||
indirectly_copyable_storable<I, O>)
constexpr unique_copy_result<I, O>
- unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // Since C++20
+ unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, class Proj = identity,
indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
@@ -950,41 +950,41 @@
(input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) ||
indirectly_copyable_storable<iterator_t<R>, O>)
constexpr unique_copy_result<borrowed_iterator_t<R>, O>
- unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // Since C++20
+ unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // since C++20
template<class I, class O>
- using remove_copy_result = in_out_result<I, O>; // Since C++20
+ using remove_copy_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T,
class Proj = identity>
indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
constexpr remove_copy_result<I, O>
- remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // Since C++20
+ remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, class T, class Proj = identity>
requires indirectly_copyable<iterator_t<R>, O> &&
indirect_binary_predicate<ranges::equal_to,
projected<iterator_t<R>, Proj>, const T*>
constexpr remove_copy_result<borrowed_iterator_t<R>, O>
- remove_copy(R&& r, O result, const T& value, Proj proj = {}); // Since C++20
+ remove_copy(R&& r, O result, const T& value, Proj proj = {}); // since C++20
template<class I, class O>
- using remove_copy_if_result = in_out_result<I, O>; // Since C++20
+ using remove_copy_if_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
requires indirectly_copyable<I, O>
constexpr remove_copy_if_result<I, O>
- remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // Since C++20
+ remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20
template<input_range R, weakly_incrementable O, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires indirectly_copyable<iterator_t<R>, O>
constexpr remove_copy_if_result<borrowed_iterator_t<R>, O>
- remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // Since C++20
+ remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20
template<class I, class O>
- using replace_copy_result = in_out_result<I, O>; // Since C++20
+ using replace_copy_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, class T1, class T2,
output_iterator<const T2&> O, class Proj = identity>
@@ -992,7 +992,7 @@
indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
constexpr replace_copy_result<I, O>
replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<input_range R, class T1, class T2, output_iterator<const T2&> O,
class Proj = identity>
@@ -1001,54 +1001,54 @@
projected<iterator_t<R>, Proj>, const T1*>
constexpr replace_copy_result<borrowed_iterator_t<R>, O>
replace_copy(R&& r, O result, const T1& old_value, const T2& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<class I, class O>
- using replace_copy_if_result = in_out_result<I, O>; // Since C++20
+ using replace_copy_if_result = in_out_result<I, O>; // since C++20
template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O,
class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
requires indirectly_copyable<I, O>
constexpr replace_copy_if_result<I, O>
replace_copy_if(I first, S last, O result, Pred pred, const T& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<input_range R, class T, output_iterator<const T&> O, class Proj = identity,
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
requires indirectly_copyable<iterator_t<R>, O>
constexpr replace_copy_if_result<borrowed_iterator_t<R>, O>
replace_copy_if(R&& r, O result, Pred pred, const T& new_value,
- Proj proj = {}); // Since C++20
+ Proj proj = {}); // since C++20
template<class I>
- using prev_permutation_result = in_found_result<I>; // Since C++20
+ using prev_permutation_result = in_found_result<I>; // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
constexpr ranges::prev_permutation_result<I>
- ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less,
class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
constexpr ranges::prev_permutation_result<borrowed_iterator_t<R>>
- ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
template<class I>
- using next_permutation_result = in_found_result<I>; // Since C++20
+ using next_permutation_result = in_found_result<I>; // since C++20
template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
class Proj = identity>
requires sortable<I, Comp, Proj>
constexpr ranges::next_permutation_result<I>
- ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
template<bidirectional_range R, class Comp = ranges::less,
class Proj = identity>
requires sortable<iterator_t<R>, Comp, Proj>
constexpr ranges::next_permutation_result<borrowed_iterator_t<R>>
- ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20
+ ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
}
@@ -1684,6 +1684,18 @@
lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, Compare comp);
+template<class InputIterator1, class InputIterator2, class Cmp>
+ constexpr auto
+ lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, InputIterator2 last2,
+ Cmp comp)
+ -> decltype(comp(*b1, *b2)); // since C++20
+
+template<class InputIterator1, class InputIterator2>
+ constexpr auto
+ lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, InputIterator2 last2); // since C++20
+
template <class BidirectionalIterator>
constexpr bool // constexpr in C++20
next_permutation(BidirectionalIterator first, BidirectionalIterator last);
@@ -1707,7 +1719,6 @@
#include <__config>
#include <__debug>
#include <cstddef>
-#include <type_traits>
#include <version>
#include <__algorithm/adjacent_find.h>
@@ -1753,6 +1764,7 @@
#include <__algorithm/is_sorted_until.h>
#include <__algorithm/iter_swap.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/lower_bound.h>
#include <__algorithm/make_heap.h>
#include <__algorithm/max.h>
@@ -1915,11 +1927,14 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
+# include <bit>
# include <concepts>
+# include <cstdlib>
# include <cstring>
# include <iterator>
# include <memory>
# include <stdexcept>
+# include <type_traits>
# include <utility>
#endif
diff --git a/third_party/llvm-project/libcxx/include/any b/third_party/llvm-project/libcxx/include/any
index 92cbc9a..963e5e0 100644
--- a/third_party/llvm-project/libcxx/include/any
+++ b/third_party/llvm-project/libcxx/include/any
@@ -87,13 +87,27 @@
#include <__memory/allocator_destructor.h>
#include <__memory/allocator_traits.h>
#include <__memory/unique_ptr.h>
+#include <__type_traits/add_const.h>
+#include <__type_traits/add_pointer.h>
+#include <__type_traits/aligned_storage.h>
+#include <__type_traits/alignment_of.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_function.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
-#include <cstdlib>
+#include <__verbose_abort>
#include <initializer_list>
-#include <type_traits>
#include <typeinfo>
#include <version>
@@ -111,16 +125,16 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
void __throw_bad_any_cast()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_any_cast();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_any_cast was thrown in -fno-exceptions mode");
#endif
}
@@ -175,7 +189,7 @@
inline _LIBCPP_INLINE_VISIBILITY
bool __compare_typeid(type_info const* __id, const void* __fallback_id)
{
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCPP_HAS_NO_RTTI)
if (__id && *__id == typeid(_Tp))
return true;
#endif
@@ -294,7 +308,7 @@
_LIBCPP_INLINE_VISIBILITY
bool has_value() const _NOEXCEPT { return __h_ != nullptr; }
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCPP_HAS_NO_RTTI)
_LIBCPP_INLINE_VISIBILITY
const type_info & type() const _NOEXCEPT {
if (__h_) {
@@ -426,7 +440,7 @@
_LIBCPP_INLINE_VISIBILITY
static void* __type_info()
{
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCPP_HAS_NO_RTTI)
return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
#else
return nullptr;
@@ -514,7 +528,7 @@
_LIBCPP_INLINE_VISIBILITY
static void* __type_info()
{
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCPP_HAS_NO_RTTI)
return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
#else
return nullptr;
@@ -680,7 +694,7 @@
typedef add_pointer_t<_ValueType> _ReturnType;
if (__any && __any->__h_) {
void *__p = __any->__call(_Action::_Get, nullptr,
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCPP_HAS_NO_RTTI)
&typeid(_ValueType),
#else
nullptr,
@@ -692,7 +706,7 @@
return nullptr;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
@@ -703,9 +717,11 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iosfwd>
# include <iterator>
# include <memory>
+# include <type_traits>
# include <variant>
#endif
diff --git a/third_party/llvm-project/libcxx/include/array b/third_party/llvm-project/libcxx/include/array
index 068a6bd..cdabc06 100644
--- a/third_party/llvm-project/libcxx/include/array
+++ b/third_party/llvm-project/libcxx/include/array
@@ -115,12 +115,21 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__iterator/reverse_iterator.h>
-#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_move_constructible.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/remove_cv.h>
#include <__utility/integer_sequence.h>
#include <__utility/move.h>
#include <__utility/unreachable.h>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -137,8 +146,8 @@
#include <initializer_list>
// [tuple.helper]
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -376,7 +385,7 @@
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, class... _Args,
class = enable_if_t<__all<_IsSame<_Tp, _Args>::value...>::value>
>
@@ -489,7 +498,7 @@
return _VSTD::move(__a.__elems_[_Ip]);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _Tp, size_t _Size, size_t... _Index>
_LIBCPP_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
@@ -528,14 +537,16 @@
make_index_sequence<_Size>());
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
+# include <cstdlib>
# include <iterator>
+# include <type_traits>
# include <utility>
#endif
diff --git a/third_party/llvm-project/libcxx/include/atomic b/third_party/llvm-project/libcxx/include/atomic
index d0d682d..2f122a7 100644
--- a/third_party/llvm-project/libcxx/include/atomic
+++ b/third_party/llvm-project/libcxx/include/atomic
@@ -519,2154 +519,39 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
-#include <__availability>
-#include <__chrono/duration.h>
+#include <__atomic/aliases.h>
+#include <__atomic/atomic.h>
+#include <__atomic/atomic_base.h>
+#include <__atomic/atomic_flag.h>
+#include <__atomic/atomic_init.h>
+#include <__atomic/atomic_lock_free.h>
+#include <__atomic/atomic_sync.h>
+#include <__atomic/check_memory_order.h>
+#include <__atomic/contention_t.h>
+#include <__atomic/cxx_atomic_impl.h>
+#include <__atomic/fence.h>
+#include <__atomic/is_always_lock_free.h>
+#include <__atomic/kill_dependency.h>
+#include <__atomic/memory_order.h>
#include <__config>
-#include <__thread/poll_with_backoff.h>
-#include <__thread/timed_backoff_policy.h>
-#include <__type_traits/conditional.h>
-#include <__type_traits/decay.h>
-#include <__type_traits/is_assignable.h>
-#include <__type_traits/is_function.h>
-#include <__type_traits/is_nothrow_default_constructible.h>
-#include <__type_traits/is_same.h>
-#include <__type_traits/is_trivially_copyable.h>
-#include <__type_traits/remove_const.h>
-#include <__type_traits/remove_pointer.h>
-#include <__type_traits/underlying_type.h>
-#include <cstddef>
-#include <cstdint>
-#include <cstring>
#include <version>
-#ifndef _LIBCPP_HAS_NO_THREADS
-# include <__threading_support>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER
-# error <atomic> is not implemented
+# error <atomic> is not implemented
#endif
+
#ifdef kill_dependency
-# error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
+# error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
#endif
-#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
- _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
- __m == memory_order_acquire || \
- __m == memory_order_acq_rel, \
- "memory order argument to atomic operation is invalid")
-
-#define _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) \
- _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || \
- __m == memory_order_acq_rel, \
- "memory order argument to atomic operation is invalid")
-
-#define _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
- _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || \
- __f == memory_order_acq_rel, \
- "memory order argument to atomic operation is invalid")
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// Figure out what the underlying type for `memory_order` would be if it were
-// declared as an unscoped enum (accounting for -fshort-enums). Use this result
-// to pin the underlying type in C++20.
-enum __legacy_memory_order {
- __mo_relaxed,
- __mo_consume,
- __mo_acquire,
- __mo_release,
- __mo_acq_rel,
- __mo_seq_cst
-};
-
-typedef underlying_type<__legacy_memory_order>::type __memory_order_underlying_t;
-
-#if _LIBCPP_STD_VER > 17
-
-enum class memory_order : __memory_order_underlying_t {
- relaxed = __mo_relaxed,
- consume = __mo_consume,
- acquire = __mo_acquire,
- release = __mo_release,
- acq_rel = __mo_acq_rel,
- seq_cst = __mo_seq_cst
-};
-
-inline constexpr auto memory_order_relaxed = memory_order::relaxed;
-inline constexpr auto memory_order_consume = memory_order::consume;
-inline constexpr auto memory_order_acquire = memory_order::acquire;
-inline constexpr auto memory_order_release = memory_order::release;
-inline constexpr auto memory_order_acq_rel = memory_order::acq_rel;
-inline constexpr auto memory_order_seq_cst = memory_order::seq_cst;
-
-#else
-
-typedef enum memory_order {
- memory_order_relaxed = __mo_relaxed,
- memory_order_consume = __mo_consume,
- memory_order_acquire = __mo_acquire,
- memory_order_release = __mo_release,
- memory_order_acq_rel = __mo_acq_rel,
- memory_order_seq_cst = __mo_seq_cst,
-} memory_order;
-
-#endif // _LIBCPP_STD_VER > 17
-
-template <typename _Tp> _LIBCPP_INLINE_VISIBILITY
-bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
- return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
-}
-
-static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
- "unexpected underlying type for std::memory_order");
-
-#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
- defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
-
-// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
-// the default operator= in an object is not volatile, a byte-by-byte copy
-// is required.
-template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
-__cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
- __a_value = __val;
-}
-template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
-__cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
- volatile char* __to = reinterpret_cast<volatile char*>(&__a_value);
- volatile char* __end = __to + sizeof(_Tp);
- volatile const char* __from = reinterpret_cast<volatile const char*>(&__val);
- while (__to != __end)
- *__to++ = *__from++;
-}
-
-#endif
-
-#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
-
-template <typename _Tp>
-struct __cxx_atomic_base_impl {
-
- _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
- __cxx_atomic_base_impl() _NOEXCEPT = default;
-#else
- __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
- : __a_value(value) {}
- _Tp __a_value;
-};
-
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) {
- // Avoid switch statement to make this a constexpr.
- return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
- (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
- (__order == memory_order_release ? __ATOMIC_RELEASE:
- (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
- (__order == memory_order_acq_rel ? __ATOMIC_ACQ_REL:
- __ATOMIC_CONSUME))));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
- // Avoid switch statement to make this a constexpr.
- return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
- (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
- (__order == memory_order_release ? __ATOMIC_RELAXED:
- (__order == memory_order_seq_cst ? __ATOMIC_SEQ_CST:
- (__order == memory_order_acq_rel ? __ATOMIC_ACQUIRE:
- __ATOMIC_CONSUME))));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
- __cxx_atomic_assign_volatile(__a->__a_value, __val);
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val) {
- __a->__a_value = __val;
-}
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_thread_fence(memory_order __order) {
- __atomic_thread_fence(__to_gcc_order(__order));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_signal_fence(memory_order __order) {
- __atomic_signal_fence(__to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
- memory_order __order) {
- __atomic_store(&__a->__a_value, &__val,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val,
- memory_order __order) {
- __atomic_store(&__a->__a_value, &__val,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a,
- memory_order __order) {
- _Tp __ret;
- __atomic_load(&__a->__a_value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __order) {
- _Tp __ret;
- __atomic_load(&__a->__a_value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __value, memory_order __order) {
- _Tp __ret;
- __atomic_exchange(&__a->__a_value, &__value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value,
- memory_order __order) {
- _Tp __ret;
- __atomic_exchange(&__a->__a_value, &__value, &__ret,
- __to_gcc_order(__order));
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(
- volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
- memory_order __success, memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- false,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(
- __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
- memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- false,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(
- volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
- memory_order __success, memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- true,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(
- __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
- memory_order __failure) {
- return __atomic_compare_exchange(&__a->__a_value, __expected, &__value,
- true,
- __to_gcc_order(__success),
- __to_gcc_failure_order(__failure));
-}
-
-template <typename _Tp>
-struct __skip_amt { enum {value = 1}; };
-
-template <typename _Tp>
-struct __skip_amt<_Tp*> { enum {value = sizeof(_Tp)}; };
-
-// FIXME: Haven't figured out what the spec says about using arrays with
-// atomic_fetch_add. Force a failure rather than creating bad behavior.
-template <typename _Tp>
-struct __skip_amt<_Tp[]> { };
-template <typename _Tp, int n>
-struct __skip_amt<_Tp[n]> { };
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Td __delta, memory_order __order) {
- return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
- memory_order __order) {
- return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Td __delta, memory_order __order) {
- return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
- memory_order __order) {
- return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_and(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_and(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_or(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
- memory_order __order) {
- return __atomic_fetch_or(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a,
- _Tp __pattern, memory_order __order) {
- return __atomic_fetch_xor(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
- memory_order __order) {
- return __atomic_fetch_xor(&__a->__a_value, __pattern,
- __to_gcc_order(__order));
-}
-
-#define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0)
-
-#elif defined(_LIBCPP_HAS_C_ATOMIC_IMP)
-
-template <typename _Tp>
-struct __cxx_atomic_base_impl {
-
- _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
- __cxx_atomic_base_impl() _NOEXCEPT = default;
-#else
- __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT
- : __a_value(__value) {}
- _LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
-};
-
-#define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s)
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_thread_fence(memory_order __order) _NOEXCEPT {
- __c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline
-void __cxx_atomic_signal_fence(memory_order __order) _NOEXCEPT {
- __c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) _NOEXCEPT {
- __c11_atomic_init(&__a->__a_value, __val);
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) _NOEXCEPT {
- __c11_atomic_init(&__a->__a_value, __val);
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) _NOEXCEPT {
- __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) _NOEXCEPT {
- __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
- using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
- return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
- using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
- return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) _NOEXCEPT {
- return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) _NOEXCEPT {
- return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
-}
-
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
- // Avoid switch statement to make this a constexpr.
- return __order == memory_order_release ? memory_order_relaxed:
- (__order == memory_order_acq_rel ? memory_order_acquire:
- __order);
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
- return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
- return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
-}
-
-#endif // _LIBCPP_HAS_GCC_ATOMIC_IMP, _LIBCPP_HAS_C_ATOMIC_IMP
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp kill_dependency(_Tp __y) _NOEXCEPT
-{
- return __y;
-}
-
-#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
-# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
-# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
-#endif
-# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
-# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
-# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
-# define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
-# define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
-# define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
-# define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
-# define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
-#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
-# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
-# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE
-#endif
-# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
-# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
-# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
-# define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
-# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
-# define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
-# define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
-# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
-#endif
-
-template <class _Tp>
-struct __libcpp_is_always_lock_free {
- // __atomic_always_lock_free is available in all Standard modes
- static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
-};
-
-#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
-
-template<typename _Tp>
-struct __cxx_atomic_lock_impl {
-
- _LIBCPP_INLINE_VISIBILITY
- __cxx_atomic_lock_impl() _NOEXCEPT
- : __a_value(), __a_lock(0) {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit
- __cxx_atomic_lock_impl(_Tp value) _NOEXCEPT
- : __a_value(value), __a_lock(0) {}
-
- _Tp __a_value;
- mutable __cxx_atomic_base_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_lock;
-
- _LIBCPP_INLINE_VISIBILITY void __lock() const volatile {
- while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
- /*spin*/;
- }
- _LIBCPP_INLINE_VISIBILITY void __lock() const {
- while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
- /*spin*/;
- }
- _LIBCPP_INLINE_VISIBILITY void __unlock() const volatile {
- __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
- }
- _LIBCPP_INLINE_VISIBILITY void __unlock() const {
- __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
- }
- _LIBCPP_INLINE_VISIBILITY _Tp __read() const volatile {
- __lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a_value);
- __unlock();
- return __old;
- }
- _LIBCPP_INLINE_VISIBILITY _Tp __read() const {
- __lock();
- _Tp __old = __a_value;
- __unlock();
- return __old;
- }
-};
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
- __cxx_atomic_assign_volatile(__a->__a_value, __val);
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_init(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) {
- __a->__a_value = __val;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
- __a->__lock();
- __cxx_atomic_assign_volatile(__a->__a_value, __val);
- __a->__unlock();
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) {
- __a->__lock();
- __a->__a_value = __val;
- __a->__unlock();
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const volatile __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
- return __a->__read();
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_load(const __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
- return __a->__read();
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, __value);
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value = __value;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- _Tp __temp;
- __a->__lock();
- __cxx_atomic_assign_volatile(__temp, __a->__a_value);
- bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- __cxx_atomic_assign_volatile(__a->__a_value, __value);
- else
- __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
- __a->__unlock();
- return __ret;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- __a->__lock();
- bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
- else
- _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
- __a->__unlock();
- return __ret;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- _Tp __temp;
- __a->__lock();
- __cxx_atomic_assign_volatile(__temp, __a->__a_value);
- bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- __cxx_atomic_assign_volatile(__a->__a_value, __value);
- else
- __cxx_atomic_assign_volatile(*__expected, __a->__a_value);
- __a->__unlock();
- return __ret;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp* __expected, _Tp __value, memory_order, memory_order) {
- __a->__lock();
- bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
- if(__ret)
- _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
- else
- _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
- __a->__unlock();
- return __ret;
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old + __delta));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value += __delta;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a,
- ptrdiff_t __delta, memory_order) {
- __a->__lock();
- _Tp* __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, __old + __delta);
- __a->__unlock();
- return __old;
-}
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a,
- ptrdiff_t __delta, memory_order) {
- __a->__lock();
- _Tp* __old = __a->__a_value;
- __a->__a_value += __delta;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old - __delta));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a,
- _Td __delta, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value -= __delta;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old & __pattern));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value &= __pattern;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old | __pattern));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value |= __pattern;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old;
- __cxx_atomic_assign_volatile(__old, __a->__a_value);
- __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old ^ __pattern));
- __a->__unlock();
- return __old;
-}
-template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
- _Tp __pattern, memory_order) {
- __a->__lock();
- _Tp __old = __a->__a_value;
- __a->__a_value ^= __pattern;
- __a->__unlock();
- return __old;
-}
-
-template <typename _Tp,
- typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
- __cxx_atomic_base_impl<_Tp>,
- __cxx_atomic_lock_impl<_Tp> >::type>
-#else
-template <typename _Tp,
- typename _Base = __cxx_atomic_base_impl<_Tp> >
-#endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS
-struct __cxx_atomic_impl : public _Base {
- static_assert(is_trivially_copyable<_Tp>::value,
- "std::atomic<T> requires that 'T' be a trivially copyable type");
-
- _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT = default;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT
- : _Base(__value) {}
-};
-
-#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
- using __cxx_contention_t = int32_t;
-#else
- using __cxx_contention_t = int64_t;
-#endif // __linux__ || (_AIX && !__64BIT__)
-
-using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t);
-
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
-
-template <class _Atp, class _Fn>
-struct __libcpp_atomic_wait_backoff_impl {
- _Atp* __a;
- _Fn __test_fn;
- _LIBCPP_AVAILABILITY_SYNC
- _LIBCPP_INLINE_VISIBILITY bool operator()(chrono::nanoseconds __elapsed) const
- {
- if(__elapsed > chrono::microseconds(64))
- {
- auto const __monitor = std::__libcpp_atomic_monitor(__a);
- if(__test_fn())
- return true;
- std::__libcpp_atomic_wait(__a, __monitor);
- }
- else if(__elapsed > chrono::microseconds(4))
- __libcpp_thread_yield();
- else
- {} // poll
- return false;
- }
-};
-
-template <class _Atp, class _Fn>
-_LIBCPP_AVAILABILITY_SYNC
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn)
-{
- __libcpp_atomic_wait_backoff_impl<_Atp, typename decay<_Fn>::type> __backoff_fn = {__a, __test_fn};
- return std::__libcpp_thread_poll_with_backoff(__test_fn, __backoff_fn);
-}
-
-#else // _LIBCPP_HAS_NO_THREADS
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const volatile*) { }
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) { }
-template <class _Atp, class _Fn>
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
-{
- return __libcpp_thread_poll_with_backoff(__test_fn, __spinning_backoff_policy());
-}
-
-#endif // _LIBCPP_HAS_NO_THREADS
-
-template <class _Atp, class _Tp>
-struct __cxx_atomic_wait_test_fn_impl {
- _Atp* __a;
- _Tp __val;
- memory_order __order;
- _LIBCPP_INLINE_VISIBILITY bool operator()() const
- {
- return !std::__cxx_nonatomic_compare_equal(std::__cxx_atomic_load(__a, __order), __val);
- }
-};
-
-template <class _Atp, class _Tp>
-_LIBCPP_AVAILABILITY_SYNC
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order)
-{
- __cxx_atomic_wait_test_fn_impl<_Atp, _Tp> __test_fn = {__a, __val, __order};
- return std::__cxx_atomic_wait(__a, __test_fn);
-}
-
-// general atomic<T>
-
-template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
-struct __atomic_base // false
-{
- mutable __cxx_atomic_impl<_Tp> __a_;
-
-#if defined(__cpp_lib_atomic_is_always_lock_free)
- static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- bool is_lock_free() const volatile _NOEXCEPT
- {return __cxx_atomic_is_lock_free(sizeof(_Tp));}
- _LIBCPP_INLINE_VISIBILITY
- bool is_lock_free() const _NOEXCEPT
- {return static_cast<__atomic_base const volatile*>(this)->is_lock_free();}
- _LIBCPP_INLINE_VISIBILITY
- void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
- {std::__cxx_atomic_store(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
- {std::__cxx_atomic_store(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
- {return std::__cxx_atomic_load(&__a_, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
- {return std::__cxx_atomic_load(&__a_, __m);}
- _LIBCPP_INLINE_VISIBILITY
- operator _Tp() const volatile _NOEXCEPT {return load();}
- _LIBCPP_INLINE_VISIBILITY
- operator _Tp() const _NOEXCEPT {return load();}
- _LIBCPP_INLINE_VISIBILITY
- _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_exchange(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_exchange(&__a_, __d, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) volatile _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) volatile _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
-
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- {std::__cxx_atomic_wait(&__a_, __v, __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- {std::__cxx_atomic_wait(&__a_, __v, __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_one() volatile _NOEXCEPT
- {std::__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_one() _NOEXCEPT
- {std::__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() volatile _NOEXCEPT
- {std::__cxx_atomic_notify_all(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() _NOEXCEPT
- {std::__cxx_atomic_notify_all(&__a_);}
-
-#if _LIBCPP_STD_VER > 17
- _LIBCPP_INLINE_VISIBILITY constexpr
- __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
-#else
- _LIBCPP_INLINE_VISIBILITY
- __atomic_base() _NOEXCEPT = default;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
-
- __atomic_base(const __atomic_base&) = delete;
-};
-
-#if defined(__cpp_lib_atomic_is_always_lock_free)
-template <class _Tp, bool __b>
-_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
-#endif
-
-// atomic<Integral>
-
-template <class _Tp>
-struct __atomic_base<_Tp, true>
- : public __atomic_base<_Tp, false>
-{
- typedef __atomic_base<_Tp, false> __base;
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- __atomic_base() _NOEXCEPT = default;
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_and(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_and(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_or(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_or(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return std::__cxx_atomic_fetch_xor(&this->__a_, __op, __m);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return std::__cxx_atomic_fetch_xor(&this->__a_, __op, __m);}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++(int) volatile _NOEXCEPT {return fetch_add(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++(int) _NOEXCEPT {return fetch_add(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--(int) volatile _NOEXCEPT {return fetch_sub(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--(int) _NOEXCEPT {return fetch_sub(_Tp(1));}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++() volatile _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator++() _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--() volatile _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator--() _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator+=(_Tp __op) _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator-=(_Tp __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator&=(_Tp __op) _NOEXCEPT {return fetch_and(__op) & __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator|=(_Tp __op) _NOEXCEPT {return fetch_or(__op) | __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator^=(_Tp __op) _NOEXCEPT {return fetch_xor(__op) ^ __op;}
-};
-
-// atomic<T>
-
-template <class _Tp>
-struct atomic
- : public __atomic_base<_Tp>
-{
- typedef __atomic_base<_Tp> __base;
- typedef _Tp value_type;
- typedef value_type difference_type;
-
-#if _LIBCPP_STD_VER > 17
- _LIBCPP_INLINE_VISIBILITY
- atomic() = default;
-#else
- _LIBCPP_INLINE_VISIBILITY
- atomic() _NOEXCEPT = default;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator=(_Tp __d) volatile _NOEXCEPT
- {__base::store(__d); return __d;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp operator=(_Tp __d) _NOEXCEPT
- {__base::store(__d); return __d;}
-
- atomic& operator=(const atomic&) = delete;
- atomic& operator=(const atomic&) volatile = delete;
-};
-
-// atomic<T*>
-
-template <class _Tp>
-struct atomic<_Tp*>
- : public __atomic_base<_Tp*>
-{
- typedef __atomic_base<_Tp*> __base;
- typedef _Tp* value_type;
- typedef ptrdiff_t difference_type;
-
- _LIBCPP_INLINE_VISIBILITY
- atomic() _NOEXCEPT = default;
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
- {__base::store(__d); return __d;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator=(_Tp* __d) _NOEXCEPT
- {__base::store(__d); return __d;}
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_add(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
- // __atomic_fetch_add accepts function pointers, guard against them.
- static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
- return std::__cxx_atomic_fetch_sub(&this->__a_, __op, __m);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++(int) volatile _NOEXCEPT {return fetch_add(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++(int) _NOEXCEPT {return fetch_add(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--(int) volatile _NOEXCEPT {return fetch_sub(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--(int) _NOEXCEPT {return fetch_sub(1);}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++() volatile _NOEXCEPT {return fetch_add(1) + 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator++() _NOEXCEPT {return fetch_add(1) + 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--() volatile _NOEXCEPT {return fetch_sub(1) - 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator--() _NOEXCEPT {return fetch_sub(1) - 1;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator+=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator+=(ptrdiff_t __op) _NOEXCEPT {return fetch_add(__op) + __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
- _LIBCPP_INLINE_VISIBILITY
- _Tp* operator-=(ptrdiff_t __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
-
- atomic& operator=(const atomic&) = delete;
- atomic& operator=(const atomic&) volatile = delete;
-};
-
-// atomic_is_lock_free
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->is_lock_free();
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->is_lock_free();
-}
-
-// atomic_init
-
-template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
-void
-atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- std::__cxx_atomic_init(&__o->__a_, __d);
-}
-
-template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
-void
-atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- std::__cxx_atomic_init(&__o->__a_, __d);
-}
-
-// atomic_store
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- __o->store(__d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- __o->store(__d);
-}
-
-// atomic_store_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
-{
- __o->store(__d, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-void
-atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
-{
- __o->store(__d, __m);
-}
-
-// atomic_load
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->load();
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
-{
- return __o->load();
-}
-
-// atomic_load_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->load(__m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->load(__m);
-}
-
-// atomic_exchange
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->exchange(__d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->exchange(__d);
-}
-
-// atomic_exchange_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
-{
- return __o->exchange(__d, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
-{
- return __o->exchange(__d, __m);
-}
-
-// atomic_compare_exchange_weak
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_weak(*__e, __d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_weak(*__e, __d);
-}
-
-// atomic_compare_exchange_strong
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_strong(*__e, __d);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
-{
- return __o->compare_exchange_strong(*__e, __d);
-}
-
-// atomic_compare_exchange_weak_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
- typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_weak(*__e, __d, __s, __f);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_weak(*__e, __d, __s, __f);
-}
-
-// atomic_compare_exchange_strong_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_strong(*__e, __d, __s, __f);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-bool
-atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
- typename atomic<_Tp>::value_type __d,
- memory_order __s, memory_order __f) _NOEXCEPT
- _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
-{
- return __o->compare_exchange_strong(*__e, __d, __s, __f);
-}
-
-// atomic_wait
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait(const volatile atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v) _NOEXCEPT
-{
- return __o->wait(__v);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait(const atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v) _NOEXCEPT
-{
- return __o->wait(__v);
-}
-
-// atomic_wait_explicit
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait_explicit(const volatile atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v,
- memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->wait(__v, __m);
-}
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_wait_explicit(const atomic<_Tp>* __o,
- typename atomic<_Tp>::value_type __v,
- memory_order __m) _NOEXCEPT
- _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
-{
- return __o->wait(__v, __m);
-}
-
-// atomic_notify_one
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-
-// atomic_notify_all
-
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
-void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-
-// atomic_fetch_add
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_add(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp
-atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_add(__op);
-}
-
-// atomic_fetch_add_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_add(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_add(__op, __m);
-}
-
-// atomic_fetch_sub
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_sub(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
-{
- return __o->fetch_sub(__op);
-}
-
-// atomic_fetch_sub_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_sub(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_sub(__op, __m);
-}
-
-// atomic_fetch_and
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_and(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_and(__op);
-}
-
-// atomic_fetch_and_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_and(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_and(__op, __m);
-}
-
-// atomic_fetch_or
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_or(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_or(__op);
-}
-
-// atomic_fetch_or_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_or(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_or(__op, __m);
-}
-
-// atomic_fetch_xor
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_xor(__op);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
-{
- return __o->fetch_xor(__op);
-}
-
-// atomic_fetch_xor_explicit
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_xor(__op, __m);
-}
-
-template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
- _Tp
->::type
-atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
-{
- return __o->fetch_xor(__op, __m);
-}
-
-// flag type and operations
-
-typedef struct atomic_flag
-{
- __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_;
-
- _LIBCPP_INLINE_VISIBILITY
- bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
-
- _LIBCPP_INLINE_VISIBILITY
- bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
- _LIBCPP_INLINE_VISIBILITY
- bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
- _LIBCPP_INLINE_VISIBILITY
- void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
- {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
- _LIBCPP_INLINE_VISIBILITY
- void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
- {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
-
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
- {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
- {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_one() volatile _NOEXCEPT
- {__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_one() _NOEXCEPT
- {__cxx_atomic_notify_one(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_all() volatile _NOEXCEPT
- {__cxx_atomic_notify_all(&__a_);}
- _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
- void notify_all() _NOEXCEPT
- {__cxx_atomic_notify_all(&__a_);}
-
-#if _LIBCPP_STD_VER > 17
- _LIBCPP_INLINE_VISIBILITY constexpr
- atomic_flag() _NOEXCEPT : __a_(false) {}
-#else
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag() _NOEXCEPT = default;
-#endif
-
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
-
- atomic_flag(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) = delete;
- atomic_flag& operator=(const atomic_flag&) volatile = delete;
-
-} atomic_flag;
-
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT
-{
- return __o->test();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test(const atomic_flag* __o) _NOEXCEPT
-{
- return __o->test();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_explicit(const volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_explicit(const atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
-{
- return __o->test_and_set();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
-{
- return __o->test_and_set();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test_and_set(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- return __o->test_and_set(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
-{
- __o->clear();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
-{
- __o->clear();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- __o->clear(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
-{
- __o->clear(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT
-{
- __o->wait(__v);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT
-{
- __o->wait(__v);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait_explicit(const volatile atomic_flag* __o,
- bool __v, memory_order __m) _NOEXCEPT
-{
- __o->wait(__v, __m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_wait_explicit(const atomic_flag* __o,
- bool __v, memory_order __m) _NOEXCEPT
-{
- __o->wait(__v, __m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_one();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
-void
-atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT
-{
- __o->notify_all();
-}
-
-// fences
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_thread_fence(memory_order __m) _NOEXCEPT
-{
- __cxx_atomic_thread_fence(__m);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void
-atomic_signal_fence(memory_order __m) _NOEXCEPT
-{
- __cxx_atomic_signal_fence(__m);
-}
-
-// Atomics for standard typedef types
-
-typedef atomic<bool> atomic_bool;
-typedef atomic<char> atomic_char;
-typedef atomic<signed char> atomic_schar;
-typedef atomic<unsigned char> atomic_uchar;
-typedef atomic<short> atomic_short;
-typedef atomic<unsigned short> atomic_ushort;
-typedef atomic<int> atomic_int;
-typedef atomic<unsigned int> atomic_uint;
-typedef atomic<long> atomic_long;
-typedef atomic<unsigned long> atomic_ulong;
-typedef atomic<long long> atomic_llong;
-typedef atomic<unsigned long long> atomic_ullong;
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-typedef atomic<char8_t> atomic_char8_t;
-#endif
-typedef atomic<char16_t> atomic_char16_t;
-typedef atomic<char32_t> atomic_char32_t;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef atomic<wchar_t> atomic_wchar_t;
-#endif
-
-typedef atomic<int_least8_t> atomic_int_least8_t;
-typedef atomic<uint_least8_t> atomic_uint_least8_t;
-typedef atomic<int_least16_t> atomic_int_least16_t;
-typedef atomic<uint_least16_t> atomic_uint_least16_t;
-typedef atomic<int_least32_t> atomic_int_least32_t;
-typedef atomic<uint_least32_t> atomic_uint_least32_t;
-typedef atomic<int_least64_t> atomic_int_least64_t;
-typedef atomic<uint_least64_t> atomic_uint_least64_t;
-
-typedef atomic<int_fast8_t> atomic_int_fast8_t;
-typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
-typedef atomic<int_fast16_t> atomic_int_fast16_t;
-typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
-typedef atomic<int_fast32_t> atomic_int_fast32_t;
-typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
-typedef atomic<int_fast64_t> atomic_int_fast64_t;
-typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
-
-typedef atomic< int8_t> atomic_int8_t;
-typedef atomic<uint8_t> atomic_uint8_t;
-typedef atomic< int16_t> atomic_int16_t;
-typedef atomic<uint16_t> atomic_uint16_t;
-typedef atomic< int32_t> atomic_int32_t;
-typedef atomic<uint32_t> atomic_uint32_t;
-typedef atomic< int64_t> atomic_int64_t;
-typedef atomic<uint64_t> atomic_uint64_t;
-
-typedef atomic<intptr_t> atomic_intptr_t;
-typedef atomic<uintptr_t> atomic_uintptr_t;
-typedef atomic<size_t> atomic_size_t;
-typedef atomic<ptrdiff_t> atomic_ptrdiff_t;
-typedef atomic<intmax_t> atomic_intmax_t;
-typedef atomic<uintmax_t> atomic_uintmax_t;
-
-// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
-
-#ifdef __cpp_lib_atomic_is_always_lock_free
-# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
-#else
-# define _LIBCPP_CONTENTION_LOCK_FREE false
-#endif
-
-#if ATOMIC_LLONG_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long> __libcpp_unsigned_lock_free;
-#elif ATOMIC_INT_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int> __libcpp_unsigned_lock_free;
-#elif ATOMIC_SHORT_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short> __libcpp_unsigned_lock_free;
-#elif ATOMIC_CHAR_LOCK_FREE == 2
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char> __libcpp_signed_lock_free;
-typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char> __libcpp_unsigned_lock_free;
-#else
- // No signed/unsigned lock-free types
-#define _LIBCPP_NO_LOCK_FREE_TYPES
-#endif
-
-#if !defined(_LIBCPP_NO_LOCK_FREE_TYPES)
-typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free;
-typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free;
-#endif
-
-#define ATOMIC_FLAG_INIT {false}
-#define ATOMIC_VAR_INIT(__v) {__v}
-
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1400
-# pragma clang deprecated(ATOMIC_VAR_INIT)
-# endif
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-
-_LIBCPP_END_NAMESPACE_STD
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <compare>
+# include <cstring>
# include <type_traits>
#endif
diff --git a/third_party/llvm-project/libcxx/include/barrier b/third_party/llvm-project/libcxx/include/barrier
index 2e8906b..ebaff8b 100644
--- a/third_party/llvm-project/libcxx/include/barrier
+++ b/third_party/llvm-project/libcxx/include/barrier
@@ -46,13 +46,18 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__atomic/atomic_base.h>
+#include <__atomic/memory_order.h>
#include <__availability>
#include <__config>
#include <__memory/unique_ptr.h>
+#include <__thread/poll_with_backoff.h>
#include <__thread/timed_backoff_policy.h>
#include <__utility/move.h>
-#include <atomic>
+#include <cstddef>
+#include <cstdint>
#include <limits>
+#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -130,7 +135,7 @@
__expected_adjustment_(0), __completion_(std::move(__completion)), __phase_(0)
{
}
- [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+ [[__nodiscard__]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
arrival_token arrive(ptrdiff_t __update)
{
auto const __old_phase = __phase_.load(memory_order_relaxed);
@@ -300,7 +305,7 @@
barrier(barrier const&) = delete;
barrier& operator=(barrier const&) = delete;
- [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+ [[__nodiscard__]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
arrival_token arrive(ptrdiff_t __update = 1)
{
return __b_.arrive(__update);
@@ -329,6 +334,7 @@
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
# include <iterator>
# include <memory>
diff --git a/third_party/llvm-project/libcxx/include/bit b/third_party/llvm-project/libcxx/include/bit
index d17a6e4..6b35bb2 100644
--- a/third_party/llvm-project/libcxx/include/bit
+++ b/third_party/llvm-project/libcxx/include/bit
@@ -83,6 +83,7 @@
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <type_traits>
diff --git a/third_party/llvm-project/libcxx/include/bitset b/third_party/llvm-project/libcxx/include/bitset
index c260f9f..fc8ffb8 100644
--- a/third_party/llvm-project/libcxx/include/bitset
+++ b/third_party/llvm-project/libcxx/include/bitset
@@ -795,11 +795,11 @@
if (__str[__i] != __zero && __str[__i] != __one)
__throw_invalid_argument("bitset string ctor has invalid argument");
- size_t _Mp = _VSTD::min(__rlen, _Size);
+ size_t __mp = _VSTD::min(__rlen, _Size);
size_t __i = 0;
- for (; __i < _Mp; ++__i)
+ for (; __i < __mp; ++__i)
{
- _CharT __c = __str[_Mp - 1 - __i];
+ _CharT __c = __str[__mp - 1 - __i];
(*this)[__i] = (__c == __one);
}
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
@@ -821,11 +821,11 @@
if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
__throw_invalid_argument("bitset string ctor has invalid argument");
- size_t _Mp = _VSTD::min(__rlen, _Size);
+ size_t __mp = _VSTD::min(__rlen, _Size);
size_t __i = 0;
- for (; __i < _Mp; ++__i)
+ for (; __i < __mp; ++__i)
{
- _CharT __c = __str[__pos + _Mp - 1 - __i];
+ _CharT __c = __str[__pos + __mp - 1 - __i];
(*this)[__i] = _Traits::eq(__c, __one);
}
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
@@ -956,8 +956,8 @@
if (__pos >= _Size)
__throw_out_of_range("bitset flip argument out of range");
- reference r = base::__make_ref(__pos);
- r = ~r;
+ reference __r = base::__make_ref(__pos);
+ __r = ~__r;
return *this;
}
@@ -1154,6 +1154,8 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
+# include <type_traits>
#endif
#endif // _LIBCPP_BITSET
diff --git a/third_party/llvm-project/libcxx/include/charconv b/third_party/llvm-project/libcxx/include/charconv
index 9c74ce3..3b14237 100644
--- a/third_party/llvm-project/libcxx/include/charconv
+++ b/third_party/llvm-project/libcxx/include/charconv
@@ -63,785 +63,42 @@
constexpr from_chars_result from_chars(const char* first, const char* last,
see below& value, int base = 10); // constexpr since C++23
- from_chars_result from_chars(const char* first, const char* last,
- float& value,
- chars_format fmt = chars_format::general);
- from_chars_result from_chars(const char* first, const char* last,
- double& value,
- chars_format fmt = chars_format::general);
- from_chars_result from_chars(const char* first, const char* last,
- long double& value,
- chars_format fmt = chars_format::general);
-
} // namespace std
*/
-#include <__algorithm/copy_n.h>
#include <__assert> // all public C++ headers provide the assertion handler
-#include <__availability>
-#include <__bit/countl.h>
#include <__charconv/chars_format.h>
+#include <__charconv/from_chars_integral.h>
#include <__charconv/from_chars_result.h>
#include <__charconv/tables.h>
+#include <__charconv/to_chars.h>
#include <__charconv/to_chars_base_10.h>
+#include <__charconv/to_chars_floating_point.h>
+#include <__charconv/to_chars_integral.h>
#include <__charconv/to_chars_result.h>
+#include <__charconv/traits.h>
#include <__config>
#include <__debug>
-#include <__errc>
-#include <__memory/addressof.h>
-#include <__type_traits/make_32_64_or_128_bit.h>
-#include <__utility/unreachable.h>
+#include <__system_error/errc.h>
#include <cmath> // for log2f
#include <cstdint>
-#include <cstdlib>
-#include <cstring>
#include <limits>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
-
-to_chars_result to_chars(char*, char*, bool, int = 10) = delete;
-from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete;
-
-namespace __itoa
-{
-
-template <typename _Tp, typename = void>
-struct _LIBCPP_HIDDEN __traits_base;
-
-template <typename _Tp>
-struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uint32_t)>>
-{
- using type = uint32_t;
-
- /// The width estimation using a log10 algorithm.
- ///
- /// The algorithm is based on
- /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
- /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
- /// function requires its input to have at least one bit set the value of
- /// zero is set to one. This means the first element of the lookup table is
- /// zero.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v)
- {
- auto __t = (32 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
- return __t - (__v < __itoa::__pow10_32[__t]) + 1;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v)
- {
- return __itoa::__base_10_u32(__p, __v);
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_32)& __pow() { return __itoa::__pow10_32; }
-};
-
-template <typename _Tp>
-struct _LIBCPP_HIDDEN
- __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(uint64_t)>> {
- using type = uint64_t;
-
- /// The width estimation using a log10 algorithm.
- ///
- /// The algorithm is based on
- /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
- /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
- /// function requires its input to have at least one bit set the value of
- /// zero is set to one. This means the first element of the lookup table is
- /// zero.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
- auto __t = (64 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
- return __t - (__v < __itoa::__pow10_64[__t]) + 1;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u64(__p, __v); }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_64)& __pow() { return __itoa::__pow10_64; }
-};
-
-
-# ifndef _LIBCPP_HAS_NO_INT128
-template <typename _Tp>
-struct _LIBCPP_HIDDEN
- __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__uint128_t)> > {
- using type = __uint128_t;
-
- /// The width estimation using a log10 algorithm.
- ///
- /// The algorithm is based on
- /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
- /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
- /// function requires its input to have at least one bit set the value of
- /// zero is set to one. This means the first element of the lookup table is
- /// zero.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
- _LIBCPP_ASSERT(__v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
- // There's always a bit set in the upper 64-bits.
- auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
- _LIBCPP_ASSERT(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
- // __t is adjusted since the lookup table misses the lower entries.
- return __t - (__v < __itoa::__pow10_128[__t - __itoa::__pow10_128_offset]) + 1;
- }
-
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u128(__p, __v); }
-
- // TODO FMT This pow function should get an index.
- // By moving this to its own header it can be reused by the pow function in to_chars_base_10.
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI decltype(__pow10_128)& __pow() { return __itoa::__pow10_128; }
-};
-#endif
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)
-{
- auto __c = __a * __b;
- __r = __c;
- return __c > numeric_limits<unsigned char>::max();
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)
-{
- auto __c = __a * __b;
- __r = __c;
- return __c > numeric_limits<unsigned short>::max();
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)
-{
- static_assert(is_unsigned<_Tp>::value, "");
- return __builtin_mul_overflow(__a, __b, &__r);
-}
-
-template <typename _Tp, typename _Up>
-inline _LIBCPP_HIDE_FROM_ABI bool
-_LIBCPP_CONSTEXPR_SINCE_CXX23 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r)
-{
- return __itoa::__mul_overflowed(__a, static_cast<_Tp>(__b), __r);
-}
-
-template <typename _Tp>
-struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp>
-{
- static constexpr int digits = numeric_limits<_Tp>::digits10 + 1;
- using __traits_base<_Tp>::__pow;
- using typename __traits_base<_Tp>::type;
-
- // precondition: at least one non-zero character available
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI char const*
- __read(char const* __p, char const* __ep, type& __a, type& __b)
- {
- type __cprod[digits];
- int __j = digits - 1;
- int __i = digits;
- do
- {
- if (*__p < '0' || *__p > '9')
- break;
- __cprod[--__i] = *__p++ - '0';
- } while (__p != __ep && __i != 0);
-
- __a = __inner_product(__cprod + __i + 1, __cprod + __j, __pow() + 1,
- __cprod[__i]);
- if (__itoa::__mul_overflowed(__cprod[__j], __pow()[__j - __i], __b))
- --__p;
- return __p;
- }
-
- template <typename _It1, typename _It2, class _Up>
- static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Up
- __inner_product(_It1 __first1, _It1 __last1, _It2 __first2, _Up __init)
- {
- for (; __first1 < __last1; ++__first1, ++__first2)
- __init = __init + *__first1 * *__first2;
- return __init;
- }
-};
-
-} // namespace __itoa
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _Tp
-__complement(_Tp __x)
-{
- static_assert(is_unsigned<_Tp>::value, "cast to unsigned first");
- return _Tp(~__x + 1);
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type);
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, _Tp __value, true_type)
-{
- auto __x = std::__to_unsigned_like(__value);
- if (__value < 0 && __first != __last)
- {
- *__first++ = '-';
- __x = std::__complement(__x);
- }
-
- return std::__to_chars_itoa(__first, __last, __x, false_type());
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)
-{
- using __tx = __itoa::__traits<_Tp>;
- auto __diff = __last - __first;
-
- if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
- return {__tx::__convert(__first, __value), errc(0)};
- else
- return {__last, errc::value_too_large};
-}
-
-# ifndef _LIBCPP_HAS_NO_INT128
-template <>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_itoa(char* __first, char* __last, __uint128_t __value, false_type)
-{
- // When the value fits in 64-bits use the 64-bit code path. This reduces
- // the number of expensive calculations on 128-bit values.
- //
- // NOTE the 128-bit code path requires this optimization.
- if(__value <= numeric_limits<uint64_t>::max())
- return __to_chars_itoa(__first, __last, static_cast<uint64_t>(__value), false_type());
-
- using __tx = __itoa::__traits<__uint128_t>;
- auto __diff = __last - __first;
-
- if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
- return {__tx::__convert(__first, __value), errc(0)};
- else
- return {__last, errc::value_too_large};
-}
-#endif
-
-template <class _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type);
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
- true_type)
-{
- auto __x = std::__to_unsigned_like(__value);
- if (__value < 0 && __first != __last)
- {
- *__first++ = '-';
- __x = std::__complement(__x);
- }
-
- return std::__to_chars_integral(__first, __last, __x, __base, false_type());
-}
-
-namespace __itoa {
-
-template <unsigned _Base>
-struct _LIBCPP_HIDDEN __integral;
-
-template <>
-struct _LIBCPP_HIDDEN __integral<2> {
- template <typename _Tp>
- _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
- // If value == 0 still need one digit. If the value != this has no
- // effect since the code scans for the most significant bit set. (Note
- // that __libcpp_clz doesn't work for 0.)
- return numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1);
- }
-
- template <typename _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
- ptrdiff_t __cap = __last - __first;
- int __n = __width(__value);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- const unsigned __divisor = 16;
- while (__value > __divisor) {
- unsigned __c = __value % __divisor;
- __value /= __divisor;
- __p -= 4;
- std::copy_n(&__base_2_lut[4 * __c], 4, __p);
- }
- do {
- unsigned __c = __value % 2;
- __value /= 2;
- *--__p = "01"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
- }
-};
-
-template <>
-struct _LIBCPP_HIDDEN __integral<8> {
- template <typename _Tp>
- _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
- // If value == 0 still need one digit. If the value != this has no
- // effect since the code scans for the most significat bit set. (Note
- // that __libcpp_clz doesn't work for 0.)
- return ((numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1)) + 2) / 3;
- }
-
- template <typename _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
- ptrdiff_t __cap = __last - __first;
- int __n = __width(__value);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- unsigned __divisor = 64;
- while (__value > __divisor) {
- unsigned __c = __value % __divisor;
- __value /= __divisor;
- __p -= 2;
- std::copy_n(&__base_8_lut[2 * __c], 2, __p);
- }
- do {
- unsigned __c = __value % 8;
- __value /= 8;
- *--__p = "01234567"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
- }
-
-};
-
-template <>
-struct _LIBCPP_HIDDEN __integral<16> {
- template <typename _Tp>
- _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
- // If value == 0 still need one digit. If the value != this has no
- // effect since the code scans for the most significat bit set. (Note
- // that __libcpp_clz doesn't work for 0.)
- return (numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1) + 3) / 4;
- }
-
- template <typename _Tp>
- _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
- ptrdiff_t __cap = __last - __first;
- int __n = __width(__value);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- unsigned __divisor = 256;
- while (__value > __divisor) {
- unsigned __c = __value % __divisor;
- __value /= __divisor;
- __p -= 2;
- std::copy_n(&__base_16_lut[2 * __c], 2, __p);
- }
- if (__first != __last)
- do {
- unsigned __c = __value % 16;
- __value /= 16;
- *--__p = "0123456789abcdef"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
- }
-};
-
-} // namespace __itoa
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int
-__to_chars_integral_width(_Tp __value) {
- return __itoa::__integral<_Base>::__width(__value);
-}
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int
-__to_chars_integral_width(_Tp __value) {
- return std::__to_chars_integral_width<_Base>(static_cast<unsigned>(__value));
-}
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value) {
- return __itoa::__integral<_Base>::__to_chars(__first, __last, __value);
-}
-
-template <unsigned _Base, typename _Tp,
- typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value) {
- return std::__to_chars_integral<_Base>(__first, __last, static_cast<unsigned>(__value));
-}
-
-template <typename _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int
-__to_chars_integral_width(_Tp __value, unsigned __base) {
- _LIBCPP_ASSERT(__value >= 0, "The function requires a non-negative value.");
-
- unsigned __base_2 = __base * __base;
- unsigned __base_3 = __base_2 * __base;
- unsigned __base_4 = __base_2 * __base_2;
-
- int __r = 0;
- while (true) {
- if (__value < __base)
- return __r + 1;
- if (__value < __base_2)
- return __r + 2;
- if (__value < __base_3)
- return __r + 3;
- if (__value < __base_4)
- return __r + 4;
-
- __value /= __base_4;
- __r += 4;
- }
-
- __libcpp_unreachable();
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-__to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
- false_type)
-{
- if (__base == 10) [[likely]]
- return std::__to_chars_itoa(__first, __last, __value, false_type());
-
- switch (__base) {
- case 2:
- return std::__to_chars_integral<2>(__first, __last, __value);
- case 8:
- return std::__to_chars_integral<8>(__first, __last, __value);
- case 16:
- return std::__to_chars_integral<16>(__first, __last, __value);
- }
-
- ptrdiff_t __cap = __last - __first;
- int __n = std::__to_chars_integral_width(__value, __base);
- if (__n > __cap)
- return {__last, errc::value_too_large};
-
- __last = __first + __n;
- char* __p = __last;
- do {
- unsigned __c = __value % __base;
- __value /= __base;
- *--__p = "0123456789abcdefghijklmnopqrstuvwxyz"[__c];
- } while (__value != 0);
- return {__last, errc(0)};
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-to_chars(char* __first, char* __last, _Tp __value)
-{
- using _Type = __make_32_64_or_128_bit_t<_Tp>;
- static_assert(!is_same<_Type, void>::value, "unsupported integral type used in to_chars");
- return std::__to_chars_itoa(__first, __last, static_cast<_Type>(__value), is_signed<_Tp>());
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
-to_chars(char* __first, char* __last, _Tp __value, int __base)
-{
- _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
-
- using _Type = __make_32_64_or_128_bit_t<_Tp>;
- return std::__to_chars_integral(__first, __last, static_cast<_Type>(__value), __base, is_signed<_Tp>());
-}
-
-template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
-{
- using __tl = numeric_limits<_Tp>;
- decltype(std::__to_unsigned_like(__value)) __x;
-
- bool __neg = (__first != __last && *__first == '-');
- auto __r = __f(__neg ? __first + 1 : __first, __last, __x, __args...);
- switch (__r.ec)
- {
- case errc::invalid_argument:
- return {__first, __r.ec};
- case errc::result_out_of_range:
- return __r;
- default:
- break;
- }
-
- if (__neg)
- {
- if (__x <= std::__complement(std::__to_unsigned_like(__tl::min())))
- {
- __x = std::__complement(__x);
- std::copy_n(std::addressof(__x), 1, std::addressof(__value));
- return __r;
- }
- }
- else
- {
- if (__x <= std::__to_unsigned_like(__tl::max()))
- {
- __value = __x;
- return __r;
- }
- }
-
- return {__r.ptr, errc::result_out_of_range};
-}
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool
-__in_pattern(_Tp __c)
-{
- return '0' <= __c && __c <= '9';
-}
-
-struct _LIBCPP_HIDDEN __in_pattern_result
-{
- bool __ok;
- int __val;
-
- explicit _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI operator bool() const { return __ok; }
-};
-
-template <typename _Tp>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI __in_pattern_result
-__in_pattern(_Tp __c, int __base)
-{
- if (__base <= 10)
- return {'0' <= __c && __c < '0' + __base, __c - '0'};
- else if (std::__in_pattern(__c))
- return {true, __c - '0'};
- else if ('a' <= __c && __c < 'a' + __base - 10)
- return {true, __c - 'a' + 10};
- else
- return {'A' <= __c && __c < 'A' + __base - 10, __c - 'A' + 10};
-}
-
-template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f,
- _Ts... __args)
-{
- auto __find_non_zero = [](_It __firstit, _It __lastit) {
- for (; __firstit != __lastit; ++__firstit)
- if (*__firstit != '0')
- break;
- return __firstit;
- };
-
- auto __p = __find_non_zero(__first, __last);
- if (__p == __last || !std::__in_pattern(*__p, __args...))
- {
- if (__p == __first)
- return {__first, errc::invalid_argument};
- else
- {
- __value = 0;
- return {__p, {}};
- }
- }
-
- auto __r = __f(__p, __last, __value, __args...);
- if (__r.ec == errc::result_out_of_range)
- {
- for (; __r.ptr != __last; ++__r.ptr)
- {
- if (!std::__in_pattern(*__r.ptr, __args...))
- break;
- }
- }
-
- return __r;
-}
-
-template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
-{
- using __tx = __itoa::__traits<_Tp>;
- using __output_type = typename __tx::type;
-
- return std::__subject_seq_combinator(
- __first, __last, __value,
- [](const char* __f, const char* __l,
- _Tp& __val) -> from_chars_result {
- __output_type __a, __b;
- auto __p = __tx::__read(__f, __l, __a, __b);
- if (__p == __l || !std::__in_pattern(*__p))
- {
- __output_type __m = numeric_limits<_Tp>::max();
- if (__m >= __a && __m - __a >= __b)
- {
- __val = __a + __b;
- return {__p, {}};
- }
- }
- return {__p, errc::result_out_of_range};
- });
-}
-
-template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
-{
- using __t = decltype(std::__to_unsigned_like(__value));
- return std::__sign_combinator(__first, __last, __value, __from_chars_atoi<__t>);
-}
-
-
-/*
-// Code used to generate __from_chars_log2f_lut.
-#include <cmath>
-#include <iostream>
-#include <format>
-
-int main() {
- for (int i = 2; i <= 36; ++i)
- std::cout << std::format("{},\n", log2f(i));
-}
-*/
-/// log2f table for bases [2, 36].
-inline constexpr float __from_chars_log2f_lut[35] = {
- 1, 1.5849625, 2, 2.321928, 2.5849626, 2.807355, 3, 3.169925, 3.321928,
- 3.4594316, 3.5849626, 3.7004397, 3.807355, 3.9068906, 4, 4.087463, 4.169925, 4.2479277,
- 4.321928, 4.3923173, 4.4594316, 4.523562, 4.5849624, 4.643856, 4.70044, 4.7548876, 4.807355,
- 4.857981, 4.9068904, 4.9541965, 5, 5.044394, 5.087463, 5.129283, 5.169925};
-
-template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_integral(const char* __first, const char* __last, _Tp& __value,
- int __base)
-{
- if (__base == 10)
- return std::__from_chars_atoi(__first, __last, __value);
-
- return std::__subject_seq_combinator(
- __first, __last, __value,
- [](const char* __p, const char* __lastp, _Tp& __val,
- int __b) -> from_chars_result {
- using __tl = numeric_limits<_Tp>;
- // __base is always between 2 and 36 inclusive.
- auto __digits = __tl::digits / __from_chars_log2f_lut[__b - 2];
- _Tp __x = __in_pattern(*__p++, __b).__val, __y = 0;
-
- for (int __i = 1; __p != __lastp; ++__i, ++__p)
- {
- if (auto __c = __in_pattern(*__p, __b))
- {
- if (__i < __digits - 1)
- __x = __x * __b + __c.__val;
- else
- {
- if (!__itoa::__mul_overflowed(__x, __b, __x))
- ++__p;
- __y = __c.__val;
- break;
- }
- }
- else
- break;
- }
-
- if (__p == __lastp || !__in_pattern(*__p, __b))
- {
- if (__tl::max() - __x >= __y)
- {
- __val = __x + __y;
- return {__p, {}};
- }
- }
- return {__p, errc::result_out_of_range};
- },
- __base);
-}
-
-template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-__from_chars_integral(const char* __first, const char* __last, _Tp& __value,
- int __base)
-{
- using __t = decltype(std::__to_unsigned_like(__value));
- return std::__sign_combinator(__first, __last, __value,
- __from_chars_integral<__t>, __base);
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-from_chars(const char* __first, const char* __last, _Tp& __value)
-{
- return std::__from_chars_atoi(__first, __last, __value);
-}
-
-template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
-from_chars(const char* __first, const char* __last, _Tp& __value, int __base)
-{
- _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
- return std::__from_chars_integral(__first, __last, __value, __base);
-}
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, float __value);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, double __value);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, long double __value);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision);
-
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
-to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
-
-#endif // _LIBCPP_STD_VER > 14
-
_LIBCPP_END_NAMESPACE_STD
-_LIBCPP_POP_MACROS
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
+# include <cstring>
# include <iosfwd>
+# include <type_traits>
#endif
#endif // _LIBCPP_CHARCONV
diff --git a/third_party/llvm-project/libcxx/include/chrono b/third_party/llvm-project/libcxx/include/chrono
index 44073b5..b5d3b03 100644
--- a/third_party/llvm-project/libcxx/include/chrono
+++ b/third_party/llvm-project/libcxx/include/chrono
@@ -182,7 +182,7 @@
bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
- bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // removed in C++20
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
@@ -195,6 +195,10 @@
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+template<class Rep1, class Period1, class Rep2, class Period2>
+ requires three_way_comparable<typename CT::rep>
+ constexpr auto operator<=>(const duration<Rep1, Period1>& lhs,
+ const duration<Rep2, Period2>& rhs); // since C++20
// duration_cast
template <class ToDuration, class Rep, class Period>
@@ -231,7 +235,7 @@
template <class Clock, class Duration1, class Duration2>
bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); // removed in C++20
template <class Clock, class Duration1, class Duration2>
bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
@@ -240,6 +244,10 @@
bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+template<class Clock, class Duration1,
+ three_way_comparable_with<Duration1> Duration2>
+ constexpr auto operator<=>(const time_point<Clock, Duration1>& lhs,
+ const time_point<Clock, Duration2>& rhs); // since C++20
// time_point_cast (constexpr in C++14)
@@ -282,6 +290,10 @@
using sys_seconds = sys_time<seconds>; // C++20
using sys_days = sys_time<days>; // C++20
+template<class charT, class traits, class Duration> // C++20
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const sys_time<Duration>& tp);
+
class file_clock // C++20
{
public:
@@ -656,6 +668,10 @@
constexpr precision to_duration() const noexcept;
};
+template<class charT, class traits, class Duration>
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const hh_mm_ss<Duration>& hms); // C++20
+
// 26.10, 12/24 hour functions
constexpr bool is_am(hours const& h) noexcept;
constexpr bool is_pm(hours const& h) noexcept;
@@ -674,6 +690,8 @@
} // chrono
namespace std {
+ template<class Duration, class charT>
+ struct formatter<chrono::sys_time<Duration>, charT>; // C++20
template<class Rep, class Period, class charT>
struct formatter<chrono::duration<Rep, Period>, charT>; // C++20
template<class charT> struct formatter<chrono::day, charT>; // C++20
@@ -691,6 +709,8 @@
template<class charT> struct formatter<chrono::year_month_day_last, charT>; // C++20
template<class charT> struct formatter<chrono::year_month_weekday, charT>; // C++20
template<class charT> struct formatter<chrono::year_month_weekday_last, charT>; // C++20
+ template<class Rep, class Period, class charT>
+ struct formatter<chrono::hh_mm_ss<duration<Rep, Period>>, charT>; // C++20
} // namespace std
namespace chrono {
@@ -769,7 +789,7 @@
// [time.syn]
#include <compare>
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && _LIBCPP_STD_VER > 17
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && _LIBCPP_STD_VER >= 20
# include <__chrono/formatter.h>
# include <__chrono/ostream.h>
# include <__chrono/parser_std_format_spec.h>
@@ -782,7 +802,13 @@
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <bit>
# include <concepts>
+# include <cstring>
+#endif
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
+# include <charconv>
#endif
#endif // _LIBCPP_CHRONO
diff --git a/third_party/llvm-project/libcxx/include/cmath b/third_party/llvm-project/libcxx/include/cmath
index a27d0eb..e815b3a 100644
--- a/third_party/llvm-project/libcxx/include/cmath
+++ b/third_party/llvm-project/libcxx/include/cmath
@@ -311,6 +311,7 @@
#include <__type_traits/is_constant_evaluated.h>
#include <__type_traits/is_floating_point.h>
#include <__type_traits/is_same.h>
+#include <__type_traits/promote.h>
#include <__type_traits/remove_cv.h>
#include <version>
@@ -543,7 +544,7 @@
using ::tgammal _LIBCPP_USING_IF_EXISTS;
using ::truncl _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
inline _LIBCPP_INLINE_VISIBILITY float hypot( float __x, float __y, float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
inline _LIBCPP_INLINE_VISIBILITY double hypot( double __x, double __y, double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
@@ -782,7 +783,7 @@
return __builtin_scalbn(__x, __exp);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _Fp>
_LIBCPP_HIDE_FROM_ABI constexpr
_Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
@@ -823,7 +824,7 @@
_IsSame<_A3, __result_type>::value));
return std::__lerp((__result_type)__a, (__result_type)__b, (__result_type)__t);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/compare b/third_party/llvm-project/libcxx/include/compare
index 9272dbf..626c743 100644
--- a/third_party/llvm-project/libcxx/include/compare
+++ b/third_party/llvm-project/libcxx/include/compare
@@ -151,6 +151,7 @@
#include <__compare/ordering.h>
#include <__compare/partial_order.h>
#include <__compare/strong_order.h>
+#include <__compare/synth_three_way.h>
#include <__compare/three_way_comparable.h>
#include <__compare/weak_order.h>
#include <__config>
diff --git a/third_party/llvm-project/libcxx/include/complex b/third_party/llvm-project/libcxx/include/complex
index 760fbaa..26f189d 100644
--- a/third_party/llvm-project/libcxx/include/complex
+++ b/third_party/llvm-project/libcxx/include/complex
@@ -236,7 +236,6 @@
#include <cmath>
#include <iosfwd>
#include <stdexcept>
-#include <type_traits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -1522,7 +1521,7 @@
}
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// Literal suffix for complex number literals [complex.literals]
inline namespace literals
{
@@ -1565,4 +1564,8 @@
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <type_traits>
+#endif
+
#endif // _LIBCPP_COMPLEX
diff --git a/third_party/llvm-project/libcxx/include/condition_variable b/third_party/llvm-project/libcxx/include/condition_variable
index f13df1c..4135a20 100644
--- a/third_party/llvm-project/libcxx/include/condition_variable
+++ b/third_party/llvm-project/libcxx/include/condition_variable
@@ -107,10 +107,18 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__chrono/duration.h>
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
#include <__memory/shared_ptr.h>
#include <__memory/unique_ptr.h>
-#include <__mutex_base>
+#include <__mutex/lock_guard.h>
+#include <__mutex/mutex.h>
+#include <__mutex/tag_types.h>
+#include <__mutex/unique_lock.h>
+#include <__utility/move.h>
#include <version>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -202,7 +210,7 @@
unique_lock<mutex> __lk(*__mut);
__lock.unlock();
unique_ptr<_Lock, __lock_external> __lxx(&__lock);
- lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock);
+ lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock_t());
__cv_.wait(__lk);
} // __mut_.unlock(), __lock.lock()
@@ -224,7 +232,7 @@
unique_lock<mutex> __lk(*__mut);
__lock.unlock();
unique_ptr<_Lock, __lock_external> __lxx(&__lock);
- lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock);
+ lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock_t());
return __cv_.wait_until(__lk, __t);
} // __mut_.unlock(), __lock.lock()
@@ -269,8 +277,17 @@
#endif // !_LIBCPP_HAS_NO_THREADS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdint>
+# include <cstdlib>
+# include <cstring>
+# include <initializer_list>
+# include <new>
+# include <stdexcept>
+# include <system_error>
# include <type_traits>
+# include <typeinfo>
#endif
#endif // _LIBCPP_CONDITION_VARIABLE
diff --git a/third_party/llvm-project/libcxx/include/cstddef b/third_party/llvm-project/libcxx/include/cstddef
index e3c0669..a364e6e 100644
--- a/third_party/llvm-project/libcxx/include/cstddef
+++ b/third_party/llvm-project/libcxx/include/cstddef
@@ -66,7 +66,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
namespace std // purposefully not versioned
{
enum class byte : unsigned char {};
diff --git a/third_party/llvm-project/libcxx/include/cstdlib b/third_party/llvm-project/libcxx/include/cstdlib
index 25c9de5..ab2c159 100644
--- a/third_party/llvm-project/libcxx/include/cstdlib
+++ b/third_party/llvm-project/libcxx/include/cstdlib
@@ -144,7 +144,7 @@
using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
using ::quick_exit _LIBCPP_USING_IF_EXISTS;
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
#endif
diff --git a/third_party/llvm-project/libcxx/include/cstring b/third_party/llvm-project/libcxx/include/cstring
index c88d977..a9bdf4f 100644
--- a/third_party/llvm-project/libcxx/include/cstring
+++ b/third_party/llvm-project/libcxx/include/cstring
@@ -100,53 +100,6 @@
using ::strerror _LIBCPP_USING_IF_EXISTS;
using ::strlen _LIBCPP_USING_IF_EXISTS;
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const char* __str) {
- // GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.
- // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
-#ifdef _LIBCPP_COMPILER_GCC
- if (__libcpp_is_constant_evaluated()) {
- size_t __i = 0;
- for (; __str[__i] != '\0'; ++__i)
- ;
- return __i;
- }
-#endif
- return __builtin_strlen(__str);
-}
-
-template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int
-__constexpr_memcmp(const _Tp* __lhs, const _Tp* __rhs, size_t __count) {
-#ifdef _LIBCPP_COMPILER_GCC
- if (__libcpp_is_constant_evaluated()) {
- for (; __count; --__count, ++__lhs, ++__rhs) {
- if (*__lhs < *__rhs)
- return -1;
- if (*__rhs < *__lhs)
- return 1;
- }
- return 0;
- }
-#endif
- return __builtin_memcmp(__lhs, __rhs, __count);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const char*
-__constexpr_char_memchr(const char* __str, int __char, size_t __count) {
-#if __has_builtin(__builtin_char_memchr)
- return __builtin_char_memchr(__str, __char, __count);
-#else
- if (!__libcpp_is_constant_evaluated())
- return static_cast<const char*>(std::memchr(__str, __char, __count));
- for (; __count; --__count) {
- if (*__str == __char)
- return __str;
- ++__str;
- }
- return nullptr;
-#endif
-}
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CSTRING
diff --git a/third_party/llvm-project/libcxx/include/ctime b/third_party/llvm-project/libcxx/include/ctime
index 2293675..b61e19d 100644
--- a/third_party/llvm-project/libcxx/include/ctime
+++ b/third_party/llvm-project/libcxx/include/ctime
@@ -66,7 +66,7 @@
using ::size_t _LIBCPP_USING_IF_EXISTS;
using ::time_t _LIBCPP_USING_IF_EXISTS;
using ::tm _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
using ::timespec _LIBCPP_USING_IF_EXISTS;
#endif
using ::clock _LIBCPP_USING_IF_EXISTS;
@@ -78,7 +78,7 @@
using ::gmtime _LIBCPP_USING_IF_EXISTS;
using ::localtime _LIBCPP_USING_IF_EXISTS;
using ::strftime _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
using ::timespec_get _LIBCPP_USING_IF_EXISTS;
#endif
diff --git a/third_party/llvm-project/libcxx/include/deque b/third_party/llvm-project/libcxx/include/deque
index f2b8076..515c960 100644
--- a/third_party/llvm-project/libcxx/include/deque
+++ b/third_party/llvm-project/libcxx/include/deque
@@ -134,15 +134,18 @@
template <class T, class Allocator>
bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
template <class T, class Allocator>
- bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
template <class T, class Allocator>
- bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
+ bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); // removed in C++20
+template<class T, class Allocator>
+ synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
+ const deque<T, Allocator>& y); // since C++20
// specialized algorithms:
template <class T, class Allocator>
@@ -165,6 +168,7 @@
#include <__algorithm/equal.h>
#include <__algorithm/fill_n.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__algorithm/remove.h>
#include <__algorithm/remove_if.h>
@@ -177,6 +181,7 @@
#include <__iterator/prev.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/segmented_iterator.h>
+#include <__memory/addressof.h>
#include <__memory/allocator_destructor.h>
#include <__memory/pointer_traits.h>
#include <__memory/temp_value.h>
@@ -184,12 +189,14 @@
#include <__memory_resource/polymorphic_allocator.h>
#include <__split_buffer>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <limits>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -249,7 +256,7 @@
typedef _Reference reference;
_LIBCPP_HIDE_FROM_ABI __deque_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
: __m_iter_(nullptr), __ptr_(nullptr)
#endif
{}
@@ -564,7 +571,7 @@
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {}
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a);
#endif
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
@@ -713,7 +720,7 @@
_LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
_LIBCPP_HIDE_FROM_ABI void push_back(const value_type& __v);
#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args> _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args);
template <class... _Args> _LIBCPP_HIDE_FROM_ABI reference emplace_back (_Args&&... __args);
#else
@@ -952,7 +959,7 @@
__append(__n);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
@@ -1314,7 +1321,7 @@
template <class _Tp, class _Allocator>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename deque<_Tp, _Allocator>::reference
#else
void
@@ -1328,7 +1335,7 @@
__alloc_traits::construct(__a, _VSTD::addressof(*end()),
_VSTD::forward<_Args>(__args)...);
++__size();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *--end();
#endif
}
@@ -1349,7 +1356,7 @@
template <class _Tp, class _Allocator>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename deque<_Tp, _Allocator>::reference
#else
void
@@ -1363,7 +1370,7 @@
__alloc_traits::construct(__a, _VSTD::addressof(*--begin()), _VSTD::forward<_Args>(__args)...);
--__start_;
++__size();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *begin();
#endif
}
@@ -1879,13 +1886,13 @@
__buf(std::max<size_type>(2* __map_.capacity(),
__nb + __map_.size()),
0, __map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __nb > 0; --__nb)
__buf.push_back(__alloc_traits::allocate(__a, __block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1894,7 +1901,7 @@
__alloc_traits::deallocate(__a, *__i, __block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __back_capacity > 0; --__back_capacity)
{
__buf.push_back(__map_.back());
@@ -2021,13 +2028,13 @@
__nb + __map_.size()),
__map_.size() - __front_capacity,
__map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __nb > 0; --__nb)
__buf.push_back(__alloc_traits::allocate(__a, __block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2036,7 +2043,7 @@
__alloc_traits::deallocate(__a, *__i, __block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __front_capacity > 0; --__front_capacity)
{
__buf.push_back(__map_.front());
@@ -2342,6 +2349,8 @@
return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
bool
@@ -2382,6 +2391,19 @@
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template<class _Tp, class _Allocator>
+inline _LIBCPP_HIDE_FROM_ABI
+__synth_three_way_result<_Tp>
+operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
+{
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
void
@@ -2391,7 +2413,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
@@ -2415,11 +2437,11 @@
inline constexpr bool __format::__enable_insertable<std::deque<wchar_t>> = true;
#endif
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
@@ -2434,9 +2456,11 @@
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iosfwd>
# include <iterator>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/third_party/llvm-project/libcxx/include/exception b/third_party/llvm-project/libcxx/include/exception
index e0f4268..97fee97 100644
--- a/third_party/llvm-project/libcxx/include/exception
+++ b/third_party/llvm-project/libcxx/include/exception
@@ -77,307 +77,20 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
-#include <__availability>
#include <__config>
-#include <__memory/addressof.h>
-#include <__type_traits/decay.h>
-#include <__type_traits/is_base_of.h>
-#include <__type_traits/is_class.h>
-#include <__type_traits/is_convertible.h>
-#include <__type_traits/is_copy_constructible.h>
-#include <__type_traits/is_final.h>
-#include <__type_traits/is_polymorphic.h>
-#include <cstddef>
-#include <cstdlib>
+#include <__exception/exception.h>
+#include <__exception/exception_ptr.h>
+#include <__exception/nested_exception.h>
+#include <__exception/operations.h>
+#include <__exception/terminate.h>
#include <version>
-// <vcruntime_exception.h> defines its own std::exception and std::bad_exception types,
-// which we use in order to be ABI-compatible with other STLs on Windows.
-#if defined(_LIBCPP_ABI_VCRUNTIME)
-# include <vcruntime_exception.h>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-namespace std // purposefully not using versioning namespace
-{
-
-#if defined(_LIBCPP_ABI_VCRUNTIME) && (!defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS != 0)
-// The std::exception class was already included above, but we're explicit about this condition here for clarity.
-
-#elif defined(_LIBCPP_ABI_VCRUNTIME) && _HAS_EXCEPTIONS == 0
-// However, <vcruntime_exception.h> does not define std::exception and std::bad_exception
-// when _HAS_EXCEPTIONS == 0.
-//
-// Since libc++ still wants to provide the std::exception hierarchy even when _HAS_EXCEPTIONS == 0
-// (after all those are simply types like any other), we define an ABI-compatible version
-// of the VCRuntime std::exception and std::bad_exception types in that mode.
-
-struct __std_exception_data {
- char const* _What;
- bool _DoFree;
-};
-
-class exception { // base of all library exceptions
-public:
- exception() _NOEXCEPT : __data_() {}
-
- explicit exception(char const* __message) _NOEXCEPT : __data_() {
- __data_._What = __message;
- __data_._DoFree = true;
- }
-
- exception(exception const&) _NOEXCEPT {}
-
- exception& operator=(exception const&) _NOEXCEPT { return *this; }
-
- virtual ~exception() _NOEXCEPT {}
-
- virtual char const* what() const _NOEXCEPT { return __data_._What ? __data_._What : "Unknown exception"; }
-
-private:
- __std_exception_data __data_;
-};
-
-class bad_exception : public exception {
-public:
- bad_exception() _NOEXCEPT : exception("bad exception") {}
-};
-
-#else // !defined(_LIBCPP_ABI_VCRUNTIME)
-// On all other platforms, we define our own std::exception and std::bad_exception types
-// regardless of whether exceptions are turned on as a language feature.
-
-class _LIBCPP_EXCEPTION_ABI exception {
-public:
- _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY exception(const exception&) _NOEXCEPT = default;
-
- virtual ~exception() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
-};
-
-class _LIBCPP_EXCEPTION_ABI bad_exception : public exception {
-public:
- _LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
- ~bad_exception() _NOEXCEPT override;
- const char* what() const _NOEXCEPT override;
-};
-#endif // !_LIBCPP_ABI_VCRUNTIME
-
-#if _LIBCPP_STD_VER <= 14 \
- || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \
- || defined(_LIBCPP_BUILDING_LIBRARY)
-typedef void (*unexpected_handler)();
-_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
-#endif
-
-typedef void (*terminate_handler)();
-_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
-
-_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
-
-class _LIBCPP_TYPE_VIS exception_ptr;
-
-_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
-
-#ifndef _LIBCPP_ABI_MICROSOFT
-
-class _LIBCPP_TYPE_VIS exception_ptr
-{
- void* __ptr_;
-public:
- _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
- _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
-
- exception_ptr(const exception_ptr&) _NOEXCEPT;
- exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
- ~exception_ptr() _NOEXCEPT;
-
- _LIBCPP_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT
- {return __ptr_ != nullptr;}
-
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
- {return __x.__ptr_ == __y.__ptr_;}
-
- friend _LIBCPP_INLINE_VISIBILITY
- bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
- {return !(__x == __y);}
-
- friend _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
- friend _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
-};
-
-template<class _Ep>
-_LIBCPP_INLINE_VISIBILITY exception_ptr
-make_exception_ptr(_Ep __e) _NOEXCEPT
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
- throw __e;
- }
- catch (...)
- {
- return current_exception();
- }
-#else
- ((void)__e);
- _VSTD::abort();
-#endif
-}
-
-#else // _LIBCPP_ABI_MICROSOFT
-
-class _LIBCPP_TYPE_VIS exception_ptr
-{
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
- void* __ptr1_;
- void* __ptr2_;
-_LIBCPP_DIAGNOSTIC_POP
-public:
- exception_ptr() _NOEXCEPT;
- exception_ptr(nullptr_t) _NOEXCEPT;
- exception_ptr(const exception_ptr& __other) _NOEXCEPT;
- exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
- exception_ptr& operator=(nullptr_t) _NOEXCEPT;
- ~exception_ptr() _NOEXCEPT;
- explicit operator bool() const _NOEXCEPT;
-};
-
-_LIBCPP_FUNC_VIS
-bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
- {return !(__x == __y);}
-
-_LIBCPP_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
-
-_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void *__except, const void* __ptr);
-_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
-
-// This is a built-in template function which automagically extracts the required
-// information.
-template <class _E> void *__GetExceptionInfo(_E);
-
-template<class _Ep>
-_LIBCPP_INLINE_VISIBILITY exception_ptr
-make_exception_ptr(_Ep __e) _NOEXCEPT
-{
- return __copy_exception_ptr(_VSTD::addressof(__e), __GetExceptionInfo(__e));
-}
-
-#endif // _LIBCPP_ABI_MICROSOFT
-// nested_exception
-
-class _LIBCPP_EXCEPTION_ABI nested_exception
-{
- exception_ptr __ptr_;
-public:
- nested_exception() _NOEXCEPT;
-// nested_exception(const nested_exception&) noexcept = default;
-// nested_exception& operator=(const nested_exception&) noexcept = default;
- virtual ~nested_exception() _NOEXCEPT;
-
- // access functions
- _LIBCPP_NORETURN void rethrow_nested() const;
- _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
-};
-
-template <class _Tp>
-struct __nested
- : public _Tp,
- public nested_exception
-{
- _LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
-};
-
-#ifndef _LIBCPP_NO_EXCEPTIONS
-template <class _Tp, class _Up, bool>
-struct __throw_with_nested;
-
-template <class _Tp, class _Up>
-struct __throw_with_nested<_Tp, _Up, true> {
- _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
- __do_throw(_Tp&& __t)
- {
- throw __nested<_Up>(static_cast<_Tp&&>(__t));
- }
-};
-
-template <class _Tp, class _Up>
-struct __throw_with_nested<_Tp, _Up, false> {
- _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
-#ifndef _LIBCPP_CXX03_LANG
- __do_throw(_Tp&& __t)
-#else
- __do_throw (_Tp& __t)
-#endif // _LIBCPP_CXX03_LANG
- {
- throw static_cast<_Tp&&>(__t);
- }
-};
-#endif
-
-template <class _Tp>
-_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
-void
-throw_with_nested(_Tp&& __t)
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- typedef typename decay<_Tp>::type _Up;
- static_assert( is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
- __throw_with_nested<_Tp, _Up,
- is_class<_Up>::value &&
- !is_base_of<nested_exception, _Up>::value &&
- !__libcpp_is_final<_Up>::value>::
- __do_throw(static_cast<_Tp&&>(__t));
-#else
- ((void)__t);
- // FIXME: Make this abort
-#endif
-}
-
-template <class _From, class _To>
-struct __can_dynamic_cast : _BoolConstant<
- is_polymorphic<_From>::value &&
- (!is_base_of<_To, _From>::value ||
- is_convertible<const _From*, const _To*>::value)> {};
-
-template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-rethrow_if_nested(const _Ep& __e,
- __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value>* = 0)
-{
- const nested_exception* __nep = dynamic_cast<const nested_exception*>(_VSTD::addressof(__e));
- if (__nep)
- __nep->rethrow_nested();
-}
-
-template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-rethrow_if_nested(const _Ep&,
- __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value>* = 0)
-{
-}
-
-} // namespace std
-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
# include <type_traits>
#endif
diff --git a/third_party/llvm-project/libcxx/include/experimental/__config b/third_party/llvm-project/libcxx/include/experimental/__config
index a71b348c..839b80a 100644
--- a/third_party/llvm-project/libcxx/include/experimental/__config
+++ b/third_party/llvm-project/libcxx/include/experimental/__config
@@ -32,18 +32,6 @@
#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
-#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
-#define _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES
-#endif
-
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \
- _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 {
-
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \
- } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
-
-#define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1
-
#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 {
diff --git a/third_party/llvm-project/libcxx/include/experimental/__memory b/third_party/llvm-project/libcxx/include/experimental/__memory
index b36f31e..b113696 100644
--- a/third_party/llvm-project/libcxx/include/experimental/__memory
+++ b/third_party/llvm-project/libcxx/include/experimental/__memory
@@ -12,9 +12,12 @@
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
#include <experimental/__config>
#include <experimental/utility> // for erased_type
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -90,7 +93,7 @@
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
{
- new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
+ new (__storage) _Tp (allocator_arg_t(), __a, _VSTD::forward<_Args>(__args)...);
}
// FIXME: This should have a version which takes a non-const alloc.
diff --git a/third_party/llvm-project/libcxx/include/experimental/algorithm b/third_party/llvm-project/libcxx/include/experimental/algorithm
deleted file mode 100644
index e0ca3c7..0000000
--- a/third_party/llvm-project/libcxx/include/experimental/algorithm
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_ALGORITHM
-#define _LIBCPP_EXPERIMENTAL_ALGORITHM
-
-/*
- experimental/algorithm synopsis
-
-#include <algorithm>
-
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-
-template <class ForwardIterator, class Searcher>
-ForwardIterator search(ForwardIterator first, ForwardIterator last,
- const Searcher &searcher);
-
-// sample removed because it's now part of C++17
-
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
-*/
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <__debug>
-#include <algorithm>
-#include <experimental/__config>
-#include <type_traits>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS
-
-template <class _ForwardIterator, class _Searcher>
-_LIBCPP_INLINE_VISIBILITY
-_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
-{ return __s(__f, __l).first; }
-
-_LIBCPP_END_NAMESPACE_LFTS
-
-#endif /* _LIBCPP_EXPERIMENTAL_ALGORITHM */
diff --git a/third_party/llvm-project/libcxx/include/experimental/coroutine b/third_party/llvm-project/libcxx/include/experimental/coroutine
deleted file mode 100644
index d9f3685..0000000
--- a/third_party/llvm-project/libcxx/include/experimental/coroutine
+++ /dev/null
@@ -1,344 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE
-#define _LIBCPP_EXPERIMENTAL_COROUTINE
-
-/**
- experimental/coroutine synopsis
-
-// C++next
-
-namespace std {
-namespace experimental {
-inline namespace coroutines_v1 {
-
- // 18.11.1 coroutine traits
-template <typename R, typename... ArgTypes>
-class coroutine_traits;
-// 18.11.2 coroutine handle
-template <typename Promise = void>
-class coroutine_handle;
-// 18.11.2.7 comparison operators:
-bool operator==(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator!=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator<(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator<=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator>=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator>(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-// 18.11.3 trivial awaitables
-struct suspend_never;
-struct suspend_always;
-// 18.11.2.8 hash support:
-template <class T> struct hash;
-template <class P> struct hash<coroutine_handle<P>>;
-
-} // namespace coroutines_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <__functional/hash.h>
-#include <__functional/operations.h>
-#include <cstddef>
-#include <experimental/__config>
-#include <new>
-#include <type_traits>
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <atomic>
-# include <climits>
-# include <cmath>
-# include <compare>
-# include <concepts>
-# include <ctime>
-# include <initializer_list>
-# include <iosfwd>
-# include <iterator>
-# include <memory>
-# include <ratio>
-# include <stdexcept>
-# include <tuple>
-# include <typeinfo>
-# include <utility>
-# include <variant>
-#endif
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#ifndef _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES
-
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES
-
-template <class _Tp, class = void>
-struct __coroutine_traits_sfinae {};
-
-template <class _Tp>
-struct __coroutine_traits_sfinae<_Tp, __void_t<typename _Tp::promise_type> >
-{
- using promise_type = typename _Tp::promise_type;
-};
-
-template <typename _Ret, typename... _Args>
-struct coroutine_traits
- : public __coroutine_traits_sfinae<_Ret>
-{
-};
-
-template <typename _Promise = void>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle;
-
-template <>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
-public:
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {}
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {}
-
- _LIBCPP_INLINE_VISIBILITY
- coroutine_handle& operator=(nullptr_t) _NOEXCEPT {
- __handle_ = nullptr;
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; }
-
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; }
-
- _LIBCPP_INLINE_VISIBILITY
- void operator()() { resume(); }
-
- _LIBCPP_INLINE_VISIBILITY
- void resume() {
- _LIBCPP_ASSERT(__is_suspended(),
- "resume() can only be called on suspended coroutines");
- _LIBCPP_ASSERT(!done(),
- "resume() has undefined behavior when the coroutine is done");
- __builtin_coro_resume(__handle_);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void destroy() {
- _LIBCPP_ASSERT(__is_suspended(),
- "destroy() can only be called on suspended coroutines");
- __builtin_coro_destroy(__handle_);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- bool done() const {
- _LIBCPP_ASSERT(__is_suspended(),
- "done() can only be called on suspended coroutines");
- return __builtin_coro_done(__handle_);
- }
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- static coroutine_handle from_address(void* __addr) _NOEXCEPT {
- coroutine_handle __tmp;
- __tmp.__handle_ = __addr;
- return __tmp;
- }
-
- // FIXME: Should from_address(nullptr) be allowed?
- _LIBCPP_INLINE_VISIBILITY
- static coroutine_handle from_address(nullptr_t) _NOEXCEPT {
- return coroutine_handle(nullptr);
- }
-
- template <class _Tp, bool _CallIsValid = false>
- static coroutine_handle from_address(_Tp*) {
- static_assert(_CallIsValid,
- "coroutine_handle<void>::from_address cannot be called with "
- "non-void pointers");
- }
-
-private:
- bool __is_suspended() const _NOEXCEPT {
- // FIXME actually implement a check for if the coro is suspended.
- return __handle_;
- }
-
- template <class _PromiseT> friend class coroutine_handle;
- void* __handle_;
-};
-
-// 18.11.2.7 comparison operators:
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
- return __x.address() == __y.address();
-}
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
- return !(__x == __y);
-}
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
- return less<void*>()(__x.address(), __y.address());
-}
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
- return __y < __x;
-}
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
- return !(__x > __y);
-}
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
- return !(__x < __y);
-}
-
-template <typename _Promise>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> {
- using _Base = coroutine_handle<>;
-public:
-#ifndef _LIBCPP_CXX03_LANG
- // 18.11.2.1 construct/reset
- using coroutine_handle<>::coroutine_handle;
-#else
- _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT : _Base() {}
- _LIBCPP_INLINE_VISIBILITY coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {}
-#endif
- _LIBCPP_INLINE_VISIBILITY
- coroutine_handle& operator=(nullptr_t) _NOEXCEPT {
- _Base::operator=(nullptr);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- _Promise& promise() const {
- return *static_cast<_Promise*>(
- __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false));
- }
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- static coroutine_handle from_address(void* __addr) _NOEXCEPT {
- coroutine_handle __tmp;
- __tmp.__handle_ = __addr;
- return __tmp;
- }
-
- // NOTE: this overload isn't required by the standard but is needed so
- // the deleted _Promise* overload doesn't make from_address(nullptr)
- // ambiguous.
- // FIXME: should from_address work with nullptr?
- _LIBCPP_INLINE_VISIBILITY
- static coroutine_handle from_address(nullptr_t) _NOEXCEPT {
- return coroutine_handle(nullptr);
- }
-
- template <class _Tp, bool _CallIsValid = false>
- static coroutine_handle from_address(_Tp*) {
- static_assert(_CallIsValid,
- "coroutine_handle<promise_type>::from_address cannot be called with "
- "non-void pointers");
- }
-
- template <bool _CallIsValid = false>
- static coroutine_handle from_address(_Promise*) {
- static_assert(_CallIsValid,
- "coroutine_handle<promise_type>::from_address cannot be used with "
- "pointers to the coroutine's promise type; use 'from_promise' instead");
- }
-
- _LIBCPP_INLINE_VISIBILITY
- static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT {
- typedef __remove_cv_t<_Promise> _RawPromise;
- coroutine_handle __tmp;
- __tmp.__handle_ = __builtin_coro_promise(
- _VSTD::addressof(const_cast<_RawPromise&>(__promise)),
- _LIBCPP_ALIGNOF(_Promise), true);
- return __tmp;
- }
-};
-
-#if __has_builtin(__builtin_coro_noop)
-struct noop_coroutine_promise {};
-
-template <>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise>
- : public coroutine_handle<> {
- using _Base = coroutine_handle<>;
- using _Promise = noop_coroutine_promise;
-public:
-
- _LIBCPP_INLINE_VISIBILITY
- _Promise& promise() const {
- return *static_cast<_Promise*>(
- __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false));
- }
-
- _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; }
- _LIBCPP_CONSTEXPR bool done() const _NOEXCEPT { return false; }
-
- _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()() const _NOEXCEPT {}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 void resume() const _NOEXCEPT {}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy() const _NOEXCEPT {}
-
-private:
- _LIBCPP_INLINE_VISIBILITY
- friend coroutine_handle<noop_coroutine_promise> noop_coroutine() _NOEXCEPT;
-
- _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT {
- this->__handle_ = __builtin_coro_noop();
- }
-};
-
-using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
-
-inline _LIBCPP_INLINE_VISIBILITY
-noop_coroutine_handle noop_coroutine() _NOEXCEPT {
- return noop_coroutine_handle();
-}
-#endif // __has_builtin(__builtin_coro_noop)
-
-struct suspend_never {
- _LIBCPP_INLINE_VISIBILITY
- bool await_ready() const _NOEXCEPT { return true; }
- _LIBCPP_INLINE_VISIBILITY
- void await_suspend(coroutine_handle<>) const _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY
- void await_resume() const _NOEXCEPT {}
-};
-
-struct suspend_always {
- _LIBCPP_INLINE_VISIBILITY
- bool await_ready() const _NOEXCEPT { return false; }
- _LIBCPP_INLINE_VISIBILITY
- void await_suspend(coroutine_handle<>) const _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY
- void await_resume() const _NOEXCEPT {}
-};
-
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp>
-struct hash<_VSTD_CORO::coroutine_handle<_Tp> > {
- using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>;
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(__arg_type const& __v) const _NOEXCEPT
- {return hash<void*>()(__v.address());}
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-
-#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */
diff --git a/third_party/llvm-project/libcxx/include/experimental/functional b/third_party/llvm-project/libcxx/include/experimental/functional
deleted file mode 100644
index cb9a5ef..0000000
--- a/third_party/llvm-project/libcxx/include/experimental/functional
+++ /dev/null
@@ -1,436 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_FUNCTIONAL
-#define _LIBCPP_EXPERIMENTAL_FUNCTIONAL
-
-/*
- experimental/functional synopsis
-
-#include <algorithm>
-
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
- // 4.3, Searchers
- template<class ForwardIterator, class BinaryPredicate = equal_to<>>
- class default_searcher;
-
- template<class RandomAccessIterator,
- class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
- class BinaryPredicate = equal_to<>>
- class boyer_moore_searcher;
-
- template<class RandomAccessIterator,
- class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
- class BinaryPredicate = equal_to<>>
- class boyer_moore_horspool_searcher;
-
- template<class ForwardIterator, class BinaryPredicate = equal_to<>>
- default_searcher<ForwardIterator, BinaryPredicate>
- make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
- BinaryPredicate pred = BinaryPredicate());
-
- template<class RandomAccessIterator,
- class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
- class BinaryPredicate = equal_to<>>
- boyer_moore_searcher<RandomAccessIterator, Hash, BinaryPredicate>
- make_boyer_moore_searcher(
- RandomAccessIterator pat_first, RandomAccessIterator pat_last,
- Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-
- template<class RandomAccessIterator,
- class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
- class BinaryPredicate = equal_to<>>
- boyer_moore_horspool_searcher<RandomAccessIterator, Hash, BinaryPredicate>
- make_boyer_moore_horspool_searcher(
- RandomAccessIterator pat_first, RandomAccessIterator pat_last,
- Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-
- } // namespace fundamentals_v1
- } // namespace experimental
-
-} // namespace std
-
-*/
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <__debug>
-#include <__functional/identity.h>
-#include <__memory/uses_allocator.h>
-#include <array>
-#include <experimental/__config>
-#include <functional>
-#include <type_traits>
-#include <unordered_map>
-#include <vector>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS
-
-#ifdef _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-# define _LIBCPP_DEPRECATED_DEFAULT_SEARCHER
-# define _LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER
-# define _LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER
-#else
-# define _LIBCPP_DEPRECATED_DEFAULT_SEARCHER _LIBCPP_DEPRECATED_("std::experimental::default_searcher will be removed in LLVM 17. Use std::default_searcher instead")
-# define _LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCPP_DEPRECATED_("std::experimental::boyer_moore_searcher will be removed in LLVM 17. Use std::boyer_moore_searcher instead")
-# define _LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCPP_DEPRECATED_("std::experimental::boyer_moore_horspool_searcher will be removed in LLVM 17. Use std::boyer_moore_horspool_searcher instead")
-#endif
-
-#if _LIBCPP_STD_VER > 11
-// default searcher
-template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-class _LIBCPP_DEPRECATED_DEFAULT_SEARCHER _LIBCPP_TEMPLATE_VIS default_searcher {
-public:
- _LIBCPP_INLINE_VISIBILITY
- default_searcher(_ForwardIterator __f, _ForwardIterator __l,
- _BinaryPredicate __p = _BinaryPredicate())
- : __first_(__f), __last_(__l), __pred_(__p) {}
-
- template <typename _ForwardIterator2>
- _LIBCPP_INLINE_VISIBILITY
- pair<_ForwardIterator2, _ForwardIterator2>
- operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
- {
- auto __proj = __identity();
- return std::__search_impl(__f, __l, __first_, __last_, __pred_, __proj, __proj);
- }
-
-private:
- _ForwardIterator __first_;
- _ForwardIterator __last_;
- _BinaryPredicate __pred_;
- };
-
-template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-_LIBCPP_DEPRECATED_DEFAULT_SEARCHER _LIBCPP_INLINE_VISIBILITY
-default_searcher<_ForwardIterator, _BinaryPredicate>
-make_default_searcher( _ForwardIterator __f, _ForwardIterator __l, _BinaryPredicate __p = _BinaryPredicate ())
-{
- return default_searcher<_ForwardIterator, _BinaryPredicate>(__f, __l, __p);
-}
-
-template<class _Key, class _Value, class _Hash, class _BinaryPredicate, bool /*useArray*/> class _BMSkipTable;
-
-// General case for BM data searching; use a map
-template<class _Key, typename _Value, class _Hash, class _BinaryPredicate>
-class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, false> {
- typedef _Value value_type;
- typedef _Key key_type;
-
- const _Value __default_value_;
- std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- _BMSkipTable(size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred)
- : __default_value_(__default), __table_(__sz, __hf, __pred) {}
-
- _LIBCPP_INLINE_VISIBILITY
- void insert(const key_type &__key, value_type __val)
- {
- __table_ [__key] = __val; // Would skip_.insert (val) be better here?
- }
-
- _LIBCPP_INLINE_VISIBILITY
- value_type operator [](const key_type & __key) const
- {
- auto __it = __table_.find (__key);
- return __it == __table_.end() ? __default_value_ : __it->second;
- }
-};
-
-
-// Special case small numeric values; use an array
-template<class _Key, typename _Value, class _Hash, class _BinaryPredicate>
-class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, true> {
-private:
- typedef _Value value_type;
- typedef _Key key_type;
-
- typedef __make_unsigned_t<key_type> unsigned_key_type;
- typedef std::array<value_type, 256> skip_map;
- skip_map __table_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY
- _BMSkipTable(size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/)
- {
- std::fill_n(__table_.begin(), __table_.size(), __default);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void insert(key_type __key, value_type __val)
- {
- __table_[static_cast<unsigned_key_type>(__key)] = __val;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- value_type operator [](key_type __key) const
- {
- return __table_[static_cast<unsigned_key_type>(__key)];
- }
-};
-
-
-template <class _RandomAccessIterator1,
- class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
- class _BinaryPredicate = equal_to<>>
-class _LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCPP_TEMPLATE_VIS boyer_moore_searcher {
-private:
- typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
- typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type;
- typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate,
- is_integral<value_type>::value && // what about enums?
- sizeof(value_type) == 1 &&
- is_same<_Hash, hash<value_type>>::value &&
- is_same<_BinaryPredicate, equal_to<>>::value
- > skip_table_type;
-
-public:
- boyer_moore_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
- _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate())
- : __first_(__f), __last_(__l), __pred_(__pred),
- __pattern_length_(_VSTD::distance(__first_, __last_)),
- __skip_{std::make_shared<skip_table_type>(__pattern_length_, -1, __hf, __pred_)},
- __suffix_{std::make_shared<vector<difference_type>>(__pattern_length_ + 1)}
- {
- // build the skip table
- for ( difference_type __i = 0; __f != __l; ++__f, (void) ++__i )
- __skip_->insert(*__f, __i);
-
- this->__build_suffix_table ( __first_, __last_, __pred_ );
- }
-
- template <typename _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
- operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
- {
- static_assert(__is_same_uncvref<typename iterator_traits<_RandomAccessIterator1>::value_type,
- typename iterator_traits<_RandomAccessIterator2>::value_type>::value,
- "Corpus and Pattern iterators must point to the same type");
-
- if (__f == __l ) return std::make_pair(__l, __l); // empty corpus
- if (__first_ == __last_) return std::make_pair(__f, __f); // empty pattern
-
- // If the pattern is larger than the corpus, we can't find it!
- if ( __pattern_length_ > _VSTD::distance(__f, __l))
- return std::make_pair(__l, __l);
-
- // Do the search
- return this->__search(__f, __l);
- }
-
-private:
- _RandomAccessIterator1 __first_;
- _RandomAccessIterator1 __last_;
- _BinaryPredicate __pred_;
- difference_type __pattern_length_;
- shared_ptr<skip_table_type> __skip_;
- shared_ptr<vector<difference_type>> __suffix_;
-
- template <typename _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
- __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
- {
- _RandomAccessIterator2 __cur = __f;
- const _RandomAccessIterator2 __last = __l - __pattern_length_;
- const skip_table_type & __skip = *__skip_.get();
- const vector<difference_type> & __suffix = *__suffix_.get();
-
- while (__cur <= __last)
- {
-
- // Do we match right where we are?
- difference_type __j = __pattern_length_;
- while (__pred_(__first_ [__j-1], __cur [__j-1])) {
- __j--;
- // We matched - we're done!
- if ( __j == 0 )
- return std::make_pair(__cur, __cur + __pattern_length_);
- }
-
- // Since we didn't match, figure out how far to skip forward
- difference_type __k = __skip[__cur [ __j - 1 ]];
- difference_type __m = __j - __k - 1;
- if (__k < __j && __m > __suffix[ __j ])
- __cur += __m;
- else
- __cur += __suffix[ __j ];
- }
-
- return std::make_pair(__l, __l); // We didn't find anything
- }
-
-
- template<typename _Iterator, typename _Container>
- void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix )
- {
- const size_t __count = _VSTD::distance(__f, __l);
-
- __prefix[0] = 0;
- size_t __k = 0;
- for ( size_t __i = 1; __i < __count; ++__i )
- {
- while ( __k > 0 && !__pred ( __f[__k], __f[__i] ))
- __k = __prefix [ __k - 1 ];
-
- if ( __pred ( __f[__k], __f[__i] ))
- __k++;
- __prefix [ __i ] = __k;
- }
- }
-
- void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
- _BinaryPredicate __pred)
- {
- const size_t __count = _VSTD::distance(__f, __l);
- vector<difference_type> & __suffix = *__suffix_.get();
- if (__count > 0)
- {
- vector<difference_type> __scratch(__count);
-
- __compute_bm_prefix(__f, __l, __pred, __scratch);
- for ( size_t __i = 0; __i <= __count; __i++ )
- __suffix[__i] = __count - __scratch[__count-1];
-
- typedef reverse_iterator<_RandomAccessIterator1> _RevIter;
- __compute_bm_prefix(_RevIter(__l), _RevIter(__f), __pred, __scratch);
-
- for ( size_t __i = 0; __i < __count; __i++ )
- {
- const size_t __j = __count - __scratch[__i];
- const difference_type __k = __i - __scratch[__i] + 1;
-
- if (__suffix[__j] > __k)
- __suffix[__j] = __k;
- }
- }
- }
-
-};
-
-template<class _RandomAccessIterator,
- class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>,
- class _BinaryPredicate = equal_to<>>
-_LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCPP_INLINE_VISIBILITY
-boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>
-make_boyer_moore_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
- _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ())
-{
- return boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p);
-}
-
-// boyer-moore-horspool
-template <class _RandomAccessIterator1,
- class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
- class _BinaryPredicate = equal_to<>>
-class _LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCPP_TEMPLATE_VIS boyer_moore_horspool_searcher {
-private:
- typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
- typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type;
- typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate,
- is_integral<value_type>::value && // what about enums?
- sizeof(value_type) == 1 &&
- is_same<_Hash, hash<value_type>>::value &&
- is_same<_BinaryPredicate, equal_to<>>::value
- > skip_table_type;
-
-public:
- boyer_moore_horspool_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
- _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate())
- : __first_(__f), __last_(__l), __pred_(__pred),
- __pattern_length_(_VSTD::distance(__first_, __last_)),
- __skip_{_VSTD::make_shared<skip_table_type>(__pattern_length_, __pattern_length_, __hf, __pred_)}
- {
- // build the skip table
- if ( __f != __l )
- {
- __l = __l - 1;
- for ( difference_type __i = 0; __f != __l; ++__f, (void) ++__i )
- __skip_->insert(*__f, __pattern_length_ - 1 - __i);
- }
- }
-
- template <typename _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
- operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
- {
- static_assert(__is_same_uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type,
- typename std::iterator_traits<_RandomAccessIterator2>::value_type>::value,
- "Corpus and Pattern iterators must point to the same type");
-
- if (__f == __l ) return std::make_pair(__l, __l); // empty corpus
- if (__first_ == __last_) return std::make_pair(__f, __f); // empty pattern
-
- // If the pattern is larger than the corpus, we can't find it!
- if ( __pattern_length_ > _VSTD::distance(__f, __l))
- return std::make_pair(__l, __l);
-
- // Do the search
- return this->__search(__f, __l);
- }
-
-private:
- _RandomAccessIterator1 __first_;
- _RandomAccessIterator1 __last_;
- _BinaryPredicate __pred_;
- difference_type __pattern_length_;
- shared_ptr<skip_table_type> __skip_;
-
- template <typename _RandomAccessIterator2>
- pair<_RandomAccessIterator2, _RandomAccessIterator2>
- __search ( _RandomAccessIterator2 __f, _RandomAccessIterator2 __l ) const {
- _RandomAccessIterator2 __cur = __f;
- const _RandomAccessIterator2 __last = __l - __pattern_length_;
- const skip_table_type & __skip = *__skip_.get();
-
- while (__cur <= __last)
- {
- // Do we match right where we are?
- difference_type __j = __pattern_length_;
- while (__pred_(__first_[__j-1], __cur[__j-1]))
- {
- __j--;
- // We matched - we're done!
- if ( __j == 0 )
- return std::make_pair(__cur, __cur + __pattern_length_);
- }
- __cur += __skip[__cur[__pattern_length_-1]];
- }
-
- return std::make_pair(__l, __l);
- }
-};
-
-template<class _RandomAccessIterator,
- class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>,
- class _BinaryPredicate = equal_to<>>
-_LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCPP_INLINE_VISIBILITY
-boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>
-make_boyer_moore_horspool_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
- _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ())
-{
- return boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p);
-}
-
-#endif // _LIBCPP_STD_VER > 11
-
-_LIBCPP_END_NAMESPACE_LFTS
-
-_LIBCPP_POP_MACROS
-
-#endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */
diff --git a/third_party/llvm-project/libcxx/include/experimental/iterator b/third_party/llvm-project/libcxx/include/experimental/iterator
index cf73b74..e47314a 100644
--- a/third_party/llvm-project/libcxx/include/experimental/iterator
+++ b/third_party/llvm-project/libcxx/include/experimental/iterator
@@ -65,7 +65,7 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_LFTS
@@ -111,13 +111,13 @@
template <class _CharT, class _Traits, class _Delim>
-_LIBCPP_HIDE_FROM_ABI ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>
+_LIBCPP_HIDE_FROM_ABI ostream_joiner<__decay_t<_Delim>, _CharT, _Traits>
make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim && __d)
-{ return ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); }
+{ return ostream_joiner<__decay_t<_Delim>, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); }
_LIBCPP_END_NAMESPACE_LFTS
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
diff --git a/third_party/llvm-project/libcxx/include/experimental/memory_resource b/third_party/llvm-project/libcxx/include/experimental/memory_resource
index f107f10..dcb61e3 100644
--- a/third_party/llvm-project/libcxx/include/experimental/memory_resource
+++ b/third_party/llvm-project/libcxx/include/experimental/memory_resource
@@ -66,16 +66,15 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__memory/allocator_traits.h>
+#include <__type_traits/aligned_storage.h>
#include <__utility/move.h>
#include <cstddef>
-#include <cstdlib>
#include <experimental/__config>
#include <experimental/__memory>
#include <limits>
#include <new>
#include <stdexcept>
#include <tuple>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -432,11 +431,13 @@
# include <atomic>
# include <climits>
# include <concepts>
+# include <cstdlib>
# include <cstring>
# include <ctime>
# include <iterator>
# include <memory>
# include <ratio>
+# include <type_traits>
# include <variant>
#endif
diff --git a/third_party/llvm-project/libcxx/include/experimental/propagate_const b/third_party/llvm-project/libcxx/include/experimental/propagate_const
index 34e917d..3efec5d 100644
--- a/third_party/llvm-project/libcxx/include/experimental/propagate_const
+++ b/third_party/llvm-project/libcxx/include/experimental/propagate_const
@@ -110,17 +110,32 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__functional/operations.h>
#include <__fwd/hash.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_function.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_swappable.h>
+#include <__type_traits/remove_cv.h>
+#include <__type_traits/remove_pointer.h>
+#include <__type_traits/remove_reference.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
+#include <cstddef>
#include <experimental/__config>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
@@ -577,5 +592,10 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
+
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <type_traits>
+#endif
+
#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
diff --git a/third_party/llvm-project/libcxx/include/experimental/type_traits b/third_party/llvm-project/libcxx/include/experimental/type_traits
index dd4c539..d1cc2e5 100644
--- a/third_party/llvm-project/libcxx/include/experimental/type_traits
+++ b/third_party/llvm-project/libcxx/include/experimental/type_traits
@@ -71,7 +71,7 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <experimental/__config>
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
#include <initializer_list>
#include <type_traits>
@@ -150,6 +150,6 @@
_LIBCPP_END_NAMESPACE_LFTS
-#endif /* _LIBCPP_STD_VER > 11 */
+#endif /* _LIBCPP_STD_VER >= 14 */
#endif /* _LIBCPP_EXPERIMENTAL_TYPE_TRAITS */
diff --git a/third_party/llvm-project/libcxx/include/ext/hash_map b/third_party/llvm-project/libcxx/include/ext/hash_map
index 3ad4b16..f7f53bc 100644
--- a/third_party/llvm-project/libcxx/include/ext/hash_map
+++ b/third_party/llvm-project/libcxx/include/ext/hash_map
@@ -208,7 +208,6 @@
#include <ext/__hash>
#include <functional>
#include <stdexcept>
-#include <type_traits>
#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)
@@ -985,6 +984,7 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_HASH_MAP
diff --git a/third_party/llvm-project/libcxx/include/ext/hash_set b/third_party/llvm-project/libcxx/include/ext/hash_set
index dc8b786..9c67862 100644
--- a/third_party/llvm-project/libcxx/include/ext/hash_set
+++ b/third_party/llvm-project/libcxx/include/ext/hash_set
@@ -665,6 +665,7 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_HASH_SET
diff --git a/third_party/llvm-project/libcxx/include/filesystem b/third_party/llvm-project/libcxx/include/filesystem
index 7efa4ed..b10555d 100644
--- a/third_party/llvm-project/libcxx/include/filesystem
+++ b/third_party/llvm-project/libcxx/include/filesystem
@@ -159,6 +159,9 @@
void swap(path& lhs, path& rhs) noexcept;
size_t hash_value(const path& p) noexcept;
+ // [fs.path.hash], hash support
+ template<> struct hash<filesystem::path>;
+
template <class Source>
path u8path(const Source& source);
template <class InputIterator>
@@ -464,6 +467,8 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
+# include <system_error>
#endif
#endif // _LIBCPP_FILESYSTEM
diff --git a/third_party/llvm-project/libcxx/include/forward_list b/third_party/llvm-project/libcxx/include/forward_list
index 61dde81..ad616d1 100644
--- a/third_party/llvm-project/libcxx/include/forward_list
+++ b/third_party/llvm-project/libcxx/include/forward_list
@@ -146,23 +146,27 @@
template <class T, class Allocator>
bool operator< (const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator!=(const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator> (const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator>=(const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
template <class T, class Allocator>
bool operator<=(const forward_list<T, Allocator>& x,
- const forward_list<T, Allocator>& y);
+ const forward_list<T, Allocator>& y); // removed in C++20
+
+template<class T, class Allocator>
+ synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
+ const forward_list<T, Allocator>& y); // since C++20
template <class T, class Allocator>
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
@@ -181,6 +185,7 @@
#include <__algorithm/comp.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
@@ -197,11 +202,18 @@
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__type_traits/conditional.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_const.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <limits>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -482,14 +494,6 @@
typedef typename allocator_traits<__begin_node_allocator>::pointer
__begin_node_pointer;
- static_assert((!is_same<allocator_type, __node_allocator>::value),
- "internal allocator type must differ from user-specified "
- "type; otherwise overload resolution breaks");
-
- static_assert(is_same<allocator_type, __rebind_alloc<__node_traits, value_type> >::value,
- "[allocator.requirements] states that rebinding an allocator to the same type should result in the "
- "original allocator");
-
__compressed_pair<__begin_node, __node_allocator> __before_begin_;
_LIBCPP_INLINE_VISIBILITY
@@ -659,9 +663,17 @@
typedef _Tp value_type;
typedef _Alloc allocator_type;
- static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ static_assert(is_same<value_type, typename allocator_type::value_type>::value,
"Allocator::value_type must be same type as value_type");
+ static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value,
+ "[allocator.requirements] states that rebinding an allocator to the same type should result in the "
+ "original allocator");
+
+ static_assert((!is_same<allocator_type, __node_allocator>::value),
+ "internal allocator type must differ from user-specified "
+ "type; otherwise overload resolution breaks");
+
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename allocator_traits<allocator_type>::pointer pointer;
@@ -671,7 +683,7 @@
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef size_type __remove_return_type;
#else
typedef void __remove_return_type;
@@ -684,7 +696,7 @@
_LIBCPP_INLINE_VISIBILITY
explicit forward_list(const allocator_type& __a);
explicit forward_list(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
explicit forward_list(size_type __n, const allocator_type& __a);
#endif
forward_list(size_type __n, const value_type& __v);
@@ -787,7 +799,7 @@
const_reference front() const {return base::__before_begin()->__next_->__value_;}
#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args> reference emplace_front(_Args&&... __args);
#else
template <class... _Args> void emplace_front(_Args&&... __args);
@@ -927,7 +939,7 @@
}
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(size_type __n,
const allocator_type& __base_alloc)
@@ -1119,7 +1131,7 @@
template <class _Tp, class _Alloc>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename forward_list<_Tp, _Alloc>::reference
#else
void
@@ -1133,7 +1145,7 @@
_VSTD::forward<_Args>(__args)...);
__h->__next_ = base::__before_begin()->__next_;
base::__before_begin()->__next_ = __h.release();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return base::__before_begin()->__next_->__value_;
#endif
}
@@ -1237,17 +1249,17 @@
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__node_pointer __first = __h.release();
__node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, __last = __last->__next_)
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__last->__next_ = __h.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1260,7 +1272,7 @@
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
@@ -1283,17 +1295,17 @@
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
__node_pointer __first = __h.release();
__node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
__last->__next_ = __h.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1306,7 +1318,7 @@
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
@@ -1711,6 +1723,8 @@
return (__ix == __ex) == (__iy == __ey);
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const forward_list<_Tp, _Alloc>& __x,
@@ -1752,6 +1766,20 @@
return !(__y < __x);
}
+#else // #if _LIBCPP_STD_VER <= 17
+
+template<class _Tp, class _Allocator>
+inline _LIBCPP_HIDE_FROM_ABI
+__synth_three_way_result<_Tp>
+operator<=>(const forward_list<_Tp, _Allocator>& __x,
+ const forward_list<_Tp, _Allocator>& __y)
+{
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // #if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -1761,7 +1789,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
typename forward_list<_Tp, _Allocator>::size_type
@@ -1779,7 +1807,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
@@ -1794,9 +1822,11 @@
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iosfwd>
# include <iterator>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/third_party/llvm-project/libcxx/include/fstream b/third_party/llvm-project/libcxx/include/fstream
index 41e95bf..09deccf 100644
--- a/third_party/llvm-project/libcxx/include/fstream
+++ b/third_party/llvm-project/libcxx/include/fstream
@@ -188,8 +188,6 @@
#include <__utility/swap.h>
#include <__utility/unreachable.h>
#include <cstdio>
-#include <cstdlib>
-#include <cstring>
#include <istream>
#include <ostream>
#include <typeinfo>
@@ -398,17 +396,17 @@
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
close();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__owns_eb_)
delete [] __extbuf_;
if (__owns_ib_)
@@ -1753,6 +1751,7 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <new>
diff --git a/third_party/llvm-project/libcxx/include/functional b/third_party/llvm-project/libcxx/include/functional
index 8589d3a..05d42fc 100644
--- a/third_party/llvm-project/libcxx/include/functional
+++ b/third_party/llvm-project/libcxx/include/functional
@@ -43,20 +43,22 @@
// construct/copy/destroy
template<class U>
- reference_wrapper(U&&);
- reference_wrapper(const reference_wrapper<T>& x) noexcept;
+ constexpr reference_wrapper(U&&); // constexpr since C++20
+ constexpr reference_wrapper(const reference_wrapper<T>& x) noexcept; // constexpr since C++20
// assignment
- reference_wrapper& operator=(const reference_wrapper<T>& x) noexcept;
+ constexpr reference_wrapper&
+ operator=(const reference_wrapper<T>& x) noexcept; // constexpr since C++20
// access
- operator T& () const noexcept;
- T& get() const noexcept;
+ constexpr operator T& () const noexcept; // constexpr since C++20
+ constexpr T& get() const noexcept; // constexpr since C++20
// invoke
template <class... ArgTypes>
- typename result_of<T&(ArgTypes&&...)>::type
- operator() (ArgTypes&&...) const;
+ constexpr typename result_of<T&(ArgTypes&&...)>::type // constexpr since C++20
+ operator() (ArgTypes&&...) const
+ noexcept(is_nothrow_invocable_v<T&, ArgTypes...>); // noexcept since C++17
};
template <class T>
@@ -220,11 +222,16 @@
template<class R, class Fn, class... BoundArgs>
constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
+// [func.invoke]
template<class F, class... Args>
constexpr // constexpr in C++20
invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
noexcept(is_nothrow_invocable_v<F, Args...>);
+template<class R, class F, class... Args>
+ constexpr R invoke_r(F&& f, Args&&... args) // C++23
+ noexcept(is_nothrow_invocable_r_v<R, F, Args...>);
+
namespace placeholders {
// M is the implementation-defined number of placeholders
extern unspecified _1;
@@ -250,10 +257,10 @@
};
template <class Operation, class T>
-binder1st<Operation> bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
+binder1st<Operation> bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
template <class Operation>
-class binder2nd // deprecated in C++11, removed in C++17
+class binder2nd // deprecated in C++11, removed in C++17
: public unary_function<typename Operation::first_argument_type,
typename Operation::result_type>
{
@@ -267,9 +274,9 @@
};
template <class Operation, class T>
-binder2nd<Operation> bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
+binder2nd<Operation> bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
-template <class Arg, class Result> // deprecated in C++11, removed in C++17
+template <class Arg, class Result> // deprecated in C++11, removed in C++17
class pointer_to_unary_function : public unary_function<Arg, Result>
{
public:
@@ -278,9 +285,9 @@
};
template <class Arg, class Result>
-pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17
+pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17
-template <class Arg1, class Arg2, class Result> // deprecated in C++11, removed in C++17
+template <class Arg1, class Arg2, class Result> // deprecated in C++11, removed in C++17
class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result>
{
public:
@@ -289,9 +296,9 @@
};
template <class Arg1, class Arg2, class Result>
-pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17
+pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17
-template<class S, class T> // deprecated in C++11, removed in C++17
+template<class S, class T> // deprecated in C++11, removed in C++17
class mem_fun_t : public unary_function<T*, S>
{
public:
@@ -300,18 +307,18 @@
};
template<class S, class T, class A>
-class mem_fun1_t : public binary_function<T*, A, S> // deprecated in C++11, removed in C++17
+class mem_fun1_t : public binary_function<T*, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun1_t(S (T::*p)(A));
S operator()(T* p, A x) const;
};
-template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17
-template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17
+template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17
+template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17
template<class S, class T>
-class mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
+class mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun_ref_t(S (T::*p)());
@@ -319,18 +326,20 @@
};
template<class S, class T, class A>
-class mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
+class mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun1_ref_t(S (T::*p)(A));
S operator()(T& p, A x) const;
};
-template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17
-template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17
+template<class S, class T>
+mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17
+template<class S, class T, class A>
+mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17
template <class S, class T>
-class const_mem_fun_t : public unary_function<const T*, S> // deprecated in C++11, removed in C++17
+class const_mem_fun_t : public unary_function<const T*, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun_t(S (T::*p)() const);
@@ -338,18 +347,20 @@
};
template <class S, class T, class A>
-class const_mem_fun1_t : public binary_function<const T*, A, S> // deprecated in C++11, removed in C++17
+class const_mem_fun1_t : public binary_function<const T*, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun1_t(S (T::*p)(A) const);
S operator()(const T* p, A x) const;
};
-template <class S, class T> const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17
-template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
+template <class S, class T>
+const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17
+template <class S, class T, class A>
+const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
template <class S, class T>
-class const_mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
+class const_mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun_ref_t(S (T::*p)() const);
@@ -357,18 +368,19 @@
};
template <class S, class T, class A>
-class const_mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
+class const_mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun1_ref_t(S (T::*p)(A) const);
S operator()(const T& p, A x) const;
};
-template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
-template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
+template <class S, class T>
+const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
+template <class S, class T, class A>
+const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
-template<class R, class T>
-constexpr unspecified mem_fn(R T::*); // constexpr in C++20
+template<class R, class T> constexpr unspecified mem_fn(R T::*); // constexpr in C++20
class bad_function_call
: public exception
@@ -505,7 +517,7 @@
#include <__compare/compare_three_way.h>
#include <__config>
#include <__debug>
-#include <__functional/binary_function.h> // TODO: deprecate
+#include <__functional/binary_function.h>
#include <__functional/binary_negate.h>
#include <__functional/bind.h>
#include <__functional/bind_back.h>
@@ -527,13 +539,11 @@
#include <__functional/pointer_to_unary_function.h>
#include <__functional/ranges_operations.h>
#include <__functional/reference_wrapper.h>
-#include <__functional/unary_function.h> // TODO: deprecate
+#include <__functional/unary_function.h>
#include <__functional/unary_negate.h>
#include <__functional/unwrap_ref.h>
#include <__utility/forward.h>
-#include <exception>
#include <memory> // TODO: find out why removing this breaks the modules build
-#include <type_traits>
#include <typeinfo>
#include <version>
@@ -542,8 +552,12 @@
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdlib>
+# include <exception>
# include <tuple>
+# include <type_traits>
# include <utility>
#endif
diff --git a/third_party/llvm-project/libcxx/include/future b/third_party/llvm-project/libcxx/include/future
index 2f14a47..22fc585 100644
--- a/third_party/llvm-project/libcxx/include/future
+++ b/third_party/llvm-project/libcxx/include/future
@@ -366,17 +366,28 @@
#include <__chrono/duration.h>
#include <__chrono/time_point.h>
#include <__config>
+#include <__exception/exception_ptr.h>
+#include <__memory/allocator.h>
#include <__memory/allocator_arg_t.h>
#include <__memory/allocator_destructor.h>
+#include <__memory/allocator_traits.h>
+#include <__memory/compressed_pair.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
#include <__memory/uses_allocator.h>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
+#include <__type_traits/aligned_storage.h>
+#include <__type_traits/alignment_of.h>
#include <__type_traits/strip_signature.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
#include <__utility/move.h>
-#include <exception>
#include <mutex>
#include <new>
-#include <system_error>
+#include <stdexcept>
#include <thread>
#include <version>
@@ -520,16 +531,16 @@
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
_LIBCPP_AVAILABILITY_FUTURE_ERROR
#endif
void __throw_future_error(future_errc __ev)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw future_error(make_error_code(__ev));
#else
- ((void)__ev);
- _VSTD::abort();
+ (void)__ev;
+ _LIBCPP_VERBOSE_ABORT("future_error was thrown in -fno-exceptions mode");
#endif
}
@@ -869,18 +880,18 @@
void
__deferred_assoc_state<_Rp, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Fp>
@@ -910,19 +921,19 @@
void
__deferred_assoc_state<void, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__func_();
this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
@@ -952,18 +963,18 @@
void
__async_assoc_state<_Rp, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
@@ -1001,19 +1012,19 @@
void
__async_assoc_state<void, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__func_();
this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Fp>
@@ -1120,7 +1131,7 @@
_Rp
future<_Rp>::get()
{
- unique_ptr<__shared_count, __release_shared_count> __(__state_);
+ unique_ptr<__shared_count, __release_shared_count> __guard(__state_);
__assoc_state<_Rp>* __s = __state_;
__state_ = nullptr;
return __s->move();
@@ -1202,7 +1213,7 @@
_Rp&
future<_Rp&>::get()
{
- unique_ptr<__shared_count, __release_shared_count> __(__state_);
+ unique_ptr<__shared_count, __release_shared_count> __guard(__state_);
__assoc_state<_Rp&>* __s = __state_;
__state_ = nullptr;
return __s->copy();
@@ -1756,7 +1767,7 @@
__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
: __f_(nullptr)
{
- typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
+ typedef __libcpp_remove_reference_t<__decay_t<_Fp> > _FR;
typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
{
@@ -1780,7 +1791,7 @@
allocator_arg_t, const _Alloc& __a0, _Fp&& __f)
: __f_(nullptr)
{
- typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
+ typedef __libcpp_remove_reference_t<__decay_t<_Fp> > _FR;
typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
{
@@ -1902,8 +1913,8 @@
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
- : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
- __p_(allocator_arg, __a) {}
+ : __f_(allocator_arg_t(), __a, _VSTD::forward<_Fp>(__f)),
+ __p_(allocator_arg_t(), __a) {}
// ~packaged_task() = default;
// no copy
@@ -1950,18 +1961,18 @@
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
@@ -1972,18 +1983,18 @@
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
@@ -2017,8 +2028,8 @@
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
- : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
- __p_(allocator_arg, __a) {}
+ : __f_(allocator_arg_t(), __a, _VSTD::forward<_Fp>(__f)),
+ __p_(allocator_arg_t(), __a) {}
// ~packaged_task() = default;
// no copy
@@ -2075,19 +2086,19 @@
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
@@ -2098,19 +2109,19 @@
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value_at_thread_exit();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
@@ -2189,20 +2200,20 @@
template <class _Fp, class... _Args>
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI
-future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
+future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type>
async(launch __policy, _Fp&& __f, _Args&&... __args)
{
- typedef __async_func<typename decay<_Fp>::type, typename decay<_Args>::type...> _BF;
+ typedef __async_func<__decay_t<_Fp>, __decay_t<_Args>...> _BF;
typedef typename _BF::_Rp _Rp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
if (__does_policy_contain(__policy, launch::async))
return _VSTD::__make_async_assoc_state<_Rp>(_BF(_LIBCPP_AUTO_CAST(_VSTD::forward<_Fp>(__f)),
_LIBCPP_AUTO_CAST(_VSTD::forward<_Args>(__args))...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch ( ... ) { if (__policy == launch::async) throw ; }
#endif
@@ -2215,7 +2226,7 @@
template <class _Fp, class... _Args>
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
-future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
+future<typename __invoke_of<__decay_t<_Fp>, __decay_t<_Args>...>::type>
async(_Fp&& __f, _Args&&... __args)
{
return _VSTD::async(launch::any, _VSTD::forward<_Fp>(__f),
@@ -2454,4 +2465,11 @@
# include <chrono>
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+# include <cstdlib>
+# include <exception>
+# include <system_error>
+#endif
+
#endif // _LIBCPP_FUTURE
diff --git a/third_party/llvm-project/libcxx/include/iomanip b/third_party/llvm-project/libcxx/include/iomanip
index 38c5c9b..53445c7 100644
--- a/third_party/llvm-project/libcxx/include/iomanip
+++ b/third_party/llvm-project/libcxx/include/iomanip
@@ -301,10 +301,10 @@
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
@@ -315,13 +315,13 @@
__mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
__is.setstate(__err);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __is;
}
@@ -361,10 +361,10 @@
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -374,13 +374,13 @@
if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
__os.setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -420,10 +420,10 @@
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
@@ -435,13 +435,13 @@
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
__is.setstate(__err);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __is;
}
@@ -481,10 +481,10 @@
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -495,13 +495,13 @@
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed())
__os.setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -513,8 +513,6 @@
return __iom_t10<_CharT>(__tm, __fmt);
}
-#if _LIBCPP_STD_VER >= 11
-
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
__quoted_output(basic_ostream<_CharT, _Traits>& __os,
@@ -622,9 +620,7 @@
return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
}
-#endif // _LIBCPP_STD_VER >= 11
-
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI
@@ -656,7 +652,7 @@
return __quoted_output_proxy<_CharT, _Traits>(__sv.data(), __sv.data() + __sv.size(), __delim, __escape);
}
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/ios b/third_party/llvm-project/libcxx/include/ios
index 9eecf4d..d972a22 100644
--- a/third_party/llvm-project/libcxx/include/ios
+++ b/third_party/llvm-project/libcxx/include/ios
@@ -219,8 +219,12 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__ios/fpos.h>
#include <__locale>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
+#include <__system_error/system_error.h>
#include <__utility/swap.h>
-#include <system_error>
+#include <__verbose_abort>
#include <version>
// standard-mandated includes
@@ -229,7 +233,7 @@
#include <iosfwd>
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-#include <atomic> // for __xindex_
+# include <__atomic/atomic.h> // for __xindex_
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -448,11 +452,10 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_failure(char const* __msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw ios_base::failure(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
@@ -1039,6 +1042,7 @@
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdlib>
@@ -1047,6 +1051,7 @@
# include <limits>
# include <new>
# include <stdexcept>
+# include <system_error>
# include <type_traits>
# include <typeinfo>
#endif
diff --git a/third_party/llvm-project/libcxx/include/istream b/third_party/llvm-project/libcxx/include/istream
index 6e67d61..7350e11 100644
--- a/third_party/llvm-project/libcxx/include/istream
+++ b/third_party/llvm-project/libcxx/include/istream
@@ -161,6 +161,10 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__iterator/istreambuf_iterator.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_base_of.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <ostream>
#include <version>
@@ -360,14 +364,14 @@
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -469,10 +473,10 @@
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
long __temp;
@@ -491,7 +495,7 @@
{
__n = static_cast<_Tp>(__temp);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -502,7 +506,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
@@ -531,7 +535,7 @@
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -555,7 +559,7 @@
__is.width(0);
if (__s == __p)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -572,7 +576,7 @@
return __is;
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY
@@ -630,7 +634,7 @@
return __is >> (char*)__s;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
@@ -640,7 +644,7 @@
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -649,7 +653,7 @@
__state |= ios_base::eofbit | ios_base::failbit;
else
__c = _Traits::to_char_type(__i);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -693,10 +697,10 @@
{
if (__sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -714,7 +718,7 @@
}
if (__gc_ == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -728,7 +732,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -749,7 +753,7 @@
sentry __s(*this, true);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -758,7 +762,7 @@
__state |= ios_base::failbit | ios_base::eofbit;
else
__gc_ = 1;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -785,7 +789,7 @@
{
if (__n > 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -806,7 +810,7 @@
}
if (__gc_ == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -845,10 +849,10 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -865,14 +869,14 @@
++__gc_;
this->rdbuf()->sbumpc();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__state |= ios_base::badbit;
// according to the spec, exceptions here are caught but not rethrown
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__gc_ == 0)
__state |= ios_base::failbit;
this->setstate(__state);
@@ -889,10 +893,10 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -917,7 +921,7 @@
this->rdbuf()->sbumpc();
++__gc_;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -932,7 +936,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
if (__n > 0)
*__s = char_type();
@@ -951,10 +955,10 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__n == numeric_limits<streamsize>::max())
{
while (true)
@@ -985,7 +989,7 @@
break;
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -996,7 +1000,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1012,14 +1016,14 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__r = this->rdbuf()->sgetc();
if (traits_type::eq_int_type(__r, traits_type::eof()))
__state |= ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1030,7 +1034,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1045,14 +1049,14 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__gc_ = this->rdbuf()->sgetn(__s, __n);
if (__gc_ != __n)
__state |= ios_base::failbit | ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1063,7 +1067,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1082,10 +1086,10 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
streamsize __c = this->rdbuf()->in_avail();
switch (__c)
{
@@ -1101,7 +1105,7 @@
__state |= ios_base::failbit | ios_base::eofbit;
break;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1112,7 +1116,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1132,13 +1136,13 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
__state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1149,7 +1153,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1169,13 +1173,13 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
__state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1186,7 +1190,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1205,10 +1209,10 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr)
return -1;
if (this->rdbuf()->pubsync() == -1)
@@ -1216,7 +1220,7 @@
__state |= ios_base::badbit;
return -1;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1227,7 +1231,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1242,12 +1246,12 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1258,7 +1262,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1273,13 +1277,13 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1290,7 +1294,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1305,13 +1309,13 @@
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1322,7 +1326,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1336,10 +1340,10 @@
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
while (true)
{
@@ -1353,7 +1357,7 @@
break;
__is.rdbuf()->sbumpc();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1364,7 +1368,7 @@
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
@@ -1450,7 +1454,7 @@
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1480,7 +1484,7 @@
__is.width(0);
if (__c == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1506,7 +1510,7 @@
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1533,7 +1537,7 @@
}
if (__extr == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1585,7 +1589,7 @@
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1612,7 +1616,7 @@
__x = bitset<_Size>(__str);
if (_Size > 0 && __c == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
diff --git a/third_party/llvm-project/libcxx/include/iterator b/third_party/llvm-project/libcxx/include/iterator
index 35eca67..c4bec91 100644
--- a/third_party/llvm-project/libcxx/include/iterator
+++ b/third_party/llvm-project/libcxx/include/iterator
@@ -387,7 +387,7 @@
class move_iterator {
public:
using iterator_type = Iterator;
- using iterator_concept = input_iterator_tag; // From C++20
+ using iterator_concept = see below; // From C++20
using iterator_category = see below; // not always present starting from C++20
using value_type = iter_value_t<Iterator>; // Until C++20, iterator_traits<Iterator>::value_type
using difference_type = iter_difference_t<Iterator>; // Until C++20, iterator_traits<Iterator>::difference_type;
@@ -732,6 +732,7 @@
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
# include <exception>
# include <new>
# include <type_traits>
diff --git a/third_party/llvm-project/libcxx/include/latch b/third_party/llvm-project/libcxx/include/latch
index ff17f84..d72cb4f 100644
--- a/third_party/llvm-project/libcxx/include/latch
+++ b/third_party/llvm-project/libcxx/include/latch
@@ -41,9 +41,12 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__atomic/atomic_base.h>
+#include <__atomic/atomic_sync.h>
+#include <__atomic/memory_order.h>
#include <__availability>
#include <__config>
-#include <atomic>
+#include <cstddef>
#include <limits>
#include <version>
@@ -111,4 +114,8 @@
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+#endif
+
#endif //_LIBCPP_LATCH
diff --git a/third_party/llvm-project/libcxx/include/libcxx.imp b/third_party/llvm-project/libcxx/include/libcxx.imp
index 575ce0f..daa9188 100644
--- a/third_party/llvm-project/libcxx/include/libcxx.imp
+++ b/third_party/llvm-project/libcxx/include/libcxx.imp
@@ -8,7 +8,6 @@
{ include: [ "<__node_handle>", "private", "<unordered_set>", "public" ] },
{ include: [ "<__split_buffer>", "private", "<deque>", "public" ] },
{ include: [ "<__split_buffer>", "private", "<vector>", "public" ] },
- { include: [ "<__std_stream>", "private", "<iostream>", "public" ] },
{ include: [ "<__threading_support>", "private", "<atomic>", "public" ] },
{ include: [ "<__threading_support>", "private", "<mutex>", "public" ] },
{ include: [ "<__threading_support>", "private", "<semaphore>", "public" ] },
@@ -16,13 +15,16 @@
{ include: [ "<__tree>", "private", "<map>", "public" ] },
{ include: [ "<__tree>", "private", "<set>", "public" ] },
{ include: [ "@<__algorithm/.*>", "private", "<algorithm>", "public" ] },
+ { include: [ "@<__atomic/.*>", "private", "<atomic>", "public" ] },
{ include: [ "@<__bit/.*>", "private", "<bit>", "public" ] },
{ include: [ "@<__charconv/.*>", "private", "<charconv>", "public" ] },
{ include: [ "@<__chrono/.*>", "private", "<chrono>", "public" ] },
{ include: [ "@<__compare/.*>", "private", "<compare>", "public" ] },
{ include: [ "@<__concepts/.*>", "private", "<concepts>", "public" ] },
+ { include: [ "@<__condition_variable/.*>", "private", "<condition_variable>", "public" ] },
{ include: [ "@<__coroutine/.*>", "private", "<coroutine>", "public" ] },
{ include: [ "@<__debug_utils/.*>", "private", "<debug_utils>", "public" ] },
+ { include: [ "@<__exception/.*>", "private", "<exception>", "public" ] },
{ include: [ "@<__expected/.*>", "private", "<expected>", "public" ] },
{ include: [ "@<__filesystem/.*>", "private", "<filesystem>", "public" ] },
{ include: [ "@<__format/.*>", "private", "<format>", "public" ] },
@@ -32,13 +34,15 @@
{ include: [ "@<__iterator/.*>", "private", "<iterator>", "public" ] },
{ include: [ "@<__memory/.*>", "private", "<memory>", "public" ] },
{ include: [ "@<__memory_resource/.*>", "private", "<memory_resource>", "public" ] },
+ { include: [ "@<__mutex/.*>", "private", "<mutex>", "public" ] },
{ include: [ "@<__numeric/.*>", "private", "<numeric>", "public" ] },
{ include: [ "@<__random/.*>", "private", "<random>", "public" ] },
{ include: [ "@<__ranges/.*>", "private", "<ranges>", "public" ] },
{ include: [ "@<__string/.*>", "private", "<string>", "public" ] },
{ include: [ "@<__support/.*>", "private", "<support>", "public" ] },
+ { include: [ "@<__system_error/.*>", "private", "<system_error>", "public" ] },
{ include: [ "@<__thread/.*>", "private", "<thread>", "public" ] },
- { include: [ "@<__tuple_dir/.*>", "private", "<tuple>", "public" ] },
+ { include: [ "@<__tuple/.*>", "private", "<tuple>", "public" ] },
{ include: [ "@<__type_traits/.*>", "private", "<type_traits>", "public" ] },
{ include: [ "@<__utility/.*>", "private", "<utility>", "public" ] },
{ include: [ "@<__variant/.*>", "private", "<variant>", "public" ] },
diff --git a/third_party/llvm-project/libcxx/include/list b/third_party/llvm-project/libcxx/include/list
index a0c7327..6969d3c 100644
--- a/third_party/llvm-project/libcxx/include/list
+++ b/third_party/llvm-project/libcxx/include/list
@@ -155,15 +155,18 @@
template <class T, class Alloc>
bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y);
template <class T, class Alloc>
- bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
template <class T, class Alloc>
- bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y);
+ bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20
+template<class T, class Allocator>
+ synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
+ const list<T, Allocator>& y); // since C++20
template <class T, class Alloc>
void swap(list<T,Alloc>& x, list<T,Alloc>& y)
@@ -171,10 +174,10 @@
template <class T, class Allocator, class U>
typename list<T, Allocator>::size_type
- erase(list<T, Allocator>& c, const U& value); // C++20
+ erase(list<T, Allocator>& c, const U& value); // since C++20
template <class T, class Allocator, class Predicate>
typename list<T, Allocator>::size_type
- erase_if(list<T, Allocator>& c, Predicate pred); // C++20
+ erase_if(list<T, Allocator>& c, Predicate pred); // since C++20
} // std
@@ -183,6 +186,7 @@
#include <__algorithm/comp.h>
#include <__algorithm/equal.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
@@ -203,13 +207,19 @@
#include <__memory/swap_allocator.h>
#include <__memory/unique_ptr.h>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__type_traits/conditional.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_nothrow_move_constructible.h>
+#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <cstring>
#include <limits>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -824,7 +834,7 @@
typedef _Tp value_type;
typedef _Alloc allocator_type;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename base::pointer pointer;
@@ -835,7 +845,7 @@
typedef typename base::const_iterator const_iterator;
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
typedef size_type __remove_return_type;
#else
typedef void __remove_return_type;
@@ -857,7 +867,7 @@
_VSTD::__debug_db_insert_c(this);
}
explicit list(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
explicit list(size_type __n, const allocator_type& __a);
#endif
list(size_type __n, const value_type& __x);
@@ -986,13 +996,13 @@
void push_back(value_type&& __x);
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
reference emplace_front(_Args&&... __args);
#else
void emplace_front(_Args&&... __args);
#endif
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
reference emplace_back(_Args&&... __args);
#else
void emplace_back(_Args&&... __args);
@@ -1200,7 +1210,7 @@
#endif
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
{
@@ -1423,10 +1433,10 @@
__r = iterator(__hold->__as_link(), this);
__hold.release();
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1435,7 +1445,7 @@
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1450,7 +1460,7 @@
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1476,10 +1486,10 @@
__r = iterator(__hold.get()->__as_link(), this);
__hold.release();
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1488,7 +1498,7 @@
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1503,7 +1513,7 @@
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1563,7 +1573,7 @@
template <class _Tp, class _Alloc>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename list<_Tp, _Alloc>::reference
#else
void
@@ -1575,7 +1585,7 @@
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
__link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return __hold.release()->__value_;
#else
__hold.release();
@@ -1584,7 +1594,7 @@
template <class _Tp, class _Alloc>
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename list<_Tp, _Alloc>::reference
#else
void
@@ -1597,7 +1607,7 @@
__link_pointer __nl = __hold->__as_link();
__link_nodes_at_back(__nl, __nl);
++base::__sz();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return __hold.release()->__value_;
#else
__hold.release();
@@ -1787,10 +1797,10 @@
++__ds;
iterator __r = iterator(__hold.release()->__as_link(), this);
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1799,7 +1809,7 @@
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1814,7 +1824,7 @@
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes_at_back(__r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1837,10 +1847,10 @@
__link_pointer __nl = __hold.release()->__as_link();
iterator __r = iterator(__nl, this);
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1849,7 +1859,7 @@
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1864,7 +1874,7 @@
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -2289,6 +2299,8 @@
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -2329,6 +2341,19 @@
return !(__y < __x);
}
+#else // _LIBCPP_STD_VER <= 17
+
+template<class _Tp, class _Allocator>
+inline _LIBCPP_HIDE_FROM_ABI
+__synth_three_way_result<_Tp>
+operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y)
+{
+ return std::lexicographical_compare_three_way(
+ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
+}
+
+#endif // _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -2338,7 +2363,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred) {
@@ -2358,11 +2383,11 @@
inline constexpr bool __format::__enable_insertable<std::list<wchar_t>> = true;
#endif
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
@@ -2377,9 +2402,11 @@
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iosfwd>
# include <iterator>
+# include <type_traits>
# include <typeinfo>
#endif
diff --git a/third_party/llvm-project/libcxx/include/locale b/third_party/llvm-project/libcxx/include/locale
index 5e925e8..251689f 100644
--- a/third_party/llvm-project/libcxx/include/locale
+++ b/third_party/llvm-project/libcxx/include/locale
@@ -202,6 +202,8 @@
#include <__iterator/ostreambuf_iterator.h>
#include <__locale>
#include <__memory/unique_ptr.h>
+#include <__type_traits/make_unsigned.h>
+#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <ctime>
@@ -3628,13 +3630,13 @@
explicit wstring_convert(_Codecvt* __pcvt);
#else
_LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT_AFTER_CXX11
+ _LIBCPP_EXPLICIT_SINCE_CXX14
wstring_convert(_Codecvt* __pcvt = new _Codecvt);
#endif
_LIBCPP_INLINE_VISIBILITY
wstring_convert(_Codecvt* __pcvt, state_type __state);
- _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
+ _LIBCPP_EXPLICIT_SINCE_CXX14 wstring_convert(const byte_string& __byte_err,
const wide_string& __wide_err = wide_string());
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
@@ -3910,7 +3912,7 @@
_Codecvt* __pcvt = new _Codecvt,
state_type __state = state_type());
#else
- _LIBCPP_EXPLICIT_AFTER_CXX11
+ _LIBCPP_EXPLICIT_SINCE_CXX14
wbuffer_convert(streambuf* __bytebuf = nullptr,
_Codecvt* __pcvt = new _Codecvt,
state_type __state = state_type());
diff --git a/third_party/llvm-project/libcxx/include/map b/third_party/llvm-project/libcxx/include/map
index 9cf47b2..75de40b 100644
--- a/third_party/llvm-project/libcxx/include/map
+++ b/third_party/llvm-project/libcxx/include/map
@@ -250,27 +250,32 @@
template <class Key, class T, class Compare, class Allocator>
bool
operator< (const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator!=(const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator> (const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator>=(const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator<=(const map<Key, T, Compare, Allocator>& x,
- const map<Key, T, Compare, Allocator>& y);
+ const map<Key, T, Compare, Allocator>& y); // removed in C++20
+
+template<class Key, class T, class Compare, class Allocator>
+ synth-three-way-result<pair<const Key, T>>
+ operator<=>(const map<Key, T, Compare, Allocator>& x,
+ const map<Key, T, Compare, Allocator>& y); // since C++20
// specialized algorithms:
template <class Key, class T, class Compare, class Allocator>
@@ -491,27 +496,32 @@
template <class Key, class T, class Compare, class Allocator>
bool
operator< (const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator!=(const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator> (const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator>=(const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
template <class Key, class T, class Compare, class Allocator>
bool
operator<=(const multimap<Key, T, Compare, Allocator>& x,
- const multimap<Key, T, Compare, Allocator>& y);
+ const multimap<Key, T, Compare, Allocator>& y); // removed in C++20
+
+template<class Key, class T, class Compare, class Allocator>
+ synth-three-way-result<pair<const Key, T>>
+ operator<=>(const multimap<Key, T, Compare, Allocator>& x,
+ const multimap<Key, T, Compare, Allocator>& y); // since c++20
// specialized algorithms:
template <class Key, class T, class Compare, class Allocator>
@@ -530,6 +540,7 @@
#include <__algorithm/equal.h>
#include <__algorithm/lexicographical_compare.h>
+#include <__algorithm/lexicographical_compare_three_way.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/binary_function.h>
@@ -538,6 +549,7 @@
#include <__iterator/erase_if_container.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
+#include <__memory/addressof.h>
#include <__memory/allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
#include <__node_handle>
@@ -547,7 +559,6 @@
#include <__utility/piecewise_construct.h>
#include <__utility/swap.h>
#include <tuple>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -601,7 +612,7 @@
swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _K2& __x, const _CP& __y) const
@@ -647,7 +658,7 @@
swap(__comp_, __y.__comp_);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _K2& __x, const _CP& __y) const
@@ -742,7 +753,7 @@
_LIBCPP_INLINE_VISIBILITY
value_type& __get_value()
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -752,7 +763,7 @@
_LIBCPP_INLINE_VISIBILITY
const value_type& __get_value() const
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -1020,7 +1031,7 @@
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -1067,7 +1078,7 @@
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
@@ -1130,7 +1141,7 @@
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
map(initializer_list<value_type> __il, const allocator_type& __a)
: map(__il, key_compare(), __a) {}
@@ -1273,7 +1284,7 @@
insert(__e.__i_, *__f);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
@@ -1367,7 +1378,7 @@
return __r;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
@@ -1382,7 +1393,7 @@
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__tree_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
@@ -1452,7 +1463,7 @@
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -1466,21 +1477,21 @@
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, size_type>
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, bool>
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -1488,7 +1499,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -1506,7 +1517,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -1523,7 +1534,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, pair<iterator,iterator>>
@@ -1677,6 +1688,8 @@
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -1722,6 +1735,24 @@
return !(__y < __x);
}
+#else // #if _LIBCPP_STD_VER <= 17
+
+template<class _Key, class _Tp, class _Compare, class _Allocator>
+inline _LIBCPP_HIDE_FROM_ABI
+__synth_three_way_result<pair<const _Key, _Tp>>
+operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x,
+ const map<_Key, _Tp, _Compare, _Allocator>& __y)
+{
+ return std::lexicographical_compare_three_way(
+ __x.begin(),
+ __x.end(),
+ __y.begin(),
+ __y.end(),
+ std::__synth_three_way<pair<const _Key, _Tp>, pair<const _Key, _Tp>>);
+}
+
+#endif // #if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -1732,7 +1763,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Compare, class _Allocator,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1800,7 +1831,7 @@
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
#endif
@@ -1846,7 +1877,7 @@
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
@@ -1910,7 +1941,7 @@
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
multimap(initializer_list<value_type> __il, const allocator_type& __a)
: multimap(__il, key_compare(), __a) {}
@@ -2053,7 +2084,7 @@
iterator erase(const_iterator __f, const_iterator __l)
{return __tree_.erase(__f.__i_, __l.__i_);}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
@@ -2127,7 +2158,7 @@
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -2141,21 +2172,21 @@
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, size_type>
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, bool>
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -2163,7 +2194,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -2181,7 +2212,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
@@ -2198,7 +2229,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
__enable_if_t<__is_transparent<_Compare, _K2>::value, pair<iterator,iterator>>
@@ -2271,6 +2302,8 @@
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -2316,6 +2349,24 @@
return !(__y < __x);
}
+#else // #if _LIBCPP_STD_VER <= 17
+
+template<class _Key, class _Tp, class _Compare, class _Allocator>
+inline _LIBCPP_HIDE_FROM_ABI
+__synth_three_way_result<pair<const _Key, _Tp>>
+operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
+{
+ return std::lexicographical_compare_three_way(
+ __x.begin(),
+ __x.end(),
+ __y.begin(),
+ __y.end(),
+ std::__synth_three_way<pair<const _Key, _Tp>, pair<const _Key, _Tp>>);
+}
+
+#endif // #if _LIBCPP_STD_VER <= 17
+
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -2326,7 +2377,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Compare, class _Allocator,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2339,7 +2390,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
@@ -2353,8 +2404,10 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
# include <utility>
#endif
diff --git a/third_party/llvm-project/libcxx/include/memory b/third_party/llvm-project/libcxx/include/memory
index 0a7787a..24344d8 100644
--- a/third_party/llvm-project/libcxx/include/memory
+++ b/third_party/llvm-project/libcxx/include/memory
@@ -917,9 +917,11 @@
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdint>
+# include <cstdlib>
# include <cstring>
# include <iosfwd>
# include <iterator>
diff --git a/third_party/llvm-project/libcxx/include/module.modulemap.in b/third_party/llvm-project/libcxx/include/module.modulemap.in
index 1f1d67d..7a7edbf 100644
--- a/third_party/llvm-project/libcxx/include/module.modulemap.in
+++ b/third_party/llvm-project/libcxx/include/module.modulemap.in
@@ -2,12 +2,11 @@
// since __config may be included from C headers which may create an
// include cycle.
module std_config [system] [extern_c] {
- header "__config"
+ textual header "__config"
export *
}
module std [system] {
- export std_config
// FIXME: The standard does not require that each of these submodules
// re-exports its imported modules. We should provide an alternative form of
// export that issues a warning if a name from the submodule is used, and
@@ -62,23 +61,25 @@
module stdbool_h {
// <stdbool.h>'s __bool_true_false_are_defined macro requires textual inclusion.
textual header "stdbool.h"
+ export *
}
module stddef_h {
// <stddef.h>'s __need_* macros require textual inclusion.
textual header "stddef.h"
+ export *
}
module stdint_h {
header "stdint.h"
export *
// FIXME: This module only exists on OS X and for some reason the
- // wildcard above doesn't export it.
+ // wildcard above doesn't export it. Removing this breaks the tests
+ // for C compatibility headers in C++17 mode with modules enabled.
export Darwin.C.stdint
}
module stdio_h {
// <stdio.h>'s __need_* macros require textual inclusion.
textual header "stdio.h"
export *
- export Darwin.C.stdio
}
module stdlib_h {
// <stdlib.h>'s __need_* macros require textual inclusion.
@@ -289,6 +290,9 @@
export *
}
module lexicographical_compare { private header "__algorithm/lexicographical_compare.h" }
+ module lexicographical_compare_three_way {
+ private header "__algorithm/lexicographical_compare_three_way.h"
+ }
module lower_bound { private header "__algorithm/lower_bound.h" }
module make_heap { private header "__algorithm/make_heap.h" }
module make_projected { private header "__algorithm/make_projected.h" }
@@ -298,7 +302,10 @@
module min { private header "__algorithm/min.h" }
module min_element { private header "__algorithm/min_element.h" }
module min_max_result { private header "__algorithm/min_max_result.h" }
- module minmax { private header "__algorithm/minmax.h" }
+ module minmax {
+ private header "__algorithm/minmax.h"
+ export *
+ }
module minmax_element { private header "__algorithm/minmax_element.h" }
module mismatch { private header "__algorithm/mismatch.h" }
module move { private header "__algorithm/move.h" }
@@ -596,11 +603,15 @@
module stable_partition { private header "__algorithm/stable_partition.h" }
module stable_sort { private header "__algorithm/stable_sort.h" }
module swap_ranges { private header "__algorithm/swap_ranges.h" }
+ module three_way_comp_ref_type { private header "__algorithm/three_way_comp_ref_type.h" }
module transform { private header "__algorithm/transform.h" }
module unique { private header "__algorithm/unique.h" }
module unique_copy { private header "__algorithm/unique_copy.h" }
module unwrap_iter { private header "__algorithm/unwrap_iter.h" }
- module unwrap_range { private header "__algorithm/unwrap_range.h" }
+ module unwrap_range {
+ private header "__algorithm/unwrap_range.h"
+ export utility.__utility.pair
+ }
module upper_bound { private header "__algorithm/upper_bound.h" }
}
}
@@ -618,6 +629,26 @@
module atomic {
header "atomic"
export *
+
+ module __atomic {
+ module aliases {
+ private header "__atomic/aliases.h"
+ export atomic
+ }
+ module atomic { private header "__atomic/atomic.h" }
+ module atomic_base { private header "__atomic/atomic_base.h" }
+ module atomic_flag { private header "__atomic/atomic_flag.h" }
+ module atomic_init { private header "__atomic/atomic_init.h" }
+ module atomic_lock_free { private header "__atomic/atomic_lock_free.h" }
+ module atomic_sync { private header "__atomic/atomic_sync.h" }
+ module check_memory_order { private header "__atomic/check_memory_order.h" }
+ module contention_t { private header "__atomic/contention_t.h" }
+ module cxx_atomic_impl { private header "__atomic/cxx_atomic_impl.h" }
+ module fence { private header "__atomic/fence.h" }
+ module is_always_lock_free { private header "__atomic/is_always_lock_free.h" }
+ module kill_dependency { private header "__atomic/kill_dependency.h" }
+ module memory_order { private header "__atomic/memory_order.h" }
+ }
}
module barrier {
@requires_LIBCXX_ENABLE_THREADS@
@@ -656,11 +687,16 @@
export *
module __charconv {
- module chars_format { private header "__charconv/chars_format.h" }
- module from_chars_result { private header "__charconv/from_chars_result.h" }
- module tables { private header "__charconv/tables.h" }
- module to_chars_base_10 { private header "__charconv/to_chars_base_10.h" }
- module to_chars_result { private header "__charconv/to_chars_result.h" }
+ module chars_format { private header "__charconv/chars_format.h" }
+ module from_chars_integral { private header "__charconv/from_chars_integral.h" }
+ module from_chars_result { private header "__charconv/from_chars_result.h" }
+ module tables { private header "__charconv/tables.h" }
+ module to_chars { private header "__charconv/to_chars.h" }
+ module to_chars_base_10 { private header "__charconv/to_chars_base_10.h" }
+ module to_chars_floating_point { private header "__charconv/to_chars_floating_point.h" }
+ module to_chars_integral { private header "__charconv/to_chars_integral.h" }
+ module to_chars_result { private header "__charconv/to_chars_result.h" }
+ module traits { private header "__charconv/traits.h" }
}
}
@@ -670,6 +706,7 @@
module __chrono {
module calendar { private header "__chrono/calendar.h" }
+ module concepts { private header "__chrono/concepts.h" }
module convert_to_timespec { private header "__chrono/convert_to_timespec.h" }
module convert_to_tm { private header "__chrono/convert_to_tm.h" }
module day { private header "__chrono/day.h" }
@@ -755,13 +792,19 @@
module derived_from { private header "__concepts/derived_from.h" }
module destructible { private header "__concepts/destructible.h" }
module different_from { private header "__concepts/different_from.h" }
- module equality_comparable { private header "__concepts/equality_comparable.h" }
+ module equality_comparable {
+ private header "__concepts/equality_comparable.h"
+ export type_traits.common_reference
+ }
module invocable { private header "__concepts/invocable.h" }
module movable { private header "__concepts/movable.h" }
module predicate { private header "__concepts/predicate.h" }
module regular { private header "__concepts/regular.h" }
module relation { private header "__concepts/relation.h" }
- module same_as { private header "__concepts/same_as.h" }
+ module same_as {
+ private header "__concepts/same_as.h"
+ export type_traits.is_same
+ }
module semiregular { private header "__concepts/semiregular.h" }
module swappable { private header "__concepts/swappable.h" }
module totally_ordered { private header "__concepts/totally_ordered.h" }
@@ -770,9 +813,12 @@
module condition_variable {
header "condition_variable"
export *
+
+ module __condition_variable {
+ module condition_variable { private header "__condition_variable/condition_variable.h" }
+ }
}
module coroutine {
- requires coroutines
header "coroutine"
export compare
export *
@@ -792,6 +838,14 @@
module exception {
header "exception"
export *
+
+ module __exception {
+ module exception { private header "__exception/exception.h" }
+ module exception_ptr { private header "__exception/exception_ptr.h" }
+ module nested_exception { private header "__exception/nested_exception.h" }
+ module operations { private header "__exception/operations.h" }
+ module terminate { private header "__exception/terminate.h" }
+ }
}
module execution {
header "execution"
@@ -850,9 +904,13 @@
private header "__format/format_context.h"
export optional
export locale
+ export __locale
}
module format_error { private header "__format/format_error.h" }
- module format_functions { private header "__format/format_functions.h" }
+ module format_functions {
+ private header "__format/format_functions.h"
+ export string
+ }
module format_fwd { private header "__format/format_fwd.h" }
module format_parse_context { private header "__format/format_parse_context.h" }
module format_string { private header "__format/format_string.h" }
@@ -979,7 +1037,11 @@
module back_insert_iterator { private header "__iterator/back_insert_iterator.h" }
module bounded_iter { private header "__iterator/bounded_iter.h" }
module common_iterator { private header "__iterator/common_iterator.h" }
- module concepts { private header "__iterator/concepts.h" }
+ module concepts {
+ private header "__iterator/concepts.h"
+ export concepts.equality_comparable
+ export type_traits.common_reference
+ }
module counted_iterator { private header "__iterator/counted_iterator.h" }
module data { private header "__iterator/data.h" }
module default_sentinel { private header "__iterator/default_sentinel.h" }
@@ -1012,7 +1074,10 @@
module permutable { private header "__iterator/permutable.h" }
module prev { private header "__iterator/prev.h" }
module projected { private header "__iterator/projected.h" }
- module readable_traits { private header "__iterator/readable_traits.h" }
+ module readable_traits {
+ private header "__iterator/readable_traits.h"
+ export __iterator.iterator_traits
+ }
module reverse_access { private header "__iterator/reverse_access.h" }
module reverse_iterator { private header "__iterator/reverse_iterator.h" }
module segmented_iterator { private header "__iterator/segmented_iterator.h" }
@@ -1061,6 +1126,7 @@
module __memory {
module addressof { private header "__memory/addressof.h" }
module align { private header "__memory/align.h" }
+ module aligned_alloc { private header "__memory/aligned_alloc.h" }
module allocate_at_least { private header "__memory/allocate_at_least.h" }
module allocation_guard { private header "__memory/allocation_guard.h" }
module allocator { private header "__memory/allocator.h" }
@@ -1071,7 +1137,10 @@
module auto_ptr { private header "__memory/auto_ptr.h" }
module builtin_new_allocator { private header "__memory/builtin_new_allocator.h" }
module compressed_pair { private header "__memory/compressed_pair.h" }
- module concepts { private header "__memory/concepts.h" }
+ module concepts {
+ private header "__memory/concepts.h"
+ export type_traits.remove_reference
+ }
module construct_at { private header "__memory/construct_at.h" }
module destruct_n { private header "__memory/destruct_n.h" }
module pointer_traits { private header "__memory/pointer_traits.h" }
@@ -1110,6 +1179,13 @@
@requires_LIBCXX_ENABLE_THREADS@
header "mutex"
export *
+
+ module __mutex {
+ module lock_guard { private header "__mutex/lock_guard.h" }
+ module mutex { private header "__mutex/mutex.h" }
+ module tag_types { private header "__mutex/tag_types.h" }
+ module unique_lock { private header "__mutex/unique_lock.h" }
+ }
}
module new {
header "new"
@@ -1339,6 +1415,7 @@
export string_view
module __string {
module char_traits { private header "__string/char_traits.h" }
+ module constexpr_c_functions { private header "__string/constexpr_c_functions.h" }
module extern_template_lists { private header "__string/extern_template_lists.h" }
module string_fwd { private header "__fwd/string.h" }
}
@@ -1357,7 +1434,24 @@
}
module system_error {
header "system_error"
+ export __errc
export *
+ module __system_error {
+ module errc { private header "__system_error/errc.h" }
+ module error_category { private header "__system_error/error_category.h" }
+ module error_code {
+ private header "__system_error/error_code.h"
+ export functional.__functional.hash
+ export functional.__functional.unary_function
+ }
+ module error_condition {
+ private header "__system_error/error_condition.h"
+ export functional.__functional.hash
+ export functional.__functional.unary_function
+ }
+ module system_error { private header "__system_error/system_error.h" }
+
+ }
}
module thread {
@requires_LIBCXX_ENABLE_THREADS@
@@ -1373,18 +1467,18 @@
header "tuple"
export *
- module apply_cv { private header "__tuple_dir/apply_cv.h" }
+ module apply_cv { private header "__tuple/apply_cv.h" }
module get_fwd { private header "__fwd/get.h" }
- module make_tuple_types { private header "__tuple_dir/make_tuple_types.h" }
- module pair_like { private header "__tuple_dir/pair_like.h" }
- module sfinae_helpers { private header "__tuple_dir/sfinae_helpers.h" }
- module tuple_element { private header "__tuple_dir/tuple_element.h" }
+ module make_tuple_types { private header "__tuple/make_tuple_types.h" }
+ module pair_like { private header "__tuple/pair_like.h" }
+ module sfinae_helpers { private header "__tuple/sfinae_helpers.h" }
+ module tuple_element { private header "__tuple/tuple_element.h" }
module tuple_fwd { private header "__fwd/tuple.h" }
- module tuple_indices { private header "__tuple_dir/tuple_indices.h" }
- module tuple_like { private header "__tuple_dir/tuple_like.h" }
- module tuple_like_ext { private header "__tuple_dir/tuple_like_ext.h" }
- module tuple_size { private header "__tuple_dir/tuple_size.h" }
- module tuple_types { private header "__tuple_dir/tuple_types.h" }
+ module tuple_indices { private header "__tuple/tuple_indices.h" }
+ module tuple_like { private header "__tuple/tuple_like.h" }
+ module tuple_like_ext { private header "__tuple/tuple_like_ext.h" }
+ module tuple_size { private header "__tuple/tuple_size.h" }
+ module tuple_types { private header "__tuple/tuple_types.h" }
}
module type_traits {
header "type_traits"
@@ -1449,6 +1543,10 @@
module is_destructible { private header "__type_traits/is_destructible.h" }
module is_empty { private header "__type_traits/is_empty.h" }
module is_enum { private header "__type_traits/is_enum.h" }
+ module is_equality_comparable {
+ private header "__type_traits/is_equality_comparable.h"
+ export integral_constant
+ }
module is_final { private header "__type_traits/is_final.h" }
module is_floating_point { private header "__type_traits/is_floating_point.h" }
module is_function { private header "__type_traits/is_function.h" }
@@ -1519,6 +1617,7 @@
module nat { private header "__type_traits/nat.h" }
module negation { private header "__type_traits/negation.h" }
module noexcept_move_assign_container { private header "__type_traits/noexcept_move_assign_container.h" }
+ module predicate_traits { private header "__type_traits/predicate_traits.h" }
module promote { private header "__type_traits/promote.h" }
module rank { private header "__type_traits/rank.h" }
module remove_all_extents { private header "__type_traits/remove_all_extents.h" }
@@ -1534,7 +1633,11 @@
module strip_signature { private header "__type_traits/strip_signature.h" }
module type_identity { private header "__type_traits/type_identity.h" }
module type_list { private header "__type_traits/type_list.h" }
- module underlying_type { private header "__type_traits/underlying_type.h" }
+ module underlying_type {
+ private header "__type_traits/underlying_type.h"
+
+ export type_traits
+ }
module void_t { private header "__type_traits/void_t.h" }
}
module typeindex {
@@ -1562,7 +1665,10 @@
module __utility {
module as_const { private header "__utility/as_const.h" }
- module auto_cast { private header "__utility/auto_cast.h" }
+ module auto_cast {
+ private header "__utility/auto_cast.h"
+ export type_traits.decay
+ }
module cmp { private header "__utility/cmp.h" }
module convert_to_integral { private header "__utility/convert_to_integral.h" }
module declval { private header "__utility/declval.h" }
@@ -1611,20 +1717,14 @@
module __availability { private header "__availability" export * }
module __bit_reference { private header "__bit_reference" export * }
module __debug { header "__debug" export * }
- module __errc { private header "__errc" export * }
module __hash_table { header "__hash_table" export * }
module __locale {
@requires_LIBCXX_ENABLE_LOCALIZATION@
private header "__locale" export *
}
module __mbstate_t { private header "__mbstate_t.h" export * }
- module __mutex_base { private header "__mutex_base" export * }
module __node_handle { private header "__node_handle" export * }
module __split_buffer { private header "__split_buffer" export * }
- module __std_stream {
- @requires_LIBCXX_ENABLE_LOCALIZATION@
- private header "__std_stream" export *
- }
module __threading_support { header "__threading_support" export * }
module __tree { header "__tree" export * }
module __undef_macros { header "__undef_macros" export * }
@@ -1633,15 +1733,6 @@
module experimental {
requires cplusplus11
- module algorithm {
- header "experimental/algorithm"
- export *
- }
- module coroutine {
- requires coroutines
- header "experimental/coroutine"
- export *
- }
module deque {
header "experimental/deque"
export *
@@ -1650,10 +1741,6 @@
header "experimental/forward_list"
export *
}
- module functional {
- header "experimental/functional"
- export *
- }
module iterator {
header "experimental/iterator"
export *
diff --git a/third_party/llvm-project/libcxx/include/mutex b/third_party/llvm-project/libcxx/include/mutex
index d93fba8..ed9b43d 100644
--- a/third_party/llvm-project/libcxx/include/mutex
+++ b/third_party/llvm-project/libcxx/include/mutex
@@ -187,9 +187,15 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
#include <__memory/shared_ptr.h>
-#include <__mutex_base>
+#include <__mutex/lock_guard.h>
+#include <__mutex/mutex.h>
+#include <__mutex/tag_types.h>
+#include <__mutex/unique_lock.h>
#include <__threading_support>
#include <__utility/forward.h>
#include <cstdint>
@@ -262,9 +268,9 @@
{
using namespace chrono;
unique_lock<mutex> __lk(__m_);
- bool no_timeout = _Clock::now() < __t;
- while (no_timeout && __locked_)
- no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout;
+ bool __no_timeout = _Clock::now() < __t;
+ while (__no_timeout && __locked_)
+ __no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout;
if (!__locked_)
{
__locked_ = true;
@@ -304,7 +310,7 @@
{
using namespace chrono;
__thread_id __id = this_thread::get_id();
- unique_lock<mutex> lk(__m_);
+ unique_lock<mutex> __lk(__m_);
if (__id == __id_)
{
if (__count_ == numeric_limits<size_t>::max())
@@ -312,9 +318,9 @@
++__count_;
return true;
}
- bool no_timeout = _Clock::now() < __t;
- while (no_timeout && __count_ != 0)
- no_timeout = __cv_.wait_until(lk, __t) == cv_status::no_timeout;
+ bool __no_timeout = _Clock::now() < __t;
+ while (__no_timeout && __count_ != 0)
+ __no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout;
if (__count_ == 0)
{
__count_ = 1;
@@ -328,7 +334,7 @@
_LIBCPP_HIDE_FROM_ABI int
try_lock(_L0& __l0, _L1& __l1)
{
- unique_lock<_L0> __u0(__l0, try_to_lock);
+ unique_lock<_L0> __u0(__l0, try_to_lock_t());
if (__u0.owns_lock())
{
if (__l1.try_lock())
@@ -467,7 +473,7 @@
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class ..._Mutexes>
class _LIBCPP_TEMPLATE_VIS scoped_lock;
@@ -544,7 +550,7 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // !_LIBCPP_HAS_NO_THREADS
struct _LIBCPP_TEMPLATE_VIS once_flag;
@@ -704,9 +710,18 @@
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdlib>
+# include <cstring>
+# include <ctime>
# include <functional>
+# include <initializer_list>
+# include <new>
+# include <stdexcept>
+# include <system_error>
# include <type_traits>
+# include <typeinfo>
#endif
#endif // _LIBCPP_MUTEX
diff --git a/third_party/llvm-project/libcxx/include/new b/third_party/llvm-project/libcxx/include/new
index 0c826f4..af396cd 100644
--- a/third_party/llvm-project/libcxx/include/new
+++ b/third_party/llvm-project/libcxx/include/new
@@ -89,12 +89,14 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
#include <__config>
+#include <__exception/exception.h>
+#include <__type_traits/alignment_of.h>
#include <__type_traits/is_function.h>
#include <__type_traits/is_same.h>
#include <__type_traits/remove_cv.h>
+#include <__verbose_abort>
#include <cstddef>
#include <cstdlib>
-#include <exception>
#include <version>
#if defined(_LIBCPP_ABI_VCRUNTIME)
@@ -173,10 +175,10 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_array_new_length()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_array_new_length();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_array_new_length was thrown in -fno-exceptions mode");
#endif
}
@@ -189,14 +191,14 @@
#endif
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// Enable the declaration even if the compiler doesn't support the language
// feature.
struct destroying_delete_t {
explicit destroying_delete_t() = default;
};
inline constexpr destroying_delete_t destroying_delete{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
} // namespace std
@@ -332,46 +334,6 @@
#endif
}
-#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
-// Low-level helpers to call the aligned allocation and deallocation functions
-// on the target platform. This is used to implement libc++'s own memory
-// allocation routines -- if you need to allocate memory inside the library,
-// chances are that you want to use `__libcpp_allocate` instead.
-//
-// Returns the allocated memory, or `nullptr` on failure.
-inline _LIBCPP_INLINE_VISIBILITY void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
-# if defined(_LIBCPP_MSVCRT_LIKE)
- return ::_aligned_malloc(__size, __alignment);
-# elif _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC)
- // aligned_alloc() requires that __size is a multiple of __alignment,
- // but for C++ [new.delete.general], only states "if the value of an
- // alignment argument passed to any of these functions is not a valid
- // alignment value, the behavior is undefined".
- // To handle calls such as ::operator new(1, std::align_val_t(128)), we
- // round __size up to the next multiple of __alignment.
- size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
- // Rounding up could have wrapped around to zero, so we have to add another
- // max() ternary to the actual call site to avoid succeeded in that case.
- return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
-# else
- void* __result = nullptr;
- (void)::posix_memalign(&__result, __alignment, __size);
- // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
- return __result;
-# endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-void __libcpp_aligned_free(void* __ptr) {
-#if defined(_LIBCPP_MSVCRT_LIKE)
- ::_aligned_free(__ptr);
-#else
- ::free(__ptr);
-#endif
-}
-#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-
-
template <class _Tp>
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
@@ -381,7 +343,7 @@
return __builtin_launder(__p);
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
constexpr _Tp* launder(_Tp* __p) noexcept
@@ -390,7 +352,7 @@
}
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
#if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
@@ -399,11 +361,12 @@
#endif // defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <exception>
# include <type_traits>
#endif
diff --git a/third_party/llvm-project/libcxx/include/numbers b/third_party/llvm-project/libcxx/include/numbers
index 72034a6..ec9eea5 100644
--- a/third_party/llvm-project/libcxx/include/numbers
+++ b/third_party/llvm-project/libcxx/include/numbers
@@ -63,7 +63,7 @@
#include <__config>
#include <version>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -128,7 +128,7 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
diff --git a/third_party/llvm-project/libcxx/include/optional b/third_party/llvm-project/libcxx/include/optional
index 6a7e2d2..ddb3f19 100644
--- a/third_party/llvm-project/libcxx/include/optional
+++ b/third_party/llvm-project/libcxx/include/optional
@@ -165,16 +165,26 @@
#include <__functional/hash.h>
#include <__functional/invoke.h>
#include <__functional/unary_function.h>
+#include <__memory/addressof.h>
#include <__memory/construct_at.h>
-#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple/sfinae_helpers.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/disjunction.h>
+#include <__type_traits/is_trivially_copy_assignable.h>
+#include <__type_traits/is_trivially_copy_constructible.h>
+#include <__type_traits/is_trivially_destructible.h>
+#include <__type_traits/is_trivially_move_assignable.h>
+#include <__type_traits/is_trivially_move_constructible.h>
+#include <__type_traits/negation.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/swap.h>
+#include <__verbose_abort>
#include <initializer_list>
#include <new>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -200,7 +210,7 @@
} // namespace std
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -208,10 +218,10 @@
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
void __throw_bad_optional_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_optional_access();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_optional_access was thrown in -fno-exceptions mode");
#endif
}
@@ -259,7 +269,7 @@
: __val_(_VSTD::forward<_Args>(__args)...),
__engaged_(true) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Fp, class... _Args>
_LIBCPP_HIDE_FROM_ABI
constexpr __optional_destruct_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
@@ -301,7 +311,7 @@
: __val_(_VSTD::forward<_Args>(__args)...),
__engaged_(true) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Fp, class... _Args>
_LIBCPP_HIDE_FROM_ABI
constexpr __optional_destruct_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
@@ -357,7 +367,7 @@
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_Args&&... __args)
{
_LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_VSTD::construct_at(_VSTD::addressof(this->__val_), _VSTD::forward<_Args>(__args)...);
#else
::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
@@ -805,7 +815,7 @@
this->__construct_from(_VSTD::move(__v));
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _Fp, class... _Args>
_LIBCPP_HIDE_FROM_ABI
constexpr explicit optional(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
@@ -1047,7 +1057,7 @@
static_cast<value_type>(_VSTD::forward<_Up>(__v));
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _Func>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto and_then(_Func&& __f) & {
@@ -1171,7 +1181,7 @@
return _VSTD::move(*this);
return _VSTD::forward<_Func>(__f)();
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
using __base::reset;
};
@@ -1572,7 +1582,7 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
@@ -1583,6 +1593,7 @@
# include <memory>
# include <ratio>
# include <tuple>
+# include <type_traits>
# include <typeinfo>
# include <utility>
# include <variant>
diff --git a/third_party/llvm-project/libcxx/include/ostream b/third_party/llvm-project/libcxx/include/ostream
index 4780c76..610a283 100644
--- a/third_party/llvm-project/libcxx/include/ostream
+++ b/third_party/llvm-project/libcxx/include/ostream
@@ -165,8 +165,15 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
+#include <__exception/operations.h>
#include <__memory/shared_ptr.h>
#include <__memory/unique_ptr.h>
+#include <__system_error/error_code.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/is_base_of.h>
+#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
#include <bitset>
#include <ios>
#include <locale>
@@ -244,7 +251,7 @@
basic_ostream& operator<<(long double __f);
basic_ostream& operator<<(const void* __p);
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI
basic_ostream& operator<<(const volatile void* __p) {
return operator<<(const_cast<const void*>(__p));
@@ -253,7 +260,7 @@
basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb);
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// LWG 2221 - nullptr. This is not backported to older standards modes.
// See https://reviews.llvm.org/D127033 for more info on the rationale.
_LIBCPP_INLINE_VISIBILITY
@@ -314,18 +321,18 @@
if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
&& !uncaught_exception())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__os_.rdbuf()->pubsync() == -1)
__os_.setstate(ios_base::badbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -352,19 +359,19 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
if (__sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_Ip __i(__sb);
@@ -379,24 +386,24 @@
}
if (__c == 0)
this->setstate(ios_base::failbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_failbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -404,10 +411,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(bool __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -416,13 +423,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -430,10 +437,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(short __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -446,13 +453,13 @@
static_cast<long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -460,10 +467,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -472,13 +479,13 @@
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -486,10 +493,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(int __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -502,13 +509,13 @@
static_cast<long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -516,10 +523,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -528,13 +535,13 @@
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -542,10 +549,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -554,13 +561,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -568,10 +575,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -580,13 +587,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -594,10 +601,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -606,13 +613,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -620,10 +627,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -632,13 +639,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -646,10 +653,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(float __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -658,13 +665,13 @@
if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -672,10 +679,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(double __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -684,13 +691,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -698,10 +705,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long double __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -710,13 +717,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -724,10 +731,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -736,13 +743,13 @@
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -751,10 +758,10 @@
__put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
const _CharT* __str, size_t __len)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -769,13 +776,13 @@
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -791,10 +798,10 @@
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -810,13 +817,13 @@
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -852,10 +859,10 @@
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -884,13 +891,13 @@
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -921,10 +928,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::put(char_type __c)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -934,13 +941,13 @@
if (__o.failed())
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -948,23 +955,23 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __sen(*this);
if (__sen && __n)
{
if (this->rdbuf()->sputn(__s, __n) != __n)
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -972,10 +979,10 @@
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::flush()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf())
{
sentry __s(*this);
@@ -985,13 +992,13 @@
this->setstate(ios_base::badbit);
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -1130,7 +1137,7 @@
std::use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class _Traits>
@@ -1179,7 +1186,7 @@
template <class _Traits>
basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -1189,7 +1196,9 @@
_LIBCPP_END_NAMESPACE_STD
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iterator>
# include <type_traits>
#endif
diff --git a/third_party/llvm-project/libcxx/include/queue b/third_party/llvm-project/libcxx/include/queue
index 6c1b892..9690aaf 100644
--- a/third_party/llvm-project/libcxx/include/queue
+++ b/third_party/llvm-project/libcxx/include/queue
@@ -227,7 +227,6 @@
#include <__memory/uses_allocator.h>
#include <__utility/forward.h>
#include <deque>
-#include <type_traits>
#include <vector>
#include <version>
@@ -278,7 +277,7 @@
_LIBCPP_INLINE_VISIBILITY
queue(const queue& __q) : c(__q.c) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _InputIterator,
class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
_LIBCPP_HIDE_FROM_ABI
@@ -363,7 +362,7 @@
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
decltype(auto) emplace(_Args&&... __args)
{ return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#else
@@ -397,7 +396,7 @@
operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Container,
class = enable_if_t<!__is_allocator<_Container>::value>
>
@@ -413,7 +412,7 @@
-> queue<typename _Container::value_type, _Container>;
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _InputIterator,
class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
queue(_InputIterator, _InputIterator)
@@ -964,7 +963,9 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
+# include <type_traits>
#endif
#endif // _LIBCPP_QUEUE
diff --git a/third_party/llvm-project/libcxx/include/random b/third_party/llvm-project/libcxx/include/random
index 5fe4906..02d71ad 100644
--- a/third_party/llvm-project/libcxx/include/random
+++ b/third_party/llvm-project/libcxx/include/random
@@ -1734,6 +1734,7 @@
# include <concepts>
# include <cstddef>
# include <cstdint>
+# include <cstdlib>
# include <iosfwd>
# include <limits>
# include <numeric>
diff --git a/third_party/llvm-project/libcxx/include/ranges b/third_party/llvm-project/libcxx/include/ranges
index f999fa0..8f3b4b2 100644
--- a/third_party/llvm-project/libcxx/include/ranges
+++ b/third_party/llvm-project/libcxx/include/ranges
@@ -49,6 +49,8 @@
using range_reference_t = iter_reference_t<iterator_t<R>>;
template<range R>
using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;
+ template <range R>
+ using range_common_reference_t = iter_common_reference_t<iterator_t<R>>;
// [range.sized], sized ranges
template<class>
@@ -375,7 +377,6 @@
#include <__ranges/view_interface.h>
#include <__ranges/views.h>
#include <__ranges/zip_view.h>
-#include <type_traits>
#include <version>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
@@ -390,11 +391,16 @@
#include <iterator>
// [tuple.helper]
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <type_traits>
+#endif
+
#endif // _LIBCPP_RANGES
diff --git a/third_party/llvm-project/libcxx/include/ratio b/third_party/llvm-project/libcxx/include/ratio
index 3969a39..327e08c 100644
--- a/third_party/llvm-project/libcxx/include/ratio
+++ b/third_party/llvm-project/libcxx/include/ratio
@@ -501,7 +501,7 @@
__static_lcm<_R1::den, _R2::den>::value> type;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _R1, class _R2>
inline constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value;
diff --git a/third_party/llvm-project/libcxx/include/regex b/third_party/llvm-project/libcxx/include/regex
index 06c017f..f89b828 100644
--- a/third_party/llvm-project/libcxx/include/regex
+++ b/third_party/llvm-project/libcxx/include/regex
@@ -225,6 +225,8 @@
int compare(const sub_match& s) const;
int compare(const string_type& s) const;
int compare(const value_type* s) const;
+
+ void swap(sub_match& s) noexcept(see below);
};
typedef sub_match<const char*> csub_match;
@@ -770,10 +772,11 @@
#include <__iterator/wrap_iter.h>
#include <__locale>
#include <__memory_resource/polymorphic_allocator.h>
+#include <__type_traits/is_swappable.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <__utility/swap.h>
-#include <cstring>
+#include <__verbose_abort>
#include <deque>
#include <stdexcept>
#include <string>
@@ -1012,10 +1015,10 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_regex_error()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw regex_error(_Ev);
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("regex_error was thrown in -fno-exceptions mode");
#endif
}
@@ -4131,9 +4134,9 @@
{
// Found [=
// This means =] must exist
- value_type _Equal_close[2] = {'=', ']'};
- _ForwardIterator __temp = _VSTD::search(__first, __last, _Equal_close,
- _Equal_close+2);
+ value_type __equal_close[2] = {'=', ']'};
+ _ForwardIterator __temp = _VSTD::search(__first, __last, __equal_close,
+ __equal_close+2);
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [= ... =]
@@ -4173,9 +4176,9 @@
{
// Found [:
// This means :] must exist
- value_type _Colon_close[2] = {':', ']'};
- _ForwardIterator __temp = _VSTD::search(__first, __last, _Colon_close,
- _Colon_close+2);
+ value_type __colon_close[2] = {':', ']'};
+ _ForwardIterator __temp = _VSTD::search(__first, __last, __colon_close,
+ __colon_close+2);
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [: ... :]
@@ -4198,9 +4201,9 @@
{
// Found [.
// This means .] must exist
- value_type _Dot_close[2] = {'.', ']'};
- _ForwardIterator __temp = _VSTD::search(__first, __last, _Dot_close,
- _Dot_close+2);
+ value_type __dot_close[2] = {'.', ']'};
+ _ForwardIterator __temp = _VSTD::search(__first, __last, __dot_close,
+ __dot_close+2);
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [. ... .]
@@ -5009,6 +5012,16 @@
_LIBCPP_INLINE_VISIBILITY
int compare(const value_type* __s) const
{return str().compare(__s);}
+
+ _LIBCPP_HIDE_FROM_ABI
+ void swap(sub_match& __s)
+#ifndef _LIBCPP_CXX03_LANG
+ _NOEXCEPT(__is_nothrow_swappable<_BidirectionalIterator>::value)
+#endif // _LIBCPP_CXX03_LANG
+ {
+ this->pair<_BidirectionalIterator, _BidirectionalIterator>::swap(__s);
+ std::swap(matched, __s.matched);
+ }
};
template <class _BiIter>
@@ -5861,7 +5874,7 @@
{
deque<__state> __states;
ptrdiff_t __highest_j = 0;
- ptrdiff_t _Np = _VSTD::distance(__first, __last);
+ ptrdiff_t __np = _VSTD::distance(__first, __last);
__node* __st = __start_.get();
if (__st)
{
@@ -5904,7 +5917,7 @@
if (!__matched || __highest_j < __s.__current_ - __s.__first_)
__highest_j = __s.__current_ - __s.__first_;
__matched = true;
- if (__highest_j == _Np)
+ if (__highest_j == __np)
__states.clear();
else
__states.pop_back();
@@ -5956,7 +5969,7 @@
vector<__state> __states;
__state __best_state;
ptrdiff_t __highest_j = 0;
- ptrdiff_t _Np = _VSTD::distance(__first, __last);
+ ptrdiff_t __np = _VSTD::distance(__first, __last);
__node* __st = __start_.get();
if (__st)
{
@@ -6008,7 +6021,7 @@
__best_state = __s;
}
__matched = true;
- if (__highest_j == _Np)
+ if (__highest_j == __np)
__states.clear();
else
__states.pop_back();
@@ -6214,7 +6227,7 @@
return __r;
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _ST, class _SA, class _Ap, class _Cp, class _Tp>
bool
regex_search(const basic_string<_Cp, _ST, _SA>&& __s,
@@ -6277,7 +6290,7 @@
return _VSTD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -6350,7 +6363,7 @@
const regex_type& __re,
regex_constants::match_flag_type __m
= regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re,
regex_constants::match_flag_type __m
@@ -6482,7 +6495,7 @@
const regex_type& __re, int __submatch = 0,
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re, int __submatch = 0,
regex_constants::match_flag_type __m =
@@ -6493,7 +6506,7 @@
const regex_type& __re, const vector<int>& __submatches,
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re, const vector<int>& __submatches,
regex_constants::match_flag_type __m =
@@ -6507,7 +6520,7 @@
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type&& __re,
initializer_list<int> __submatches,
@@ -6522,7 +6535,7 @@
const int (&__submatches)[_Np],
regex_constants::match_flag_type __m =
regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
@@ -6844,7 +6857,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _BidirT>
@@ -6866,9 +6879,11 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
+# include <cstdlib>
# include <iosfwd>
# include <iterator>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/third_party/llvm-project/libcxx/include/scoped_allocator b/third_party/llvm-project/libcxx/include/scoped_allocator
index 461c67e..f6160b5 100644
--- a/third_party/llvm-project/libcxx/include/scoped_allocator
+++ b/third_party/llvm-project/libcxx/include/scoped_allocator
@@ -678,7 +678,7 @@
template <class...> friend class __scoped_allocator_storage;
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _OuterAlloc, class... _InnerAllocs>
scoped_allocator_adaptor(_OuterAlloc, _InnerAllocs...)
-> scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>;
diff --git a/third_party/llvm-project/libcxx/include/semaphore b/third_party/llvm-project/libcxx/include/semaphore
index ddccb28..cfbc247 100644
--- a/third_party/llvm-project/libcxx/include/semaphore
+++ b/third_party/llvm-project/libcxx/include/semaphore
@@ -46,12 +46,15 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__atomic/atomic_base.h>
+#include <__atomic/atomic_sync.h>
+#include <__atomic/memory_order.h>
#include <__availability>
#include <__chrono/time_point.h>
#include <__config>
#include <__thread/timed_backoff_policy.h>
#include <__threading_support>
-#include <atomic>
+#include <cstddef>
#include <limits>
#include <version>
@@ -172,11 +175,11 @@
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
bool try_acquire_until(chrono::time_point<Clock, Duration> const& __abs_time)
{
- auto const current = Clock::now();
- if (current >= __abs_time)
+ auto const __current = Clock::now();
+ if (__current >= __abs_time)
return try_acquire();
else
- return try_acquire_for(__abs_time - current);
+ return try_acquire_for(__abs_time - __current);
}
};
@@ -188,4 +191,8 @@
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+#endif
+
#endif //_LIBCPP_SEMAPHORE
diff --git a/third_party/llvm-project/libcxx/include/set b/third_party/llvm-project/libcxx/include/set
index 1154c4e..05bffe6 100644
--- a/third_party/llvm-project/libcxx/include/set
+++ b/third_party/llvm-project/libcxx/include/set
@@ -547,7 +547,7 @@
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -593,7 +593,7 @@
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
@@ -650,7 +650,7 @@
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
set(initializer_list<value_type> __il, const allocator_type& __a)
: set(__il, key_compare(), __a) {}
@@ -767,7 +767,7 @@
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__tree_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
@@ -844,7 +844,7 @@
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -858,21 +858,21 @@
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -880,7 +880,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -898,7 +898,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -915,7 +915,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
@@ -1038,7 +1038,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Compare, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
typename set<_Key, _Compare, _Allocator>::size_type
@@ -1084,7 +1084,7 @@
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
#endif
@@ -1121,7 +1121,7 @@
insert(__f, __l);
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
@@ -1186,7 +1186,7 @@
insert(__il.begin(), __il.end());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
multiset(initializer_list<value_type> __il, const allocator_type& __a)
: multiset(__il, key_compare(), __a) {}
@@ -1302,7 +1302,7 @@
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__tree_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
@@ -1380,7 +1380,7 @@
iterator find(const key_type& __k) {return __tree_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -1394,21 +1394,21 @@
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const
{return __tree_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -1416,7 +1416,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const key_type& __k) const
{return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -1434,7 +1434,7 @@
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const key_type& __k) const
{return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
@@ -1451,7 +1451,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
{return __tree_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
@@ -1573,7 +1573,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Compare, class _Allocator, class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
typename multiset<_Key, _Compare, _Allocator>::size_type
@@ -1584,7 +1584,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _CompareT = std::less<_KeyT>>
@@ -1598,8 +1598,10 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_SET
diff --git a/third_party/llvm-project/libcxx/include/shared_mutex b/third_party/llvm-project/libcxx/include/shared_mutex
index 6919898..db35514 100644
--- a/third_party/llvm-project/libcxx/include/shared_mutex
+++ b/third_party/llvm-project/libcxx/include/shared_mutex
@@ -124,16 +124,25 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
+#include <__chrono/duration.h>
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
+#include <__memory/addressof.h>
+#include <__mutex/mutex.h>
+#include <__mutex/tag_types.h>
+#include <__mutex/unique_lock.h>
+#include <__system_error/system_error.h>
+#include <__utility/swap.h>
+#include <cerrno>
#include <version>
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_LIBRARY)
-
-#include <__mutex_base>
+#if _LIBCPP_STD_VER >= 14 || defined(_LIBCPP_BUILDING_LIBRARY)
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -177,7 +186,7 @@
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
{
__shared_mutex_base __base_;
@@ -293,11 +302,11 @@
{
while (true)
{
- cv_status status = __base_.__gate1_.wait_until(__lk, __abs_time);
+ cv_status __status = __base_.__gate1_.wait_until(__lk, __abs_time);
if ((__base_.__state_ & __base_.__write_entered_) == 0 &&
(__base_.__state_ & __base_.__n_readers_) < __base_.__n_readers_)
break;
- if (status == cv_status::timeout)
+ if (__status == cv_status::timeout)
return false;
}
}
@@ -502,8 +511,12 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_STD_VER >= 14
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <system_error>
+#endif
+
#endif // _LIBCPP_SHARED_MUTEX
diff --git a/third_party/llvm-project/libcxx/include/source_location b/third_party/llvm-project/libcxx/include/source_location
index 4c4a096..e9e852a 100644
--- a/third_party/llvm-project/libcxx/include/source_location
+++ b/third_party/llvm-project/libcxx/include/source_location
@@ -35,7 +35,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20 && __has_builtin(__builtin_source_location)
+#if _LIBCPP_STD_VER >= 20 && __has_builtin(__builtin_source_location) && \
+ !(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER <= 1403)
class source_location {
// The names source_location::__impl, _M_file_name, _M_function_name, _M_line, and _M_column
@@ -78,7 +79,8 @@
}
};
-#endif // _LIBCPP_STD_VER >= 20 && __has_builtin(__builtin_source_location)
+#endif // _LIBCPP_STD_VER >= 20 && __has_builtin(__builtin_source_location) && !(defined(_LIBCPP_APPLE_CLANG_VER) &&
+ // _LIBCPP_APPLE_CLANG_VER <= 1403)
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/include/span b/third_party/llvm-project/libcxx/include/span
index 23af04f..2ef1ea6 100644
--- a/third_party/llvm-project/libcxx/include/span
+++ b/third_party/llvm-project/libcxx/include/span
@@ -141,11 +141,14 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
+#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <array> // for array
#include <cstddef> // for byte
#include <limits>
-#include <type_traits> // for remove_cv, etc
#include <version>
// standard-mandated includes
@@ -166,7 +169,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp>
struct __is_std_array : false_type {};
@@ -238,10 +241,12 @@
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
_LIBCPP_INLINE_VISIBILITY
constexpr explicit span(_It __first, _End __last) : __data_{_VSTD::to_address(__first)} {
- (void)__last;
- _LIBCPP_ASSERT((__last - __first >= 0), "invalid range in span's constructor (iterator, sentinel)");
- _LIBCPP_ASSERT(__last - __first == _Extent,
- "invalid range in span's constructor (iterator, sentinel): last - first != extent");
+ // [span.cons]/10
+ // Throws: When and what last - first throws.
+ [[maybe_unused]] auto __dist = __last - __first;
+ _LIBCPP_ASSERT(__dist >= 0, "invalid range in span's constructor (iterator, sentinel)");
+ _LIBCPP_ASSERT(
+ __dist == _Extent, "invalid range in span's constructor (iterator, sentinel): last - first != extent");
}
_LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data_{__arr} {}
@@ -566,10 +571,10 @@
auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept
{ return __s.__as_writable_bytes(); }
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<contiguous_iterator _It, class _EndOrSize>
span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _Tp, size_t _Sz>
span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;
@@ -583,7 +588,7 @@
template<ranges::contiguous_range _Range>
span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
@@ -593,6 +598,7 @@
# include <concepts>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_SPAN
diff --git a/third_party/llvm-project/libcxx/include/sstream b/third_party/llvm-project/libcxx/include/sstream
index 78cc28a..389bbf6 100644
--- a/third_party/llvm-project/libcxx/include/sstream
+++ b/third_party/llvm-project/libcxx/include/sstream
@@ -541,10 +541,10 @@
{
if (!(__mode_ & ios_base::out))
return traits_type::eof();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
ptrdiff_t __nout = this->pptr() - this->pbase();
ptrdiff_t __hm = __hm_ - this->pbase();
__str_.push_back(char_type());
@@ -553,13 +553,13 @@
this->setp(__p, __p + __str_.size());
this->__pbump(__nout);
__hm_ = this->pbase() + __hm;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
return traits_type::eof();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__hm_ = _VSTD::max(this->pptr() + 1, __hm_);
if (__mode_ & ios_base::in)
diff --git a/third_party/llvm-project/libcxx/include/stack b/third_party/llvm-project/libcxx/include/stack
index d653d1b..318c9c7 100644
--- a/third_party/llvm-project/libcxx/include/stack
+++ b/third_party/llvm-project/libcxx/include/stack
@@ -102,9 +102,9 @@
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__memory/uses_allocator.h>
+#include <__type_traits/is_same.h>
#include <__utility/forward.h>
#include <deque>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -204,7 +204,7 @@
: c(_VSTD::move(__s.c), __a) {}
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _InputIterator,
class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
_LIBCPP_HIDE_FROM_ABI
@@ -235,7 +235,7 @@
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
decltype(auto) emplace(_Args&&... __args)
{ return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#else
@@ -268,7 +268,7 @@
operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Container,
class = enable_if_t<!__is_allocator<_Container>::value>
>
@@ -284,7 +284,7 @@
-> stack<typename _Container::value_type, _Container>;
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template<class _InputIterator,
class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
stack(_InputIterator, _InputIterator)
@@ -366,6 +366,7 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <functional>
+# include <type_traits>
#endif
#endif // _LIBCPP_STACK
diff --git a/third_party/llvm-project/libcxx/include/stdatomic.h b/third_party/llvm-project/libcxx/include/stdatomic.h
index ff2a568..9c002e5 100644
--- a/third_party/llvm-project/libcxx/include/stdatomic.h
+++ b/third_party/llvm-project/libcxx/include/stdatomic.h
@@ -121,7 +121,7 @@
# pragma GCC system_header
#endif
-#if defined(__cplusplus) && _LIBCPP_STD_VER > 20
+#if defined(__cplusplus) && _LIBCPP_STD_VER >= 23
#include <atomic>
#include <version>
@@ -230,6 +230,6 @@
# include_next <stdatomic.h>
# endif
-#endif // defined(__cplusplus) && _LIBCPP_STD_VER > 20
+#endif // defined(__cplusplus) && _LIBCPP_STD_VER >= 23
#endif // _LIBCPP_STDATOMIC_H
diff --git a/third_party/llvm-project/libcxx/include/stdexcept b/third_party/llvm-project/libcxx/include/stdexcept
index 68de6ce..8e2f985 100644
--- a/third_party/llvm-project/libcxx/include/stdexcept
+++ b/third_party/llvm-project/libcxx/include/stdexcept
@@ -43,8 +43,8 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <cstdlib>
-#include <exception>
+#include <__exception/exception.h>
+#include <__verbose_abort>
#include <iosfwd> // for string forward decl
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -220,91 +220,88 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_logic_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw logic_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("logic_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_domain_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw domain_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("domain_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_invalid_argument(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw invalid_argument(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("invalid_argument was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_length_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw length_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("length_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_out_of_range(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw out_of_range(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("out_of_range was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_range_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw range_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("range_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_overflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw overflow_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("overflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_underflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw underflow_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("underflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <exception>
+#endif
+
#endif // _LIBCPP_STDEXCEPT
diff --git a/third_party/llvm-project/libcxx/include/string b/third_party/llvm-project/libcxx/include/string
index 9f5838d..1de3fb7 100644
--- a/third_party/llvm-project/libcxx/include/string
+++ b/third_party/llvm-project/libcxx/include/string
@@ -550,6 +550,7 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator.h>
#include <__memory/allocator_traits.h>
@@ -561,7 +562,15 @@
#include <__string/char_traits.h>
#include <__string/extern_template_lists.h>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_nothrow_default_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_standard_layout.h>
+#include <__type_traits/is_trivial.h>
#include <__type_traits/noexcept_move_assign_container.h>
+#include <__type_traits/remove_cvref.h>
#include <__utility/auto_cast.h>
#include <__utility/move.h>
#include <__utility/swap.h>
@@ -569,12 +578,10 @@
#include <climits>
#include <cstdint>
#include <cstdio> // EOF
-#include <cstdlib>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <string_view>
-#include <type_traits>
#include <version>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -842,8 +849,23 @@
__default_init();
}
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str, const allocator_type& __a);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str)
+ : __r_(__default_init_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc())) {
+ if (!__str.__is_long())
+ __r_.first() = __str.__r_.first();
+ else
+ __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
+ std::__debug_db_insert_c(this);
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str, const allocator_type& __a)
+ : __r_(__default_init_tag(), __a) {
+ if (!__str.__is_long())
+ __r_.first() = __str.__r_.first();
+ else
+ __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
+ std::__debug_db_insert_c(this);
+ }
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str)
@@ -875,7 +897,7 @@
}
#endif // _LIBCPP_CXX03_LANG
- template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
+ template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s)
: __r_(__default_init_tag(), __default_init_tag()) {
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
@@ -883,10 +905,15 @@
std::__debug_db_insert_c(this);
}
- template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a);
+ template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a)
+ : __r_(__default_init_tag(), __a) {
+ _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
+ __init(__s, traits_type::length(__s));
+ std::__debug_db_insert_c(this);
+ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
basic_string(nullptr_t) = delete;
#endif
@@ -911,7 +938,7 @@
std::__debug_db_insert_c(this);
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
basic_string(basic_string&& __str, size_type __pos, const _Allocator& __alloc = _Allocator())
: basic_string(std::move(__str), __pos, npos, __alloc) {}
@@ -941,11 +968,22 @@
}
#endif
- template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a);
+ template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)
+ : __r_(__default_init_tag(), __a) {
+ __init(__n, __c);
+ std::__debug_db_insert_c(this);
+ }
_LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator());
+ basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator())
+ : __r_(__default_init_tag(), __a) {
+ size_type __str_sz = __str.size();
+ if (__pos > __str_sz)
+ __throw_out_of_range();
+ __init(__str.data() + __pos, std::min(__n, __str_sz - __pos));
+ std::__debug_db_insert_c(this);
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator())
@@ -958,31 +996,49 @@
}
template <class _Tp,
- class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type());
+ basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type())
+ : __r_(__default_init_tag(), __a) {
+ __self_view __sv0 = __t;
+ __self_view __sv = __sv0.substr(__pos, __n);
+ __init(__sv.data(), __sv.size());
+ std::__debug_db_insert_c(this);
+ }
template <class _Tp,
- class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
- const _Tp& __t);
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t)
+ : __r_(__default_init_tag(), __default_init_tag()) {
+ __self_view __sv = __t;
+ __init(__sv.data(), __sv.size());
+ std::__debug_db_insert_c(this);
+ }
template <class _Tp,
- class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
- const _Tp& __t, const allocator_type& __a);
+ const _Tp& __t, const allocator_type& __a)
+ : __r_(__default_init_tag(), __a) {
+ __self_view __sv = __t;
+ __init(__sv.data(), __sv.size());
+ std::__debug_db_insert_c(this);
+ }
- template <class _InputIterator, class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value> >
+ template <class _InputIterator, __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last)
: __r_(__default_init_tag(), __default_init_tag()) {
__init(__first, __last);
std::__debug_db_insert_c(this);
}
- template <class _InputIterator, class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value> >
+ template <class _InputIterator, __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
: __r_(__default_init_tag(), __a) {
@@ -1004,15 +1060,19 @@
}
#endif // _LIBCPP_CXX03_LANG
- inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string();
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() {
+ std::__debug_db_erase_c(this);
+ if (__is_long())
+ __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const basic_string& __str);
- template <class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
- !__is_same_uncvref<_Tp, basic_string>::value> >
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value, int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const _Tp& __t) {
__self_view __sv = __t;
return assign(__sv);
@@ -1030,7 +1090,7 @@
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& operator=(const value_type* __s) {return assign(__s);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
basic_string& operator=(nullptr_t) = delete;
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c);
@@ -1097,7 +1157,7 @@
_LIBCPP_CONSTEXPR_SINCE_CXX20 void reserve(size_type __requested_capacity);
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Op>
_LIBCPP_HIDE_FROM_ABI constexpr
void resize_and_overwrite(size_type __n, _Op __op) {
@@ -1132,14 +1192,11 @@
return append(__str);
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string >::value,
- basic_string&
- >
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string >::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
operator+=(const _Tp& __t) {
__self_view __sv = __t; return append(__sv);
}
@@ -1162,25 +1219,27 @@
return append(__str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- append(const _Tp& __t) { __self_view __sv = __t; return append(__sv.data(), __sv.size()); }
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ append(const _Tp& __t) {
+ __self_view __sv = __t;
+ return append(__sv.data(), __sv.size());
+ }
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);
- template <class _Tp>
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- append(const _Tp& __t, size_type __pos, size_type __n=npos);
+
+ basic_string&
+ append(const _Tp& __t, size_type __pos, size_type __n = npos);
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);
@@ -1188,27 +1247,16 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __append_default_init(size_type __n);
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- basic_string&
- >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+ template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
append(_InputIterator __first, _InputIterator __last) {
- const basic_string __temp(__first, __last, __alloc());
- append(__temp.data(), __temp.size());
- return *this;
+ const basic_string __temp(__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ return *this;
}
- template<class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string&
- >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+
+ template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
append(_ForwardIterator __first, _ForwardIterator __last);
#ifndef _LIBCPP_CXX03_LANG
@@ -1239,14 +1287,13 @@
return *(data() + size() - 1);
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- assign(const _Tp & __t) { __self_view __sv = __t; return assign(__sv.data(), __sv.size()); }
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(const _Tp& __t) {
+ __self_view __sv = __t;
+ return assign(__sv.data(), __sv.size());
+ }
+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& assign(const basic_string& __str) { return *this = __str; }
#ifndef _LIBCPP_CXX03_LANG
@@ -1256,34 +1303,25 @@
{*this = std::move(__str); return *this;}
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- assign(const _Tp & __t, size_type __pos, size_type __n=npos);
+
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(const _Tp& __t, size_type __pos, size_type __n = npos);
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s);
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c);
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- basic_string&
- >
- assign(_InputIterator __first, _InputIterator __last);
- template<class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string&
- >
- assign(_ForwardIterator __first, _ForwardIterator __last);
+ template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(_InputIterator __first, _InputIterator __last);
+
+ template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ assign(_ForwardIterator __first, _ForwardIterator __last);
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
@@ -1294,30 +1332,26 @@
return insert(__pos1, __str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- insert(size_type __pos1, const _Tp& __t)
- { __self_view __sv = __t; return insert(__pos1, __sv.data(), __sv.size()); }
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ insert(size_type __pos1, const _Tp& __t) {
+ __self_view __sv = __t;
+ return insert(__pos1, __sv.data(), __sv.size());
+ }
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n = npos);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
insert(const_iterator __pos, size_type __n, value_type __c) {
@@ -1328,22 +1362,14 @@
return begin() + __p;
}
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- iterator
- >
- insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
- template<class _ForwardIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- iterator
- >
- insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
+ template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
+ insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
+
+ template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
+ insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
iterator insert(const_iterator __pos, initializer_list<value_type> __il)
@@ -1361,28 +1387,27 @@
return replace(__pos1, __n1, __str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- replace(size_type __pos1, size_type __n1, const _Tp& __t) { __self_view __sv = __t; return replace(__pos1, __n1, __sv.data(), __sv.size()); }
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
- basic_string&
- >
- replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
- _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos1, size_type __n1, const _Tp& __t) {
+ __self_view __sv = __t;
+ return replace(__pos1, __n1, __sv.data(), __sv.size());
+ }
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos);
+
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos);
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
replace(const_iterator __i1, const_iterator __i2, const basic_string& __str) {
@@ -1390,14 +1415,12 @@
static_cast<size_type>(__i1 - begin()), static_cast<size_type>(__i2 - __i1), __str.data(), __str.size());
}
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- basic_string&
- >
- replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { __self_view __sv = __t; return replace(__i1 - begin(), __i2 - __i1, __sv); }
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) {
+ __self_view __sv = __t;
+ return replace(__i1 - begin(), __i2 - __i1, __sv);
+ }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n) {
@@ -1414,14 +1437,10 @@
return replace(static_cast<size_type>(__i1 - begin()), static_cast<size_type>(__i2 - __i1), __n, __c);
}
- template<class _InputIterator>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_input_iterator<_InputIterator>::value,
- basic_string&
- >
- replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
+ template <class _InputIterator, __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
+ replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
@@ -1460,7 +1479,7 @@
const value_type* c_str() const _NOEXCEPT {return data();}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
const value_type* data() const _NOEXCEPT {return std::__to_address(__get_pointer());}
-#if _LIBCPP_STD_VER > 14 || defined(_LIBCPP_BUILDING_LIBRARY)
+#if _LIBCPP_STD_VER >= 17 || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
value_type* data() _NOEXCEPT {return std::__to_address(__get_pointer());}
#endif
@@ -1471,16 +1490,11 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
- _LIBCPP_CONSTEXPR_SINCE_CXX20
- size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
_LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;
@@ -1488,14 +1502,10 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1505,14 +1515,10 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1523,14 +1529,10 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1541,14 +1543,10 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_first_not_of(const _Tp &__t, size_type __pos = 0) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1559,14 +1557,10 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- size_type
- >
- find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
+ find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20
size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1577,23 +1571,13 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
int compare(const basic_string& __str) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
- >
- compare(const _Tp &__t) const _NOEXCEPT;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 int
+ compare(const _Tp& __t) const _NOEXCEPT;
- template <class _Tp>
- _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
- >
- compare(size_type __pos1, size_type __n1, const _Tp& __t) const;
+ template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> = 0>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 int
+ compare(size_type __pos1, size_type __n1, const _Tp& __t) const;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
@@ -1601,20 +1585,19 @@
int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2,
size_type __n2 = npos) const;
- template <class _Tp>
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
- int
- >
- compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const;
+ template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string>::value,
+ int> = 0>
+ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
+ compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) const;
+
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const value_type* __s) const _NOEXCEPT;
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
_LIBCPP_CONSTEXPR_SINCE_CXX20
int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
constexpr _LIBCPP_HIDE_FROM_ABI
bool starts_with(__self_view __sv) const noexcept
{ return __self_view(data(), size()).starts_with(__sv); }
@@ -1640,7 +1623,7 @@
{ return ends_with(__self_view(__s)); }
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
constexpr _LIBCPP_HIDE_FROM_ABI
bool contains(__self_view __sv) const noexcept
{ return __self_view(data(), size()).contains(__sv); }
@@ -1683,7 +1666,7 @@
}
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __begin_lifetime(pointer __begin, size_type __n) {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
if (__libcpp_is_constant_evaluated()) {
for (size_type __i = 0; __i != __n; ++__i)
std::construct_at(std::addressof(__begin[__i]));
@@ -1691,7 +1674,7 @@
#else
(void)__begin;
(void)__n;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __default_init() {
@@ -1839,21 +1822,11 @@
// to only inline the fast path code directly in the ctor.
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __init_copy_ctor_external(const value_type* __s, size_type __sz);
- template <class _InputIterator>
- inline _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
- >
- __init(_InputIterator __first, _InputIterator __last);
+ template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> = 0>
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(_InputIterator __first, _InputIterator __last);
- template <class _ForwardIterator>
- inline _LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __is_cpp17_forward_iterator<_ForwardIterator>::value
- >
- __init(_ForwardIterator __first, _ForwardIterator __last);
+ template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> = 0>
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(_ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_CONSTEXPR_SINCE_CXX20
void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
@@ -1918,7 +1891,7 @@
_NOEXCEPT_(__alloc_traits::is_always_equal::value);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __move_assign(basic_string& __str, true_type)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_NOEXCEPT;
#else
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
@@ -2129,44 +2102,6 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
- __init(__s, traits_type::length(__s));
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
- : __r_(__default_init_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc()))
-{
- if (!__str.__is_long())
- __r_.first() = __str.__r_.first();
- else
- __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()),
- __str.__get_long_size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(
- const basic_string& __str, const allocator_type& __a)
- : __r_(__default_init_tag(), __a)
-{
- if (!__str.__is_long())
- __r_.first() = __str.__r_.first();
- else
- __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()),
- __str.__get_long_size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
void basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(
const value_type* __s, size_type __sz) {
@@ -2220,81 +2155,18 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class>
+template <class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> >
_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- __init(__n, __c);
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str,
- size_type __pos, size_type __n,
- const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- size_type __str_sz = __str.size();
- if (__pos > __str_sz)
- __throw_out_of_range();
- __init(__str.data() + __pos, std::min(__n, __str_sz - __pos));
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp, class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(
- const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a)
- : __r_(__default_init_tag(), __a)
-{
- __self_view __sv0 = __t;
- __self_view __sv = __sv0.substr(__pos, __n);
- __init(__sv.data(), __sv.size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp, class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)
- : __r_(__default_init_tag(), __default_init_tag())
-{
- __self_view __sv = __t;
- __init(__sv.data(), __sv.size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp, class>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _Allocator& __a)
- : __r_(__default_init_tag(), __a)
-{
- __self_view __sv = __t;
- __init(__sv.data(), __sv.size());
- std::__debug_db_insert_c(this);
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-template <class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value
->
-basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
+void basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
{
__default_init();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2302,16 +2174,12 @@
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value
->
+template <class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 void
basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)
{
if (__libcpp_is_constant_evaluated())
@@ -2335,14 +2203,14 @@
__set_long_size(__sz);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first, (void) ++__p)
traits_type::assign(*__p, *__first);
traits_type::assign(*__p, value_type());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2350,16 +2218,7 @@
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-
-template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-basic_string<_CharT, _Traits, _Allocator>::~basic_string()
-{
- std::__debug_db_erase_c(this);
- if (__is_long())
- __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
@@ -2522,7 +2381,7 @@
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
{
- if (this != &__str) {
+ if (this != std::addressof(__str)) {
__copy_assign_alloc(__str);
if (!__is_long()) {
if (!__str.__is_long()) {
@@ -2555,7 +2414,7 @@
inline _LIBCPP_CONSTEXPR_SINCE_CXX20
void
basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_NOEXCEPT
#else
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
@@ -2584,13 +2443,8 @@
#endif
template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
{
const basic_string __temp(__first, __last, __alloc());
@@ -2599,13 +2453,8 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
size_type __cap = capacity();
@@ -2647,16 +2496,12 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
-basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __pos, size_type __n)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp& __t, size_type __pos, size_type __n) {
__self_view __sv = __t;
size_type __sz = __sv.size();
if (__pos > __sz)
@@ -2664,7 +2509,6 @@
return assign(__sv.data() + __pos, std::min(__n, __sz - __pos));
}
-
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string<_CharT, _Traits, _Allocator>&
@@ -2786,13 +2630,8 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(
_ForwardIterator __first, _ForwardIterator __last)
{
@@ -2833,15 +2672,12 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
- __enable_if_t
- <
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
- >
-basic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __pos, size_type __n)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::append(const _Tp& __t, size_type __pos, size_type __n) {
__self_view __sv = __t;
size_type __sz = __sv.size();
if (__pos > __sz)
@@ -2933,13 +2769,8 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_exactly_cpp17_input_iterator<_InputIterator>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::iterator
->
+template<class _InputIterator, __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
{
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
@@ -2950,13 +2781,8 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_forward_iterator<_ForwardIterator>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::iterator
->
+template<class _ForwardIterator, __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
{
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
@@ -2991,16 +2817,12 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
-basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t,
- size_type __pos2, size_type __n)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n) {
__self_view __sv = __t;
size_type __str_sz = __sv.size();
if (__pos2 > __str_sz)
@@ -3135,13 +2957,8 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __is_cpp17_input_iterator<_InputIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
+template<class _InputIterator, __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2,
_InputIterator __j1, _InputIterator __j2)
{
@@ -3162,16 +2979,13 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- basic_string<_CharT, _Traits, _Allocator>&
->
-basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const _Tp& __t,
- size_type __pos2, size_type __n2)
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::replace(
+ size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2) {
__self_view __sv = __t;
size_type __str_sz = __sv.size();
if (__pos2 > __str_sz)
@@ -3365,23 +3179,23 @@
}
else
{
- #ifndef _LIBCPP_NO_EXCEPTIONS
+ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
auto __allocation = std::__allocate_at_least(__alloc(), __target_capacity + 1);
__new_data = __allocation.ptr;
__target_capacity = __allocation.count - 1;
- #ifndef _LIBCPP_NO_EXCEPTIONS
+ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
return;
}
- #else // _LIBCPP_NO_EXCEPTIONS
+ #else // _LIBCPP_HAS_NO_EXCEPTIONS
if (__new_data == nullptr)
return;
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__begin_lifetime(__new_data, __target_capacity + 1);
__now_long = true;
@@ -3495,13 +3309,8 @@
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const _Tp &__t,
size_type __pos) const _NOEXCEPT
{
@@ -3556,13 +3365,8 @@
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3617,13 +3421,8 @@
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3677,13 +3476,8 @@
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3737,13 +3531,8 @@
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3798,13 +3587,8 @@
}
template<class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::size_type
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const _Tp& __t,
size_type __pos) const _NOEXCEPT
{
@@ -3837,13 +3621,8 @@
// compare
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 int
basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const _NOEXCEPT
{
__self_view __sv = __t;
@@ -3893,13 +3672,8 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
- int
->
+template <class _Tp, __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
const _Tp& __t) const
@@ -3919,20 +3693,12 @@
}
template <class _CharT, class _Traits, class _Allocator>
-template <class _Tp>
-_LIBCPP_CONSTEXPR_SINCE_CXX20
-__enable_if_t
-<
- __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
- && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
- int
->
-basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
- size_type __n1,
- const _Tp& __t,
- size_type __pos2,
- size_type __n2) const
-{
+template <class _Tp,
+ __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
+ !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
+ int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20 int basic_string<_CharT, _Traits, _Allocator>::compare(
+ size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2) const {
__self_view __sv = __t;
return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
}
@@ -3982,7 +3748,7 @@
return false;
if (data() == nullptr)
return false;
- if (data()[size()] != value_type())
+ if (!_Traits::eq(data()[size()], value_type()))
return false;
return true;
}
@@ -4010,7 +3776,7 @@
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
#else
size_t __lhs_sz = __lhs.size();
@@ -4060,7 +3826,7 @@
operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
const _CharT* __rhs) _NOEXCEPT
{
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
#else
typedef basic_string<_CharT, _Traits, _Allocator> _String;
@@ -4071,7 +3837,7 @@
#endif
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(
@@ -4086,7 +3852,7 @@
return basic_string_view<_CharT, _Traits>(__lhs) <=> basic_string_view<_CharT, _Traits>(__rhs);
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
@@ -4230,7 +3996,7 @@
{
return !(__lhs < __rhs);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// operator +
@@ -4445,11 +4211,11 @@
basic_string<_CharT, _Traits, _Allocator>::npos;
template <class _CharT, class _Allocator>
-struct __string_hash : public __unary_function<basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t>
-{
- size_t
- operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT
- { return std::__do_string_hash(__val.data(), __val.data() + __val.size()); }
+struct __string_hash : public __unary_function<basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t> {
+ _LIBCPP_HIDE_FROM_ABI size_t
+ operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT {
+ return std::__do_string_hash(__val.data(), __val.data() + __val.size());
+ }
};
template <class _Allocator>
@@ -4504,7 +4270,7 @@
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits, class _Allocator, class _Up>
inline _LIBCPP_HIDE_FROM_ABI
typename basic_string<_CharT, _Traits, _Allocator>::size_type
@@ -4562,7 +4328,7 @@
#endif // _LIBCPP_ENABLE_DEBUG_MODE
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
// Literal suffixes for basic_string [basic.string.literals]
inline namespace literals
{
@@ -4604,7 +4370,7 @@
} // namespace string_literals
} // namespace literals
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <>
inline constexpr bool __format::__enable_insertable<std::basic_string<char>> = true;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -4622,9 +4388,11 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
# include <new>
+# include <type_traits>
# include <typeinfo>
# include <utility>
# include <vector>
diff --git a/third_party/llvm-project/libcxx/include/string_view b/third_party/llvm-project/libcxx/include/string_view
index ea98e38..f8cecfb 100644
--- a/third_party/llvm-project/libcxx/include/string_view
+++ b/third_party/llvm-project/libcxx/include/string_view
@@ -208,6 +208,7 @@
#include <__functional/hash.h>
#include <__functional/unary_function.h>
#include <__fwd/string_view.h>
+#include <__iterator/bounded_iter.h>
#include <__iterator/concepts.h>
#include <__iterator/readable_traits.h>
#include <__iterator/reverse_iterator.h>
@@ -218,10 +219,17 @@
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
#include <__string/char_traits.h>
+#include <__type_traits/is_array.h>
+#include <__type_traits/is_convertible.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_standard_layout.h>
+#include <__type_traits/is_trivial.h>
+#include <__type_traits/remove_cvref.h>
+#include <__type_traits/remove_reference.h>
+#include <__type_traits/type_identity.h>
#include <iosfwd>
#include <limits>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -265,7 +273,11 @@
using const_pointer = const _CharT*;
using reference = _CharT&;
using const_reference = const _CharT&;
+#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+ using const_iterator = __bounded_iter<const_pointer>;
+#else
using const_iterator = const_pointer; // See [string.view.iterators]
+#endif
using iterator = const_iterator;
using const_reverse_iterator = _VSTD::reverse_iterator<const_iterator>;
using reverse_iterator = const_reverse_iterator;
@@ -293,12 +305,13 @@
basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
: __data_(__s), __size_(__len)
{
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_ASSERT(__len <= static_cast<size_type>(numeric_limits<difference_type>::max()), "string_view::string_view(_CharT *, size_t): length does not fit in difference_type");
_LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
#endif
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
requires (is_same_v<iter_value_t<_It>, _CharT> && !is_convertible_v<_End, size_type>)
constexpr _LIBCPP_HIDE_FROM_ABI basic_string_view(_It __begin, _End __end)
@@ -306,9 +319,9 @@
{
_LIBCPP_ASSERT((__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range");
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Range>
requires (
!is_same_v<remove_cvref_t<_Range>, basic_string_view> &&
@@ -318,20 +331,17 @@
!is_convertible_v<_Range, const _CharT*> &&
(!requires(remove_cvref_t<_Range>& __d) {
__d.operator _VSTD::basic_string_view<_CharT, _Traits>();
- }) &&
- (!requires {
- typename remove_reference_t<_Range>::traits_type;
- } || is_same_v<typename remove_reference_t<_Range>::traits_type, _Traits>)
+ })
)
constexpr explicit _LIBCPP_HIDE_FROM_ABI
basic_string_view(_Range&& __r) : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
basic_string_view(const _CharT* __s)
: __data_(__s), __size_(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
basic_string_view(nullptr_t) = delete;
#endif
@@ -343,10 +353,22 @@
const_iterator end() const _NOEXCEPT { return cend(); }
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- const_iterator cbegin() const _NOEXCEPT { return __data_; }
+ const_iterator cbegin() const _NOEXCEPT {
+#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+ return std::__make_bounded_iter(data(), data(), data() + size());
+#else
+ return __data_;
+#endif
+ }
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- const_iterator cend() const _NOEXCEPT { return __data_ + __size_; }
+ const_iterator cend() const _NOEXCEPT {
+#ifdef _LIBCPP_DEBUG_ITERATOR_BOUNDS_CHECKING
+ return std::__make_bounded_iter(data() + size(), data(), data() + size());
+#else
+ return __data_ + __size_;
+#endif
+ }
_LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_INLINE_VISIBILITY
const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
@@ -674,7 +696,7 @@
(data(), size(), __s, __pos, traits_type::length(__s));
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
constexpr _LIBCPP_INLINE_VISIBILITY
bool starts_with(basic_string_view __s) const noexcept
{ return size() >= __s.size() && compare(0, __s.size(), __s) == 0; }
@@ -700,7 +722,7 @@
{ return ends_with(basic_string_view(__s)); }
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
constexpr _LIBCPP_INLINE_VISIBILITY
bool contains(basic_string_view __sv) const noexcept
{ return find(__sv) != npos; }
@@ -720,23 +742,23 @@
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_string_view);
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits>
inline constexpr bool ranges::enable_view<basic_string_view<_CharT, _Traits>> = true;
template <class _CharT, class _Traits>
inline constexpr bool ranges::enable_borrowed_range<basic_string_view<_CharT, _Traits> > = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// [string.view.deduct]
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
basic_string_view(_It, _End) -> basic_string_view<iter_value_t<_It>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <ranges::contiguous_range _Range>
basic_string_view(_Range) -> basic_string_view<ranges::range_value_t<_Range>>;
#endif
@@ -773,11 +795,11 @@
if (__lhs.size() != __rhs.size()) return false;
return __lhs.compare(__rhs) == 0;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// operator <=>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI constexpr auto
@@ -807,7 +829,7 @@
}
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
// operator !=
template<class _CharT, class _Traits>
@@ -940,7 +962,7 @@
return __lhs.compare(__rhs) >= 0;
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
@@ -976,7 +998,7 @@
struct hash<basic_string_view<wchar_t, char_traits<wchar_t> > > : __string_view_hash<wchar_t> {};
#endif
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline namespace literals
{
inline namespace string_view_literals
@@ -1024,8 +1046,10 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_STRING_VIEW
diff --git a/third_party/llvm-project/libcxx/include/system_error b/third_party/llvm-project/libcxx/include/system_error
index 9891992..a60c984 100644
--- a/third_party/llvm-project/libcxx/include/system_error
+++ b/third_party/llvm-project/libcxx/include/system_error
@@ -146,13 +146,11 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <__errc>
-#include <__functional/hash.h>
-#include <__functional/unary_function.h>
-#include <__memory/addressof.h>
-#include <stdexcept>
-#include <string>
-#include <type_traits>
+#include <__system_error/errc.h>
+#include <__system_error/error_category.h>
+#include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
+#include <__system_error/system_error.h>
#include <version>
// standard-mandated includes
@@ -164,385 +162,11 @@
# pragma GCC system_header
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-// is_error_code_enum
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_error_code_enum
- : public false_type {};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp>
-inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value;
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdint>
+# include <cstring>
+# include <limits>
+# include <type_traits>
#endif
-// is_error_condition_enum
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum
- : public false_type {};
-
-#if _LIBCPP_STD_VER > 14
-template <class _Tp>
-inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
-#endif
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc>
- : true_type { };
-
-#ifdef _LIBCPP_CXX03_LANG
-template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc::__lx>
- : true_type { };
-#endif
-
-class _LIBCPP_TYPE_VIS error_condition;
-class _LIBCPP_TYPE_VIS error_code;
-
-// class error_category
-
-class _LIBCPP_HIDDEN __do_message;
-
-class _LIBCPP_TYPE_VIS error_category
-{
-public:
- virtual ~error_category() _NOEXCEPT;
-
-#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
- error_category() noexcept;
-#else
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR_SINCE_CXX14 error_category() _NOEXCEPT = default;
-#endif
- error_category(const error_category&) = delete;
- error_category& operator=(const error_category&) = delete;
-
- virtual const char* name() const _NOEXCEPT = 0;
- virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
- virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
- virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
- virtual string message(int __ev) const = 0;
-
- _LIBCPP_INLINE_VISIBILITY
- bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;}
-
-#if _LIBCPP_STD_VER > 17
-
- _LIBCPP_HIDE_FROM_ABI
- strong_ordering operator<=>(const error_category& __rhs) const noexcept {return compare_three_way()(this, std::addressof(__rhs));}
-
-#else // _LIBCPP_STD_VER > 17
-
- _LIBCPP_INLINE_VISIBILITY
- bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);}
-
- _LIBCPP_INLINE_VISIBILITY
- bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
-
-#endif // _LIBCPP_STD_VER > 17
-
- friend class _LIBCPP_HIDDEN __do_message;
-};
-
-class _LIBCPP_HIDDEN __do_message
- : public error_category
-{
-public:
- string message(int __ev) const override;
-};
-
-_LIBCPP_FUNC_VIS const error_category& generic_category() _NOEXCEPT;
-_LIBCPP_FUNC_VIS const error_category& system_category() _NOEXCEPT;
-
-namespace __adl_only {
- // Those cause ADL to trigger but they are not viable candidates,
- // so they are never actually selected.
- void make_error_condition() = delete;
- void make_error_code() = delete;
-} // namespace __adl_only
-
-class _LIBCPP_TYPE_VIS error_condition
-{
- int __val_;
- const error_category* __cat_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- error_condition(int __val, const error_category& __cat) _NOEXCEPT
- : __val_(__val), __cat_(&__cat) {}
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- error_condition(_Ep __e,
- typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr
- ) _NOEXCEPT
- {
- using __adl_only::make_error_condition;
- *this = make_error_condition(__e);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void assign(int __val, const error_category& __cat) _NOEXCEPT
- {
- __val_ = __val;
- __cat_ = &__cat;
- }
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_error_condition_enum<_Ep>::value,
- error_condition&
- >::type
- operator=(_Ep __e) _NOEXCEPT
- {
- using __adl_only::make_error_condition;
- *this = make_error_condition(__e);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void clear() _NOEXCEPT
- {
- __val_ = 0;
- __cat_ = &generic_category();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- int value() const _NOEXCEPT {return __val_;}
-
- _LIBCPP_INLINE_VISIBILITY
- const error_category& category() const _NOEXCEPT {return *__cat_;}
- string message() const;
-
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT {return __val_ != 0;}
-};
-
-inline _LIBCPP_INLINE_VISIBILITY
-error_condition
-make_error_condition(errc __e) _NOEXCEPT
-{
- return error_condition(static_cast<int>(__e), generic_category());
-}
-
-// error_code
-
-class _LIBCPP_TYPE_VIS error_code
-{
- int __val_;
- const error_category* __cat_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- error_code(int __val, const error_category& __cat) _NOEXCEPT
- : __val_(__val), __cat_(&__cat) {}
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- error_code(_Ep __e,
- typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr
- ) _NOEXCEPT
- {
- using __adl_only::make_error_code;
- *this = make_error_code(__e);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void assign(int __val, const error_category& __cat) _NOEXCEPT
- {
- __val_ = __val;
- __cat_ = &__cat;
- }
-
- template <class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_error_code_enum<_Ep>::value,
- error_code&
- >::type
- operator=(_Ep __e) _NOEXCEPT
- {
- using __adl_only::make_error_code;
- *this = make_error_code(__e);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void clear() _NOEXCEPT
- {
- __val_ = 0;
- __cat_ = &system_category();
- }
-
- _LIBCPP_INLINE_VISIBILITY
- int value() const _NOEXCEPT {return __val_;}
-
- _LIBCPP_INLINE_VISIBILITY
- const error_category& category() const _NOEXCEPT {return *__cat_;}
-
- _LIBCPP_INLINE_VISIBILITY
- error_condition default_error_condition() const _NOEXCEPT
- {return __cat_->default_error_condition(__val_);}
-
- string message() const;
-
- _LIBCPP_INLINE_VISIBILITY
- explicit operator bool() const _NOEXCEPT {return __val_ != 0;}
-};
-
-inline _LIBCPP_INLINE_VISIBILITY
-error_code
-make_error_code(errc __e) _NOEXCEPT
-{
- return error_code(static_cast<int>(__e), generic_category());
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_code& __x, const error_code& __y) _NOEXCEPT
-{
- return __x.category() == __y.category() && __x.value() == __y.value();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT
-{
- return __x.category().equivalent(__x.value(), __y)
- || __y.category().equivalent(__x, __y.value());
-}
-
-#if _LIBCPP_STD_VER <= 17
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT
-{
- return __y == __x;
-}
-#endif
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT
-{
- return __x.category() == __y.category() && __x.value() == __y.value();
-}
-
-#if _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
-{return !(__x == __y);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
-{
- return __x.category() < __y.category()
- || (__x.category() == __y.category() && __x.value() < __y.value());
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool
-operator<(const error_code& __x, const error_code& __y) _NOEXCEPT
-{
- return __x.category() < __y.category()
- || (__x.category() == __y.category() && __x.value() < __y.value());
-}
-
-#else // _LIBCPP_STD_VER <= 17
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering
-operator<=>(const error_code& __x, const error_code& __y) noexcept
-{
- if (auto __c = __x.category() <=> __y.category(); __c != 0)
- return __c;
- return __x.value() <=> __y.value();
-}
-
-inline _LIBCPP_HIDE_FROM_ABI strong_ordering
-operator<=>(const error_condition& __x, const error_condition& __y) noexcept
-{
- if (auto __c = __x.category() <=> __y.category(); __c != 0)
- return __c;
- return __x.value() <=> __y.value();
-}
-
-#endif // _LIBCPP_STD_VER <= 17
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<error_code>
- : public __unary_function<error_code, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(const error_code& __ec) const _NOEXCEPT
- {
- return static_cast<size_t>(__ec.value());
- }
-};
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<error_condition>
- : public __unary_function<error_condition, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(const error_condition& __ec) const _NOEXCEPT
- {
- return static_cast<size_t>(__ec.value());
- }
-};
-
-// system_error
-
-class _LIBCPP_TYPE_VIS system_error
- : public runtime_error
-{
- error_code __ec_;
-public:
- system_error(error_code __ec, const string& __what_arg);
- system_error(error_code __ec, const char* __what_arg);
- system_error(error_code __ec);
- system_error(int __ev, const error_category& __ecat, const string& __what_arg);
- system_error(int __ev, const error_category& __ecat, const char* __what_arg);
- system_error(int __ev, const error_category& __ecat);
- system_error(const system_error&) _NOEXCEPT = default;
- ~system_error() _NOEXCEPT override;
-
- _LIBCPP_INLINE_VISIBILITY
- const error_code& code() const _NOEXCEPT {return __ec_;}
-
-private:
- static string __init(const error_code&, string);
-};
-
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS
-void __throw_system_error(int __ev, const char* __what_arg);
-
-_LIBCPP_END_NAMESPACE_STD
-
#endif // _LIBCPP_SYSTEM_ERROR
diff --git a/third_party/llvm-project/libcxx/include/thread b/third_party/llvm-project/libcxx/include/thread
index 7a1117f..e071476 100644
--- a/third_party/llvm-project/libcxx/include/thread
+++ b/third_party/llvm-project/libcxx/include/thread
@@ -64,6 +64,9 @@
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& out, thread::id id);
+template<class charT>
+struct formatter<thread::id, charT>;
+
namespace this_thread
{
@@ -84,19 +87,33 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
+#include <__chrono/steady_clock.h>
+#include <__chrono/time_point.h>
+#include <__concepts/arithmetic.h>
+#include <__condition_variable/condition_variable.h>
#include <__config>
+#include <__exception/terminate.h>
+#include <__format/concepts.h>
+#include <__format/format_parse_context.h>
+#include <__format/formatter.h>
+#include <__format/formatter_integral.h>
+#include <__format/parser_std_format_spec.h>
#include <__functional/hash.h>
+#include <__functional/unary_function.h>
+#include <__memory/addressof.h>
#include <__memory/unique_ptr.h>
-#include <__mutex_base>
+#include <__mutex/mutex.h>
+#include <__mutex/unique_lock.h>
+#include <__system_error/system_error.h>
#include <__thread/poll_with_backoff.h>
#include <__thread/timed_backoff_policy.h>
#include <__threading_support>
#include <__utility/forward.h>
#include <cstddef>
+#include <cstdint>
#include <iosfwd>
-#include <system_error>
#include <tuple>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -219,6 +236,45 @@
operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id)
{return __os << __id.__id_;}
+#if _LIBCPP_STD_VER >= 23
+template <__fmt_char_type _CharT>
+struct _LIBCPP_TEMPLATE_VIS formatter<__thread_id, _CharT> {
+ public:
+ _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
+ -> decltype(__parse_ctx.begin()) {
+ return __parser_.__parse(__parse_ctx, __format_spec::__fields_fill_align_width);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI auto format(__thread_id __id, auto& __ctx) const -> decltype(__ctx.out()) {
+ // In __threading_support __libcpp_thread_id is either a
+ // unsigned long long or a pthread_t.
+ //
+ // The type of pthread_t is left unspecified in POSIX so it can be any
+ // type. The most logical types are an integral or pointer.
+ // On Linux systems pthread_t is an unsigned long long.
+ // On Apple systems pthread_t is a pointer type.
+ //
+ // Note the output should match what the stream operator does. Since
+ // the ostream operator has been shipped years before this formatter
+ // was added to the Standard, this formatter does what the stream
+ // operator does. This may require platform specific changes.
+
+ using _Tp = decltype(__get_underlying_id(__id));
+ using _Cp = conditional_t<integral<_Tp>, _Tp, conditional_t<is_pointer_v<_Tp>, uintptr_t, void>>;
+ static_assert(!is_same_v<_Cp, void>, "unsupported thread::id type, please file a bug report");
+
+ __format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
+ if constexpr (is_pointer_v<_Tp>) {
+ __specs.__std_.__alternate_form_ = true;
+ __specs.__std_.__type_ = __format_spec::__type::__hexadecimal_lower_case;
+ }
+ return __formatter::__format_integer(reinterpret_cast<_Cp>(__get_underlying_id(__id)), __ctx, __specs);
+ }
+
+ __format_spec::__parser<_CharT> __parser_{.__alignment_ = __format_spec::__alignment::__right};
+};
+#endif // _LIBCPP_STD_VER >= 23
+
class _LIBCPP_TYPE_VIS thread
{
__libcpp_thread_t __t_;
@@ -301,7 +357,7 @@
{
typedef unique_ptr<__thread_struct> _TSPtr;
_TSPtr __tsp(new __thread_struct);
- typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
+ typedef tuple<_TSPtr, __decay_t<_Fp>, __decay_t<_Args>...> _Gp;
unique_ptr<_Gp> __p(
new _Gp(_VSTD::move(__tsp),
_VSTD::forward<_Fp>(__f),
@@ -367,10 +423,10 @@
// The standard guarantees a 64bit signed integer resolution for nanoseconds,
// so use INT64_MAX / 1e9 as cut-off point. Use a constant to avoid <climits>
// and issues with long double folding on PowerPC with GCC.
- _LIBCPP_CONSTEXPR chrono::duration<long double> _Max =
+ _LIBCPP_CONSTEXPR chrono::duration<long double> __max =
chrono::duration<long double>(9223372036.0L);
chrono::nanoseconds __ns;
- if (__d < _Max)
+ if (__d < __max)
{
__ns = chrono::duration_cast<chrono::nanoseconds>(__d);
if (__ns < __d)
@@ -415,7 +471,10 @@
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstring>
# include <functional>
+# include <new>
+# include <system_error>
#endif
#endif // _LIBCPP_THREAD
diff --git a/third_party/llvm-project/libcxx/include/tuple b/third_party/llvm-project/libcxx/include/tuple
index b0616bd..abfd441 100644
--- a/third_party/llvm-project/libcxx/include/tuple
+++ b/third_party/llvm-project/libcxx/include/tuple
@@ -865,7 +865,7 @@
: __base_(allocator_arg_t(), __a, __t)
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(tuple<U...>&) constructors (including allocator_arg_t variants)
template <class... _Up, enable_if_t<
@@ -879,7 +879,7 @@
_LIBCPP_HIDE_FROM_ABI constexpr
explicit(!(is_convertible_v<_Up&, _Tp> && ...))
tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t) : __base_(allocator_arg_t(), __alloc, __t) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
// tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
@@ -929,7 +929,7 @@
: __base_(allocator_arg_t(), __a, _VSTD::move(__t))
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)
template <class... _Up, enable_if_t<
@@ -944,7 +944,7 @@
explicit(!(is_convertible_v<const _Up&&, _Tp> && ...))
tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)
: __base_(allocator_arg_t(), __alloc, std::move(__t)) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
// tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)
@@ -1018,7 +1018,7 @@
: __base_(allocator_arg_t(), __a, __p)
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(pair<U1, U2>&) constructors (including allocator_arg_t variants)
template <class _U1, class _U2, enable_if_t<
@@ -1082,7 +1082,7 @@
: __base_(allocator_arg_t(), __a, _VSTD::move(__p))
{ }
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
// tuple(const pair<U1, U2>&&) constructors (including allocator_arg_t variants)
template <class _U1, class _U2, enable_if_t<
@@ -1097,7 +1097,7 @@
explicit(!_BothImplicitlyConvertible<const pair<_U1, _U2>&&>::value)
tuple(allocator_arg_t, const _Alloc& __alloc, const pair<_U1, _U2>&& __p)
: __base_(allocator_arg_t(), __alloc, std::move(__p)) {}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
// [tuple.assign]
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1109,7 +1109,7 @@
return *this;
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
const tuple& operator=(tuple const& __tuple) const
requires (_And<is_copy_assignable<const _Tp>...>::value) {
@@ -1126,7 +1126,7 @@
typename __make_tuple_indices<sizeof...(_Tp)>::type());
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
tuple& operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple)
@@ -1170,7 +1170,7 @@
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class... _UTypes, enable_if_t<
_And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,
is_assignable<const _Tp&, const _UTypes&>...>::value>* = nullptr>
@@ -1193,7 +1193,7 @@
typename __make_tuple_indices<sizeof...(_Tp)>::type());
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
template <template<class...> class Pred, bool _Const,
class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
@@ -1212,7 +1212,7 @@
template <bool _Const, class _Pair>
struct _NothrowAssignFromPair : _AssignPredicateFromPair<is_nothrow_assignable, _Const, _Pair> {};
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _U1, class _U2, enable_if_t<
_EnableAssignFromPair<true, const pair<_U1, _U2>&>::value>* = nullptr>
_LIBCPP_HIDE_FROM_ABI constexpr
@@ -1232,7 +1232,7 @@
std::get<1>(*this) = std::move(__pair.second);
return *this;
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
template<class _Up1, class _Up2, __enable_if_t<
_EnableAssignFromPair<false, pair<_Up1, _Up2> const&>::value
@@ -1296,12 +1296,12 @@
void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{__base_.swap(__t.__base_);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr
void swap(const tuple& __t) const noexcept(__all<is_nothrow_swappable_v<const _Tp&>...>::value) {
__base_.swap(__t.__base_);
}
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
};
template <>
@@ -1324,12 +1324,12 @@
tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) _NOEXCEPT {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
void swap(tuple&) _NOEXCEPT {}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
_LIBCPP_HIDE_FROM_ABI constexpr void swap(const tuple&) const noexcept {}
#endif
};
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class... _TTypes, class... _UTypes, template<class> class _TQual, template<class> class _UQual>
requires requires { typename tuple<common_reference_t<_TQual<_TTypes>, _UQual<_UTypes>>...>; }
struct basic_common_reference<tuple<_TTypes...>, tuple<_UTypes...>, _TQual, _UQual> {
@@ -1341,9 +1341,9 @@
struct common_type<tuple<_TTypes...>, tuple<_UTypes...>> {
using type = tuple<common_type_t<_TTypes, _UTypes>...>;
};
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class ..._Tp>
tuple(_Tp...) -> tuple<_Tp...>;
template <class _Tp1, class _Tp2>
@@ -1363,7 +1363,7 @@
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{__t.swap(__u);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class... _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr
enable_if_t<__all<is_swappable_v<const _Tp>...>::value, void>
@@ -1413,7 +1413,7 @@
static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get());
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
namespace __find_detail {
@@ -1552,7 +1552,7 @@
return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
// operator<=>
@@ -1574,7 +1574,7 @@
return _VSTD::__tuple_compare_three_way(__x, __y, index_sequence_for<_Tp...>{});
}
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCPP_STD_VER >= 20
template <class ..._Tp, class ..._Up>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
@@ -1644,7 +1644,7 @@
return !(__y < __x);
}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
// tuple_cat
@@ -1803,7 +1803,7 @@
{
}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
@@ -1845,7 +1845,7 @@
#undef _LIBCPP_NOEXCEPT_RETURN
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
#endif // !defined(_LIBCPP_CXX03_LANG)
diff --git a/third_party/llvm-project/libcxx/include/typeindex b/third_party/llvm-project/libcxx/include/typeindex
index e3132c8..251aa43 100644
--- a/third_party/llvm-project/libcxx/include/typeindex
+++ b/third_party/llvm-project/libcxx/include/typeindex
@@ -87,7 +87,7 @@
_LIBCPP_INLINE_VISIBILITY
bool operator>=(const type_index& __y) const _NOEXCEPT
{return !__t_->before(*__y.__t_);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI
strong_ordering operator<=>(const type_index& __y) const noexcept {
if (*__t_ == *__y.__t_)
diff --git a/third_party/llvm-project/libcxx/include/typeinfo b/third_party/llvm-project/libcxx/include/typeinfo
index 4431039..4691765 100644
--- a/third_party/llvm-project/libcxx/include/typeinfo
+++ b/third_party/llvm-project/libcxx/include/typeinfo
@@ -21,7 +21,7 @@
public:
virtual ~type_info();
- bool operator==(const type_info& rhs) const noexcept;
+ bool operator==(const type_info& rhs) const noexcept; // constexpr since C++23
bool operator!=(const type_info& rhs) const noexcept; // removed in C++20
bool before(const type_info& rhs) const noexcept;
@@ -59,11 +59,11 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
#include <__config>
+#include <__exception/exception.h>
+#include <__type_traits/is_constant_evaluated.h>
+#include <__verbose_abort>
#include <cstddef>
#include <cstdint>
-#include <cstdlib>
-#include <exception>
-#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -104,8 +104,13 @@
size_t hash_code() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const type_info& __arg) const _NOEXCEPT {
+ // When evaluated in a constant expression, both type infos simply can't come
+ // from different translation units, so it is sufficient to compare their addresses.
+ if (__libcpp_is_constant_evaluated()) {
+ return this == &__arg;
+ }
return __compare(__arg) == 0;
}
@@ -330,9 +335,14 @@
return __impl::__hash(__type_name);
}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
bool operator==(const type_info& __arg) const _NOEXCEPT
{
+ // When evaluated in a constant expression, both type infos simply can't come
+ // from different translation units, so it is sufficient to compare their addresses.
+ if (__libcpp_is_constant_evaluated()) {
+ return this == &__arg;
+ }
return __impl::__eq(__type_name, __arg.__type_name);
}
@@ -395,12 +405,18 @@
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_cast()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_cast();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_cast was thrown in -fno-exceptions mode");
#endif
}
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <exception>
+# include <type_traits>
+#endif
+
#endif // __LIBCPP_TYPEINFO
diff --git a/third_party/llvm-project/libcxx/include/unordered_map b/third_party/llvm-project/libcxx/include/unordered_map
index 14f93ba..238aa44 100644
--- a/third_party/llvm-project/libcxx/include/unordered_map
+++ b/third_party/llvm-project/libcxx/include/unordered_map
@@ -575,7 +575,7 @@
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return static_cast<const _Hash&>(*this)(__x);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _K2& __x) const
@@ -611,7 +611,7 @@
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return __hash_(__x);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _K2& __x) const
@@ -661,7 +661,7 @@
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _K2& __y) const
@@ -712,7 +712,7 @@
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return __pred_(__x, __y.__get_value().first);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _K2& __y) const
@@ -825,7 +825,7 @@
_LIBCPP_INLINE_VISIBILITY
value_type& __get_value()
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -835,7 +835,7 @@
_LIBCPP_INLINE_VISIBILITY
const value_type& __get_value() const
{
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return *_VSTD::launder(_VSTD::addressof(__cc_));
#else
return __cc_;
@@ -1035,7 +1035,7 @@
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
private:
typedef __hash_value_type<key_type, mapped_type> __value_type;
@@ -1075,7 +1075,7 @@
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -1123,7 +1123,7 @@
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
unordered_map(size_type __n, const allocator_type& __a)
: unordered_map(__n, hasher(), key_equal(), __a) {}
@@ -1270,7 +1270,7 @@
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
@@ -1350,7 +1350,7 @@
// FIXME: Add debug mode checking for the iterator input
return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first;
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
@@ -1364,7 +1364,7 @@
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__table_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
@@ -1443,31 +1443,31 @@
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -1475,7 +1475,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -1484,7 +1484,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
mapped_type& operator[](const key_type& __k);
#ifndef _LIBCPP_CXX03_LANG
@@ -1874,7 +1874,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1928,7 +1928,7 @@
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
private:
typedef __hash_value_type<key_type, mapped_type> __value_type;
@@ -1967,7 +1967,7 @@
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __map_node_handle<__node, allocator_type> node_type;
#endif
@@ -2015,7 +2015,7 @@
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
#endif // _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_INLINE_VISIBILITY
unordered_multimap(size_type __n, const allocator_type& __a)
: unordered_multimap(__n, hasher(), key_equal(), __a) {}
@@ -2151,7 +2151,7 @@
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__table_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
@@ -2230,31 +2230,31 @@
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -2262,7 +2262,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -2271,7 +2271,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -2584,7 +2584,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2629,7 +2629,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
@@ -2647,7 +2647,9 @@
# include <algorithm>
# include <bit>
# include <concepts>
+# include <cstdlib>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_UNORDERED_MAP
diff --git a/third_party/llvm-project/libcxx/include/unordered_set b/third_party/llvm-project/libcxx/include/unordered_set
index b4203c0..a6afb74 100644
--- a/third_party/llvm-project/libcxx/include/unordered_set
+++ b/third_party/llvm-project/libcxx/include/unordered_set
@@ -513,7 +513,7 @@
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
static_assert(is_same<allocator_type, __rebind_alloc<allocator_traits<allocator_type>, value_type> >::value,
"[allocator.requirements] states that rebinding an allocator to the same type should result in the "
@@ -535,7 +535,7 @@
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __table::__node, allocator_type> node_type;
typedef __insert_return_type<iterator, node_type> insert_return_type;
#endif
@@ -553,7 +553,7 @@
}
explicit unordered_set(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_set(size_type __n, const allocator_type& __a)
: unordered_set(__n, hasher(), key_equal(), __a) {}
@@ -573,7 +573,7 @@
unordered_set(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
unordered_set(_InputIterator __first, _InputIterator __last,
@@ -600,7 +600,7 @@
unordered_set(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_set(initializer_list<value_type> __il, size_type __n,
const allocator_type& __a)
@@ -711,7 +711,7 @@
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {__table_.clear();}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
@@ -787,31 +787,31 @@
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -819,7 +819,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -828,7 +828,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_unique(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -1120,7 +1120,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Value, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1173,7 +1173,7 @@
typedef value_type& reference;
typedef const value_type& const_reference;
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
- "Invalid allocator::value_type");
+ "Allocator::value_type must be same type as value_type");
private:
typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;
@@ -1191,7 +1191,7 @@
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typedef __set_node_handle<typename __table::__node, allocator_type> node_type;
#endif
@@ -1210,7 +1210,7 @@
const key_equal& __eql = key_equal());
unordered_multiset(size_type __n, const hasher& __hf,
const key_equal& __eql, const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset(size_type __n, const allocator_type& __a)
: unordered_multiset(__n, hasher(), key_equal(), __a) {}
@@ -1228,7 +1228,7 @@
unordered_multiset(_InputIterator __first, _InputIterator __last,
size_type __n , const hasher& __hf,
const key_equal& __eql, const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset(_InputIterator __first, _InputIterator __last,
@@ -1256,7 +1256,7 @@
unordered_multiset(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset(initializer_list<value_type> __il, size_type __n, const allocator_type& __a)
: unordered_multiset(__il, __n, hasher(), key_equal(), __a) {}
@@ -1338,7 +1338,7 @@
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
@@ -1425,31 +1425,31 @@
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
iterator find(const _K2& __k) {return __table_.find(__k);}
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const _K2& __k) const {return __table_.find(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
size_type count(const _K2& __k) const {return __table_.__count_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
bool contains(const key_type& __k) const {return find(__k) != end();}
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
bool contains(const _K2& __k) const {return find(__k) != end();}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
@@ -1457,7 +1457,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template<class _K2, enable_if_t<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value>* = nullptr>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const _K2& __k)
@@ -1466,7 +1466,7 @@
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const _K2& __k) const
{return __table_.__equal_range_multi(__k);}
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
@@ -1758,7 +1758,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Value, class _Hash, class _Pred, class _Alloc,
class _Predicate>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1803,7 +1803,7 @@
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
@@ -1817,8 +1817,10 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
+# include <cstdlib>
# include <functional>
# include <iterator>
+# include <type_traits>
#endif
#endif // _LIBCPP_UNORDERED_SET
diff --git a/third_party/llvm-project/libcxx/include/utility b/third_party/llvm-project/libcxx/include/utility
index a4d8cf8..1dc16b1 100644
--- a/third_party/llvm-project/libcxx/include/utility
+++ b/third_party/llvm-project/libcxx/include/utility
@@ -117,24 +117,30 @@
template<class T1, class T2> pair(T1, T2) -> pair<T1, T2>;
-template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
-template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
-template <class T1, class T2>
- constexpr common_comparison_type_t<synth-three-way-result<T1>,
- synth-three-way-result<T2>>
- operator<=>(const pair<T1,T2>&, const pair<T1,T2>&); // C++20
+template <class T1, class T2, class U1, class U2>
+bool operator==(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14
+template <class T1, class T2, class U1, class U2>
+bool operator!=(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator< (const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator> (const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator>=(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+bool operator<=(const pair<T1,T2>&, const pair<U1,U2>&); // constexpr in C++14, removed in C++20
+template <class T1, class T2, class U1, class U2>
+ constexpr common_comparison_type_t<synth-three-way-result<T1,U1>,
+ synth-three-way-result<T2,U2>>
+ operator<=>(const pair<T1,T2>&, const pair<U1,U2>&); // C++20
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&); // constexpr in C++14
template <class T1, class T2>
void
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20
-template<class T1, class T2>
-constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // since C++23
+template<class T1, class T2> // since C++23
+constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
@@ -208,8 +214,8 @@
using index_sequence_for = make_index_sequence<sizeof...(T)>;
template<class T, class U=T>
- constexpr T exchange(T& obj, U&& new_value)
- noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value); // constexpr in C++17, noexcept in C++23
+ constexpr T exchange(T& obj, U&& new_value) // constexpr in C++17, noexcept in C++23
+ noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value);
// 20.2.7, in-place construction // C++17
struct in_place_t {
@@ -266,8 +272,8 @@
#include <initializer_list>
// [tuple.helper]
-#include <__tuple_dir/tuple_element.h>
-#include <__tuple_dir/tuple_size.h>
+#include <__tuple/tuple_element.h>
+#include <__tuple/tuple_size.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/third_party/llvm-project/libcxx/include/valarray b/third_party/llvm-project/libcxx/include/valarray
index 92521ed..c5ed152 100644
--- a/third_party/llvm-project/libcxx/include/valarray
+++ b/third_party/llvm-project/libcxx/include/valarray
@@ -351,8 +351,10 @@
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/operations.h>
+#include <__memory/addressof.h>
#include <__memory/allocator.h>
#include <__memory/uninitialized_algorithms.h>
+#include <__type_traits/decay.h>
#include <__type_traits/remove_reference.h>
#include <__utility/move.h>
#include <__utility/swap.h>
@@ -432,7 +434,7 @@
struct _UnaryOp
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
_A0 __a0_;
@@ -451,7 +453,7 @@
struct _BinaryOp
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
_A0 __a0_;
@@ -1104,7 +1106,7 @@
valarray& __assign_range(const value_type* __f, const value_type* __l);
};
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, size_t _Size>
valarray(const _Tp(&)[_Size], size_t) -> valarray<_Tp>;
#endif
@@ -1115,7 +1117,7 @@
struct _UnaryOp<_Op, valarray<_Tp> >
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
const valarray<_Tp>& __a0_;
@@ -1134,7 +1136,7 @@
struct _BinaryOp<_Op, valarray<_Tp>, _A1>
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
const valarray<_Tp>& __a0_;
@@ -1155,7 +1157,7 @@
struct _BinaryOp<_Op, _A0, valarray<_Tp> >
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
_A0 __a0_;
@@ -1176,7 +1178,7 @@
struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
{
typedef typename _Op::__result_type __result_type;
- typedef typename decay<__result_type>::type value_type;
+ using value_type = __decay_t<__result_type>;
_Op __op_;
const valarray<_Tp>& __a0_;
@@ -2818,20 +2820,20 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
::new ((void*)__end_) value_type();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2852,20 +2854,20 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2877,20 +2879,20 @@
if (__v.size())
{
__begin_ = __end_ = allocator<value_type>().allocate(__v.size());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__v.size());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2914,21 +2916,21 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2943,21 +2945,21 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2970,23 +2972,23 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ga.__vp_;
for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2999,23 +3001,23 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ma.__vp_;
for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3028,23 +3030,23 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ia.__vp_;
for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3753,20 +3755,20 @@
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
::new ((void*)__end_) value_type(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -4933,8 +4935,10 @@
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <algorithm>
# include <concepts>
+# include <cstdlib>
# include <cstring>
# include <functional>
+# include <type_traits>
#endif
#endif // _LIBCPP_VALARRAY
diff --git a/third_party/llvm-project/libcxx/include/variant b/third_party/llvm-project/libcxx/include/variant
index 13c8982..425fead 100644
--- a/third_party/llvm-project/libcxx/include/variant
+++ b/third_party/llvm-project/libcxx/include/variant
@@ -210,10 +210,12 @@
#include <__compare/compare_three_way_result.h>
#include <__compare/three_way_comparable.h>
#include <__config>
+#include <__exception/exception.h>
#include <__functional/hash.h>
#include <__functional/invoke.h>
#include <__functional/operations.h>
#include <__functional/unary_function.h>
+#include <__memory/addressof.h>
#include <__type_traits/add_const.h>
#include <__type_traits/add_cv.h>
#include <__type_traits/add_pointer.h>
@@ -231,12 +233,13 @@
#include <__type_traits/remove_const.h>
#include <__type_traits/type_identity.h>
#include <__type_traits/void_t.h>
+#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__variant/monostate.h>
-#include <exception>
+#include <__verbose_abort>
#include <initializer_list>
#include <limits>
#include <new>
@@ -266,7 +269,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
// Light N-dimensional array of function pointers. Used in place of std::array to avoid
// adding a dependency.
@@ -285,10 +288,10 @@
inline _LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
void __throw_bad_variant_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_variant_access();
#else
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("bad_variant_access was thrown in -fno-exceptions mode");
#endif
}
@@ -594,9 +597,9 @@
template <class _Fp, class _Vp, class... _Vs>
_LIBCPP_HIDE_FROM_ABI
static constexpr auto __make_fdiagonal() {
- constexpr size_t _Np = __remove_cvref_t<_Vp>::__size();
- static_assert(__all<(_Np == __remove_cvref_t<_Vs>::__size())...>::value);
- return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<_Np>{});
+ constexpr size_t __np = __remove_cvref_t<_Vp>::__size();
+ static_assert(__all<(__np == __remove_cvref_t<_Vs>::__size())...>::value);
+ return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<__np>{});
}
template <class _Fp, class... _Vs, size_t... _Is>
@@ -660,7 +663,7 @@
_VSTD::forward<_Vs>(__vs)...);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Rp, class _Visitor, class... _Vs>
_LIBCPP_HIDE_FROM_ABI
static constexpr _Rp __visit_value(_Visitor&& __visitor,
@@ -692,7 +695,7 @@
_Visitor&& __visitor;
};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Rp, class _Visitor>
struct __value_visitor_return_type {
template <class... _Alts>
@@ -721,7 +724,7 @@
return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Rp, class _Visitor>
_LIBCPP_HIDE_FROM_ABI
static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
@@ -1187,7 +1190,7 @@
_VSTD::swap(__lhs, __rhs);
}
__impl __tmp(_VSTD::move(*__rhs));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if constexpr (__all<is_nothrow_move_constructible_v<_Types>...>::value) {
this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
} else {
@@ -1652,7 +1655,7 @@
return __variant::__visit_value_at(__lhs.index(), __convert_to_bool<equal_to<>>{}, __lhs, __rhs);
}
-# if _LIBCPP_STD_VER > 17
+# if _LIBCPP_STD_VER >= 20
template <class... _Types> requires (three_way_comparable<_Types> && ...)
_LIBCPP_HIDE_FROM_ABI constexpr common_comparison_category_t<compare_three_way_result_t<_Types>...>
@@ -1671,7 +1674,7 @@
return __variant::__visit_value_at(__lhs.index(), __three_way, __lhs, __rhs);
}
-# endif // _LIBCPP_STD_VER > 17
+# endif // _LIBCPP_STD_VER >= 20
template <class... _Types>
_LIBCPP_HIDE_FROM_ABI
@@ -1757,7 +1760,7 @@
_VSTD::forward<_Vs>(__vs)...);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <
class _Rp, class _Visitor, class... _Vs,
typename = void_t<decltype(_VSTD::__as_variant(std::declval<_Vs>()))...> >
@@ -1824,13 +1827,14 @@
return std::__unchecked_get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
}
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <exception>
# include <type_traits>
# include <typeinfo>
# include <utility>
diff --git a/third_party/llvm-project/libcxx/include/vector b/third_party/llvm-project/libcxx/include/vector
index 4b7ae13..40f73b8 100644
--- a/third_party/llvm-project/libcxx/include/vector
+++ b/third_party/llvm-project/libcxx/include/vector
@@ -299,6 +299,7 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/wrap_iter.h>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
@@ -307,18 +308,19 @@
#include <__memory_resource/polymorphic_allocator.h>
#include <__split_buffer>
#include <__type_traits/is_allocator.h>
+#include <__type_traits/is_constructible.h>
+#include <__type_traits/is_nothrow_move_assignable.h>
#include <__type_traits/noexcept_move_assign_container.h>
+#include <__type_traits/type_identity.h>
#include <__utility/exception_guard.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <climits>
-#include <cstdlib>
#include <cstring>
#include <iosfwd> // for forward declaration of vector
#include <limits>
#include <stdexcept>
-#include <type_traits>
#include <version>
// standard-mandated includes
@@ -389,7 +391,7 @@
std::__debug_db_insert_c(this);
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n, const allocator_type& __a);
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(size_type __n, const value_type& __x);
@@ -474,7 +476,7 @@
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(vector&& __x)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
noexcept;
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
@@ -594,7 +596,7 @@
template <class... _Args>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
reference emplace_back(_Args&&... __args);
#else
void emplace_back(_Args&&... __args);
@@ -1083,7 +1085,7 @@
__guard.__complete();
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Tp, class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
@@ -1216,7 +1218,7 @@
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI
vector<_Tp, _Allocator>::vector(vector&& __x)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
noexcept
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
@@ -1512,19 +1514,19 @@
{
if (capacity() > size())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
allocator_type& __a = this->__alloc();
__split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
__swap_out_circular_buffer(__v);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -1588,7 +1590,7 @@
template <class... _Args>
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
typename vector<_Tp, _Allocator>::reference
#else
void
@@ -1601,7 +1603,7 @@
}
else
__emplace_back_slow_path(std::forward<_Args>(__args)...);
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return this->back();
#endif
}
@@ -1831,24 +1833,24 @@
__split_buffer<value_type, allocator_type&> __v(__a);
if (__first != __last)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__v.__construct_at_end(__first, __last);
difference_type __old_size = __old_last - this->__begin_;
difference_type __old_p = __p - this->__begin_;
reserve(__recommend(size() + __v.size()));
__p = this->__begin_ + __old_p;
__old_last = this->__begin_ + __old_size;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
erase(__make_iter(__old_last), end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__p = std::rotate(__p, __old_last, this->__end_);
insert(__make_iter(__p), std::make_move_iterator(__v.begin()),
@@ -2123,7 +2125,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~vector() { __destroy_vector(*this)(); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit vector(size_type __n, const allocator_type& __a);
#endif
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v);
@@ -2157,7 +2159,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
vector(vector&& __v)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
noexcept;
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
@@ -2254,16 +2256,16 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const {return __make_ref(__size_ - 1);}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void push_back(const value_type& __x);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference emplace_back(_Args&&... __args)
#else
_LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args)
#endif
{
push_back ( value_type ( std::forward<_Args>(__args)... ));
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
return this->back();
#endif
}
@@ -2271,7 +2273,7 @@
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back() {--__size_;}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator emplace(const_iterator __position, _Args&&... __args)
{ return insert ( __position, value_type ( std::forward<_Args>(__args)... )); }
@@ -2550,7 +2552,7 @@
}
}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
template <class _Allocator>
_LIBCPP_CONSTEXPR_SINCE_CXX20
vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a)
@@ -2603,13 +2605,13 @@
__size_(0),
__cap_alloc_(0, __default_init_tag())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2618,7 +2620,7 @@
std::__debug_db_invalidate_all(this);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Allocator>
@@ -2630,13 +2632,13 @@
__size_(0),
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2645,7 +2647,7 @@
std::__debug_db_invalidate_all(this);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Allocator>
@@ -2772,7 +2774,7 @@
template <class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector<bool, _Allocator>::vector(vector&& __v)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_NOEXCEPT
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
@@ -2923,17 +2925,17 @@
{
if (__external_cap_to_internal(size()) > __cap())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
vector(*this, allocator_type(__alloc())).swap(*this);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3034,24 +3036,24 @@
vector __v(get_allocator());
if (__first != __last)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__v.assign(__first, __last);
difference_type __old_size = static_cast<difference_type>(__old_end - begin());
difference_type __old_p = __p - begin();
reserve(__recommend(size() + __v.size()));
__p = begin() + __old_p;
__old_end = begin() + __old_size;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
erase(__old_end, end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__p = std::rotate(__p, __old_end, end());
insert(__p, __v.begin(), __v.end());
@@ -3293,7 +3295,7 @@
__x.swap(__y);
}
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Allocator, class _Up>
_LIBCPP_CONSTEXPR_SINCE_CXX20
inline _LIBCPP_HIDE_FROM_ABI typename vector<_Tp, _Allocator>::size_type
@@ -3319,13 +3321,13 @@
inline constexpr bool __format::__enable_insertable<vector<wchar_t>> = true;
#endif
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
template <class _Tp, class CharT>
// Since is-vector-bool-reference is only used once it's inlined here.
requires same_as<typename _Tp::__container, vector<bool, typename _Tp::__container::allocator_type>>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_Tp, CharT> {
+struct _LIBCPP_TEMPLATE_VIS formatter<_Tp, CharT> {
private:
formatter<bool, CharT> __underlying_;
@@ -3340,11 +3342,11 @@
return __underlying_.format(__ref, __ctx);
}
};
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
@@ -3359,6 +3361,8 @@
# include <algorithm>
# include <atomic>
# include <concepts>
+# include <cstdlib>
+# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
diff --git a/third_party/llvm-project/libcxx/include/version b/third_party/llvm-project/libcxx/include/version
index 9705229..f58b51e 100644
--- a/third_party/llvm-project/libcxx/include/version
+++ b/third_party/llvm-project/libcxx/include/version
@@ -85,6 +85,8 @@
__cpp_lib_expected 202202L <expected>
__cpp_lib_filesystem 201703L <filesystem>
__cpp_lib_format 202106L <format>
+__cpp_lib_format_ranges 202207L <format>
+__cpp_lib_formatters 202302L <stacktrace> <thread>
__cpp_lib_forward_like 202207L <utility>
__cpp_lib_gcd_lcm 201606L <numeric>
__cpp_lib_generic_associative_lookup 201304L <map> <set>
@@ -122,6 +124,7 @@
__cpp_lib_math_constants 201907L <numbers>
__cpp_lib_math_special_functions 201603L <cmath>
__cpp_lib_memory_resource 201603L <memory_resource>
+__cpp_lib_move_iterator_concept 202207L <iterator>
__cpp_lib_move_only_function 202110L <functional>
__cpp_lib_node_extract 201606L <map> <set> <unordered_map>
<unordered_set>
@@ -139,6 +142,7 @@
__cpp_lib_quoted_string_io 201304L <iomanip>
__cpp_lib_ranges 202106L <algorithm> <functional> <iterator>
<memory> <ranges>
+__cpp_lib_ranges_as_rvalue 202207L <ranges>
__cpp_lib_ranges_chunk 202202L <ranges>
__cpp_lib_ranges_chunk_by 202202L <ranges>
__cpp_lib_ranges_iota 202202L <numeric>
@@ -208,7 +212,7 @@
// clang-format off
-#if _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER >= 14
# define __cpp_lib_chrono_udls 201304L
# define __cpp_lib_complex_udls 201309L
# define __cpp_lib_exchange_function 201304L
@@ -223,7 +227,7 @@
# define __cpp_lib_quoted_string_io 201304L
# define __cpp_lib_result_of_sfinae 201210L
# define __cpp_lib_robust_nonmodifying_seq_ops 201304L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# define __cpp_lib_shared_timed_mutex 201402L
# endif
# define __cpp_lib_string_udls 201304L
@@ -233,7 +237,7 @@
# define __cpp_lib_tuples_by_type 201304L
#endif
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER >= 17
# define __cpp_lib_addressof_constexpr 201603L
# define __cpp_lib_allocator_traits_is_always_equal 201411L
# define __cpp_lib_any 201606L
@@ -248,7 +252,7 @@
# define __cpp_lib_clamp 201603L
# define __cpp_lib_enable_shared_from_this 201603L
// # define __cpp_lib_execution 201603L
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# define __cpp_lib_filesystem 201703L
# endif
# define __cpp_lib_gcd_lcm 201606L
@@ -276,7 +280,7 @@
# define __cpp_lib_raw_memory_algorithms 201606L
# define __cpp_lib_sample 201603L
# define __cpp_lib_scoped_lock 201703L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# define __cpp_lib_shared_mutex 201505L
# endif
# define __cpp_lib_shared_ptr_arrays 201611L
@@ -292,7 +296,7 @@
# define __cpp_lib_void_t 201411L
#endif
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
# undef __cpp_lib_array_constexpr
# define __cpp_lib_array_constexpr 201811L
# define __cpp_lib_assume_aligned 201811L
@@ -302,10 +306,10 @@
// # define __cpp_lib_atomic_ref 201806L
// # define __cpp_lib_atomic_shared_ptr 201711L
# define __cpp_lib_atomic_value_initialization 201911L
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_atomic_wait 201907L
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_barrier 201907L
# endif
# define __cpp_lib_bind_front 201907L
@@ -329,14 +333,14 @@
# define __cpp_lib_constexpr_utility 201811L
# define __cpp_lib_constexpr_vector 201907L
# define __cpp_lib_coroutine 201902L
-# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+# if _LIBCPP_STD_VER >= 20 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
# define __cpp_lib_destroying_delete 201806L
# endif
# define __cpp_lib_endian 201907L
# define __cpp_lib_erase_if 202002L
# undef __cpp_lib_execution
// # define __cpp_lib_execution 201902L
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
// # define __cpp_lib_format 202106L
# endif
# define __cpp_lib_generic_unordered_lookup 201811L
@@ -350,22 +354,23 @@
# if !defined(_LIBCPP_HAS_NO_THREADS)
// # define __cpp_lib_jthread 201911L
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_latch 201907L
# endif
# define __cpp_lib_list_remove_return_type 201806L
# define __cpp_lib_math_constants 201907L
+# define __cpp_lib_move_iterator_concept 202207L
# define __cpp_lib_polymorphic_allocator 201902L
# define __cpp_lib_ranges 202106L
# define __cpp_lib_remove_cvref 201711L
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# define __cpp_lib_semaphore 201907L
# endif
# undef __cpp_lib_shared_ptr_arrays
# define __cpp_lib_shared_ptr_arrays 201707L
# define __cpp_lib_shift 201806L
// # define __cpp_lib_smart_ptr_for_overwrite 202002L
-# if __has_builtin(__builtin_source_location)
+# if __has_builtin(__builtin_source_location) && !(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER <= 1403)
# define __cpp_lib_source_location 201907L
# endif
# define __cpp_lib_span 202002L
@@ -381,7 +386,7 @@
# define __cpp_lib_unwrap_ref 201811L
#endif
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
# define __cpp_lib_adaptor_iterator_pair_constructor 202106L
# define __cpp_lib_allocate_at_least 202106L
// # define __cpp_lib_associative_heterogeneous_erasure 202110L
@@ -392,15 +397,22 @@
// # define __cpp_lib_constexpr_cmath 202202L
# undef __cpp_lib_constexpr_memory
# define __cpp_lib_constexpr_memory 202202L
-// # define __cpp_lib_constexpr_typeinfo 202106L
+# define __cpp_lib_constexpr_typeinfo 202106L
# define __cpp_lib_expected 202202L
+# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+# define __cpp_lib_format_ranges 202207L
+# endif
+# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+// # define __cpp_lib_formatters 202302L
+# endif
# define __cpp_lib_forward_like 202207L
-// # define __cpp_lib_invoke_r 202106L
+# define __cpp_lib_invoke_r 202106L
# define __cpp_lib_is_scoped_enum 202011L
// # define __cpp_lib_move_only_function 202110L
# undef __cpp_lib_optional
# define __cpp_lib_optional 202110L
// # define __cpp_lib_out_ptr 202106L
+# define __cpp_lib_ranges_as_rvalue 202207L
// # define __cpp_lib_ranges_chunk 202202L
// # define __cpp_lib_ranges_chunk_by 202202L
// # define __cpp_lib_ranges_iota 202202L
diff --git a/third_party/llvm-project/libcxx/lib/abi/CHANGELOG.TXT b/third_party/llvm-project/libcxx/lib/abi/CHANGELOG.TXT
index 6f17e85..8661ab4 100644
--- a/third_party/llvm-project/libcxx/lib/abi/CHANGELOG.TXT
+++ b/third_party/llvm-project/libcxx/lib/abi/CHANGELOG.TXT
@@ -13,6 +13,34 @@
New entries should be added directly below the "Version" header.
------------
+Version 17.0
+------------
+
+* [libc++] Remove explicit instantiations of __insertion_sort_incomplete and __sort5 from the dylib
+
+ These instantiations were never visible, because they are only used in `__sort`, which is also explicitly
+ instantiated in the dylib.
+
+ All platforms
+ -------------
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_
+ Symbol removed: _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_
+ Symbol removed: _ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_
+
+------------
Version 16.0
------------
@@ -159,7 +187,7 @@
In fact, any program that would have attempted to refer to that symbol would
have previously failed to link.
- x86_64-apple-apple-darwin
+ <arch>-apple-darwin
-------------------------
Symbol added: _ZNSt3__15ctypeIcE10table_sizeE
@@ -338,7 +366,7 @@
Those were previously defined in both libc++ and libc++abi, which was an
ODR violation.
- <arch>-apple-apple-darwin
+ <arch>-apple-darwin
-------------------------
The following symbols are now re-exported from libc++abi instead of exported
by libc++ directly (this should not be an ABI break):
@@ -396,8 +424,8 @@
We re-export some symbols that were exported from libc++abi but not from
libc++. Exporting new symbols is not an ABI break.
- x86_64-apple-apple-darwin
- -------------------------
+ <arch>-apple-darwin
+ -------------------
Symbol added: ___cxa_allocate_dependent_exception
Symbol added: ___cxa_free_dependent_exception
@@ -411,12 +439,8 @@
adds a few symbols to the dylib. This is backwards-compatible since we're
just adding new symbols.
- x86_64-unknown-linux-gnu
- ------------------------
- TODO
-
- <arch>-apple-apple-darwin
- -------------------------
+ All platforms
+ -------------
Symbol added: __ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEEx
Symbol added: __ZNSt3__120__libcpp_atomic_waitEPVKvx
Symbol added: __ZNSt3__123__cxx_atomic_notify_allEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE
@@ -441,12 +465,8 @@
against an older version of libc++abi that doesn't provide those symbols,
however doing so is not supported anyway.
- x86_64-unknown-linux-gnu
- ------------------------
- TODO
-
- x86_64-apple-apple-darwin
- -------------------------
+ <arch>-apple-darwin
+ -------------------
Symbol added: ___cxa_throw_bad_array_new_length
Symbol added: ___cxa_uncaught_exceptions
@@ -566,11 +586,10 @@
Symbol removed: _ZTSNSt3__124__libcpp_debug_exceptionE
Symbol removed: _ZTVNSt3__124__libcpp_debug_exceptionE
-
- x86_64-apple-apple-darwin
- -------------------------
- Symbol added: __ZNSt3__111__libcpp_db10__insert_cEPvPFPNS_8__c_nodeES1_S1_S3_E
- Symbol removed: __ZNSt3__111__libcpp_db10__insert_cEPv
+ <arch>-apple-darwin
+ -------------------
+ Symbol added: __ZNSt3__111__libcpp_db10__insert_cEPvPFPNS_8__c_nodeES1_S1_S3_E
+ Symbol removed: __ZNSt3__111__libcpp_db10__insert_cEPv
* r355367 - Fix -fsanitize=vptr badness in <__debug>
@@ -598,8 +617,8 @@
users couldn't be relying on the functionality because it is marked as being
unavailable using Clang's availability attribute.
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
Symbol removed: __ZNKSt16bad_array_length4whatEv
Symbol removed: __ZNKSt16bad_array_length4whatEv
Symbol removed: __ZNSt16bad_array_lengthC1Ev
@@ -678,8 +697,8 @@
Symbol removed: _ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv
Symbol removed: _ZNSt3__119__start_std_streamsE
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
Symbol removed: __ZNSt3__221__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv
Symbol removed: __ZNSt3__119__start_std_streamsE
@@ -696,8 +715,8 @@
Symbol added: _ZNSt3__16__itoa8__u64toaEmPc
Symbol added: _ZNSt3__16__itoa8__u32toaEjPc
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
Symbol added: __ZNSt3__16__itoa8__u64toaEyPc
Symbol added: __ZNSt3__16__itoa8__u32toaEjPc
@@ -725,8 +744,8 @@
----------------
No changes
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
Symbol added: ___cxa_deleted_virtual
* r296729 - Remove std::num_get template methods which should be inline
@@ -757,8 +776,8 @@
Symbol removed: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_
Symbol removed: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
No changes
-----------
@@ -808,8 +827,8 @@
Symbol removed: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_
Symbol removed: _ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
No changes
* r285101 - Add -fvisibility-inlines-hidden when building libc++.
@@ -841,8 +860,8 @@
Symbol removed: _ZNSt3__120__codecvt_utf8_utf16IDsED0Ev
Symbol removed: _ZNSt3__120__codecvt_utf8_utf16IwED0Ev
- x86_64-apple-darwin16.0
- -----------------------
+ <arch>-apple-darwin
+ -------------------
No Changes - inline symbols are already hidden
* r284206 - Implement C++17 aligned allocation in <new>
@@ -881,8 +900,7 @@
Symbol added: _ZTSSt12bad_any_cast
Symbol added: _ZTVSt12bad_any_cast
-* r295398 - Remove basic_string::insert and basic_string::replace template methods
- which should be inline.
+* r295398 - Remove basic_string::insert and basic_string::replace template methods which should be inline.
These functions should never have had visible definitions in the dylib but
since they were previously not specified with 'inline' they accidentally
diff --git a/third_party/llvm-project/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
index 774bf39..3db8b28 100644
--- a/third_party/llvm-project/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1540,21 +1540,6 @@
{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
@@ -1739,7 +1724,6 @@
{'is_defined': True, 'name': '__ZNSt3__16thread6detachEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__16threadD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__16threadD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 3323fd5..7c90dd2 100644
--- a/third_party/llvm-project/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1714,21 +1714,6 @@
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__122__libcpp_verbose_abortEPKcz', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16_FilesystemClock9is_steadyE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem4path19preferred_separatorE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -1748,7 +1733,6 @@
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17collateIcE2idE', 'storage_mapping_class': 'RW', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17collateIcED0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17collateIcED1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 318b85b..f0eb2a6 100644
--- a/third_party/llvm-project/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1714,21 +1714,6 @@
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__122__libcpp_verbose_abortEPKcz', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem16_FilesystemClock9is_steadyE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__14__fs10filesystem4path19preferred_separatorE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -1748,7 +1733,6 @@
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
-{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17collateIcE2idE', 'storage_mapping_class': 'RW', 'type': 'OBJECT'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17collateIcED0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__17collateIcED1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
index 70161ed..8eb7039 100644
--- a/third_party/llvm-project/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1540,21 +1540,6 @@
{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
@@ -1739,7 +1724,6 @@
{'is_defined': True, 'name': '__ZNSt3__16thread6detachEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__16threadD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__16threadD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 0, 'type': 'OBJECT'}
{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-freebsd.libcxxabi.v1.stable.exceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-freebsd.libcxxabi.v1.stable.exceptions.nonew.abilist
index 01a3ea9..3f8ff0f 100644
--- a/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-freebsd.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-freebsd.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1235,21 +1235,6 @@
{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIlNS_22__cxx_atomic_base_implIlEEEE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
@@ -1434,7 +1419,6 @@
{'is_defined': True, 'name': '_ZNSt3__16thread6detachEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__16threadD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__16threadD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
index d56172f..dfa36dc 100644
--- a/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1233,21 +1233,6 @@
{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
@@ -1435,7 +1420,6 @@
{'is_defined': True, 'name': '_ZNSt3__16thread6detachEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__16threadD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__16threadD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist b/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
index 06a3b25..d9ba05c 100644
--- a/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
+++ b/third_party/llvm-project/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
@@ -1205,21 +1205,6 @@
{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__134__construct_barrier_algorithm_baseERl', 'type': 'FUNC'}
@@ -1407,7 +1392,6 @@
{'is_defined': True, 'name': '_ZNSt3__16thread6detachEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__16threadD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__16threadD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tE2idE', 'size': 16, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__17codecvtIDiDu11__mbstate_tED1Ev', 'type': 'FUNC'}
diff --git a/third_party/llvm-project/libcxx/src/algorithm.cpp b/third_party/llvm-project/libcxx/src/algorithm.cpp
index bd47e08..5a47558 100644
--- a/third_party/llvm-project/libcxx/src/algorithm.cpp
+++ b/third_party/llvm-project/libcxx/src/algorithm.cpp
@@ -7,11 +7,24 @@
//===----------------------------------------------------------------------===//
#include <algorithm>
+#include <bit>
_LIBCPP_BEGIN_NAMESPACE_STD
-// TODO(varconst): this currently doesn't benefit `ranges::sort` because it uses `ranges::less` instead of `__less`.
+template <class Comp, class RandomAccessIterator>
+void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) {
+ auto depth_limit = 2 * std::__bit_log2(static_cast<size_t>(last - first));
+ // Only use bitset partitioning for arithmetic types. We should also check
+ // that the default comparator is in use so that we are sure that there are no
+ // branches in the comparator.
+ std::__introsort<_ClassicAlgPolicy,
+ Comp&,
+ RandomAccessIterator,
+ __use_branchless_sort<Comp, RandomAccessIterator>::value>(first, last, comp, depth_limit);
+}
+
+// clang-format off
template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
@@ -29,25 +42,6 @@
template void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
template void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-template bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
-#endif
-template bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-template bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-template bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
-template bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-template bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
-template bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-template bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
-template bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-template bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-template bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-template bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
-template bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
-template bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
+// clang-format on
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/src/atomic.cpp b/third_party/llvm-project/libcxx/src/atomic.cpp
index 7777e88..9a34210 100644
--- a/third_party/llvm-project/libcxx/src/atomic.cpp
+++ b/third_party/llvm-project/libcxx/src/atomic.cpp
@@ -77,20 +77,25 @@
const_cast<__cxx_atomic_contention_t*>(__ptr), 0);
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
+/*
+ * Since __cxx_contention_t is int64_t even on 32bit FreeBSD
+ * platforms, we have to use umtx ops that work on the long type, and
+ * limit its use to architectures where long and int64_t are synonyms.
+ */
static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr,
__cxx_contention_t __val)
{
_umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr),
- UMTX_OP_WAIT_UINT_PRIVATE, __val, NULL, NULL);
+ UMTX_OP_WAIT, __val, NULL, NULL);
}
static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr,
bool __notify_one)
{
_umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr),
- UMTX_OP_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, NULL, NULL);
+ UMTX_OP_WAKE, __notify_one ? 1 : INT_MAX, NULL, NULL);
}
#else // <- Add other operating systems here
diff --git a/third_party/llvm-project/libcxx/src/chrono.cpp b/third_party/llvm-project/libcxx/src/chrono.cpp
index 0af89d6..213f888 100644
--- a/third_party/llvm-project/libcxx/src/chrono.cpp
+++ b/third_party/llvm-project/libcxx/src/chrono.cpp
@@ -12,9 +12,9 @@
#define _LARGE_TIME_API
#endif
-#include <cerrno> // errno
+#include <__system_error/system_error.h>
+#include <cerrno> // errno
#include <chrono>
-#include <system_error> // __throw_system_error
#if defined(__MVS__)
#include <__support/ibm/gettod_zos.h> // gettimeofdayMonotonic
@@ -167,59 +167,6 @@
#if defined(__APPLE__)
-// TODO(ldionne):
-// This old implementation of steady_clock is retained until Chrome drops supports
-// for macOS < 10.12. The issue is that they link libc++ statically into their
-// application, which means that libc++ must support being built for such deployment
-// targets. See https://llvm.org/D74489 for details.
-#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
- (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
- (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
- (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
-# define _LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME
-#endif
-
-#if defined(_LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME)
-
-// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
-// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
-// are run time constants supplied by the OS. This clock has no relationship
-// to the Gregorian calendar. It's main use is as a high resolution timer.
-
-// MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
-// for that case as an optimization.
-
-static steady_clock::rep steady_simplified() {
- return static_cast<steady_clock::rep>(mach_absolute_time());
-}
-static double compute_steady_factor() {
- mach_timebase_info_data_t MachInfo;
- mach_timebase_info(&MachInfo);
- return static_cast<double>(MachInfo.numer) / MachInfo.denom;
-}
-
-static steady_clock::rep steady_full() {
- static const double factor = compute_steady_factor();
- return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
-}
-
-typedef steady_clock::rep (*FP)();
-
-static FP init_steady_clock() {
- mach_timebase_info_data_t MachInfo;
- mach_timebase_info(&MachInfo);
- if (MachInfo.numer == MachInfo.denom)
- return &steady_simplified;
- return &steady_full;
-}
-
-static steady_clock::time_point __libcpp_steady_clock_now() {
- static FP fp = init_steady_clock();
- return steady_clock::time_point(steady_clock::duration(fp()));
-}
-
-#else // vvvvv default behavior for Apple platforms vvvvv
-
// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or
// mach_absolute_time are able to time functions in the nanosecond range.
// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it
@@ -232,8 +179,6 @@
return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
}
-#endif
-
#elif defined(_LIBCPP_WIN32API)
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:
diff --git a/third_party/llvm-project/libcxx/src/condition_variable.cpp b/third_party/llvm-project/libcxx/src/condition_variable.cpp
index b17c4cf..85f334e 100644
--- a/third_party/llvm-project/libcxx/src/condition_variable.cpp
+++ b/third_party/llvm-project/libcxx/src/condition_variable.cpp
@@ -12,7 +12,6 @@
#include <condition_variable>
#include <thread>
-#include <system_error>
#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
# pragma comment(lib, "pthread")
diff --git a/third_party/llvm-project/libcxx/src/filesystem/filesystem_common.h b/third_party/llvm-project/libcxx/src/filesystem/filesystem_common.h
index 0e71569..a1756cf 100644
--- a/third_party/llvm-project/libcxx/src/filesystem/filesystem_common.h
+++ b/third_party/llvm-project/libcxx/src/filesystem/filesystem_common.h
@@ -12,14 +12,15 @@
#include <__assert>
#include <__config>
#include <array>
+#include <cerrno>
#include <chrono>
#include <climits>
#include <cstdarg>
#include <ctime>
#include <filesystem>
#include <ratio>
-#include <system_error>
#include <utility>
+#include <system_error>
#if defined(_LIBCPP_WIN32API)
# define WIN32_LEAN_AND_MEAN
@@ -34,19 +35,16 @@
# include <unistd.h>
#endif // defined(_LIBCPP_WIN32API)
-#include "../include/apple_availability.h"
-
-#if !defined(__APPLE__)
-// We can use the presence of UTIME_OMIT to detect platforms that provide
-// utimensat.
+// We can use the presence of UTIME_OMIT to detect platforms that provide utimensat.
#if defined(UTIME_OMIT)
-#define _LIBCPP_USE_UTIMENSAT
-#endif
+# define _LIBCPP_USE_UTIMENSAT
#endif
+// TODO: Check whether these functions actually need internal linkage, or if they can be made normal header functions
_LIBCPP_DIAGNOSTIC_PUSH
_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wunused-function")
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-function")
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-template")
#if defined(_LIBCPP_WIN32API)
# define PATHSTR(x) (L##x)
@@ -96,16 +94,16 @@
string ret;
va_list ap;
va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
ret = format_string_impl(msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
va_end(ap);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
va_end(ap);
return ret;
}
@@ -202,16 +200,16 @@
T report(const error_code& ec, const char* msg, ...) const {
va_list ap;
va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
report_impl(ec, msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
va_end(ap);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
va_end(ap);
return error_value<T>();
}
@@ -224,16 +222,16 @@
T report(errc const& err, const char* msg, ...) const {
va_list ap;
va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
report_impl(make_error_code(err), msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
va_end(ap);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
va_end(ap);
return error_value<T>();
}
diff --git a/third_party/llvm-project/libcxx/src/future.cpp b/third_party/llvm-project/libcxx/src/future.cpp
index cdaa938..f8f466b 100644
--- a/third_party/llvm-project/libcxx/src/future.cpp
+++ b/third_party/llvm-project/libcxx/src/future.cpp
@@ -197,12 +197,12 @@
{
if (__state_)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (!__state_->__has_value() && __state_->use_count() > 1)
__state_->set_exception(make_exception_ptr(
future_error(make_error_code(future_errc::broken_promise))
));
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__state_->__release_shared();
}
}
diff --git a/third_party/llvm-project/libcxx/src/include/apple_availability.h b/third_party/llvm-project/libcxx/src/include/apple_availability.h
index 75bf796..c8d158e 100644
--- a/third_party/llvm-project/libcxx/src/include/apple_availability.h
+++ b/third_party/llvm-project/libcxx/src/include/apple_availability.h
@@ -12,24 +12,6 @@
#if defined(__APPLE__)
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101300
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110000
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 110000
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
-#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 40000
-#define _LIBCPP_USE_UTIMENSAT
-#endif
-#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__
-
-#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500
#define _LIBCPP_USE_ULOCK
#endif
diff --git a/third_party/llvm-project/libcxx/src/include/ryu/common.h b/third_party/llvm-project/libcxx/src/include/ryu/common.h
index c24115c..4503e6d 100644
--- a/third_party/llvm-project/libcxx/src/include/ryu/common.h
+++ b/third_party/llvm-project/libcxx/src/include/ryu/common.h
@@ -43,7 +43,8 @@
// clang-format off
#include <__assert>
-#include "__config"
+#include <__config>
+#include <cstring>
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -91,13 +92,13 @@
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __float_to_bits(const float __f) {
uint32_t __bits = 0;
- _VSTD::memcpy(&__bits, &__f, sizeof(float));
+ std::memcpy(&__bits, &__f, sizeof(float));
return __bits;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint64_t __double_to_bits(const double __d) {
uint64_t __bits = 0;
- _VSTD::memcpy(&__bits, &__d, sizeof(double));
+ std::memcpy(&__bits, &__d, sizeof(double));
return __bits;
}
diff --git a/third_party/llvm-project/libcxx/src/include/ryu/ryu.h b/third_party/llvm-project/libcxx/src/include/ryu/ryu.h
index cb44bd3..8bd34cd 100644
--- a/third_party/llvm-project/libcxx/src/include/ryu/ryu.h
+++ b/third_party/llvm-project/libcxx/src/include/ryu/ryu.h
@@ -48,7 +48,7 @@
#include <__charconv/to_chars_result.h>
#include <__config>
#include <__debug>
-#include <__errc>
+#include <__system_error/errc.h>
#include <cstdint>
#include <cstring>
#include <type_traits>
diff --git a/third_party/llvm-project/libcxx/src/ios.cpp b/third_party/llvm-project/libcxx/src/ios.cpp
index 870406b..bb62eb9 100644
--- a/third_party/llvm-project/libcxx/src/ios.cpp
+++ b/third_party/llvm-project/libcxx/src/ios.cpp
@@ -413,20 +413,20 @@
ios_base::__set_badbit_and_consider_rethrow()
{
__rdstate_ |= badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (__exceptions_ & badbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
void
ios_base::__set_failbit_and_consider_rethrow()
{
__rdstate_ |= failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (__exceptions_ & failbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool
diff --git a/third_party/llvm-project/libcxx/src/iostream.cpp b/third_party/llvm-project/libcxx/src/iostream.cpp
index a8948ac..36c6894 100644
--- a/third_party/llvm-project/libcxx/src/iostream.cpp
+++ b/third_party/llvm-project/libcxx/src/iostream.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include <__locale>
-#include <__std_stream>
+#include "std_stream.h"
#include <new>
#include <string>
diff --git a/third_party/llvm-project/libcxx/src/locale.cpp b/third_party/llvm-project/libcxx/src/locale.cpp
index 678c487..1e60c02 100644
--- a/third_party/llvm-project/libcxx/src/locale.cpp
+++ b/third_party/llvm-project/libcxx/src/locale.cpp
@@ -118,7 +118,7 @@
_LIBCPP_NORETURN static void __throw_runtime_error(const string &msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw runtime_error(msg);
#else
(void)msg;
@@ -236,10 +236,10 @@
facets_(N),
name_(name)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
facets_ = locale::classic().__locale_->facets_;
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
@@ -286,7 +286,7 @@
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new messages_byname<wchar_t>(name_));
#endif
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -295,7 +295,7 @@
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other)
@@ -316,10 +316,10 @@
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
facets_[i]->__add_shared();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
install(new collate_byname<char>(name));
@@ -380,7 +380,7 @@
install(new messages_byname<wchar_t>(name));
#endif
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -389,7 +389,7 @@
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class F>
@@ -409,10 +409,10 @@
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
facets_[i]->__add_shared();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
install_from<_VSTD::collate<char> >(one);
@@ -489,7 +489,7 @@
install_from<_VSTD::messages<wchar_t> >(one);
#endif
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -498,7 +498,7 @@
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other, facet* f, long id)
@@ -6529,7 +6529,7 @@
void __throw_runtime_error(const char* msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw runtime_error(msg);
#else
(void)msg;
diff --git a/third_party/llvm-project/libcxx/src/memory_resource.cpp b/third_party/llvm-project/libcxx/src/memory_resource.cpp
index e00611d..ca1d640 100644
--- a/third_party/llvm-project/libcxx/src/memory_resource.cpp
+++ b/third_party/llvm-project/libcxx/src/memory_resource.cpp
@@ -107,7 +107,7 @@
new_res = new_res ? new_res : new_delete_resource();
lock_guard<mutex> guard(res_lock);
memory_resource* old_res = res;
- res = new_res;
+ res = new_res;
return old_res;
} else {
lock_guard<mutex> guard(res_lock);
diff --git a/third_party/llvm-project/libcxx/src/mutex.cpp b/third_party/llvm-project/libcxx/src/mutex.cpp
index e73df81..c25010f 100644
--- a/third_party/llvm-project/libcxx/src/mutex.cpp
+++ b/third_party/llvm-project/libcxx/src/mutex.cpp
@@ -9,7 +9,6 @@
#include <__assert>
#include <limits>
#include <mutex>
-#include <system_error>
#include "include/atomic_support.h"
@@ -211,21 +210,21 @@
#if defined(_LIBCPP_HAS_NO_THREADS)
if (flag == 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
flag = 1;
func(arg);
flag = ~once_flag::_State_type(0);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
flag = 0;
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
#else // !_LIBCPP_HAS_NO_THREADS
__libcpp_mutex_lock(&mut);
@@ -233,10 +232,10 @@
__libcpp_condvar_wait(&cv, &mut);
if (flag == 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__libcpp_relaxed_store(&flag, once_flag::_State_type(1));
__libcpp_mutex_unlock(&mut);
func(arg);
@@ -245,7 +244,7 @@
_AO_Release);
__libcpp_mutex_unlock(&mut);
__libcpp_condvar_broadcast(&cv);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -255,7 +254,7 @@
__libcpp_condvar_broadcast(&cv);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
__libcpp_mutex_unlock(&mut);
diff --git a/third_party/llvm-project/libcxx/src/new.cpp b/third_party/llvm-project/libcxx/src/new.cpp
index 48d6f99..3c3d1dc 100644
--- a/third_party/llvm-project/libcxx/src/new.cpp
+++ b/third_party/llvm-project/libcxx/src/new.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include <__memory/aligned_alloc.h>
#include <new>
#include <stdlib.h>
@@ -38,7 +39,7 @@
void
__throw_bad_alloc()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_alloc();
#else
_VSTD::abort();
@@ -72,7 +73,7 @@
if (nh)
nh();
else
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
break;
@@ -86,17 +87,17 @@
operator new(size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new(size);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -112,17 +113,17 @@
operator new[](size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new[](size);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -192,7 +193,7 @@
if (nh)
nh();
else {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
break;
@@ -207,17 +208,17 @@
operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new(size, alignment);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -233,17 +234,17 @@
operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new[](size, alignment);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
diff --git a/third_party/llvm-project/libcxx/src/random.cpp b/third_party/llvm-project/libcxx/src/random.cpp
index 3873246..c120d6a 100644
--- a/third_party/llvm-project/libcxx/src/random.cpp
+++ b/third_party/llvm-project/libcxx/src/random.cpp
@@ -13,9 +13,9 @@
# define _CRT_RAND_S
#endif // defined(_LIBCPP_USING_WIN32_RANDOM)
+#include <__system_error/system_error.h>
#include <limits>
#include <random>
-#include <system_error>
#if defined(__sun__)
# define rename solaris_headers_are_broken
diff --git a/third_party/llvm-project/libcxx/src/ryu/d2fixed.cpp b/third_party/llvm-project/libcxx/src/ryu/d2fixed.cpp
index c1a1f6c..e03f1a7 100644
--- a/third_party/llvm-project/libcxx/src/ryu/d2fixed.cpp
+++ b/third_party/llvm-project/libcxx/src/ryu/d2fixed.cpp
@@ -43,7 +43,6 @@
#include <__config>
#include <charconv>
#include <cstring>
-#include <system_error>
#include "include/ryu/common.h"
#include "include/ryu/d2fixed.h"
@@ -135,19 +134,19 @@
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 4, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 4, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__digits >= 100) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__digits >= 10) {
const uint32_t __c = __digits << 1;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
} else {
__result[0] = static_cast<char>('0' + __digits);
}
@@ -164,14 +163,14 @@
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength + 1 - __i - 4, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength + 1 - __i - 4, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__digits >= 100) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__digits >= 10) {
@@ -190,7 +189,7 @@
for (; __i < __count - 1; __i += 2) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __count - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __count - __i - 2, __DIGIT_TABLE + __c, 2);
}
if (__i < __count) {
const char __c = static_cast<char>('0' + (__digits % 10));
@@ -200,7 +199,7 @@
void __append_nine_digits(uint32_t __digits, char* const __result) {
if (__digits == 0) {
- _VSTD::memset(__result, '0', 9);
+ std::memset(__result, '0', 9);
return;
}
@@ -213,8 +212,8 @@
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + 7 - __i, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + 5 - __i, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + 7 - __i, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + 5 - __i, __DIGIT_TABLE + __c1, 2);
}
__result[0] = static_cast<char>('0' + __digits);
}
@@ -251,7 +250,7 @@
*_First++ = '0';
if (__precision > 0) {
*_First++ = '.';
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
return { _First, errc{} };
@@ -322,14 +321,14 @@
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
} else if (__i < __MIN_BLOCK_2[__idx]) {
__i = __MIN_BLOCK_2[__idx];
if (_Last - _First < static_cast<ptrdiff_t>(9 * __i)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', 9 * __i);
+ std::memset(_First, '0', 9 * __i);
_First += 9 * __i;
}
for (; __i < __blocks; ++__i) {
@@ -342,7 +341,7 @@
if (_Last - _First < static_cast<ptrdiff_t>(__fill)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __fill);
+ std::memset(_First, '0', __fill);
_First += __fill;
break;
}
@@ -416,7 +415,7 @@
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
return { _First, errc{} };
@@ -440,10 +439,10 @@
*_First++ = '0';
if (__precision > 0) {
*_First++ = '.';
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
- _VSTD::memcpy(_First, "e+00", 4);
+ std::memcpy(_First, "e+00", 4);
_First += 4;
return { _First, errc{} };
}
@@ -589,7 +588,7 @@
return { _Last, errc::value_too_large };
}
if (__digits == 0) {
- _VSTD::memset(_First, '0', __maximum);
+ std::memset(_First, '0', __maximum);
} else {
__append_c_digits(__maximum, __digits, _First);
}
@@ -654,11 +653,11 @@
if (__exp >= 100) {
const int32_t __c = __exp % 10;
- _VSTD::memcpy(_First, __DIGIT_TABLE + 2 * (__exp / 10), 2);
+ std::memcpy(_First, __DIGIT_TABLE + 2 * (__exp / 10), 2);
_First[2] = static_cast<char>('0' + __c);
_First += 3;
} else {
- _VSTD::memcpy(_First, __DIGIT_TABLE + 2 * __exp, 2);
+ std::memcpy(_First, __DIGIT_TABLE + 2 * __exp, 2);
_First += 2;
}
diff --git a/third_party/llvm-project/libcxx/src/ryu/d2s.cpp b/third_party/llvm-project/libcxx/src/ryu/d2s.cpp
index 245c2eb..ede2607 100644
--- a/third_party/llvm-project/libcxx/src/ryu/d2s.cpp
+++ b/third_party/llvm-project/libcxx/src/ryu/d2s.cpp
@@ -527,10 +527,10 @@
const uint32_t __d0 = (__d % 100) << 1;
const uint32_t __d1 = (__d / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
}
uint32_t __output2 = static_cast<uint32_t>(_Output);
while (__output2 >= 10000) {
@@ -542,35 +542,35 @@
__output2 /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
}
if (__output2 >= 100) {
const uint32_t __c = (__output2 % 100) << 1;
__output2 /= 100;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
}
if (__output2 >= 10) {
const uint32_t __c = __output2 << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
} else {
*--_Mid = static_cast<char>('0' + __output2);
}
if (_Ryu_exponent > 0) { // case "172900" with _Can_use_ryu
// Performance note: it might be more efficient to do this immediately after setting _Mid.
- _VSTD::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
+ std::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
} else if (_Ryu_exponent == 0) { // case "1729"
// Done!
} else if (_Whole_digits > 0) { // case "17.29"
// Performance note: moving digits might not be optimal.
- _VSTD::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
+ std::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
_First[_Whole_digits] = '.';
} else { // case "0.001729"
// Performance note: a larger memset() followed by overwriting '.' might be more efficient.
_First[0] = '0';
_First[1] = '.';
- _VSTD::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
+ std::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
}
return { _First + _Total_fixed_length, errc{} };
@@ -602,10 +602,10 @@
const uint32_t __c1 = (__c / 100) << 1;
const uint32_t __d0 = (__d % 100) << 1;
const uint32_t __d1 = (__d / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(__result + __olength - __i - 5, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(__result + __olength - __i - 7, __DIGIT_TABLE + __d1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 5, __DIGIT_TABLE + __d0, 2);
+ std::memcpy(__result + __olength - __i - 7, __DIGIT_TABLE + __d1, 2);
__i += 8;
}
uint32_t __output2 = static_cast<uint32_t>(_Output);
@@ -618,14 +618,14 @@
__output2 /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__output2 >= 100) {
const uint32_t __c = (__output2 % 100) << 1;
__output2 /= 100;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__output2 >= 10) {
@@ -657,11 +657,11 @@
if (_Scientific_exponent >= 100) {
const int32_t __c = _Scientific_exponent % 10;
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * (_Scientific_exponent / 10), 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * (_Scientific_exponent / 10), 2);
__result[__index + 2] = static_cast<char>('0' + __c);
__index += 3;
} else {
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
__index += 2;
}
@@ -713,7 +713,7 @@
return { _Last, errc::value_too_large };
}
- _VSTD::memcpy(_First, "0e+00", 5);
+ std::memcpy(_First, "0e+00", 5);
return { _First + 5, errc{} };
}
diff --git a/third_party/llvm-project/libcxx/src/ryu/f2s.cpp b/third_party/llvm-project/libcxx/src/ryu/f2s.cpp
index 3bcfe46..db93a48 100644
--- a/third_party/llvm-project/libcxx/src/ryu/f2s.cpp
+++ b/third_party/llvm-project/libcxx/src/ryu/f2s.cpp
@@ -565,35 +565,35 @@
_Output /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
}
if (_Output >= 100) {
const uint32_t __c = (_Output % 100) << 1;
_Output /= 100;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
}
if (_Output >= 10) {
const uint32_t __c = _Output << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
} else {
*--_Mid = static_cast<char>('0' + _Output);
}
if (_Ryu_exponent > 0) { // case "172900" with _Can_use_ryu
// Performance note: it might be more efficient to do this immediately after setting _Mid.
- _VSTD::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
+ std::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
} else if (_Ryu_exponent == 0) { // case "1729"
// Done!
} else if (_Whole_digits > 0) { // case "17.29"
// Performance note: moving digits might not be optimal.
- _VSTD::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
+ std::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
_First[_Whole_digits] = '.';
} else { // case "0.001729"
// Performance note: a larger memset() followed by overwriting '.' might be more efficient.
_First[0] = '0';
_First[1] = '.';
- _VSTD::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
+ std::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
}
return { _First + _Total_fixed_length, errc{} };
@@ -617,14 +617,14 @@
_Output /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (_Output >= 100) {
const uint32_t __c = (_Output % 100) << 1;
_Output /= 100;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (_Output >= 10) {
@@ -654,7 +654,7 @@
__result[__index++] = '+';
}
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
__index += 2;
return { _First + _Total_scientific_length, errc{} };
@@ -673,7 +673,7 @@
return { _Last, errc::value_too_large };
}
- _VSTD::memcpy(_First, "0e+00", 5);
+ std::memcpy(_First, "0e+00", 5);
return { _First + 5, errc{} };
}
diff --git a/third_party/llvm-project/libcxx/src/shared_mutex.cpp b/third_party/llvm-project/libcxx/src/shared_mutex.cpp
index 73d4dc1..b1976c1 100644
--- a/third_party/llvm-project/libcxx/src/shared_mutex.cpp
+++ b/third_party/llvm-project/libcxx/src/shared_mutex.cpp
@@ -10,6 +10,7 @@
#ifndef _LIBCPP_HAS_NO_THREADS
+#include <mutex>
#include <shared_mutex>
#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
# pragma comment(lib, "pthread")
diff --git a/third_party/llvm-project/libcxx/include/__std_stream b/third_party/llvm-project/libcxx/src/std_stream.h
similarity index 98%
rename from third_party/llvm-project/libcxx/include/__std_stream
rename to third_party/llvm-project/libcxx/src/std_stream.h
index e419e8c..9c15d7d 100644
--- a/third_party/llvm-project/libcxx/include/__std_stream
+++ b/third_party/llvm-project/libcxx/src/std_stream.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___STD_STREAM
-#define _LIBCPP___STD_STREAM
+#ifndef _LIBCPP_STD_STREAM_H
+#define _LIBCPP_STD_STREAM_H
#include <__config>
#include <__locale>
@@ -358,4 +358,4 @@
_LIBCPP_POP_MACROS
-#endif // _LIBCPP___STD_STREAM
+#endif // _LIBCPP_STD_STREAM_H
diff --git a/third_party/llvm-project/libcxx/src/stdexcept.cpp b/third_party/llvm-project/libcxx/src/stdexcept.cpp
index d08b674..d5c9173 100644
--- a/third_party/llvm-project/libcxx/src/stdexcept.cpp
+++ b/third_party/llvm-project/libcxx/src/stdexcept.cpp
@@ -9,7 +9,6 @@
#include <new>
#include <stdexcept>
#include <string>
-#include <system_error>
#ifdef _LIBCPP_ABI_VCRUNTIME
#include "support/runtime/stdexcept_vcruntime.ipp"
diff --git a/third_party/llvm-project/libcxx/src/string.cpp b/third_party/llvm-project/libcxx/src/string.cpp
index db211b2..b18dcce 100644
--- a/third_party/llvm-project/libcxx/src/string.cpp
+++ b/third_party/llvm-project/libcxx/src/string.cpp
@@ -63,7 +63,7 @@
template<typename T>
inline void throw_helper(const string& msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw T(msg);
#else
fprintf(stderr, "%s\n", msg.c_str());
diff --git a/third_party/llvm-project/libcxx/src/support/runtime/exception_fallback.ipp b/third_party/llvm-project/libcxx/src/support/runtime/exception_fallback.ipp
index ade9335..3b2716d 100644
--- a/third_party/llvm-project/libcxx/src/support/runtime/exception_fallback.ipp
+++ b/third_party/llvm-project/libcxx/src/support/runtime/exception_fallback.ipp
@@ -51,15 +51,15 @@
void
terminate() noexcept
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -67,7 +67,7 @@
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
diff --git a/third_party/llvm-project/libcxx/src/support/runtime/exception_msvc.ipp b/third_party/llvm-project/libcxx/src/support/runtime/exception_msvc.ipp
index 7e36c70..0114d5a 100644
--- a/third_party/llvm-project/libcxx/src/support/runtime/exception_msvc.ipp
+++ b/third_party/llvm-project/libcxx/src/support/runtime/exception_msvc.ipp
@@ -57,15 +57,15 @@
_LIBCPP_NORETURN
void terminate() noexcept
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -73,7 +73,7 @@
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
diff --git a/third_party/llvm-project/libcxx/src/support/solaris/README b/third_party/llvm-project/libcxx/src/support/solaris/README.txt
similarity index 100%
rename from third_party/llvm-project/libcxx/src/support/solaris/README
rename to third_party/llvm-project/libcxx/src/support/solaris/README.txt
diff --git a/third_party/llvm-project/libcxx/src/system_error.cpp b/third_party/llvm-project/libcxx/src/system_error.cpp
index ba5fa8f..190abfd 100644
--- a/third_party/llvm-project/libcxx/src/system_error.cpp
+++ b/third_party/llvm-project/libcxx/src/system_error.cpp
@@ -286,7 +286,7 @@
void
__throw_system_error(int ev, const char* what_arg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw system_error(error_code(ev, system_category()), what_arg);
#else
(void)ev;
diff --git a/third_party/llvm-project/libcxx/test/.clang-format b/third_party/llvm-project/libcxx/test/.clang-format
new file mode 100644
index 0000000..b446ff7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/.clang-format
@@ -0,0 +1,5 @@
+BasedOnStyle: InheritParentConfig
+
+# Disable formatting options which may break tests.
+SortIncludes: false
+ReflowComments: false
diff --git a/third_party/llvm-project/libcxx/test/configs/apple-libc++-backdeployment.cfg.in b/third_party/llvm-project/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
index 6c2e70f..b471c02 100644
--- a/third_party/llvm-project/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
@@ -7,7 +7,7 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl
+import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
@@ -54,7 +54,9 @@
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
))
-libcxx.test.newconfig.configure(
+config.stdlib = 'apple-libc++'
+
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/apple-libc++-shared.cfg.in b/third_party/llvm-project/libcxx/test/configs/apple-libc++-shared.cfg.in
index 71c4a9e..af1926e 100644
--- a/third_party/llvm-project/libcxx/test/configs/apple-libc++-shared.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/apple-libc++-shared.cfg.in
@@ -22,10 +22,12 @@
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib} -- '
))
+config.stdlib = 'apple-libc++'
+
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/ibm-libc++-shared.cfg.in b/third_party/llvm-project/libcxx/test/configs/ibm-libc++-shared.cfg.in
index fb65bf6..a93b308 100644
--- a/third_party/llvm-project/libcxx/test/configs/ibm-libc++-shared.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/ibm-libc++-shared.cfg.in
@@ -24,8 +24,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-mingw.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-mingw.cfg.in
index 0cb6793..449b030 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-mingw.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-mingw.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
index e8f1fc3..3814bd4 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
index f071bf7..eeeafcf 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
@@ -17,8 +17,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
index c6ddfb7..bdaa834 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
@@ -17,8 +17,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared.cfg.in
index 7228c7e..eb86b88 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-shared.cfg.in
@@ -18,8 +18,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
index 460f7d6..6093ad5 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static.cfg.in b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static.cfg.in
index bdbcb0b..8b66a12 100644
--- a/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static.cfg.in
+++ b/third_party/llvm-project/libcxx/test/configs/llvm-libc++-static.cfg.in
@@ -18,8 +18,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
index fc58955..057f126 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
@@ -35,12 +35,9 @@
};
-int main(int, char**)
-{
+void f() {
int v[1] = {1};
std::random_shuffle(&v[0], &v[1]); // expected-warning {{'random_shuffle<int *>' is deprecated}}
gen r;
std::random_shuffle(&v[0], &v[1], r); // expected-warning {{'random_shuffle<int *, gen &>' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
index c26f755..3cbe04f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
@@ -26,7 +26,7 @@
// This template is a better match than the actual `builtin_memmove` (it can match the pointer type exactly, without an
// implicit conversion to `void*`), so it should hijack the call inside `std::copy` and similar algorithms if it's made.
template <class Dst, class Src>
-constexpr void* __builtin_memmove(Dst*, Src*, size_t) {
+constexpr void* __builtin_memmove(Dst*, Src*, std::size_t) {
assert(false);
return nullptr;
}
@@ -172,7 +172,7 @@
using To = typename std::iterator_traits<OutIter>::value_type;
{
- const size_t N = 5;
+ const std::size_t N = 5;
From input[N] = {make<From>(0), make<From>(1), make<From>(2), make<From>(3), make<From>(4)};
To output[N];
@@ -192,7 +192,7 @@
}
{
- const size_t N = 0;
+ const std::size_t N = 0;
From input[1] = {make<From>(1)};
To output[1] = {make<To>(2)};
@@ -211,25 +211,25 @@
constexpr void test_copy() {
// Classic.
if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::copy(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::copy_backward(first, last, out + n);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
std::copy_n(first, n, out);
});
}
// Ranges.
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::ranges::copy(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::ranges::copy_backward(first, last, out + n);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
std::ranges::copy_n(first, n, out);
});
}
@@ -237,19 +237,19 @@
template <class InIter, template <class> class SentWrapper, class OutIter>
constexpr void test_move() {
if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::move(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::move_backward(first, last, out + n);
});
}
// Ranges.
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::ranges::move(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::ranges::move_backward(first, last, out + n);
});
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
index 7505e57..7c2d388 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
@@ -36,7 +36,7 @@
// This template is a better match than the actual `builtin_memmove` (it can match the pointer type exactly, without an
// implicit conversion to `void*`), so it should hijack the call inside `std::copy` and similar algorithms if it's made.
template <class Dst, class Src>
-constexpr void* __builtin_memmove(Dst* dst, Src* src, size_t count) {
+constexpr void* __builtin_memmove(Dst* dst, Src* src, std::size_t count) {
memmove_called = true;
return __builtin_memmove(static_cast<void*>(dst), static_cast<const void*>(src), count);
}
@@ -135,7 +135,7 @@
// Normal case.
{
- const size_t N = 4;
+ const std::size_t N = 4;
From input[N] = {make<From>(1), make<From>(2), make<From>(3), make<From>(4)};
To output[N];
@@ -162,7 +162,7 @@
// Empty input sequence.
{
- const size_t N = 0;
+ const std::size_t N = 0;
From input[1] = {make<From>(1)};
To output[1] = {make<To>(2)};
@@ -185,37 +185,37 @@
void test_copy_and_move() {
// Classic.
if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::copy(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::copy_backward(first, last, out + n);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
std::copy_n(first, n, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::move(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::move_backward(first, last, out + n);
});
}
// Ranges.
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::ranges::copy(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::ranges::copy_backward(first, last, out + n);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
std::ranges::copy_n(first, n, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
std::ranges::move(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
std::ranges::move_backward(first, last, out + n);
});
}
@@ -281,36 +281,36 @@
}
};
- check([](auto first, auto last, auto out, size_t) {
+ check([](auto first, auto last, auto out, std::size_t) {
std::copy(first, last, out);
});
- check([](auto first, auto last, auto out, size_t n) {
+ check([](auto first, auto last, auto out, std::size_t n) {
std::copy_backward(first, last, out + n);
});
- check([](auto first, auto, auto out, size_t n) {
+ check([](auto first, auto, auto out, std::size_t n) {
std::copy_n(first, n, out);
});
- check([](auto first, auto last, auto out, size_t) {
+ check([](auto first, auto last, auto out, std::size_t) {
std::move(first, last, out);
});
- check([](auto first, auto last, auto out, size_t n) {
+ check([](auto first, auto last, auto out, std::size_t n) {
std::move_backward(first, last, out + n);
});
// Ranges.
- check([](auto first, auto last, auto out, size_t) {
+ check([](auto first, auto last, auto out, std::size_t) {
std::ranges::copy(first, last, out);
});
- check([](auto first, auto last, auto out, size_t n) {
+ check([](auto first, auto last, auto out, std::size_t n) {
std::ranges::copy_backward(first, last, out + n);
});
- check([](auto first, auto, auto out, size_t n) {
+ check([](auto first, auto, auto out, std::size_t n) {
std::ranges::copy_n(first, n, out);
});
- check([](auto first, auto last, auto out, size_t) {
+ check([](auto first, auto last, auto out, std::size_t) {
std::ranges::move(first, last, out);
});
- check([](auto first, auto last, auto out, size_t n) {
+ check([](auto first, auto last, auto out, std::size_t n) {
std::ranges::move_backward(first, last, out + n);
});
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
index bb01cc4..f295b80 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
@@ -22,13 +22,13 @@
#include "test_iterators.h"
-template <size_t N, class Iter>
+template <std::size_t N, class Iter>
requires (N == 0)
constexpr auto wrap_n_times(Iter i) {
return i;
}
-template <size_t N, class Iter>
+template <std::size_t N, class Iter>
requires (N != 0)
constexpr auto wrap_n_times(Iter i) {
return std::make_reverse_iterator(wrap_n_times<N - 1>(i));
@@ -37,12 +37,12 @@
static_assert(std::is_same_v<decltype(wrap_n_times<2>(std::declval<int*>())),
std::reverse_iterator<std::reverse_iterator<int*>>>);
-template <class InIter, template <class> class SentWrapper, class OutIter, size_t W1, size_t W2, class Func>
+template <class InIter, template <class> class SentWrapper, class OutIter, std::size_t W1, size_t W2, class Func>
constexpr void test_one(Func func) {
using From = std::iter_value_t<InIter>;
using To = std::iter_value_t<OutIter>;
- const size_t N = 4;
+ const std::size_t N = 4;
From input[N] = {{1}, {2}, {3}, {4}};
To output[N];
@@ -60,46 +60,46 @@
}));
}
-template <class InIter, template <class> class SentWrapper, class OutIter, size_t W1, size_t W2>
+template <class InIter, template <class> class SentWrapper, class OutIter, std::size_t W1, size_t W2>
constexpr void test_copy_and_move() {
// Classic.
if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
std::copy(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
std::copy_backward(first, last, out + n);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, std::size_t n) {
std::copy_n(first, n, out);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
std::move(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
std::move_backward(first, last, out + n);
});
}
// Ranges.
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
std::ranges::copy(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
std::ranges::copy_backward(first, last, out + n);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, std::size_t n) {
std::ranges::copy_n(first, n, out);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
std::ranges::move(first, last, out);
});
- test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+ test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
std::ranges::move_backward(first, last, out + n);
});
}
-template <size_t W1, size_t W2, class From, class To, template <class> class SentWrapper>
+template <std::size_t W1, size_t W2, class From, class To, template <class> class SentWrapper>
constexpr void test_all_permutations_with_counts_from_to_sent() {
test_copy_and_move<From*, SentWrapper, To*, W1, W2>();
test_copy_and_move<contiguous_iterator<From*>, SentWrapper, To*, W1, W2>();
@@ -114,7 +114,7 @@
}
}
-template <size_t W1, size_t W2>
+template <std::size_t W1, size_t W2>
constexpr void test_all_permutations_with_counts() {
test_all_permutations_with_counts_from_to_sent<W1, W2, int, int, std::type_identity_t>();
test_all_permutations_with_counts_from_to_sent<W1, W2, int, int, sized_sentinel>();
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp
index 47b3c77..bb8dccc 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp
@@ -10,7 +10,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <algorithm>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_less.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
index 89f12e5..6085aa9 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
@@ -206,10 +206,10 @@
struct ValueIterator {
typedef std::input_iterator_tag iterator_category;
- typedef size_t value_type;
- typedef ptrdiff_t difference_type;
- typedef size_t reference;
- typedef size_t* pointer;
+ typedef std::size_t value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::size_t reference;
+ typedef std::size_t* pointer;
ValueIterator() { }
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_three_way_comp.inconsistent.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_three_way_comp.inconsistent.pass.cpp
new file mode 100644
index 0000000..eb2a483
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/debug_three_way_comp.inconsistent.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <algorithm>
+
+// template <class _Comp> struct __debug_three_way_comp
+
+// Make sure __debug_three_way_comp asserts when the comparator is not consistent.
+
+// UNSUPPORTED: !libcpp-has-debug-mode, c++03, c++11, c++14, c++17
+
+#include <algorithm>
+#include <iterator>
+
+#include "check_assertion.h"
+
+struct AlwaysLess {
+ std::strong_ordering operator()(int, int) const { return std::strong_ordering::less; }
+};
+
+struct AlwaysGreater {
+ std::strong_ordering operator()(int, int) const { return std::strong_ordering::greater; }
+};
+
+struct InconsistentEquals {
+ std::strong_ordering operator()(int a, int) const {
+ if (a == 0)
+ return std::strong_ordering::equal;
+ return std::strong_ordering::greater;
+ }
+};
+
+int main(int, char**) {
+ int zero = 0;
+ int one = 1;
+
+ AlwaysLess alwaysLess;
+ std::__debug_three_way_comp<AlwaysLess> debugAlwaysLess(alwaysLess);
+ TEST_LIBCPP_ASSERT_FAILURE(debugAlwaysLess(zero, one), "Comparator does not induce a strict weak ordering");
+
+ AlwaysGreater alwaysGreater;
+ std::__debug_three_way_comp<AlwaysGreater> debugAlwaysGreater(alwaysGreater);
+ TEST_LIBCPP_ASSERT_FAILURE(debugAlwaysGreater(zero, one), "Comparator does not induce a strict weak ordering");
+
+ InconsistentEquals inconsistentEquals;
+ std::__debug_three_way_comp<InconsistentEquals> debugInconsistentEquals(inconsistentEquals);
+ TEST_LIBCPP_ASSERT_FAILURE(debugInconsistentEquals(zero, one), "Comparator does not induce a strict weak ordering");
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/half_positive.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
index 9976796..82d18cb 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
@@ -35,7 +35,7 @@
assert(test<int>());
assert(test<long>());
assert((test<UserDefinedIntegral<int>, int>()));
- assert(test<size_t>());
+ assert(test<std::size_t>());
#if !defined(TEST_HAS_NO_INT128)
assert(test<__int128_t>());
#endif // !defined(TEST_HAS_NO_INT128)
@@ -46,7 +46,7 @@
static_assert(test<char>(), "");
static_assert(test<int>(), "");
static_assert(test<long>(), "");
- static_assert(test<size_t>(), "");
+ static_assert(test<std::size_t>(), "");
#if !defined(TEST_HAS_NO_INT128)
static_assert(test<__int128_t>(), "");
#endif // !defined(TEST_HAS_NO_INT128)
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/lifetimebound.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/lifetimebound.verify.cpp
new file mode 100644
index 0000000..b16ecfb
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/lifetimebound.verify.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+// ADDITIONAL_COMPILE_FLAGS: -Wno-pessimizing-move -Wno-unused-variable
+
+#include <algorithm>
+
+#include "test_macros.h"
+
+struct Comp {
+ template <class T, class U>
+ bool operator()(T, U) {
+ return false;
+ }
+};
+
+void func() {
+ int i = 0;
+ {
+ auto&& v1 = std::min(0, i); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v2 = std::min(i, 0); // expected-warning {{temporary bound to local reference 'v2' will be destroyed at the end of the full-expression}}
+ auto&& v3 = std::min(0, i, Comp{}); // expected-warning {{temporary bound to local reference 'v3' will be destroyed at the end of the full-expression}}
+ auto&& v4 = std::min(i, 0, Comp{}); // expected-warning {{temporary bound to local reference 'v4' will be destroyed at the end of the full-expression}}
+ }
+ {
+ auto&& v1 = std::max(0, i); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v2 = std::max(i, 0); // expected-warning {{temporary bound to local reference 'v2' will be destroyed at the end of the full-expression}}
+ auto&& v3 = std::max(0, i, Comp{}); // expected-warning {{temporary bound to local reference 'v3' will be destroyed at the end of the full-expression}}
+ auto&& v4 = std::max(i, 0, Comp{}); // expected-warning {{temporary bound to local reference 'v4' will be destroyed at the end of the full-expression}}
+ }
+ {
+ auto&& v1 = std::minmax(0, i); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v2 = std::minmax(i, 0); // expected-warning {{temporary bound to local reference 'v2' will be destroyed at the end of the full-expression}}
+ auto&& v3 = std::minmax(0, i, Comp{}); // expected-warning {{temporary bound to local reference 'v3' will be destroyed at the end of the full-expression}}
+ auto&& v4 = std::minmax(i, 0, Comp{}); // expected-warning {{temporary bound to local reference 'v4' will be destroyed at the end of the full-expression}}
+ auto v5 = std::minmax(0, i); // expected-warning {{temporary whose address is used as value of local variable 'v5' will be destroyed at the end of the full-expression}}
+ auto v6 = std::minmax(i, 0); // expected-warning {{temporary whose address is used as value of local variable 'v6' will be destroyed at the end of the full-expression}}
+ auto v7 = std::minmax(0, i, Comp{}); // expected-warning {{temporary whose address is used as value of local variable 'v7' will be destroyed at the end of the full-expression}}
+ auto v8 = std::minmax(i, 0, Comp{}); // expected-warning {{temporary whose address is used as value of local variable 'v8' will be destroyed at the end of the full-expression}}
+ }
+#if TEST_STD_VER >= 20
+ {
+ auto&& v1 = std::ranges::min(0, i); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v2 = std::ranges::min(i, 0); // expected-warning {{temporary bound to local reference 'v2' will be destroyed at the end of the full-expression}}
+ auto&& v3 = std::ranges::min(0, i, Comp{}); // expected-warning {{temporary bound to local reference 'v3' will be destroyed at the end of the full-expression}}
+ auto&& v4 = std::ranges::min(i, 0, Comp{}); // expected-warning {{temporary bound to local reference 'v4' will be destroyed at the end of the full-expression}}
+ }
+ {
+ auto&& v1 = std::ranges::max(0, i); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v2 = std::ranges::max(i, 0); // expected-warning {{temporary bound to local reference 'v2' will be destroyed at the end of the full-expression}}
+ auto&& v3 = std::ranges::max(0, i, Comp{}); // expected-warning {{temporary bound to local reference 'v3' will be destroyed at the end of the full-expression}}
+ auto&& v4 = std::ranges::max(i, 0, Comp{}); // expected-warning {{temporary bound to local reference 'v4' will be destroyed at the end of the full-expression}}
+ }
+ {
+ auto&& v1 = std::ranges::minmax(0, i); // expected-warning {{temporary bound to local reference 'v1' will be destroyed at the end of the full-expression}}
+ auto&& v2 = std::ranges::minmax(i, 0); // expected-warning {{temporary bound to local reference 'v2' will be destroyed at the end of the full-expression}}
+ auto&& v3 = std::ranges::minmax(0, i, Comp{}); // expected-warning {{temporary bound to local reference 'v3' will be destroyed at the end of the full-expression}}
+ auto&& v4 = std::ranges::minmax(i, 0, Comp{}); // expected-warning {{temporary bound to local reference 'v4' will be destroyed at the end of the full-expression}}
+ auto v5 = std::ranges::minmax(0, i); // expected-warning {{temporary whose address is used as value of local variable 'v5' will be destroyed at the end of the full-expression}}
+ auto v6 = std::ranges::minmax(i, 0); // expected-warning {{temporary whose address is used as value of local variable 'v6' will be destroyed at the end of the full-expression}}
+ auto v7 = std::ranges::minmax(0, i, Comp{}); // expected-warning {{temporary whose address is used as value of local variable 'v7' will be destroyed at the end of the full-expression}}
+ auto v8 = std::ranges::minmax(i, 0, Comp{}); // expected-warning {{temporary whose address is used as value of local variable 'v8' will be destroyed at the end of the full-expression}}
+ }
+#endif // TEST_STD_VER >= 20
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
index 0f50d1c..307610d 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
@@ -79,12 +79,13 @@
};
#if TEST_STD_VER > 17
+template <class T>
struct ThreeWay {
int *copies_;
constexpr explicit ThreeWay(int *copies) : copies_(copies) {}
constexpr ThreeWay(const ThreeWay& rhs) : copies_(rhs.copies_) { *copies_ += 1; }
constexpr ThreeWay& operator=(const ThreeWay&) = default;
- constexpr std::strong_ordering operator()(void*, void*) const { return std::strong_ordering::equal; }
+ constexpr std::strong_ordering operator()(T, T) const { return std::strong_ordering::equal; }
};
#endif
@@ -142,7 +143,7 @@
if (!TEST_IS_CONSTANT_EVALUATED) { (void)std::inplace_merge(first, mid, last, Less<T>(&copies)); assert(copies == 0); }
(void)std::lexicographical_compare(first, last, first2, last2, Less<T>(&copies)); assert(copies == 0);
#if TEST_STD_VER > 17
- //(void)std::lexicographical_compare_three_way(first, last, first2, last2, ThreeWay(&copies)); assert(copies == 0);
+ (void)std::lexicographical_compare_three_way(first, last, first2, last2, ThreeWay<T>(&copies)); assert(copies == 0);
#endif
(void)std::lower_bound(first, last, value, Less<T>(&copies)); assert(copies == 0);
(void)std::make_heap(first, last, Less<T>(&copies)); assert(copies == 0);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp
index a7ddf22..78a5863 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp
@@ -138,6 +138,10 @@
(void) std::is_sorted(it, it, pred);
(void) std::lexicographical_compare(it, it, it, it);
(void) std::lexicographical_compare(it, it, it, it, pred);
+#if TEST_STD_VER > 17
+ (void)std::lexicographical_compare_three_way(it, it, it, it);
+ (void)std::lexicographical_compare_three_way(it, it, it, it, std::compare_three_way());
+#endif
(void) std::lower_bound(it, it, 0);
(void) std::lower_bound(it, it, 0, pred);
(void) std::make_heap(it, it);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
index 664ea70..712f12c2 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
@@ -34,7 +34,8 @@
for (int i = 0; i < kSize; ++i) {
v[i].value = kSize / 2 - i * (i % 2 ? -1 : 1);
}
- std::__sort(v.begin(), v.end(), std::less<EqualType>());
+ std::less<EqualType> comp;
+ std::__sort_dispatch<std::_ClassicAlgPolicy>(v.begin(), v.end(), comp);
return v;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp
index c0422dc..233e974 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp
@@ -12,7 +12,7 @@
// We flag uses of the verbose termination function in older dylibs at compile-time to avoid runtime
// failures when back-deploying.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
#include <cstdlib>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/assertions/deprecated-link-time-custom-handler.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/assertions/deprecated-link-time-custom-handler.pass.cpp
index b699a3d..9365bd2 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/assertions/deprecated-link-time-custom-handler.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/assertions/deprecated-link-time-custom-handler.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: availability-verbose_abort-missing
+
// Make sure that we still support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED for folks
// who customize the verbose termination function at link-time in back-deployment environments.
diff --git a/third_party/llvm-project/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp
index 80f3f25..7eb8acb 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp
@@ -10,8 +10,7 @@
// is required for users to be able to include any public header and then override
// the function using a strong definition.
-// The system-provided <uchar.h> seems to be broken on AIX, which trips up this test.
-// XFAIL: LIBCXX-AIX-FIXME
+// XFAIL: availability-verbose_abort-missing
/*
BEGIN-SCRIPT
@@ -658,126 +657,108 @@
// RUN: %{build} -DTEST_122
#if defined(TEST_122) && __cplusplus >= 201103L
-# include <experimental/algorithm>
+# include <experimental/deque>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_123
-#if defined(TEST_123) && __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-# include <experimental/coroutine>
+#if defined(TEST_123) && __cplusplus >= 201103L
+# include <experimental/forward_list>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_124
#if defined(TEST_124) && __cplusplus >= 201103L
-# include <experimental/deque>
+# include <experimental/iterator>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_125
#if defined(TEST_125) && __cplusplus >= 201103L
-# include <experimental/forward_list>
+# include <experimental/list>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_126
#if defined(TEST_126) && __cplusplus >= 201103L
-# include <experimental/functional>
+# include <experimental/map>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_127
#if defined(TEST_127) && __cplusplus >= 201103L
-# include <experimental/iterator>
+# include <experimental/memory_resource>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_128
#if defined(TEST_128) && __cplusplus >= 201103L
-# include <experimental/list>
+# include <experimental/propagate_const>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_129
-#if defined(TEST_129) && __cplusplus >= 201103L
-# include <experimental/map>
+#if defined(TEST_129) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L
+# include <experimental/regex>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_130
#if defined(TEST_130) && __cplusplus >= 201103L
-# include <experimental/memory_resource>
+# include <experimental/set>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_131
#if defined(TEST_131) && __cplusplus >= 201103L
-# include <experimental/propagate_const>
+# include <experimental/simd>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_132
-#if defined(TEST_132) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L
-# include <experimental/regex>
+#if defined(TEST_132) && __cplusplus >= 201103L
+# include <experimental/string>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_133
#if defined(TEST_133) && __cplusplus >= 201103L
-# include <experimental/set>
+# include <experimental/type_traits>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_134
#if defined(TEST_134) && __cplusplus >= 201103L
-# include <experimental/simd>
+# include <experimental/unordered_map>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_135
#if defined(TEST_135) && __cplusplus >= 201103L
-# include <experimental/string>
+# include <experimental/unordered_set>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_136
#if defined(TEST_136) && __cplusplus >= 201103L
-# include <experimental/type_traits>
+# include <experimental/utility>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
// RUN: %{build} -DTEST_137
#if defined(TEST_137) && __cplusplus >= 201103L
-# include <experimental/unordered_map>
- using HandlerType = decltype(std::__libcpp_verbose_abort);
-#endif
-
-// RUN: %{build} -DTEST_138
-#if defined(TEST_138) && __cplusplus >= 201103L
-# include <experimental/unordered_set>
- using HandlerType = decltype(std::__libcpp_verbose_abort);
-#endif
-
-// RUN: %{build} -DTEST_139
-#if defined(TEST_139) && __cplusplus >= 201103L
-# include <experimental/utility>
- using HandlerType = decltype(std::__libcpp_verbose_abort);
-#endif
-
-// RUN: %{build} -DTEST_140
-#if defined(TEST_140) && __cplusplus >= 201103L
# include <experimental/vector>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
-// RUN: %{build} -DTEST_141
-#if defined(TEST_141)
+// RUN: %{build} -DTEST_138
+#if defined(TEST_138)
# include <ext/hash_map>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
-// RUN: %{build} -DTEST_142
-#if defined(TEST_142)
+// RUN: %{build} -DTEST_139
+#if defined(TEST_139)
# include <ext/hash_set>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
index e99af02..495d02f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
@@ -37,6 +37,7 @@
#include <atomic>
#include <cassert>
+#include <cstddef>
template <typename T>
struct atomic_test : public std::__atomic_base<T> {
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
index ca6f006..9ba2fc9 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
@@ -18,12 +18,12 @@
void void_pointer() {
{
volatile std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_add(&obj, 0);
}
{
std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_add(&obj, 0);
}
}
@@ -33,12 +33,12 @@
void pointer_to_incomplete_type() {
{
volatile std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_add(&obj, 0);
}
{
std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_add(&obj, 0);
}
}
@@ -46,12 +46,12 @@
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add(&fun, 0);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add(&fun, 0);
}
}
@@ -63,12 +63,12 @@
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_add' in}}
+ // expected-error@*:* {{no member named 'fetch_add' in}}
std::atomic_fetch_add(&fun, 0);
}
{
std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_add' in}}
+ // expected-error@*:* {{no member named 'fetch_add' in}}
std::atomic_fetch_add(&fun, 0);
}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
index 773dbc7..afcd995 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
@@ -21,12 +21,12 @@
void void_pointer() {
{
volatile std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_add_explicit(&obj, 0, std::memory_order_relaxed);
}
{
std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_add_explicit(&obj, 0, std::memory_order_relaxed);
}
}
@@ -36,12 +36,12 @@
void pointer_to_incomplete_type() {
{
volatile std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_add_explicit(&obj, 0, std::memory_order_relaxed);
}
{
std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_add_explicit(&obj, 0, std::memory_order_relaxed);
}
}
@@ -49,12 +49,12 @@
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
}
@@ -66,12 +66,12 @@
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_add' in}}
+ // expected-error@*:* {{no member named 'fetch_add' in}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_add' in}}
+ // expected-error@*:* {{no member named 'fetch_add' in}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
index c2cf156..f179bd0 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
@@ -18,12 +18,12 @@
void void_pointer() {
{
volatile std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_sub(&obj, 0);
}
{
std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_sub(&obj, 0);
}
}
@@ -33,12 +33,12 @@
void pointer_to_incomplete_type() {
{
volatile std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_sub(&obj, 0);
}
{
std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_sub(&obj, 0);
}
}
@@ -46,12 +46,12 @@
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub(&fun, 0);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub(&fun, 0);
}
}
@@ -63,12 +63,12 @@
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_sub' in}}
+ // expected-error@*:* {{no member named 'fetch_sub' in}}
std::atomic_fetch_sub(&fun, 0);
}
{
std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_sub' in}}
+ // expected-error@*:* {{no member named 'fetch_sub' in}}
std::atomic_fetch_sub(&fun, 0);
}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
index 73c2b96..bbab767 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
@@ -21,12 +21,12 @@
void void_pointer() {
{
volatile std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_sub_explicit(&obj, 0, std::memory_order_relaxed);
}
{
std::atomic<void*> obj;
- // expected-error@atomic:* {{incomplete type 'void' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'void' where a complete type is required}}
std::atomic_fetch_sub_explicit(&obj, 0, std::memory_order_relaxed);
}
}
@@ -36,12 +36,12 @@
void pointer_to_incomplete_type() {
{
volatile std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_sub_explicit(&obj, 0, std::memory_order_relaxed);
}
{
std::atomic<Incomplete*> obj;
- // expected-error@atomic:* {{incomplete type 'Incomplete' where a complete type is required}}
+ // expected-error@*:* {{incomplete type 'Incomplete' where a complete type is required}}
std::atomic_fetch_sub_explicit(&obj, 0, std::memory_order_relaxed);
}
}
@@ -49,12 +49,12 @@
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re@atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
}
@@ -66,12 +66,12 @@
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_sub' in}}
+ // expected-error@*:* {{no member named 'fetch_sub' in}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (S::*)(int)> fun;
- // expected-error@atomic:* {{no member named 'fetch_sub' in}}
+ // expected-error@*:* {{no member named 'fetch_sub' in}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/bit-int.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/bit-int.verify.cpp
index fc6a529..209ec71 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/bit-int.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/bit-int.verify.cpp
@@ -18,10 +18,7 @@
#include <atomic>
-int main(int, char**)
-{
- // expected-error@atomic:*1 {{_Atomic cannot be applied to integer type '_BitInt(32)'}}
+void f() {
+ // expected-error@*:*1 {{_Atomic cannot be applied to integer type '_BitInt(32)'}}
std::atomic<_BitInt(32)> x(42);
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
index 3eb4cab..a6c1160 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
@@ -18,7 +18,7 @@
#include <atomic>
-int main(int, char**) {
+void f() {
std::atomic<int> x(42);
volatile std::atomic<int>& vx = x;
int val1 = 1; ((void)val1);
@@ -123,6 +123,4 @@
std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_acquire);
std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_seq_cst);
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/clang_tidy.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/clang_tidy.sh.cpp
index 57cabf3..74df7af 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/clang_tidy.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/clang_tidy.sh.cpp
@@ -215,21 +215,12 @@
# include <wctype.h>
#endif
#if __cplusplus >= 201103L
-# include <experimental/algorithm>
-#endif
-#if __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-# include <experimental/coroutine>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/deque>
#endif
#if __cplusplus >= 201103L
# include <experimental/forward_list>
#endif
#if __cplusplus >= 201103L
-# include <experimental/functional>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/iterator>
#endif
#if __cplusplus >= 201103L
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
index eb4d4cf..3f7086f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
@@ -17,9 +17,6 @@
#include <map>
#include <functional>
-#include "test_macros.h"
-
-
template <template <typename ...> class Container>
void test_set() {
struct KeyBase { };
@@ -48,12 +45,10 @@
C c;
}
-int main(int, char**) {
+void f() {
// expected-no-diagnostics
test_set<std::set>();
test_set<std::multiset>();
test_map<std::map>();
test_map<std::multimap>();
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
index 61cdc2f..3bb59f1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
@@ -23,7 +23,7 @@
}
};
-int main(int, char**) {
+void f() {
static_assert(!std::__invokable<BadCompare const&, int const&, int const&>::value, "");
static_assert(std::__invokable<BadCompare&, int const&, int const&>::value, "");
@@ -45,6 +45,4 @@
using C = std::multimap<long, int, BadCompare>;
C s;
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
index 5fd6204..467f6cd 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// test that array<T, 0>::back() triggers an assertion
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
index 4952713..a0045e1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// test that array<T, 0>::back() triggers an assertion
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
index 1bd7582..a114fb7 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// test that array<T, 0>::operator[] triggers an assertion
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
index 9cbe7c5..7537053 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <deque>
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/segmented_iterator.compile.pass.cpp
similarity index 71%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/segmented_iterator.compile.pass.cpp
index 92dc58c..27100f9 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/segmented_iterator.compile.pass.cpp
@@ -6,16 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// <complex.h>
+#include <deque>
-#include <complex.h>
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
-
- return 0;
-}
+using DequeIterator = typename std::deque<int>::iterator;
+static_assert(std::__is_segmented_iterator<DequeIterator>::value, "");
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp
index 3b90464..e9e0034 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp
@@ -15,13 +15,15 @@
// resizes or shrinks at the correct time.
#include <deque>
+#include <cassert>
#include <cstdio>
#include <memory>
#include <queue>
#include <stack>
+#include <string>
#include "min_allocator.h"
-#include "rapid-cxx-test.h"
+#include "assert_macros.h"
template <class Adaptor>
struct ContainerAdaptor : public Adaptor {
@@ -56,22 +58,15 @@
template <class Deque>
struct PrintOnFailure {
explicit PrintOnFailure(Deque const& deque) : deque_(&deque) {}
-
- ~PrintOnFailure() {
- if (::rapid_cxx_test::get_reporter().current_failure().type
- != ::rapid_cxx_test::failure_type::none) {
- print(*deque_);
- }
- }
+ void operator()() const { print(*deque_); }
private:
const Deque* deque_;
PrintOnFailure(PrintOnFailure const&) = delete;
};
-TEST_SUITE(deque_spare_tests)
-TEST_CASE(push_back) {
+static void push_back() {
const auto BS = BlockSize<LargeT>::value;
std::unique_ptr<Deque<LargeT>> dp(new Deque<LargeT>);
auto& d = *dp;
@@ -79,126 +74,126 @@
// Test nothing is allocated after default construction.
{
- TEST_REQUIRE(d.size() == 0);
- TEST_REQUIRE(d.__capacity() == 0);
- TEST_REQUIRE(d.__block_count() == 0);
+ TEST_REQUIRE(d.size() == 0, on_fail);
+ TEST_REQUIRE(d.__capacity() == 0, on_fail);
+ TEST_REQUIRE(d.__block_count() == 0, on_fail);
}
// First push back allocates one block.
d.push_back({});
{
- TEST_REQUIRE(d.size() == 1);
- TEST_REQUIRE(d.__front_spare() == 0);
- TEST_REQUIRE(d.__back_spare() == 14);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
- TEST_REQUIRE(d.__capacity() == BS - 1);
- TEST_REQUIRE(d.__block_count() == 1);
+ TEST_REQUIRE(d.size() == 1, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 14, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__capacity() == BS - 1, on_fail);
+ TEST_REQUIRE(d.__block_count() == 1, on_fail);
}
d.push_back({});
{
- TEST_REQUIRE(d.size() == 2);
- TEST_REQUIRE(d.__front_spare() == 0);
- TEST_REQUIRE(d.__back_spare() == 13);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
+ TEST_REQUIRE(d.size() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 13, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
}
// Push back until we need a new block.
for (int RemainingCap = d.__capacity() - d.size(); RemainingCap >= 0; --RemainingCap)
d.push_back({});
{
- TEST_REQUIRE(d.__block_count() == 2);
- TEST_REQUIRE(d.__front_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare() == 15);
+ TEST_REQUIRE(d.__block_count() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 15, on_fail);
}
// Remove the only element in the new block. Test that we keep the empty
// block as a spare.
d.pop_back();
{
- TEST_REQUIRE(d.__block_count() == 2);
- TEST_REQUIRE(d.__front_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare_blocks() == 1);
- TEST_REQUIRE(d.__back_spare() == 16);
+ TEST_REQUIRE(d.__block_count() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 1, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 16, on_fail);
}
// Pop back again, keep the spare.
d.pop_back();
{
- TEST_REQUIRE(d.__block_count() == 2);
- TEST_REQUIRE(d.__front_spare() == 0);
- TEST_REQUIRE(d.__back_spare() == 17);
- TEST_REQUIRE(d.__back_spare_blocks() == 1);
+ TEST_REQUIRE(d.__block_count() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 17, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 1, on_fail);
}
dp.reset();
- TEST_REQUIRE(AllocBytes == 0);
+ TEST_REQUIRE(AllocBytes == 0, on_fail);
}
-TEST_CASE(push_front) {
+static void push_front() {
std::unique_ptr<Deque<LargeT>> dp(new Deque<LargeT>);
auto& d = *dp;
PrintOnFailure<Deque<LargeT>> on_fail(d);
// Test nothing is allocated after default construction.
{
- TEST_REQUIRE(d.size() == 0);
- TEST_REQUIRE(d.__capacity() == 0);
- TEST_REQUIRE(d.__block_count() == 0);
+ TEST_REQUIRE(d.size() == 0, on_fail);
+ TEST_REQUIRE(d.__capacity() == 0, on_fail);
+ TEST_REQUIRE(d.__block_count() == 0, on_fail);
}
// First push front allocates one block, and we start the sequence in the
// middle.
d.push_front({});
{
- TEST_REQUIRE(d.size() == 1);
- TEST_REQUIRE(d.__front_spare() == 7);
- TEST_REQUIRE(d.__back_spare() == 7);
- TEST_REQUIRE(d.__front_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
- TEST_REQUIRE(d.__block_count() == 1);
+ TEST_REQUIRE(d.size() == 1, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 7, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 7, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__block_count() == 1, on_fail);
}
d.push_front({});
{
- TEST_REQUIRE(d.size() == 2);
- TEST_REQUIRE(d.__front_spare() == 6);
- TEST_REQUIRE(d.__back_spare() == 7);
- TEST_REQUIRE(d.__front_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
+ TEST_REQUIRE(d.size() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 6, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 7, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
}
// Push front until we need a new block.
for (int RemainingCap = d.__front_spare(); RemainingCap >= 0; --RemainingCap)
d.push_front({});
{
- TEST_REQUIRE(d.__block_count() == 2);
- TEST_REQUIRE(d.__front_spare() == 15);
- TEST_REQUIRE(d.__back_spare() == 7);
- TEST_REQUIRE(d.__front_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
+ TEST_REQUIRE(d.__block_count() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 15, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 7, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
}
// Remove the only element in the new block. Test that we keep the empty
// block as a spare.
d.pop_front();
{
- TEST_REQUIRE(d.__block_count() == 2);
- TEST_REQUIRE(d.__front_spare_blocks() == 1);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
- TEST_REQUIRE(d.__back_spare() == 7);
+ TEST_REQUIRE(d.__block_count() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 1, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 7, on_fail);
}
// Pop back again, keep the spare.
d.pop_front();
{
- TEST_REQUIRE(d.__block_count() == 2);
- TEST_REQUIRE(d.__front_spare_blocks() == 1);
- TEST_REQUIRE(d.__back_spare() == 7);
+ TEST_REQUIRE(d.__block_count() == 2, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 1, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 7, on_fail);
}
dp.reset();
- TEST_REQUIRE(AllocBytes == 0);
+ TEST_REQUIRE(AllocBytes == 0, on_fail);
}
-TEST_CASE(std_queue) {
+static void std_queue() {
using D = Deque<LargeT>;
using Queue = std::queue<LargeT, D>;
ContainerAdaptor<Queue> CA;
@@ -209,24 +204,24 @@
while (d.__block_count() < 4)
q.push({});
{
- TEST_REQUIRE(d.__block_count() == 4);
- TEST_REQUIRE(d.__front_spare() == 0);
- TEST_REQUIRE(d.__back_spare() == 15);
- TEST_REQUIRE(d.__back_spare_blocks() == 0);
+ TEST_REQUIRE(d.__block_count() == 4, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 15, on_fail);
+ TEST_REQUIRE(d.__back_spare_blocks() == 0, on_fail);
}
while (d.__back_spare()) {
q.push({});
}
{
- TEST_REQUIRE(d.__block_count() == 4);
- TEST_REQUIRE(d.__front_spare() == 0);
- TEST_REQUIRE(d.__back_spare() == 0);
+ TEST_REQUIRE(d.__block_count() == 4, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 0, on_fail);
}
q.pop();
{
- TEST_REQUIRE(d.__block_count() == 4);
- TEST_REQUIRE(d.__front_spare() == 1);
- TEST_REQUIRE(d.__back_spare() == 0);
+ TEST_REQUIRE(d.__block_count() == 4, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 1, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 0, on_fail);
}
// Pop until we create a spare block at the front.
@@ -234,35 +229,35 @@
q.pop();
{
- TEST_REQUIRE(d.__block_count() == 4);
- TEST_REQUIRE(d.__front_spare_blocks() == 1);
- TEST_REQUIRE(d.__front_spare() == 16);
- TEST_REQUIRE(d.__back_spare() == 0);
+ TEST_REQUIRE(d.__block_count() == 4, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 1, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 16, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 0, on_fail);
}
// Push at the end -- should re-use new spare block at front
q.push({});
{
- TEST_REQUIRE(d.__block_count() == 4);
- TEST_REQUIRE(d.__front_spare_blocks() == 0);
- TEST_REQUIRE(d.__front_spare() == 0);
- TEST_REQUIRE(d.__back_spare() == 15);
+ TEST_REQUIRE(d.__block_count() == 4, on_fail);
+ TEST_REQUIRE(d.__front_spare_blocks() == 0, on_fail);
+ TEST_REQUIRE(d.__front_spare() == 0, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 15, on_fail);
}
while (!q.empty()) {
q.pop();
- TEST_REQUIRE(d.__front_spare_blocks() + d.__back_spare_blocks() <= 2);
+ TEST_REQUIRE(d.__front_spare_blocks() + d.__back_spare_blocks() <= 2, on_fail);
}
// The empty state has two blocks
{
- TEST_REQUIRE(d.__front_spare() == 16);
- TEST_REQUIRE(d.__back_spare() == 15);
- TEST_REQUIRE(d.__capacity() == 31);
+ TEST_REQUIRE(d.__front_spare() == 16, on_fail);
+ TEST_REQUIRE(d.__back_spare() == 15, on_fail);
+ TEST_REQUIRE(d.__capacity() == 31, on_fail);
}
}
-TEST_CASE(pop_front_push_back) {
+static void pop_front_push_back() {
Deque<char> d(32 * 1024, 'a');
bool take_from_front = true;
while (d.size() > 0) {
@@ -279,4 +274,11 @@
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ push_back();
+ push_front();
+ std_queue();
+ pop_front_push_back();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
index 4d02547..22847b1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <list>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
index 1a823b2..4519725 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <list>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector.bool/trivial_for_purposes_of_call.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector.bool/trivial_for_purposes_of_call.pass.cpp
index d9d698f..d29b0f1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector.bool/trivial_for_purposes_of_call.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector.bool/trivial_for_purposes_of_call.pass.cpp
@@ -26,10 +26,9 @@
// UNSUPPORTED: c++03
-#include <vector>
#include <cassert>
-
-#include "test_macros.h"
+#include <type_traits>
+#include <vector>
template <class T>
using IsTrivialForCall = std::integral_constant<bool,
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
index b2956a6..42fd9bc 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
index 14c3800..7d8f6e3 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
index ee7e36e..5dc4867 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
index cba6479..b25c766 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
index 95a8160..0b3b380 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
index 3192768..12ad7a2 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
index 8d4099f..5a7a90e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
index dc77111..df56247 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
@@ -41,8 +41,8 @@
// Create a vector containing some number of elements that will
// have to be moved when it is resized.
v.reserve(10);
- size_t old_cap = v.capacity();
- for (size_t i = 0; i < v.capacity(); ++i) {
+ std::size_t old_cap = v.capacity();
+ for (std::size_t i = 0; i < v.capacity(); ++i) {
v.emplace_back(42);
}
assert(v.capacity() == old_cap);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
index 5a29248..4aa87d3 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
@@ -31,7 +31,7 @@
return __builtin_popcount(n) == 1;
}
-void test_next_pow2_val(size_t n)
+void test_next_pow2_val(std::size_t n)
{
std::size_t npow2 = std::__next_hash_pow2(n);
assert(is_power_of_two(npow2) && npow2 > n);
@@ -68,7 +68,7 @@
unsigned num_reserve1,
unsigned num_reserve2)
{
- std::unordered_map<uint64_t, unsigned long> m;
+ std::unordered_map<std::uint64_t, unsigned long> m;
m.reserve(num_reserve1);
for (unsigned I = 0; I < num_inserts; ++I) m[I] = 0;
m.reserve(num_reserve2);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
index 642e5fa..d19ab1e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
@@ -22,7 +22,7 @@
#include "test_macros.h"
bool
-is_prime(size_t n)
+is_prime(std::size_t n)
{
switch (n)
{
@@ -30,7 +30,7 @@
case 1:
return false;
}
- for (size_t i = 2; i*i <= n; ++i)
+ for (std::size_t i = 2; i*i <= n; ++i)
{
if (n % i == 0)
return false;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
index 603b4fc..9fd4f69 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
@@ -48,12 +48,10 @@
C c;
}
-int main(int, char**) {
+void f() {
// expected-no-diagnostics
test_set<std::unordered_set>();
test_set<std::unordered_multiset>();
test_map<std::unordered_map>();
test_map<std::unordered_multimap>();
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
index 2a389c0..a5d529d 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
@@ -17,7 +17,7 @@
struct BadHash {
template <class T>
- size_t operator()(T const& t) {
+ std::size_t operator()(T const& t) {
return std::hash<T>{}(t);
}
};
@@ -29,7 +29,7 @@
}
};
-int main(int, char**) {
+void f() {
static_assert(!std::__invokable<BadEqual const&, int const&, int const&>::value, "");
static_assert(std::__invokable<BadEqual&, int const&, int const&>::value, "");
@@ -54,6 +54,4 @@
using C = std::unordered_multimap<long, int, BadHash, BadEqual>;
C s;
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
index 4406fa8..e581b08 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
index 858ed1c..4a94b87 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
index b4505f9..22b7a6e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
@@ -17,7 +17,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
index 0c2f12a..f1b3151 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
index 9c27d58..a1edf04 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
index 42bd462..0d72153 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
@@ -17,7 +17,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
index 37d43fb..4d2d9eb 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
index c8e7523..da9902e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
index 1b5aaa4..191a514 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
@@ -17,7 +17,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
index 5634ffd..69d473a 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
index dd3ad22..4a1788e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
@@ -16,7 +16,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
index 385e627..e1afe26 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
@@ -17,7 +17,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
index 45be37d..f492b76 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
@@ -28,7 +28,7 @@
BadHashNoCopy(BadHashNoCopy const&) = delete;
template <class T>
- size_t operator()(T const&) const { return 0; }
+ std::size_t operator()(T const&) const { return 0; }
};
struct BadHashNoCall {
@@ -39,7 +39,7 @@
struct GoodHashNoDefault {
explicit GoodHashNoDefault(void*) {}
template <class T>
- size_t operator()(T const&) const { return 0; }
+ std::size_t operator()(T const&) const { return 0; }
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp
index cd373e7..3ca2470 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp
@@ -19,7 +19,7 @@
// Check that we ensure that `[it, sent)` is a valid range.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp
index 1888b4b..f48c186 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp
@@ -16,7 +16,7 @@
// dynamic_extent version.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp
index 9e92e83..ab9c12f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp
@@ -14,7 +14,7 @@
// Check that we ensure `other.size() == Extent`.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp
index bf1233f..2236de6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp
@@ -14,7 +14,7 @@
// Check that we ensure `size(r) == Extent`.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <span>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp
index e6fb20d..95cc558 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp
@@ -14,7 +14,7 @@
// Make sure that accessing a span out-of-bounds triggers an assertion.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp
index 8234ef8..df750a7 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp
@@ -14,7 +14,7 @@
// Make sure that accessing a span out-of-bounds triggers an assertion.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp
index 2e643b3..12a8b23 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp
@@ -14,7 +14,7 @@
// Make sure that accessing a span out-of-bounds triggers an assertion.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp
index d17948f..733f9fd 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp
@@ -14,7 +14,7 @@
// Make sure that creating a sub-span with an incorrect number of elements triggers an assertion.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp
index e49f37f..6ec90ad 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp
@@ -14,7 +14,7 @@
// Make sure that creating a sub-span with an incorrect number of elements triggers an assertion.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp
index 487140f..a66ca54 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp
@@ -9,16 +9,20 @@
// <span>
//
+// template<size_t Offset, size_t Count = dynamic_extent>
+// constexpr span<element_type, see-below> subspan() const;
+//
+// Requires: Offset <= size() && (Count == dynamic_extent || Count <= size() - Offset)
+//
// constexpr span<element_type, dynamic_extent> subspan(
// size_type offset, size_type count = dynamic_extent) const;
//
-// Requires: (0 <= Offset && Offset <= size())
-// && (Count == dynamic_extent || Count >= 0 && Offset + Count <= size())
+// Requires: offset <= size() && (count == dynamic_extent || count <= size() - offset)
// Make sure that creating a sub-span with an incorrect number of elements triggers an assertion.
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <array>
@@ -44,13 +48,13 @@
std::array<int, 3> array{0, 1, 2};
std::span<int, 3> const s(array.data(), array.size());
TEST_LIBCPP_ASSERT_FAILURE(s.subspan(4), "span<T, N>::subspan(offset, count): offset out of range");
- // s.subspan<4>() caught at compile-time (tested elsewhere)
+ // s.subspan<4>() caught at compile-time (tested in libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp)
TEST_LIBCPP_ASSERT_FAILURE(s.subspan(0, 4), "span<T, N>::subspan(offset, count): count out of range");
- // s.subspan<0, 4>() caught at compile-time (tested elsewhere)
+ // s.subspan<0, 4>() caught at compile-time (tested in libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp)
TEST_LIBCPP_ASSERT_FAILURE(s.subspan(1, 3), "span<T, N>::subspan(offset, count): offset + count out of range");
- // s.subspan<1, 3>() caught at compile-time (tested elsewhere)
+ // s.subspan<1, 3>() caught at compile-time (tested in libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp)
}
return 0;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/debug/containers.multithread.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
index a389c31..eb2373e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
@@ -32,14 +32,14 @@
template <typename Container>
void ThreadUseIter() {
- const size_t maxRounds = 7;
+ const std::size_t maxRounds = 7;
struct TestRunner{
void operator()() {
- for (size_t count = 0; count < maxRounds; count++) {
- const size_t containerCount = 11;
+ for (std::size_t count = 0; count < maxRounds; count++) {
+ const std::size_t containerCount = 11;
std::vector<Container> containers;
std::vector<typename Container::iterator> iterators;
- for (size_t containerIndex = 0; containerIndex < containerCount; containerIndex++) {
+ for (std::size_t containerIndex = 0; containerIndex < containerCount; containerIndex++) {
containers.push_back(makeContainer<Container>(3));
Container& c = containers.back();
iterators.push_back(c.begin());
@@ -50,12 +50,12 @@
};
TestRunner r;
- const size_t threadCount = 4;
+ const std::size_t threadCount = 4;
std::vector<std::thread> threads;
- for (size_t count = 0; count < threadCount; count++)
+ for (std::size_t count = 0; count < threadCount; count++)
threads.emplace_back(r);
r();
- for (size_t count = 0; count < threadCount; count++)
+ for (std::size_t count = 0; count < threadCount; count++)
threads[count].join();
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
index 9fc8306..3fe7ced 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
@@ -25,11 +25,6 @@
#include <memory>
#include "test_macros.h"
-int main(int, char**)
-{
- typedef std::auto_ptr<int> AP; // expected-warning {{'auto_ptr<int>' is deprecated}}
- typedef std::auto_ptr<void> APV; // expected-warning {{'auto_ptr<void>' is deprecated}}
- typedef std::auto_ptr_ref<int> APR; // expected-warning {{'auto_ptr_ref<int>' is deprecated}}
-
- return 0;
-}
+typedef std::auto_ptr<int> AP; // expected-warning {{'auto_ptr<int>' is deprecated}}
+typedef std::auto_ptr<void> APV; // expected-warning {{'auto_ptr<void>' is deprecated}}
+typedef std::auto_ptr_ref<int> APR; // expected-warning {{'auto_ptr_ref<int>' is deprecated}}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
index a4a05e6..b887df6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
@@ -6,6 +6,10 @@
//
//===----------------------------------------------------------------------===//
+// When building with modules, including headers inside extern "C" is an anti-pattern
+// that we don't want to support and can't support with LSV enabled.
+// UNSUPPORTED: modules-build
+
// Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This
// is ill-formed (no diagnostic required), per [using.headers]p3, but we permit
// it as an extension.
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
index 688bab4..4f8ae78 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// This test breaks when enabling LSV.
+// UNSUPPORTED: modules-build
+
// Test that limits macros are available when <stdint.h> is included
// with or without macro _XOPEN_SOURCE=700.
//
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
index 4ccc3c0..5b21cc6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
@@ -19,15 +19,10 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
#include <memory>
-#include "test_macros.h"
-int main(int, char**)
-{
+void f() {
int x = 0;
std::allocator<int> a;
- int* p = a.address(x); // expected-warning {{'address' is deprecated}}
- (void)p;
-
- return 0;
+ (void)a.address(x); // expected-warning {{'address' is deprecated}}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
index cca8510..da35465 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
@@ -29,15 +29,15 @@
#endif
#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+static const std::size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
#else
-static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+static const std::size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
#endif
-static const size_t OverAligned = MaxAligned * 2;
+static const std::size_t OverAligned = MaxAligned * 2;
-template <size_t Align>
+template <std::size_t Align>
struct TEST_ALIGNAS(Align) AlignedType {
char data;
static int constructed;
@@ -45,11 +45,11 @@
AlignedType(AlignedType const&) { ++constructed; }
~AlignedType() { --constructed; }
};
-template <size_t Align>
+template <std::size_t Align>
int AlignedType<Align>::constructed = 0;
-template <size_t Align>
+template <std::size_t Align>
void test_aligned() {
typedef AlignedType<Align> T;
T::constructed = 0;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
index c122be5..2289cd6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
@@ -21,14 +21,8 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <memory>
-#include <cassert>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::allocator<int> a;
a.allocate(3, nullptr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
index efb57b6..79fd61d 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
@@ -18,12 +18,10 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
#include <memory>
+
#include "test_macros.h"
-int main(int, char**)
-{
+void f() {
std::allocator<int> a;
TEST_IGNORE_NODISCARD a.allocate(3, nullptr); // expected-warning {{'allocate' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
index 2b3a05e..87d81d0 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
@@ -14,7 +14,6 @@
#include <functional>
#include <cassert>
-#include "test_macros.h"
int identity(int v) { return v; }
int sum(int a, int b) { return a + b; }
@@ -26,8 +25,7 @@
int identity(int v) { return v; }
};
-int main(int, char**)
-{
+void f() {
typedef std::pointer_to_unary_function<int, int> PUF; // expected-warning {{'pointer_to_unary_function<int, int>' is deprecated}}
typedef std::pointer_to_binary_function<int, int, int> PBF; // expected-warning {{'pointer_to_binary_function<int, int, int>' is deprecated}}
std::ptr_fun<int, int>(identity); // expected-warning {{'ptr_fun<int, int>' is deprecated}}
@@ -50,6 +48,4 @@
std::mem_fun_ref<int, Foo, int>(&Foo::identity); // expected-warning {{'mem_fun_ref<int, Foo, int>' is deprecated}}
std::mem_fun_ref<int, Foo>(&Foo::const_zero); // expected-warning {{'mem_fun_ref<int, Foo>' is deprecated}}
std::mem_fun_ref<int, Foo, int>(&Foo::const_identity); // expected-warning {{'mem_fun_ref<int, Foo, int>' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/depr/enable_removed_cpp17_features.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/depr/enable_removed_cpp17_features.compile.pass.cpp
similarity index 95%
rename from third_party/llvm-project/libcxx/test/libcxx/depr/enable_removed_cpp17_features.pass.cpp
rename to third_party/llvm-project/libcxx/test/libcxx/depr/enable_removed_cpp17_features.compile.pass.cpp
index 3ae848f..a734d8a 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/depr/enable_removed_cpp17_features.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/depr/enable_removed_cpp17_features.compile.pass.cpp
@@ -22,8 +22,3 @@
#ifndef _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
#error _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR must be defined
#endif
-
-int main(int, char**) {
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/math_nodiscard_extensions.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/math_nodiscard_extensions.verify.cpp
index a3db61b..dabeda7 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/math_nodiscard_extensions.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/math_nodiscard_extensions.verify.cpp
@@ -11,146 +11,155 @@
// We don't control the implementation of the math.h functions on windows
// UNSUPPORTED: windows
-// check that const cmath functions are declared [[nodiscard]]
+// Check that functions from `<cmath>` that Clang marks with the `[[gnu::const]]` attribute are declared
+// `[[nodiscard]]`.
#include <cmath>
+#include "test_macros.h"
void test() {
- std::signbit(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::signbit(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::signbit(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::signbit(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::signbit(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::fpclassify(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fpclassify(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fpclassify(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fpclassify(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fpclassify(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isfinite(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isfinite(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isfinite(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isfinite(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isfinite(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isinf(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isinf(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isinf(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isinf(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isinf(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isnan(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnan(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnan(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnan(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnan(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isnormal(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnormal(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnormal(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnormal(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isnormal(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isgreater(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreater(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreater(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreater(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreater(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isgreaterequal(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreaterequal(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreaterequal(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreaterequal(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isgreaterequal(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isless(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isless(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isless(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isless(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isless(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::islessequal(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessequal(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessequal(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessequal(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessequal(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::islessgreater(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessgreater(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessgreater(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessgreater(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::islessgreater(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::isunordered(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isunordered(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isunordered(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isunordered(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::isunordered(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::ceil(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
+ // These tests rely on Clang's behaviour of adding `[[gnu::const]]` to the double overload of most of the functions
+ // below.
+ // Without that attribute being added implicitly, this test can't be checked consistently because its result depends
+ // on whether we're getting libc++'s own `std::foo(double)` or the underlying C library's `foo(double)`.
+#ifdef TEST_COMPILER_CLANG
std::ceil(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::ceil(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::ceil(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::ceil(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::fabs(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::fabs(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fabs(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fabs(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fabs(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::floor(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::floor(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::floor(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::floor(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::floor(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::cbrt(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::cbrt(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::cbrt(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::cbrt(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::cbrt(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::copysign(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::copysign(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::copysign(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::copysign(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::copysign(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::fmax(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::fmax(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fmax(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fmax(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fmax(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::fmin(0.f, 0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::fmin(0., 0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fmin(0.l, 0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fmin(0, 0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::fmin(0U, 0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::nearbyint(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::nearbyint(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::nearbyint(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::nearbyint(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::nearbyint(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::rint(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::rint(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::rint(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::rint(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::rint(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::round(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::round(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::round(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::round(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::round(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
-
- std::trunc(0.f); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
std::trunc(0.); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::trunc(0.l); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::trunc(0); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
- std::trunc(0U); // expected-warning-re {{ignoring return value of function declared with {{.*}} attribute}}
+#endif
+
+ std::signbit(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::signbit(0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::signbit(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::signbit(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::signbit(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::fpclassify(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fpclassify(0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fpclassify(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fpclassify(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fpclassify(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isfinite(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isfinite(0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isfinite(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isfinite(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isfinite(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isinf(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isinf(0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isinf(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isinf(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isinf(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isnan(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnan(0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnan(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnan(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnan(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isnormal(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnormal(0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnormal(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnormal(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isnormal(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isgreater(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreater(0., 0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreater(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreater(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreater(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isgreaterequal(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreaterequal(0., 0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreaterequal(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreaterequal(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isgreaterequal(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isless(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isless(0., 0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isless(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isless(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isless(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::islessequal(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessequal(0., 0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessequal(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessequal(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessequal(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::islessgreater(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessgreater(0., 0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessgreater(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessgreater(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::islessgreater(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::isunordered(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isunordered(0., 0.); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isunordered(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isunordered(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::isunordered(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::ceil(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::ceil(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::ceil(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::ceil(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::fabs(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fabs(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fabs(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fabs(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::floor(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::floor(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::floor(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::floor(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::cbrt(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::cbrt(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::cbrt(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::cbrt(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::copysign(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::copysign(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::copysign(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::copysign(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::fmax(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fmax(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fmax(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fmax(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::fmin(0.f, 0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fmin(0.l, 0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fmin(0, 0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::fmin(0U, 0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::nearbyint(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::nearbyint(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::nearbyint(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::nearbyint(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::rint(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::rint(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::rint(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::rint(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::round(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::round(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::round(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::round(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::trunc(0.f); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::trunc(0.l); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::trunc(0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::trunc(0U); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
index 9e3796c..242d935 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
@@ -16,9 +16,6 @@
_LIBCPP_NODISCARD_AFTER_CXX17 int foo() { return 6; }
-int main(int, char**)
-{
+void f() {
foo(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
index e0d457b..0cc86e2 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
@@ -183,12 +183,10 @@
#endif
}
-int main(int, char**) {
+void tests() {
test_algorithms();
int i = 42;
test_template_cast_wrappers(i, std::move(i));
test_nontemplate_cast_wrappers();
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
index e816624..3d0dd2a 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
@@ -174,6 +174,14 @@
std::lexicographical_compare(std::begin(arr), std::end(arr), std::begin(arr),
std::end(arr), std::greater<int>());
+#if TEST_STD_VER >= 20
+ // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::lexicographical_compare_three_way(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr));
+
+ // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::lexicographical_compare_three_way(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr), std::compare_three_way());
+#endif
+
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
std::lower_bound(std::begin(arr), std::end(arr), 1);
@@ -341,12 +349,10 @@
#endif
}
-int main(int, char**) {
+void f() {
test_algorithms();
int i = 42;
test_template_cast_wrappers(i, std::move(i));
test_nontemplate_cast_wrappers();
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/double_include.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/double_include.sh.cpp
index ea9fc7b..b6bbf4e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/double_include.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/double_include.sh.cpp
@@ -13,9 +13,6 @@
// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags}
// RUN: %{run}
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
#if defined(__DEPRECATED)
# undef __DEPRECATED
@@ -216,21 +213,12 @@
# include <wctype.h>
#endif
#if __cplusplus >= 201103L
-# include <experimental/algorithm>
-#endif
-#if __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-# include <experimental/coroutine>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/deque>
#endif
#if __cplusplus >= 201103L
# include <experimental/forward_list>
#endif
#if __cplusplus >= 201103L
-# include <experimental/functional>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/iterator>
#endif
#if __cplusplus >= 201103L
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp
deleted file mode 100644
index ba207e9..0000000
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/algorithm>
-
-#include <experimental/algorithm>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_ALGORITHM
-# error "<experimental/algorithm> must include <algorithm>"
-#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/algorithms/version.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/algorithms/version.pass.cpp
deleted file mode 100644
index 0a96474..0000000
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/algorithms/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/algorithm>
-
-#include <experimental/algorithm>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-# error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp
deleted file mode 100644
index c237ca0..0000000
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: fcoroutines-ts
-// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-coroutine
-
-// A simple "breathing" test that checks that <experimental/coroutine>
-// can be parsed and used in all dialects, including C++03 in order to match
-// Clang's behavior.
-
-#include <experimental/coroutine>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental::coroutines_v1;
-
-coro::suspend_always sa;
-coro::suspend_never sn;
-
-struct MyFuture {
- struct promise_type {
- typedef coro::coroutine_handle<promise_type> HandleT;
- coro::suspend_never initial_suspend() { return sn; }
- coro::suspend_always final_suspend() TEST_NOEXCEPT { return sa; }
- coro::suspend_never yield_value(int) { return sn; }
- MyFuture get_return_object() {
- MyFuture f(HandleT::from_promise(*this));
- return f;
- }
- void return_void() {}
- void unhandled_exception() {}
- };
- typedef promise_type::HandleT HandleT;
- MyFuture() : p() {}
- MyFuture(HandleT h) : p(h) {}
-
- coro::coroutine_handle<promise_type> p;
-};
-
-MyFuture test_coro() {
- co_await sn;
- co_yield 42;
- co_return;
-}
-
-int main(int, char**)
-{
- MyFuture f = test_coro();
- while (!f.p.done())
- f.p.resume();
- f.p.destroy();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
deleted file mode 100644
index 46cf345..0000000
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// REQUIRES: fcoroutines-ts
-// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts
-
-#include <experimental/coroutine>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION must be defined
-#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
index 5c717f8..c68e6a3 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
@@ -14,7 +14,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
index 5305042..a2dc95a 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
@@ -14,7 +14,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
index b6945bb..fc12e65 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
index c59ac64..5e2e02f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
index 5e491e7..45f4aed 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
@@ -18,7 +18,7 @@
// Use the first element as a position into the data
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
if (size <= 1) return 0;
- const size_t partition_point = data[0] % size;
+ const std::size_t partition_point = data[0] % size;
std::vector<std::uint8_t> working(data + 1, data + size);
const auto partition_iter = working.begin() + partition_point;
std::nth_element(working.begin(), partition_iter, working.end());
diff --git a/third_party/llvm-project/libcxx/test/libcxx/fuzzing/random.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/fuzzing/random.pass.cpp
index e7545ff..79ab7ac 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/fuzzing/random.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/fuzzing/random.pass.cpp
@@ -38,7 +38,7 @@
using ResultT = typename Dist::result_type;
static_assert(std::is_same<ResultT, typename ParamT::distribution_type::result_type>::value, "");
- static ParamT Create(const uint8_t* data, std::size_t size, bool &OK) {
+ static ParamT Create(const std::uint8_t* data, std::size_t size, bool &OK) {
constexpr bool select_vector_result = std::is_constructible<ParamT, ResultT*, ResultT*, ResultT*>::value;
constexpr bool select_vector_double = std::is_constructible<ParamT, double*, double*>::value;
constexpr int selector = select_vector_result ? 0 : (select_vector_double ? 1 : 2);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
index 48b3f10..c8529f9 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
@@ -12,7 +12,7 @@
// UNSUPPORTED: c++03
// TODO: Investigate these failures which break the CI.
-// UNSUPPORTED: clang-14, clang-15, clang-16
+// UNSUPPORTED: clang-14, clang-15, clang-16, clang-17
// TODO: Investigate this failure on GCC 12 (in Ubuntu Jammy)
// UNSUPPORTED: gcc-12
diff --git a/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
index 9a19c46..4c6ac40 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp
@@ -26,17 +26,15 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
#include "filesystem_common.h"
using namespace fs::detail;
-TEST_SUITE(directory_entry_mods_suite)
-
-TEST_CASE(last_write_time_not_representable_error) {
+static void last_write_time_not_representable_error() {
using namespace fs;
using namespace std::chrono;
scoped_test_env env;
@@ -55,13 +53,13 @@
file_time_type start_time = file_time_type::clock::now() - hours(1);
last_write_time(file, start_time);
- TEST_CHECK(ent.last_write_time() == old_time);
+ assert(ent.last_write_time() == old_time);
bool IsRepresentable = true;
file_time_type rep_value;
{
std::error_code ec;
- TEST_REQUIRE(!set_file_times(file, TS, ec));
+ assert(!set_file_times(file, TS, ec));
ec.clear();
rep_value = last_write_time(file, ec);
IsRepresentable = !bool(ec);
@@ -70,30 +68,34 @@
if (!IsRepresentable) {
std::error_code rec = GetTestEC();
ent.refresh(rec);
- TEST_CHECK(!rec);
+ assert(!rec);
const std::errc expected_err = std::errc::value_too_large;
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, expected_err));
+ assert(ent.last_write_time(ec) == file_time_type::min());
+ assert(ErrorIs(ec, expected_err));
ec = GetTestEC();
- TEST_CHECK(last_write_time(file, ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, expected_err));
+ assert(last_write_time(file, ec) == file_time_type::min());
+ assert(ErrorIs(ec, expected_err));
ExceptionChecker CheckExcept(file, expected_err,
"directory_entry::last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, CheckExcept,
+ TEST_VALIDATE_EXCEPTION(filesystem_error, CheckExcept,
ent.last_write_time());
} else {
ent.refresh();
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == rep_value);
- TEST_CHECK(!ec);
+ assert(ent.last_write_time(ec) == rep_value);
+ assert(!ec);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ last_write_time_not_representable_error();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
index 9dc863d..c397f23 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <filesystem>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
index 88054f3..b86282c 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
@@ -280,12 +280,12 @@
int main(int, char**) {
{ assert((test_case<file_time_type, time_t, struct timespec>::test())); }
{
- assert((test_case<TestFileTimeT<int64_t>, int64_t,
- TestTimeSpec<int64_t, long> >::test()));
+ assert((test_case<TestFileTimeT<std::int64_t>, std::int64_t,
+ TestTimeSpec<std::int64_t, long> >::test()));
}
{
- assert((test_case<TestFileTimeT<long long>, int32_t,
- TestTimeSpec<int32_t, int32_t> >::test()));
+ assert((test_case<TestFileTimeT<long long>, std::int32_t,
+ TestTimeSpec<std::int32_t, std::int32_t> >::test()));
}
{
// Test that insane platforms like ppc64 linux, which use long double as time_t,
@@ -295,12 +295,12 @@
}
#ifndef TEST_HAS_NO_INT128_T
{
- assert((test_case<TestFileTimeT<__int128_t, std::nano>, int64_t,
- TestTimeSpec<int64_t, long> >::test()));
+ assert((test_case<TestFileTimeT<__int128_t, std::nano>, std::int64_t,
+ TestTimeSpec<std::int64_t, long> >::test()));
}
{
- assert((test_case<TestFileTimeT<__int128_t, std::nano>, int32_t,
- TestTimeSpec<int32_t, int32_t> >::test()));
+ assert((test_case<TestFileTimeT<__int128_t, std::nano>, std::int32_t,
+ TestTimeSpec<std::int32_t, std::int32_t> >::test()));
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.advance.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.advance.pass.cpp
index 715aebe..b455767 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.advance.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.advance.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <list>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.next.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.next.pass.cpp
index 6a5328e..992a406 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.next.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.next.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <list>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.prev.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.prev.pass.cpp
index 5e5723c..f1903cb 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.prev.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/assert.prev.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <list>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp
index d426148..04761fa 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp
@@ -13,7 +13,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <iterator>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_bidirectional_iterator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_bidirectional_iterator.compile.pass.cpp
index 7ba8c75..dff0185 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_bidirectional_iterator.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_bidirectional_iterator.compile.pass.cpp
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// This test uses iterator types from std::filesystem
+// XFAIL: availability-filesystem-missing
// template<class I>
// concept __iterator_traits_detail::__cpp17_bidirectional_iterator;
@@ -72,7 +72,7 @@
static_assert(!std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::back_insert_iterator<std::vector<int>>>);
static_assert(!std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::front_insert_iterator<std::vector<int>>>);
static_assert(!std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::insert_iterator<std::vector<int>>>);
-static_assert(!std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::move_iterator<int*>>);
+static_assert(std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::move_iterator<int*>>);
// <list>
static_assert(std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::list<int>::iterator>);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_forward_iterator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_forward_iterator.compile.pass.cpp
index 7a2000a..2371cbd 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_forward_iterator.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_forward_iterator.compile.pass.cpp
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// This test uses iterator types from std::filesystem
+// XFAIL: availability-filesystem-missing
// template<class I>
// concept __iterator_traits_detail::__cpp17_forward_iterator;
@@ -72,7 +72,7 @@
static_assert(!std::__iterator_traits_detail::__cpp17_forward_iterator<std::back_insert_iterator<std::vector<int>>>);
static_assert(!std::__iterator_traits_detail::__cpp17_forward_iterator<std::front_insert_iterator<std::vector<int>>>);
static_assert(!std::__iterator_traits_detail::__cpp17_forward_iterator<std::insert_iterator<std::vector<int>>>);
-static_assert(!std::__iterator_traits_detail::__cpp17_forward_iterator<std::move_iterator<int*>>);
+static_assert(std::__iterator_traits_detail::__cpp17_forward_iterator<std::move_iterator<int*>>);
// <list>
static_assert(std::__iterator_traits_detail::__cpp17_forward_iterator<std::list<int>::iterator>);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_input_iterator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_input_iterator.compile.pass.cpp
index 49f42dd..e6c48b5 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_input_iterator.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_input_iterator.compile.pass.cpp
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// This test uses iterator types from std::filesystem
+// XFAIL: availability-filesystem-missing
// template<class I>
// concept __iterator_traits_detail::__cpp17_input_iterator;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_iterator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_iterator.compile.pass.cpp
index 3ce86df..2dc3320 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_iterator.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_iterator.compile.pass.cpp
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// This test uses iterator types from std::filesystem
+// XFAIL: availability-filesystem-missing
// template<class I>
// concept __iterator_traits_detail::__cpp17_iterator;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_random_access_iterator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_random_access_iterator.compile.pass.cpp
index ddbf60f..01fef35 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_random_access_iterator.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_random_access_iterator.compile.pass.cpp
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// This test uses iterator types from std::filesystem
+// XFAIL: availability-filesystem-missing
// template<class I>
// concept __iterator_traits_detail::__cpp17_random_access_iterator;
@@ -72,7 +72,7 @@
static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::back_insert_iterator<std::vector<int>>>);
static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::front_insert_iterator<std::vector<int>>>);
static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::insert_iterator<std::vector<int>>>);
-static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::move_iterator<int*>>);
+static_assert(std::__iterator_traits_detail::__cpp17_random_access_iterator<std::move_iterator<int*>>);
// <list>
static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::list<int>::iterator>);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator_with_data.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator_with_data.pass.cpp
index a4c2b08..b2e3ffe 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator_with_data.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/iterator_with_data.pass.cpp
@@ -36,4 +36,6 @@
int main(int, char**) {
test();
static_assert(test());
+
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
index 95626be..6440e28 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
@@ -16,8 +16,7 @@
#include <iterator>
-int main(int, char**) {
+void f() {
char const* it = "";
std::__unconstrained_reverse_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::__unconstrained_reverse_iterator<const char *>'}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
index 4ccf85e..1ad9ca9 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
@@ -16,9 +16,7 @@
#include "test_iterators.h"
-int main(int, char**) {
+void f() {
using BadIter = std::reverse_iterator<forward_iterator<int*>>;
BadIter i; //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}reverse_iterator<It> requires It to be a bidirectional iterator.}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
index 2f63ee3..723cd9f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
@@ -11,7 +11,7 @@
// Test exporting the symbol: "__cxa_deleted_virtual" in macosx
// But don't expect the symbol to be exported in previous versions.
//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
struct S { virtual void f() = delete; virtual ~S() {} };
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp
new file mode 100644
index 0000000..658d60c
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// When built with modules, this test gives diagnostics like
+// declaration of 'lerp' must be imported from module 'std.compat.cmath'
+// before it is required
+// therefore disable the test in this configuration.
+// UNSUPPORTED: modules-build
+
+// <math.h>
+
+// [support.c.headers.other]/1
+// ... except for the functions described in [sf.cmath], the
+// std::lerp function overloads ([c.math.lerp]) ...
+
+#include <math.h>
+
+void f() {
+ {
+ float f;
+ ::lerp(f, f, f); // expected-error {{no member named 'lerp' in the global namespace}}
+ std::lerp(f, f, f); // expected-error {{no member named 'lerp' in namespace 'std'}}
+ }
+ {
+ double d;
+ ::lerp(d, d, d); // expected-error {{no member named 'lerp' in the global namespace}}
+ std::lerp(d, d, d); // expected-error {{no member named 'lerp' in namespace 'std'}}
+ }
+ {
+ long double l;
+ ::lerp(l, l, l); // expected-error {{no member named 'lerp' in the global namespace}}
+ std::lerp(l, l, l); // expected-error {{no member named 'lerp' in namespace 'std'}}
+ }
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
index 6296bbd..159ab9b 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
@@ -10,9 +10,7 @@
// allocation/deallocation on deployment targets that don't support it (before macosx10.13).
// UNSUPPORTED: c++03, c++11, c++14
-
-// Aligned allocation was not provided before macosx10.13.
-// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// REQUIRES: availability-aligned_allocation-missing
#include <new>
#include <cstddef>
@@ -23,8 +21,7 @@
struct alignas(OverAligned) A { };
-int main(int, char**)
-{
+void f() {
// Normal versions
{
A *a1 = new A; // expected-error-re {{aligned allocation function of type {{.+}} is only available on}}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
index 545032b..9acaa4a 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -9,10 +9,9 @@
// test libc++'s implementation of align_val_t, and the relevant new/delete
// overloads in all dialects when -faligned-allocation is present.
-// The dylibs shipped before macosx10.13 do not contain the aligned allocation
-// functions, so trying to force using those with -faligned-allocation results
-// in a link error.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// Some dylibs do not contain the aligned allocation functions, so trying to force
+// using those with -faligned-allocation results in a link error.
+// XFAIL: availability-aligned_allocation-missing
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.
@@ -42,6 +41,11 @@
#include "test_macros.h"
+TEST_DIAGNOSTIC_PUSH
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wprivate-header")
+#include <__memory/aligned_alloc.h>
+TEST_DIAGNOSTIC_POP
+
struct alloc_stats {
alloc_stats() { reset(); }
@@ -102,7 +106,7 @@
}
#ifndef NO_SIZE
-void operator delete(void* p, size_t n)TEST_NOEXCEPT {
+void operator delete(void* p, std::size_t n)TEST_NOEXCEPT {
::free(p);
stats.sized_called++;
stats.last_size = n;
@@ -118,7 +122,7 @@
stats.last_size = -1;
}
-void operator delete(void* p, size_t n, std::align_val_t a)TEST_NOEXCEPT {
+void operator delete(void* p, std::size_t n, std::align_val_t a)TEST_NOEXCEPT {
std::__libcpp_aligned_free(p);
stats.aligned_sized_called++;
stats.last_align = static_cast<int>(a);
@@ -129,12 +133,12 @@
void test_libcpp_dealloc() {
void* p = nullptr;
#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
- size_t over_align_val = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2;
+ std::size_t over_align_val = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2;
#else
- size_t over_align_val = TEST_ALIGNOF(std::max_align_t) * 2;
+ std::size_t over_align_val = TEST_ALIGNOF(std::max_align_t) * 2;
#endif
- size_t under_align_val = TEST_ALIGNOF(int);
- size_t with_size_val = 2;
+ std::size_t under_align_val = TEST_ALIGNOF(int);
+ std::size_t with_size_val = 2;
{
std::__libcpp_deallocate_unsized(p, under_align_val);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
index 8820e12..8d766ac 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
@@ -9,10 +9,9 @@
// test libc++'s implementation of align_val_t, and the relevant new/delete
// overloads in all dialects when -faligned-allocation is present.
-// The dylibs shipped before macosx10.13 do not contain the aligned allocation
-// functions, so trying to force using those with -faligned-allocation results
-// in a link error.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// Some dylibs do not contain the aligned allocation functions, so trying to force
+// using those with -faligned-allocation results in a link error.
+// XFAIL: availability-aligned_allocation-missing
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.
@@ -21,14 +20,15 @@
// REQUIRES: -faligned-allocation
// ADDITIONAL_COMPILE_FLAGS: -faligned-allocation
-#include <new>
-#include <typeinfo>
-#include <string>
#include <cassert>
+#include <new>
+#include <string>
+#include <type_traits>
+#include <typeinfo>
#include "test_macros.h"
-static void test_allocations(size_t size, size_t alignment) {
+static void test_allocations(std::size_t size, size_t alignment) {
{
void* ptr = ::operator new(size, std::align_val_t(alignment));
assert(ptr);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
index cf4c595..430ddac 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// This test breaks when enabling LSV.
+// UNSUPPORTED: modules-build
+
// UNSUPPORTED: c++03, c++11, c++14
// Make sure that <ctime> can be included even when _XOPEN_SOURCE is defined.
diff --git a/third_party/llvm-project/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
index 5c28ff9..d263397 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
#include <new>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/min_max_macros.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
index 0d9170b..9dd4345 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -9,9 +9,6 @@
// Test that headers are not tripped up by the surrounding code defining the
// min() and max() macros.
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
#if defined(__DEPRECATED)
# undef __DEPRECATED
@@ -338,14 +335,6 @@
TEST_MACROS();
#endif
#if __cplusplus >= 201103L
-# include <experimental/algorithm>
-TEST_MACROS();
-#endif
-#if __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-# include <experimental/coroutine>
-TEST_MACROS();
-#endif
-#if __cplusplus >= 201103L
# include <experimental/deque>
TEST_MACROS();
#endif
@@ -354,10 +343,6 @@
TEST_MACROS();
#endif
#if __cplusplus >= 201103L
-# include <experimental/functional>
-TEST_MACROS();
-#endif
-#if __cplusplus >= 201103L
# include <experimental/iterator>
TEST_MACROS();
#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/modules_include.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/modules_include.sh.cpp
index a45d3d4..1ef40a1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/modules_include.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/modules_include.sh.cpp
@@ -10,16 +10,12 @@
// This is important notably because the LLDB data formatters use
// libc++ headers with modules enabled.
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
-// XFAIL: LIBCXX-FREEBSD-FIXME
-
// GCC doesn't support -fcxx-modules
// UNSUPPORTED: gcc
// The Windows headers don't appear to be compatible with modules
// UNSUPPORTED: windows
+// UNSUPPORTED: buildhost=windows
// The Android headers don't appear to be compatible with modules yet
// XFAIL: LIBCXX-ANDROID-FIXME
@@ -35,7 +31,10 @@
BEGIN-SCRIPT
for i, header in enumerate(public_headers):
- print("// {}: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_{}".format('RUN', i))
+ print("// {}: echo '%{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_{} &' >> %t.sh".format('RUN', i))
+ print("// {}: echo 'TEST_{}=$!' >> %t.sh".format('RUN', i))
+ if i >= 16:
+ print("// {}: echo \"wait $TEST_{}\" >> %t.sh".format('RUN', i - 16))
if header in header_restrictions:
print("#if defined(TEST_{}) && {}".format(i, header_restrictions[header]))
else:
@@ -43,584 +42,859 @@
print("#include <{}>".format(header))
print("#endif")
+for i in range(len(public_headers))[-16:]:
+ print("// {}: echo \"wait $TEST_{}\" >> %t.sh".format('RUN', i))
+
+print("// {}: bash %t.sh".format('RUN'))
+
END-SCRIPT
*/
+// RUN: echo "" > %t.sh
// RUN: rm -rf %t
// RUN: mkdir %t
// DO NOT MANUALLY EDIT ANYTHING BETWEEN THE MARKERS BELOW
// GENERATED-MARKER
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_0
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_0 &' >> %t.sh
+// RUN: echo 'TEST_0=$!' >> %t.sh
#if defined(TEST_0)
#include <algorithm>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_1
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_1 &' >> %t.sh
+// RUN: echo 'TEST_1=$!' >> %t.sh
#if defined(TEST_1)
#include <any>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_2
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_2 &' >> %t.sh
+// RUN: echo 'TEST_2=$!' >> %t.sh
#if defined(TEST_2)
#include <array>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_3
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_3 &' >> %t.sh
+// RUN: echo 'TEST_3=$!' >> %t.sh
#if defined(TEST_3)
#include <atomic>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_4
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_4 &' >> %t.sh
+// RUN: echo 'TEST_4=$!' >> %t.sh
#if defined(TEST_4) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <barrier>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_5
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_5 &' >> %t.sh
+// RUN: echo 'TEST_5=$!' >> %t.sh
#if defined(TEST_5)
#include <bit>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_6
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_6 &' >> %t.sh
+// RUN: echo 'TEST_6=$!' >> %t.sh
#if defined(TEST_6)
#include <bitset>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_7
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_7 &' >> %t.sh
+// RUN: echo 'TEST_7=$!' >> %t.sh
#if defined(TEST_7)
#include <cassert>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_8
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_8 &' >> %t.sh
+// RUN: echo 'TEST_8=$!' >> %t.sh
#if defined(TEST_8)
#include <ccomplex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_9
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_9 &' >> %t.sh
+// RUN: echo 'TEST_9=$!' >> %t.sh
#if defined(TEST_9)
#include <cctype>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_10
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_10 &' >> %t.sh
+// RUN: echo 'TEST_10=$!' >> %t.sh
#if defined(TEST_10)
#include <cerrno>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_11
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_11 &' >> %t.sh
+// RUN: echo 'TEST_11=$!' >> %t.sh
#if defined(TEST_11)
#include <cfenv>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_12
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_12 &' >> %t.sh
+// RUN: echo 'TEST_12=$!' >> %t.sh
#if defined(TEST_12)
#include <cfloat>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_13
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_13 &' >> %t.sh
+// RUN: echo 'TEST_13=$!' >> %t.sh
#if defined(TEST_13)
#include <charconv>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_14
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_14 &' >> %t.sh
+// RUN: echo 'TEST_14=$!' >> %t.sh
#if defined(TEST_14)
#include <chrono>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_15
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_15 &' >> %t.sh
+// RUN: echo 'TEST_15=$!' >> %t.sh
#if defined(TEST_15)
#include <cinttypes>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_16
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_16 &' >> %t.sh
+// RUN: echo 'TEST_16=$!' >> %t.sh
+// RUN: echo "wait $TEST_0" >> %t.sh
#if defined(TEST_16)
#include <ciso646>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_17
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_17 &' >> %t.sh
+// RUN: echo 'TEST_17=$!' >> %t.sh
+// RUN: echo "wait $TEST_1" >> %t.sh
#if defined(TEST_17)
#include <climits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_18
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_18 &' >> %t.sh
+// RUN: echo 'TEST_18=$!' >> %t.sh
+// RUN: echo "wait $TEST_2" >> %t.sh
#if defined(TEST_18) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <clocale>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_19
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_19 &' >> %t.sh
+// RUN: echo 'TEST_19=$!' >> %t.sh
+// RUN: echo "wait $TEST_3" >> %t.sh
#if defined(TEST_19)
#include <cmath>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_20
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_20 &' >> %t.sh
+// RUN: echo 'TEST_20=$!' >> %t.sh
+// RUN: echo "wait $TEST_4" >> %t.sh
#if defined(TEST_20) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <codecvt>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_21
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_21 &' >> %t.sh
+// RUN: echo 'TEST_21=$!' >> %t.sh
+// RUN: echo "wait $TEST_5" >> %t.sh
#if defined(TEST_21)
#include <compare>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_22
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_22 &' >> %t.sh
+// RUN: echo 'TEST_22=$!' >> %t.sh
+// RUN: echo "wait $TEST_6" >> %t.sh
#if defined(TEST_22)
#include <complex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_23
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_23 &' >> %t.sh
+// RUN: echo 'TEST_23=$!' >> %t.sh
+// RUN: echo "wait $TEST_7" >> %t.sh
#if defined(TEST_23)
#include <complex.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_24
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_24 &' >> %t.sh
+// RUN: echo 'TEST_24=$!' >> %t.sh
+// RUN: echo "wait $TEST_8" >> %t.sh
#if defined(TEST_24)
#include <concepts>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_25
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_25 &' >> %t.sh
+// RUN: echo 'TEST_25=$!' >> %t.sh
+// RUN: echo "wait $TEST_9" >> %t.sh
#if defined(TEST_25)
#include <condition_variable>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_26
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_26 &' >> %t.sh
+// RUN: echo 'TEST_26=$!' >> %t.sh
+// RUN: echo "wait $TEST_10" >> %t.sh
#if defined(TEST_26) && (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
#include <coroutine>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_27
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_27 &' >> %t.sh
+// RUN: echo 'TEST_27=$!' >> %t.sh
+// RUN: echo "wait $TEST_11" >> %t.sh
#if defined(TEST_27)
#include <csetjmp>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_28
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_28 &' >> %t.sh
+// RUN: echo 'TEST_28=$!' >> %t.sh
+// RUN: echo "wait $TEST_12" >> %t.sh
#if defined(TEST_28)
#include <csignal>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_29
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_29 &' >> %t.sh
+// RUN: echo 'TEST_29=$!' >> %t.sh
+// RUN: echo "wait $TEST_13" >> %t.sh
#if defined(TEST_29)
#include <cstdarg>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_30
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_30 &' >> %t.sh
+// RUN: echo 'TEST_30=$!' >> %t.sh
+// RUN: echo "wait $TEST_14" >> %t.sh
#if defined(TEST_30)
#include <cstdbool>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_31
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_31 &' >> %t.sh
+// RUN: echo 'TEST_31=$!' >> %t.sh
+// RUN: echo "wait $TEST_15" >> %t.sh
#if defined(TEST_31)
#include <cstddef>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_32
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_32 &' >> %t.sh
+// RUN: echo 'TEST_32=$!' >> %t.sh
+// RUN: echo "wait $TEST_16" >> %t.sh
#if defined(TEST_32)
#include <cstdint>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_33
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_33 &' >> %t.sh
+// RUN: echo 'TEST_33=$!' >> %t.sh
+// RUN: echo "wait $TEST_17" >> %t.sh
#if defined(TEST_33)
#include <cstdio>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_34
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_34 &' >> %t.sh
+// RUN: echo 'TEST_34=$!' >> %t.sh
+// RUN: echo "wait $TEST_18" >> %t.sh
#if defined(TEST_34)
#include <cstdlib>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_35
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_35 &' >> %t.sh
+// RUN: echo 'TEST_35=$!' >> %t.sh
+// RUN: echo "wait $TEST_19" >> %t.sh
#if defined(TEST_35)
#include <cstring>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_36
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_36 &' >> %t.sh
+// RUN: echo 'TEST_36=$!' >> %t.sh
+// RUN: echo "wait $TEST_20" >> %t.sh
#if defined(TEST_36)
#include <ctgmath>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_37
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_37 &' >> %t.sh
+// RUN: echo 'TEST_37=$!' >> %t.sh
+// RUN: echo "wait $TEST_21" >> %t.sh
#if defined(TEST_37)
#include <ctime>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_38
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_38 &' >> %t.sh
+// RUN: echo 'TEST_38=$!' >> %t.sh
+// RUN: echo "wait $TEST_22" >> %t.sh
#if defined(TEST_38)
#include <ctype.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_39
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_39 &' >> %t.sh
+// RUN: echo 'TEST_39=$!' >> %t.sh
+// RUN: echo "wait $TEST_23" >> %t.sh
#if defined(TEST_39)
#include <cuchar>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_40
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_40 &' >> %t.sh
+// RUN: echo 'TEST_40=$!' >> %t.sh
+// RUN: echo "wait $TEST_24" >> %t.sh
#if defined(TEST_40) && !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
#include <cwchar>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_41
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_41 &' >> %t.sh
+// RUN: echo 'TEST_41=$!' >> %t.sh
+// RUN: echo "wait $TEST_25" >> %t.sh
#if defined(TEST_41) && !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
#include <cwctype>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_42
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_42 &' >> %t.sh
+// RUN: echo 'TEST_42=$!' >> %t.sh
+// RUN: echo "wait $TEST_26" >> %t.sh
#if defined(TEST_42)
#include <deque>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_43
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_43 &' >> %t.sh
+// RUN: echo 'TEST_43=$!' >> %t.sh
+// RUN: echo "wait $TEST_27" >> %t.sh
#if defined(TEST_43)
#include <errno.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_44
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_44 &' >> %t.sh
+// RUN: echo 'TEST_44=$!' >> %t.sh
+// RUN: echo "wait $TEST_28" >> %t.sh
#if defined(TEST_44)
#include <exception>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_45
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_45 &' >> %t.sh
+// RUN: echo 'TEST_45=$!' >> %t.sh
+// RUN: echo "wait $TEST_29" >> %t.sh
#if defined(TEST_45)
#include <execution>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_46
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_46 &' >> %t.sh
+// RUN: echo 'TEST_46=$!' >> %t.sh
+// RUN: echo "wait $TEST_30" >> %t.sh
#if defined(TEST_46)
#include <expected>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_47
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_47 &' >> %t.sh
+// RUN: echo 'TEST_47=$!' >> %t.sh
+// RUN: echo "wait $TEST_31" >> %t.sh
#if defined(TEST_47)
#include <fenv.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_48
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_48 &' >> %t.sh
+// RUN: echo 'TEST_48=$!' >> %t.sh
+// RUN: echo "wait $TEST_32" >> %t.sh
#if defined(TEST_48) && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
#include <filesystem>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_49
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_49 &' >> %t.sh
+// RUN: echo 'TEST_49=$!' >> %t.sh
+// RUN: echo "wait $TEST_33" >> %t.sh
#if defined(TEST_49)
#include <float.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_50
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_50 &' >> %t.sh
+// RUN: echo 'TEST_50=$!' >> %t.sh
+// RUN: echo "wait $TEST_34" >> %t.sh
#if defined(TEST_50)
#include <format>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_51
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_51 &' >> %t.sh
+// RUN: echo 'TEST_51=$!' >> %t.sh
+// RUN: echo "wait $TEST_35" >> %t.sh
#if defined(TEST_51)
#include <forward_list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_52
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_52 &' >> %t.sh
+// RUN: echo 'TEST_52=$!' >> %t.sh
+// RUN: echo "wait $TEST_36" >> %t.sh
#if defined(TEST_52) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_FSTREAM)
#include <fstream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_53
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_53 &' >> %t.sh
+// RUN: echo 'TEST_53=$!' >> %t.sh
+// RUN: echo "wait $TEST_37" >> %t.sh
#if defined(TEST_53)
#include <functional>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_54
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_54 &' >> %t.sh
+// RUN: echo 'TEST_54=$!' >> %t.sh
+// RUN: echo "wait $TEST_38" >> %t.sh
#if defined(TEST_54) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <future>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_55
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_55 &' >> %t.sh
+// RUN: echo 'TEST_55=$!' >> %t.sh
+// RUN: echo "wait $TEST_39" >> %t.sh
#if defined(TEST_55)
#include <initializer_list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_56
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_56 &' >> %t.sh
+// RUN: echo 'TEST_56=$!' >> %t.sh
+// RUN: echo "wait $TEST_40" >> %t.sh
#if defined(TEST_56)
#include <inttypes.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_57
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_57 &' >> %t.sh
+// RUN: echo 'TEST_57=$!' >> %t.sh
+// RUN: echo "wait $TEST_41" >> %t.sh
#if defined(TEST_57) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <iomanip>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_58
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_58 &' >> %t.sh
+// RUN: echo 'TEST_58=$!' >> %t.sh
+// RUN: echo "wait $TEST_42" >> %t.sh
#if defined(TEST_58) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <ios>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_59
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_59 &' >> %t.sh
+// RUN: echo 'TEST_59=$!' >> %t.sh
+// RUN: echo "wait $TEST_43" >> %t.sh
#if defined(TEST_59)
#include <iosfwd>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_60
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_60 &' >> %t.sh
+// RUN: echo 'TEST_60=$!' >> %t.sh
+// RUN: echo "wait $TEST_44" >> %t.sh
#if defined(TEST_60) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <iostream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_61
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_61 &' >> %t.sh
+// RUN: echo 'TEST_61=$!' >> %t.sh
+// RUN: echo "wait $TEST_45" >> %t.sh
#if defined(TEST_61) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <istream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_62
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_62 &' >> %t.sh
+// RUN: echo 'TEST_62=$!' >> %t.sh
+// RUN: echo "wait $TEST_46" >> %t.sh
#if defined(TEST_62)
#include <iterator>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_63
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_63 &' >> %t.sh
+// RUN: echo 'TEST_63=$!' >> %t.sh
+// RUN: echo "wait $TEST_47" >> %t.sh
#if defined(TEST_63) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <latch>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_64
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_64 &' >> %t.sh
+// RUN: echo 'TEST_64=$!' >> %t.sh
+// RUN: echo "wait $TEST_48" >> %t.sh
#if defined(TEST_64)
#include <limits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_65
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_65 &' >> %t.sh
+// RUN: echo 'TEST_65=$!' >> %t.sh
+// RUN: echo "wait $TEST_49" >> %t.sh
#if defined(TEST_65)
#include <limits.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_66
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_66 &' >> %t.sh
+// RUN: echo 'TEST_66=$!' >> %t.sh
+// RUN: echo "wait $TEST_50" >> %t.sh
#if defined(TEST_66)
#include <list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_67
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_67 &' >> %t.sh
+// RUN: echo 'TEST_67=$!' >> %t.sh
+// RUN: echo "wait $TEST_51" >> %t.sh
#if defined(TEST_67) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <locale>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_68
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_68 &' >> %t.sh
+// RUN: echo 'TEST_68=$!' >> %t.sh
+// RUN: echo "wait $TEST_52" >> %t.sh
#if defined(TEST_68) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <locale.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_69
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_69 &' >> %t.sh
+// RUN: echo 'TEST_69=$!' >> %t.sh
+// RUN: echo "wait $TEST_53" >> %t.sh
#if defined(TEST_69)
#include <map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_70
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_70 &' >> %t.sh
+// RUN: echo 'TEST_70=$!' >> %t.sh
+// RUN: echo "wait $TEST_54" >> %t.sh
#if defined(TEST_70)
#include <math.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_71
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_71 &' >> %t.sh
+// RUN: echo 'TEST_71=$!' >> %t.sh
+// RUN: echo "wait $TEST_55" >> %t.sh
#if defined(TEST_71)
#include <memory>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_72
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_72 &' >> %t.sh
+// RUN: echo 'TEST_72=$!' >> %t.sh
+// RUN: echo "wait $TEST_56" >> %t.sh
#if defined(TEST_72)
#include <memory_resource>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_73
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_73 &' >> %t.sh
+// RUN: echo 'TEST_73=$!' >> %t.sh
+// RUN: echo "wait $TEST_57" >> %t.sh
#if defined(TEST_73) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <mutex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_74
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_74 &' >> %t.sh
+// RUN: echo 'TEST_74=$!' >> %t.sh
+// RUN: echo "wait $TEST_58" >> %t.sh
#if defined(TEST_74)
#include <new>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_75
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_75 &' >> %t.sh
+// RUN: echo 'TEST_75=$!' >> %t.sh
+// RUN: echo "wait $TEST_59" >> %t.sh
#if defined(TEST_75)
#include <numbers>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_76
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_76 &' >> %t.sh
+// RUN: echo 'TEST_76=$!' >> %t.sh
+// RUN: echo "wait $TEST_60" >> %t.sh
#if defined(TEST_76)
#include <numeric>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_77
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_77 &' >> %t.sh
+// RUN: echo 'TEST_77=$!' >> %t.sh
+// RUN: echo "wait $TEST_61" >> %t.sh
#if defined(TEST_77)
#include <optional>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_78
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_78 &' >> %t.sh
+// RUN: echo 'TEST_78=$!' >> %t.sh
+// RUN: echo "wait $TEST_62" >> %t.sh
#if defined(TEST_78) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <ostream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_79
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_79 &' >> %t.sh
+// RUN: echo 'TEST_79=$!' >> %t.sh
+// RUN: echo "wait $TEST_63" >> %t.sh
#if defined(TEST_79)
#include <queue>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_80
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_80 &' >> %t.sh
+// RUN: echo 'TEST_80=$!' >> %t.sh
+// RUN: echo "wait $TEST_64" >> %t.sh
#if defined(TEST_80)
#include <random>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_81
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_81 &' >> %t.sh
+// RUN: echo 'TEST_81=$!' >> %t.sh
+// RUN: echo "wait $TEST_65" >> %t.sh
#if defined(TEST_81)
#include <ranges>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_82
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_82 &' >> %t.sh
+// RUN: echo 'TEST_82=$!' >> %t.sh
+// RUN: echo "wait $TEST_66" >> %t.sh
#if defined(TEST_82)
#include <ratio>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_83
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_83 &' >> %t.sh
+// RUN: echo 'TEST_83=$!' >> %t.sh
+// RUN: echo "wait $TEST_67" >> %t.sh
#if defined(TEST_83) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <regex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_84
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_84 &' >> %t.sh
+// RUN: echo 'TEST_84=$!' >> %t.sh
+// RUN: echo "wait $TEST_68" >> %t.sh
#if defined(TEST_84)
#include <scoped_allocator>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_85
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_85 &' >> %t.sh
+// RUN: echo 'TEST_85=$!' >> %t.sh
+// RUN: echo "wait $TEST_69" >> %t.sh
#if defined(TEST_85) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <semaphore>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_86
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_86 &' >> %t.sh
+// RUN: echo 'TEST_86=$!' >> %t.sh
+// RUN: echo "wait $TEST_70" >> %t.sh
#if defined(TEST_86)
#include <set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_87
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_87 &' >> %t.sh
+// RUN: echo 'TEST_87=$!' >> %t.sh
+// RUN: echo "wait $TEST_71" >> %t.sh
#if defined(TEST_87)
#include <setjmp.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_88
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_88 &' >> %t.sh
+// RUN: echo 'TEST_88=$!' >> %t.sh
+// RUN: echo "wait $TEST_72" >> %t.sh
#if defined(TEST_88) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <shared_mutex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_89
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_89 &' >> %t.sh
+// RUN: echo 'TEST_89=$!' >> %t.sh
+// RUN: echo "wait $TEST_73" >> %t.sh
#if defined(TEST_89)
#include <source_location>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_90
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_90 &' >> %t.sh
+// RUN: echo 'TEST_90=$!' >> %t.sh
+// RUN: echo "wait $TEST_74" >> %t.sh
#if defined(TEST_90)
#include <span>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_91
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_91 &' >> %t.sh
+// RUN: echo 'TEST_91=$!' >> %t.sh
+// RUN: echo "wait $TEST_75" >> %t.sh
#if defined(TEST_91) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <sstream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_92
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_92 &' >> %t.sh
+// RUN: echo 'TEST_92=$!' >> %t.sh
+// RUN: echo "wait $TEST_76" >> %t.sh
#if defined(TEST_92)
#include <stack>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_93
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_93 &' >> %t.sh
+// RUN: echo 'TEST_93=$!' >> %t.sh
+// RUN: echo "wait $TEST_77" >> %t.sh
#if defined(TEST_93) && __cplusplus > 202002L && !defined(_LIBCPP_HAS_NO_THREADS)
#include <stdatomic.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_94
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_94 &' >> %t.sh
+// RUN: echo 'TEST_94=$!' >> %t.sh
+// RUN: echo "wait $TEST_78" >> %t.sh
#if defined(TEST_94)
#include <stdbool.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_95
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_95 &' >> %t.sh
+// RUN: echo 'TEST_95=$!' >> %t.sh
+// RUN: echo "wait $TEST_79" >> %t.sh
#if defined(TEST_95)
#include <stddef.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_96
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_96 &' >> %t.sh
+// RUN: echo 'TEST_96=$!' >> %t.sh
+// RUN: echo "wait $TEST_80" >> %t.sh
#if defined(TEST_96)
#include <stdexcept>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_97
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_97 &' >> %t.sh
+// RUN: echo 'TEST_97=$!' >> %t.sh
+// RUN: echo "wait $TEST_81" >> %t.sh
#if defined(TEST_97)
#include <stdint.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_98
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_98 &' >> %t.sh
+// RUN: echo 'TEST_98=$!' >> %t.sh
+// RUN: echo "wait $TEST_82" >> %t.sh
#if defined(TEST_98)
#include <stdio.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_99
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_99 &' >> %t.sh
+// RUN: echo 'TEST_99=$!' >> %t.sh
+// RUN: echo "wait $TEST_83" >> %t.sh
#if defined(TEST_99)
#include <stdlib.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_100
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_100 &' >> %t.sh
+// RUN: echo 'TEST_100=$!' >> %t.sh
+// RUN: echo "wait $TEST_84" >> %t.sh
#if defined(TEST_100) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <streambuf>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_101
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_101 &' >> %t.sh
+// RUN: echo 'TEST_101=$!' >> %t.sh
+// RUN: echo "wait $TEST_85" >> %t.sh
#if defined(TEST_101)
#include <string>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_102
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_102 &' >> %t.sh
+// RUN: echo 'TEST_102=$!' >> %t.sh
+// RUN: echo "wait $TEST_86" >> %t.sh
#if defined(TEST_102)
#include <string.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_103
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_103 &' >> %t.sh
+// RUN: echo 'TEST_103=$!' >> %t.sh
+// RUN: echo "wait $TEST_87" >> %t.sh
#if defined(TEST_103)
#include <string_view>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_104
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_104 &' >> %t.sh
+// RUN: echo 'TEST_104=$!' >> %t.sh
+// RUN: echo "wait $TEST_88" >> %t.sh
#if defined(TEST_104) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#include <strstream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_105
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_105 &' >> %t.sh
+// RUN: echo 'TEST_105=$!' >> %t.sh
+// RUN: echo "wait $TEST_89" >> %t.sh
#if defined(TEST_105)
#include <system_error>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_106
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_106 &' >> %t.sh
+// RUN: echo 'TEST_106=$!' >> %t.sh
+// RUN: echo "wait $TEST_90" >> %t.sh
#if defined(TEST_106)
#include <tgmath.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_107
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_107 &' >> %t.sh
+// RUN: echo 'TEST_107=$!' >> %t.sh
+// RUN: echo "wait $TEST_91" >> %t.sh
#if defined(TEST_107) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <thread>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_108
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_108 &' >> %t.sh
+// RUN: echo 'TEST_108=$!' >> %t.sh
+// RUN: echo "wait $TEST_92" >> %t.sh
#if defined(TEST_108)
#include <tuple>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_109
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_109 &' >> %t.sh
+// RUN: echo 'TEST_109=$!' >> %t.sh
+// RUN: echo "wait $TEST_93" >> %t.sh
#if defined(TEST_109)
#include <type_traits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_110
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_110 &' >> %t.sh
+// RUN: echo 'TEST_110=$!' >> %t.sh
+// RUN: echo "wait $TEST_94" >> %t.sh
#if defined(TEST_110)
#include <typeindex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_111
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_111 &' >> %t.sh
+// RUN: echo 'TEST_111=$!' >> %t.sh
+// RUN: echo "wait $TEST_95" >> %t.sh
#if defined(TEST_111)
#include <typeinfo>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_112
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_112 &' >> %t.sh
+// RUN: echo 'TEST_112=$!' >> %t.sh
+// RUN: echo "wait $TEST_96" >> %t.sh
#if defined(TEST_112)
#include <uchar.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_113
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_113 &' >> %t.sh
+// RUN: echo 'TEST_113=$!' >> %t.sh
+// RUN: echo "wait $TEST_97" >> %t.sh
#if defined(TEST_113)
#include <unordered_map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_114
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_114 &' >> %t.sh
+// RUN: echo 'TEST_114=$!' >> %t.sh
+// RUN: echo "wait $TEST_98" >> %t.sh
#if defined(TEST_114)
#include <unordered_set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_115
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_115 &' >> %t.sh
+// RUN: echo 'TEST_115=$!' >> %t.sh
+// RUN: echo "wait $TEST_99" >> %t.sh
#if defined(TEST_115)
#include <utility>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_116
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_116 &' >> %t.sh
+// RUN: echo 'TEST_116=$!' >> %t.sh
+// RUN: echo "wait $TEST_100" >> %t.sh
#if defined(TEST_116)
#include <valarray>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_117
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_117 &' >> %t.sh
+// RUN: echo 'TEST_117=$!' >> %t.sh
+// RUN: echo "wait $TEST_101" >> %t.sh
#if defined(TEST_117)
#include <variant>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_118
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_118 &' >> %t.sh
+// RUN: echo 'TEST_118=$!' >> %t.sh
+// RUN: echo "wait $TEST_102" >> %t.sh
#if defined(TEST_118)
#include <vector>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_119
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_119 &' >> %t.sh
+// RUN: echo 'TEST_119=$!' >> %t.sh
+// RUN: echo "wait $TEST_103" >> %t.sh
#if defined(TEST_119)
#include <version>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_120
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_120 &' >> %t.sh
+// RUN: echo 'TEST_120=$!' >> %t.sh
+// RUN: echo "wait $TEST_104" >> %t.sh
#if defined(TEST_120) && !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
#include <wchar.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_121
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_121 &' >> %t.sh
+// RUN: echo 'TEST_121=$!' >> %t.sh
+// RUN: echo "wait $TEST_105" >> %t.sh
#if defined(TEST_121) && !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
#include <wctype.h>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_122
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_122 &' >> %t.sh
+// RUN: echo 'TEST_122=$!' >> %t.sh
+// RUN: echo "wait $TEST_106" >> %t.sh
#if defined(TEST_122) && __cplusplus >= 201103L
-#include <experimental/algorithm>
-#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_123
-#if defined(TEST_123) && __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-#include <experimental/coroutine>
-#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_124
-#if defined(TEST_124) && __cplusplus >= 201103L
#include <experimental/deque>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_125
-#if defined(TEST_125) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_123 &' >> %t.sh
+// RUN: echo 'TEST_123=$!' >> %t.sh
+// RUN: echo "wait $TEST_107" >> %t.sh
+#if defined(TEST_123) && __cplusplus >= 201103L
#include <experimental/forward_list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_126
-#if defined(TEST_126) && __cplusplus >= 201103L
-#include <experimental/functional>
-#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_127
-#if defined(TEST_127) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_124 &' >> %t.sh
+// RUN: echo 'TEST_124=$!' >> %t.sh
+// RUN: echo "wait $TEST_108" >> %t.sh
+#if defined(TEST_124) && __cplusplus >= 201103L
#include <experimental/iterator>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_128
-#if defined(TEST_128) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_125 &' >> %t.sh
+// RUN: echo 'TEST_125=$!' >> %t.sh
+// RUN: echo "wait $TEST_109" >> %t.sh
+#if defined(TEST_125) && __cplusplus >= 201103L
#include <experimental/list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_129
-#if defined(TEST_129) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_126 &' >> %t.sh
+// RUN: echo 'TEST_126=$!' >> %t.sh
+// RUN: echo "wait $TEST_110" >> %t.sh
+#if defined(TEST_126) && __cplusplus >= 201103L
#include <experimental/map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_130
-#if defined(TEST_130) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_127 &' >> %t.sh
+// RUN: echo 'TEST_127=$!' >> %t.sh
+// RUN: echo "wait $TEST_111" >> %t.sh
+#if defined(TEST_127) && __cplusplus >= 201103L
#include <experimental/memory_resource>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_131
-#if defined(TEST_131) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_128 &' >> %t.sh
+// RUN: echo 'TEST_128=$!' >> %t.sh
+// RUN: echo "wait $TEST_112" >> %t.sh
+#if defined(TEST_128) && __cplusplus >= 201103L
#include <experimental/propagate_const>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_132
-#if defined(TEST_132) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_129 &' >> %t.sh
+// RUN: echo 'TEST_129=$!' >> %t.sh
+// RUN: echo "wait $TEST_113" >> %t.sh
+#if defined(TEST_129) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L
#include <experimental/regex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_133
-#if defined(TEST_133) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_130 &' >> %t.sh
+// RUN: echo 'TEST_130=$!' >> %t.sh
+// RUN: echo "wait $TEST_114" >> %t.sh
+#if defined(TEST_130) && __cplusplus >= 201103L
#include <experimental/set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_134
-#if defined(TEST_134) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_131 &' >> %t.sh
+// RUN: echo 'TEST_131=$!' >> %t.sh
+// RUN: echo "wait $TEST_115" >> %t.sh
+#if defined(TEST_131) && __cplusplus >= 201103L
#include <experimental/simd>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_135
-#if defined(TEST_135) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_132 &' >> %t.sh
+// RUN: echo 'TEST_132=$!' >> %t.sh
+// RUN: echo "wait $TEST_116" >> %t.sh
+#if defined(TEST_132) && __cplusplus >= 201103L
#include <experimental/string>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_136
-#if defined(TEST_136) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_133 &' >> %t.sh
+// RUN: echo 'TEST_133=$!' >> %t.sh
+// RUN: echo "wait $TEST_117" >> %t.sh
+#if defined(TEST_133) && __cplusplus >= 201103L
#include <experimental/type_traits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_137
-#if defined(TEST_137) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_134 &' >> %t.sh
+// RUN: echo 'TEST_134=$!' >> %t.sh
+// RUN: echo "wait $TEST_118" >> %t.sh
+#if defined(TEST_134) && __cplusplus >= 201103L
#include <experimental/unordered_map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_138
-#if defined(TEST_138) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_135 &' >> %t.sh
+// RUN: echo 'TEST_135=$!' >> %t.sh
+// RUN: echo "wait $TEST_119" >> %t.sh
+#if defined(TEST_135) && __cplusplus >= 201103L
#include <experimental/unordered_set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_139
-#if defined(TEST_139) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_136 &' >> %t.sh
+// RUN: echo 'TEST_136=$!' >> %t.sh
+// RUN: echo "wait $TEST_120" >> %t.sh
+#if defined(TEST_136) && __cplusplus >= 201103L
#include <experimental/utility>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_140
-#if defined(TEST_140) && __cplusplus >= 201103L
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_137 &' >> %t.sh
+// RUN: echo 'TEST_137=$!' >> %t.sh
+// RUN: echo "wait $TEST_121" >> %t.sh
+#if defined(TEST_137) && __cplusplus >= 201103L
#include <experimental/vector>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_141
-#if defined(TEST_141)
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_138 &' >> %t.sh
+// RUN: echo 'TEST_138=$!' >> %t.sh
+// RUN: echo "wait $TEST_122" >> %t.sh
+#if defined(TEST_138)
#include <ext/hash_map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_142
-#if defined(TEST_142)
+// RUN: echo '%{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_139 &' >> %t.sh
+// RUN: echo 'TEST_139=$!' >> %t.sh
+// RUN: echo "wait $TEST_123" >> %t.sh
+#if defined(TEST_139)
#include <ext/hash_set>
#endif
+// RUN: echo "wait $TEST_124" >> %t.sh
+// RUN: echo "wait $TEST_125" >> %t.sh
+// RUN: echo "wait $TEST_126" >> %t.sh
+// RUN: echo "wait $TEST_127" >> %t.sh
+// RUN: echo "wait $TEST_128" >> %t.sh
+// RUN: echo "wait $TEST_129" >> %t.sh
+// RUN: echo "wait $TEST_130" >> %t.sh
+// RUN: echo "wait $TEST_131" >> %t.sh
+// RUN: echo "wait $TEST_132" >> %t.sh
+// RUN: echo "wait $TEST_133" >> %t.sh
+// RUN: echo "wait $TEST_134" >> %t.sh
+// RUN: echo "wait $TEST_135" >> %t.sh
+// RUN: echo "wait $TEST_136" >> %t.sh
+// RUN: echo "wait $TEST_137" >> %t.sh
+// RUN: echo "wait $TEST_138" >> %t.sh
+// RUN: echo "wait $TEST_139" >> %t.sh
+// RUN: bash %t.sh
// GENERATED-MARKER
diff --git a/third_party/llvm-project/libcxx/test/libcxx/nasty_macros.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/nasty_macros.compile.pass.cpp
index 7896b5e..3e3e134 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/nasty_macros.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/nasty_macros.compile.pass.cpp
@@ -9,9 +9,6 @@
// Test that headers are not tripped up by the surrounding code defining various
// alphabetic macros.
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
#if defined(__DEPRECATED)
# undef __DEPRECATED
@@ -340,21 +337,12 @@
# include <wctype.h>
#endif
#if __cplusplus >= 201103L
-# include <experimental/algorithm>
-#endif
-#if __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-# include <experimental/coroutine>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/deque>
#endif
#if __cplusplus >= 201103L
# include <experimental/forward_list>
#endif
#if __cplusplus >= 201103L
-# include <experimental/functional>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/iterator>
#endif
#if __cplusplus >= 201103L
diff --git a/third_party/llvm-project/libcxx/test/libcxx/no_assert_include.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
index ce94592..f92b787 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -9,9 +9,6 @@
// Ensure that none of the standard C++ headers implicitly include cassert or
// assert.h (because assert() is implemented as a macro).
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
#if defined(__DEPRECATED)
# undef __DEPRECATED
@@ -213,21 +210,12 @@
# include <wctype.h>
#endif
#if __cplusplus >= 201103L
-# include <experimental/algorithm>
-#endif
-#if __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
-# include <experimental/coroutine>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/deque>
#endif
#if __cplusplus >= 201103L
# include <experimental/forward_list>
#endif
#if __cplusplus >= 201103L
-# include <experimental/functional>
-#endif
-#if __cplusplus >= 201103L
# include <experimental/iterator>
#endif
#if __cplusplus >= 201103L
diff --git a/third_party/llvm-project/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
index 054a682..3029487 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
@@ -40,10 +40,10 @@
test<long>();
test<long long>();
- test<int8_t>();
- test<int16_t>();
- test<int32_t>();
- test<int64_t>();
+ test<std::int8_t>();
+ test<std::int16_t>();
+ test<std::int32_t>();
+ test<std::int64_t>();
test<unsigned char>();
test<unsigned short>();
@@ -51,10 +51,10 @@
test<unsigned long>();
test<unsigned long long>();
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
#ifndef TEST_HAS_NO_INT128
test<__int128_t>();
@@ -62,8 +62,8 @@
#endif
test<char>();
- test<ptrdiff_t>();
- test<size_t>();
+ test<std::ptrdiff_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
index 7559c88..03d5927 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
@@ -13,7 +13,6 @@
#include <random>
-int main(int, char**) {
+void f() {
std::random_device d; // expected-error {{no type named 'random_device' in namespace 'std'}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/private_headers.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/private_headers.verify.cpp
index ebbd50b..e201605 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/private_headers.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/private_headers.verify.cpp
@@ -81,6 +81,7 @@
#include <__algorithm/iter_swap.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/iter_swap.h'}}
#include <__algorithm/iterator_operations.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/iterator_operations.h'}}
#include <__algorithm/lexicographical_compare.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/lexicographical_compare.h'}}
+#include <__algorithm/lexicographical_compare_three_way.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/lexicographical_compare_three_way.h'}}
#include <__algorithm/lower_bound.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/lower_bound.h'}}
#include <__algorithm/make_heap.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/make_heap.h'}}
#include <__algorithm/make_projected.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/make_projected.h'}}
@@ -220,6 +221,7 @@
#include <__algorithm/stable_partition.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/stable_partition.h'}}
#include <__algorithm/stable_sort.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/stable_sort.h'}}
#include <__algorithm/swap_ranges.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/swap_ranges.h'}}
+#include <__algorithm/three_way_comp_ref_type.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/three_way_comp_ref_type.h'}}
#include <__algorithm/transform.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/transform.h'}}
#include <__algorithm/uniform_random_bit_generator_adaptor.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/uniform_random_bit_generator_adaptor.h'}}
#include <__algorithm/unique.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/unique.h'}}
@@ -227,6 +229,20 @@
#include <__algorithm/unwrap_iter.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/unwrap_iter.h'}}
#include <__algorithm/unwrap_range.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/unwrap_range.h'}}
#include <__algorithm/upper_bound.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/upper_bound.h'}}
+#include <__atomic/aliases.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/aliases.h'}}
+#include <__atomic/atomic.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/atomic.h'}}
+#include <__atomic/atomic_base.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/atomic_base.h'}}
+#include <__atomic/atomic_flag.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/atomic_flag.h'}}
+#include <__atomic/atomic_init.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/atomic_init.h'}}
+#include <__atomic/atomic_lock_free.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/atomic_lock_free.h'}}
+#include <__atomic/atomic_sync.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/atomic_sync.h'}}
+#include <__atomic/check_memory_order.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/check_memory_order.h'}}
+#include <__atomic/contention_t.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/contention_t.h'}}
+#include <__atomic/cxx_atomic_impl.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/cxx_atomic_impl.h'}}
+#include <__atomic/fence.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/fence.h'}}
+#include <__atomic/is_always_lock_free.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/is_always_lock_free.h'}}
+#include <__atomic/kill_dependency.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/kill_dependency.h'}}
+#include <__atomic/memory_order.h> // expected-error@*:* {{use of private header from outside its module: '__atomic/memory_order.h'}}
#include <__availability> // expected-error@*:* {{use of private header from outside its module: '__availability'}}
#include <__bit/bit_cast.h> // expected-error@*:* {{use of private header from outside its module: '__bit/bit_cast.h'}}
#include <__bit/bit_ceil.h> // expected-error@*:* {{use of private header from outside its module: '__bit/bit_ceil.h'}}
@@ -243,11 +259,17 @@
#include <__bit/rotate.h> // expected-error@*:* {{use of private header from outside its module: '__bit/rotate.h'}}
#include <__bit_reference> // expected-error@*:* {{use of private header from outside its module: '__bit_reference'}}
#include <__charconv/chars_format.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/chars_format.h'}}
+#include <__charconv/from_chars_integral.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/from_chars_integral.h'}}
#include <__charconv/from_chars_result.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/from_chars_result.h'}}
#include <__charconv/tables.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/tables.h'}}
+#include <__charconv/to_chars.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/to_chars.h'}}
#include <__charconv/to_chars_base_10.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/to_chars_base_10.h'}}
+#include <__charconv/to_chars_floating_point.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/to_chars_floating_point.h'}}
+#include <__charconv/to_chars_integral.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/to_chars_integral.h'}}
#include <__charconv/to_chars_result.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/to_chars_result.h'}}
+#include <__charconv/traits.h> // expected-error@*:* {{use of private header from outside its module: '__charconv/traits.h'}}
#include <__chrono/calendar.h> // expected-error@*:* {{use of private header from outside its module: '__chrono/calendar.h'}}
+#include <__chrono/concepts.h> // expected-error@*:* {{use of private header from outside its module: '__chrono/concepts.h'}}
#include <__chrono/convert_to_timespec.h> // expected-error@*:* {{use of private header from outside its module: '__chrono/convert_to_timespec.h'}}
#include <__chrono/convert_to_tm.h> // expected-error@*:* {{use of private header from outside its module: '__chrono/convert_to_tm.h'}}
#include <__chrono/day.h> // expected-error@*:* {{use of private header from outside its module: '__chrono/day.h'}}
@@ -306,12 +328,17 @@
#include <__concepts/semiregular.h> // expected-error@*:* {{use of private header from outside its module: '__concepts/semiregular.h'}}
#include <__concepts/swappable.h> // expected-error@*:* {{use of private header from outside its module: '__concepts/swappable.h'}}
#include <__concepts/totally_ordered.h> // expected-error@*:* {{use of private header from outside its module: '__concepts/totally_ordered.h'}}
+#include <__condition_variable/condition_variable.h> // expected-error@*:* {{use of private header from outside its module: '__condition_variable/condition_variable.h'}}
#include <__coroutine/coroutine_handle.h> // expected-error@*:* {{use of private header from outside its module: '__coroutine/coroutine_handle.h'}}
#include <__coroutine/coroutine_traits.h> // expected-error@*:* {{use of private header from outside its module: '__coroutine/coroutine_traits.h'}}
#include <__coroutine/noop_coroutine_handle.h> // expected-error@*:* {{use of private header from outside its module: '__coroutine/noop_coroutine_handle.h'}}
#include <__coroutine/trivial_awaitables.h> // expected-error@*:* {{use of private header from outside its module: '__coroutine/trivial_awaitables.h'}}
#include <__debug_utils/randomize_range.h> // expected-error@*:* {{use of private header from outside its module: '__debug_utils/randomize_range.h'}}
-#include <__errc> // expected-error@*:* {{use of private header from outside its module: '__errc'}}
+#include <__exception/exception.h> // expected-error@*:* {{use of private header from outside its module: '__exception/exception.h'}}
+#include <__exception/exception_ptr.h> // expected-error@*:* {{use of private header from outside its module: '__exception/exception_ptr.h'}}
+#include <__exception/nested_exception.h> // expected-error@*:* {{use of private header from outside its module: '__exception/nested_exception.h'}}
+#include <__exception/operations.h> // expected-error@*:* {{use of private header from outside its module: '__exception/operations.h'}}
+#include <__exception/terminate.h> // expected-error@*:* {{use of private header from outside its module: '__exception/terminate.h'}}
#include <__expected/bad_expected_access.h> // expected-error@*:* {{use of private header from outside its module: '__expected/bad_expected_access.h'}}
#include <__expected/expected.h> // expected-error@*:* {{use of private header from outside its module: '__expected/expected.h'}}
#include <__expected/unexpect.h> // expected-error@*:* {{use of private header from outside its module: '__expected/unexpect.h'}}
@@ -445,6 +472,7 @@
#include <__mbstate_t.h> // expected-error@*:* {{use of private header from outside its module: '__mbstate_t.h'}}
#include <__memory/addressof.h> // expected-error@*:* {{use of private header from outside its module: '__memory/addressof.h'}}
#include <__memory/align.h> // expected-error@*:* {{use of private header from outside its module: '__memory/align.h'}}
+#include <__memory/aligned_alloc.h> // expected-error@*:* {{use of private header from outside its module: '__memory/aligned_alloc.h'}}
#include <__memory/allocate_at_least.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocate_at_least.h'}}
#include <__memory/allocation_guard.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocation_guard.h'}}
#include <__memory/allocator.h> // expected-error@*:* {{use of private header from outside its module: '__memory/allocator.h'}}
@@ -477,7 +505,10 @@
#include <__memory_resource/pool_options.h> // expected-error@*:* {{use of private header from outside its module: '__memory_resource/pool_options.h'}}
#include <__memory_resource/synchronized_pool_resource.h> // expected-error@*:* {{use of private header from outside its module: '__memory_resource/synchronized_pool_resource.h'}}
#include <__memory_resource/unsynchronized_pool_resource.h> // expected-error@*:* {{use of private header from outside its module: '__memory_resource/unsynchronized_pool_resource.h'}}
-#include <__mutex_base> // expected-error@*:* {{use of private header from outside its module: '__mutex_base'}}
+#include <__mutex/lock_guard.h> // expected-error@*:* {{use of private header from outside its module: '__mutex/lock_guard.h'}}
+#include <__mutex/mutex.h> // expected-error@*:* {{use of private header from outside its module: '__mutex/mutex.h'}}
+#include <__mutex/tag_types.h> // expected-error@*:* {{use of private header from outside its module: '__mutex/tag_types.h'}}
+#include <__mutex/unique_lock.h> // expected-error@*:* {{use of private header from outside its module: '__mutex/unique_lock.h'}}
#include <__node_handle> // expected-error@*:* {{use of private header from outside its module: '__node_handle'}}
#include <__numeric/accumulate.h> // expected-error@*:* {{use of private header from outside its module: '__numeric/accumulate.h'}}
#include <__numeric/adjacent_difference.h> // expected-error@*:* {{use of private header from outside its module: '__numeric/adjacent_difference.h'}}
@@ -568,21 +599,26 @@
#include <__ranges/views.h> // expected-error@*:* {{use of private header from outside its module: '__ranges/views.h'}}
#include <__ranges/zip_view.h> // expected-error@*:* {{use of private header from outside its module: '__ranges/zip_view.h'}}
#include <__split_buffer> // expected-error@*:* {{use of private header from outside its module: '__split_buffer'}}
-#include <__std_stream> // expected-error@*:* {{use of private header from outside its module: '__std_stream'}}
#include <__string/char_traits.h> // expected-error@*:* {{use of private header from outside its module: '__string/char_traits.h'}}
+#include <__string/constexpr_c_functions.h> // expected-error@*:* {{use of private header from outside its module: '__string/constexpr_c_functions.h'}}
#include <__string/extern_template_lists.h> // expected-error@*:* {{use of private header from outside its module: '__string/extern_template_lists.h'}}
+#include <__system_error/errc.h> // expected-error@*:* {{use of private header from outside its module: '__system_error/errc.h'}}
+#include <__system_error/error_category.h> // expected-error@*:* {{use of private header from outside its module: '__system_error/error_category.h'}}
+#include <__system_error/error_code.h> // expected-error@*:* {{use of private header from outside its module: '__system_error/error_code.h'}}
+#include <__system_error/error_condition.h> // expected-error@*:* {{use of private header from outside its module: '__system_error/error_condition.h'}}
+#include <__system_error/system_error.h> // expected-error@*:* {{use of private header from outside its module: '__system_error/system_error.h'}}
#include <__thread/poll_with_backoff.h> // expected-error@*:* {{use of private header from outside its module: '__thread/poll_with_backoff.h'}}
#include <__thread/timed_backoff_policy.h> // expected-error@*:* {{use of private header from outside its module: '__thread/timed_backoff_policy.h'}}
-#include <__tuple_dir/apply_cv.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/apply_cv.h'}}
-#include <__tuple_dir/make_tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/make_tuple_types.h'}}
-#include <__tuple_dir/pair_like.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/pair_like.h'}}
-#include <__tuple_dir/sfinae_helpers.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/sfinae_helpers.h'}}
-#include <__tuple_dir/tuple_element.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_element.h'}}
-#include <__tuple_dir/tuple_indices.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_indices.h'}}
-#include <__tuple_dir/tuple_like.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_like.h'}}
-#include <__tuple_dir/tuple_like_ext.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_like_ext.h'}}
-#include <__tuple_dir/tuple_size.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_size.h'}}
-#include <__tuple_dir/tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_types.h'}}
+#include <__tuple/apply_cv.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/apply_cv.h'}}
+#include <__tuple/make_tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/make_tuple_types.h'}}
+#include <__tuple/pair_like.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/pair_like.h'}}
+#include <__tuple/sfinae_helpers.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/sfinae_helpers.h'}}
+#include <__tuple/tuple_element.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_element.h'}}
+#include <__tuple/tuple_indices.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_indices.h'}}
+#include <__tuple/tuple_like.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_like.h'}}
+#include <__tuple/tuple_like_ext.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_like_ext.h'}}
+#include <__tuple/tuple_size.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_size.h'}}
+#include <__tuple/tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_types.h'}}
#include <__type_traits/add_const.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/add_const.h'}}
#include <__type_traits/add_cv.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/add_cv.h'}}
#include <__type_traits/add_lvalue_reference.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/add_lvalue_reference.h'}}
@@ -632,6 +668,7 @@
#include <__type_traits/is_destructible.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_destructible.h'}}
#include <__type_traits/is_empty.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_empty.h'}}
#include <__type_traits/is_enum.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_enum.h'}}
+#include <__type_traits/is_equality_comparable.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_equality_comparable.h'}}
#include <__type_traits/is_final.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_final.h'}}
#include <__type_traits/is_floating_point.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_floating_point.h'}}
#include <__type_traits/is_function.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/is_function.h'}}
@@ -696,6 +733,7 @@
#include <__type_traits/nat.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/nat.h'}}
#include <__type_traits/negation.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/negation.h'}}
#include <__type_traits/noexcept_move_assign_container.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/noexcept_move_assign_container.h'}}
+#include <__type_traits/predicate_traits.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/predicate_traits.h'}}
#include <__type_traits/promote.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/promote.h'}}
#include <__type_traits/rank.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/rank.h'}}
#include <__type_traits/remove_all_extents.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/remove_all_extents.h'}}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.tuple/tuple-for-each.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.tuple/tuple-for-each.pass.cpp
new file mode 100644
index 0000000..11176c7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.tuple/tuple-for-each.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17, c++20
+
+// <ranges>
+
+// template<class F, class Tuple>
+// constexpr void tuple-for-each(F&& f, Tuple&& t) { // exposition only
+
+// LWG3755 tuple-for-each can call user-defined operator,
+
+#include <ranges>
+#include <tuple>
+#include <cstdlib>
+
+struct Evil {
+ void operator,(Evil) { std::abort(); }
+};
+
+int main(int, char**) {
+ std::tuple<int, int> t;
+ std::ranges::__tuple_for_each([](int) { return Evil{}; }, t);
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp
index e9cd574..10d96a6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp
@@ -13,7 +13,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: no-exceptions
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <ranges>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.join/segmented_iterator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.join/segmented_iterator.compile.pass.cpp
new file mode 100644
index 0000000..82e8cab
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.join/segmented_iterator.compile.pass.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+// UNSUPPORTED: !c++experimental
+
+#include <ranges>
+#include <utility>
+#include <vector>
+
+using JoinView = decltype(std::views::join(std::declval<std::vector<std::vector<int>>&>()));
+using JoinIter = std::ranges::iterator_t<JoinView>;
+static_assert(std::__is_segmented_iterator<JoinIter>::value);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
index 37cd715..2918d4f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
@@ -54,7 +54,7 @@
int x;
int* begin() const;
int* end() const;
- constexpr static size_t size() { return 1; }
+ constexpr static std::size_t size() { return 1; }
};
static_assert( std::ranges::forward_range<TinyView>);
static_assert( std::ranges::__tiny_range<TinyView>);
@@ -107,7 +107,7 @@
struct EmptyTinyView : std::ranges::view_base {
int* begin() const;
int* end() const;
- constexpr static size_t size() { return 1; }
+ constexpr static std::size_t size() { return 1; }
};
static_assert( std::ranges::forward_range<EmptyTinyView>);
static_assert( std::ranges::__tiny_range<EmptyTinyView>);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
index a66b378..12b0de9 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
+++ b/third_party/llvm-project/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
@@ -10,6 +10,7 @@
#define TEST_LIBCXX_RANGES_RANGE_ADAPTORS_RANGE_LAZY_SPLIT_TYPES_H
#include <concepts>
+#include <cstddef>
#include <ranges>
#include <string_view>
#include "test_iterators.h"
@@ -53,7 +54,7 @@
constexpr ForwardTinyView() = default;
constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(nullptr); }
constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(nullptr); }
- constexpr static size_t size() { return 1; }
+ constexpr static std::size_t size() { return 1; }
};
static_assert(std::ranges::forward_range<ForwardTinyView>);
static_assert(std::ranges::view<ForwardTinyView>);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/ranges/version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/ranges/version.compile.pass.cpp
index de955a9..4b3aa3f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/ranges/version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/ranges/version.compile.pass.cpp
@@ -16,6 +16,3 @@
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
#endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/compile-error.compile.pass.mm
similarity index 67%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/compile-error.compile.pass.mm
index 92dc58c..04bb4cc 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/compile-error.compile.pass.mm
@@ -6,16 +6,13 @@
//
//===----------------------------------------------------------------------===//
-// <complex.h>
+// REQUIRES: objective-c++
-#include <complex.h>
+// XFAIL: *
-#include "test_macros.h"
+// Make sure the test DOES NOT pass if it fails at compile-time
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
+struct Foo { };
+typedef Foo::x x;
- return 0;
-}
+int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/compile-success.compile.pass.mm
similarity index 72%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/compile-success.compile.pass.mm
index b619499..9effc02 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/compile-success.compile.pass.mm
@@ -6,14 +6,11 @@
//
//===----------------------------------------------------------------------===//
-// <ciso646>
+// REQUIRES: objective-c++
-#include <ciso646>
+// Make sure the test passes if it succeeds to compile
-#include "test_macros.h"
+@interface I;
+@end
-int main(int, char**)
-{
-
- return 0;
-}
+int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/link-error.compile.pass.mm
similarity index 63%
copy from third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/link-error.compile.pass.mm
index 1efeba1..77f6a63 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/link-error.compile.pass.mm
@@ -6,10 +6,16 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
+// REQUIRES: objective-c++
-// The "hash_value" function is tested as part of [path.compare]
-// in class.path/path.members/path.compare.pass.cpp
+// Make sure the test passes even if there's a link error, i.e. it isn't linked.
+
+@interface I;
+@end
+
+extern void this_is_an_undefined_symbol();
+
int main(int, char**) {
- return 0;
+ this_is_an_undefined_symbol();
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/run-error.compile.pass.mm
similarity index 71%
rename from third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
rename to third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/run-error.compile.pass.mm
index 1efeba1..cdd3ef4 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/compile.pass.mm/run-error.compile.pass.mm
@@ -6,10 +6,13 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
+// REQUIRES: objective-c++
-// The "hash_value" function is tested as part of [path.compare]
-// in class.path/path.members/path.compare.pass.cpp
+// Make sure the test passes even if there's a runtime error, i.e. it isn't run.
+
+@interface I;
+@end
+
int main(int, char**) {
- return 0;
+ return 1;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/compile-error.link.pass.mm
similarity index 67%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/compile-error.link.pass.mm
index 92dc58c..6227641 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/compile-error.link.pass.mm
@@ -6,16 +6,13 @@
//
//===----------------------------------------------------------------------===//
-// <complex.h>
+// REQUIRES: objective-c++
-#include <complex.h>
+// XFAIL: *
-#include "test_macros.h"
+// Make sure the test DOES NOT pass if it fails at compile-time.
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
+struct Foo { };
+typedef Foo::x x;
- return 0;
-}
+int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/link-error.link.pass.mm
similarity index 67%
copy from third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/link-error.link.pass.mm
index 1efeba1..e955942 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/link-error.link.pass.mm
@@ -6,10 +6,15 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
+// REQUIRES: objective-c++
-// The "hash_value" function is tested as part of [path.compare]
-// in class.path/path.members/path.compare.pass.cpp
+// XFAIL: *
+
+// Make sure the test DOES NOT pass if it fails to link.
+
+extern void this_is_an_undefined_symbol();
+
int main(int, char**) {
- return 0;
+ this_is_an_undefined_symbol();
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/link-success.link.pass.mm
similarity index 72%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/link-success.link.pass.mm
index b619499..a831d7f 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/link-success.link.pass.mm
@@ -6,14 +6,11 @@
//
//===----------------------------------------------------------------------===//
-// <ciso646>
+// REQUIRES: objective-c++
-#include <ciso646>
+// Make sure the test passes if it succeeds to link.
-#include "test_macros.h"
+@interface I;
+@end
-int main(int, char**)
-{
-
- return 0;
-}
+int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/run-error.link.pass.mm
similarity index 70%
copy from third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
copy to third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/run-error.link.pass.mm
index 1efeba1..778fab3 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/link.pass.mm/run-error.link.pass.mm
@@ -6,10 +6,14 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
+// REQUIRES: objective-c++
-// The "hash_value" function is tested as part of [path.compare]
-// in class.path/path.members/path.compare.pass.cpp
+// Make sure the test passes if it succeeds to link, even though it would have
+// failed at runtime.
+
+@interface I;
+@end
+
int main(int, char**) {
- return 0;
+ return 1;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
index b1234ae..e96d6be 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
@@ -10,7 +10,6 @@
// ADDITIONAL_COMPILE_FLAGS: -Wunused-variable
-int main(int, char**) {
+void f() {
int foo; // expected-warning {{unused variable}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
index d679e7a..504b8c8 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
@@ -18,7 +18,7 @@
template <class T>
class small_pointer {
- uint16_t offset;
+ std::uint16_t offset;
};
template <class T>
@@ -26,8 +26,8 @@
public:
using value_type = T;
using pointer = small_pointer<T>;
- using size_type = int16_t;
- using difference_type = int16_t;
+ using size_type = std::int16_t;
+ using difference_type = std::int16_t;
small_iter_allocator() TEST_NOEXCEPT {}
@@ -132,5 +132,5 @@
# endif
#else
-# error "size_t has an unexpected size"
+# error "std::size_t has an unexpected size"
#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
index 9024d11..4d3eeb1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
@@ -16,7 +16,7 @@
template <class T>
class small_pointer {
- uint16_t offset;
+ std::uint16_t offset;
};
template <class T>
@@ -24,8 +24,8 @@
public:
using value_type = T;
using pointer = small_pointer<T>;
- using size_type = int16_t;
- using difference_type = int16_t;
+ using size_type = std::int16_t;
+ using difference_type = std::int16_t;
small_iter_allocator() TEST_NOEXCEPT {}
@@ -131,5 +131,5 @@
# endif
#else
-# error "size_t has an unexpected size"
+# error "std::size_t has an unexpected size"
#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
index f2d961e..522f606 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
index b2f0475..94a4351 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
index 3de1b84..5dd987b 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
index 74d0e4f..9f583fc 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
index d2d9134..c7c8c8d 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
index 218ab0e..9a3e6b2 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
index 5592959..feb9499 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
@@ -22,8 +22,7 @@
// Reported as https://llvm.org/PR53170.
// reserve(n) used to shrink the string until https://llvm.org/D117332 was shipped.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
#include <string>
#include <stdexcept>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
index 69b45f8..4bc622f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -18,48 +18,48 @@
#include "test_macros.h"
// alignment of the string heap buffer is hardcoded to 16
-static const size_t alignment = 16;
+static const std::size_t alignment = 16;
template <class = int>
TEST_CONSTEXPR_CXX20 void full_size() {
std::string str;
- assert(str.max_size() == std::numeric_limits<size_t>::max() - alignment);
+ assert(str.max_size() == std::numeric_limits<std::size_t>::max() - alignment);
#ifndef TEST_HAS_NO_CHAR8_T
std::u8string u8str;
- assert(u8str.max_size() == std::numeric_limits<size_t>::max() - alignment);
+ assert(u8str.max_size() == std::numeric_limits<std::size_t>::max() - alignment);
#endif
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
std::wstring wstr;
- assert(wstr.max_size() == std::numeric_limits<size_t>::max() / sizeof(wchar_t) - alignment);
+ assert(wstr.max_size() == std::numeric_limits<std::size_t>::max() / sizeof(wchar_t) - alignment);
#endif
std::u16string u16str;
std::u32string u32str;
- assert(u16str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
- assert(u32str.max_size() == std::numeric_limits<size_t>::max() / 4 - alignment);
+ assert(u16str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
+ assert(u32str.max_size() == std::numeric_limits<std::size_t>::max() / 4 - alignment);
}
template <class = int>
TEST_CONSTEXPR_CXX20 void half_size() {
std::string str;
- assert(str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
+ assert(str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
#ifndef TEST_HAS_NO_CHAR8_T
std::u8string u8str;
- assert(u8str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
+ assert(u8str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
#endif
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
std::wstring wstr;
- assert(wstr.max_size() == std::numeric_limits<size_t>::max() / std::max<size_t>(2ul, sizeof(wchar_t)) - alignment);
+ assert(wstr.max_size() == std::numeric_limits<std::size_t>::max() / std::max<size_t>(2ul, sizeof(wchar_t)) - alignment);
#endif
std::u16string u16str;
std::u32string u32str;
- assert(u16str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
- assert(u32str.max_size() == std::numeric_limits<size_t>::max() / 4 - alignment);
+ assert(u16str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
+ assert(u32str.max_size() == std::numeric_limits<std::size_t>::max() / 4 - alignment);
}
TEST_CONSTEXPR_CXX20 bool test() {
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
index 13a2301..2a120fb 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
int main(int, char**) {
- using T = decltype(uint8_t() - uint8_t());
+ using T = decltype(std::uint8_t() - std::uint8_t());
{
typedef std::string C;
C c(1, '\0');
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
index f22caff..582986c 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
index 286e348..8fb734c 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <string>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/constexpr.cstring.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/constexpr.cstring.compile.pass.cpp
index ad078c0..f440810 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/constexpr.cstring.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/constexpr.cstring.compile.pass.cpp
@@ -8,9 +8,11 @@
// UNSUPPORTED: c++03, c++11
+// ADDITIONAL_COMPILE_FLAGS: -Wno-private-header
+
// Check that __constexpr_* cstring functions are actually constexpr
-#include <cstring>
+#include <__string/constexpr_c_functions.h>
static_assert(std::__constexpr_strlen("Banane") == 6, "");
static_assert(std::__constexpr_memcmp("Banane", "Banand", 6) == 1, "");
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/version_cuchar.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/version_cuchar.pass.cpp
index 2c62af8..1eeaec1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/version_cuchar.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/c.strings/version_cuchar.pass.cpp
@@ -8,9 +8,6 @@
// UNSUPPORTED: c++03
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// <cuchar>
#include <cuchar>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp
new file mode 100644
index 0000000..7d7ea07
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: has-unix-headers
+
+// UNSUPPORTED: c++03, c++11
+// XFAIL: availability-verbose_abort-missing
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
+
+// Construct a string_view from an invalid length
+// constexpr basic_string_view( const _CharT* s, size_type len )
+
+#include <string_view>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+ char c = 0;
+ TEST_LIBCPP_ASSERT_FAILURE(
+ std::string_view(&c, -1), "string_view::string_view(_CharT *, size_t): length does not fit in difference_type");
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
index f674cfa..16acfd6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: c++11, c++14
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// Construct a string_view from a null pointer
diff --git a/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/string.view.iterators/debug.iterator-indexing.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/string.view.iterators/debug.iterator-indexing.pass.cpp
new file mode 100644
index 0000000..f6b16eb
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/strings/string.view/string.view.iterators/debug.iterator-indexing.pass.cpp
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// Make sure that std::string_view's iterators check for OOB accesses when the debug mode is enabled.
+
+// REQUIRES: has-unix-headers
+// UNSUPPORTED: !libcpp-has-debug-mode
+
+#include <string_view>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+ // string_view::iterator
+ {
+ std::string_view const str("hello world");
+ {
+ auto it = str.end();
+ TEST_LIBCPP_ASSERT_FAILURE(*it, "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.end();
+ TEST_LIBCPP_ASSERT_FAILURE(it.operator->(), "__bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.begin();
+ TEST_LIBCPP_ASSERT_FAILURE(it[99], "__bounded_iter::operator[]: Attempt to index an iterator out-of-range");
+ }
+ }
+
+ // string_view::const_iterator
+ {
+ std::string_view const str("hello world");
+ {
+ auto it = str.cend();
+ TEST_LIBCPP_ASSERT_FAILURE(*it, "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.cend();
+ TEST_LIBCPP_ASSERT_FAILURE(it.operator->(), "__bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.cbegin();
+ TEST_LIBCPP_ASSERT_FAILURE(it[99], "__bounded_iter::operator[]: Attempt to index an iterator out-of-range");
+ }
+ }
+
+ // string_view::reverse_iterator
+ {
+ std::string_view const str("hello world");
+ {
+ auto it = str.rend();
+ TEST_LIBCPP_ASSERT_FAILURE(*it, "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.rend();
+ TEST_LIBCPP_ASSERT_FAILURE(it.operator->(), "__bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.rbegin();
+ TEST_LIBCPP_ASSERT_FAILURE(it[99], "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
+ }
+ }
+
+ // string_view::const_reverse_iterator
+ {
+ std::string_view const str("hello world");
+ {
+ auto it = str.crend();
+ TEST_LIBCPP_ASSERT_FAILURE(*it, "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.crend();
+ TEST_LIBCPP_ASSERT_FAILURE(it.operator->(), "__bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
+ }
+ {
+ auto it = str.crbegin();
+ TEST_LIBCPP_ASSERT_FAILURE(it[99], "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
+ }
+ }
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/atomic.availability.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
index e96d461..419be93 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
@@ -7,17 +7,14 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
-// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
+// REQUIRES: availability-synchronization_library-missing
// Test the availability markup on the C++20 Synchronization Library
// additions to <atomic>.
#include <atomic>
-
-int main(int, char**)
-{
+void f() {
{
std::atomic<int> i(3);
std::memory_order m = std::memory_order_relaxed;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/barrier.availability.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
index 8da39fe..c9baa8b 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
-// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
+// REQUIRES: availability-synchronization_library-missing
// Test the availability markup on std::barrier.
@@ -19,8 +18,7 @@
void operator()() { }
};
-int main(int, char**)
-{
+void f() {
// Availability markup on std::barrier<>
{
std::barrier<> b(10); // expected-error {{is unavailable}}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
index c4090ed..f9a97d5 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, no-threads
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <future>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
index a4c21ec..de39734 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, no-threads
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <future>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/latch.availability.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/latch.availability.verify.cpp
index 8555e0e..3aa50ea 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/latch.availability.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/latch.availability.verify.cpp
@@ -7,16 +7,13 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
-// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
+// REQUIRES: availability-synchronization_library-missing
// Test the availability markup on std::latch.
#include <latch>
-
-int main(int, char**)
-{
+void f() {
std::latch latch(10);
latch.count_down(); // expected-error {{is unavailable}}
latch.count_down(3); // expected-error {{is unavailable}}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
index a6d5c36..29a6a60 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
@@ -7,17 +7,14 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
-// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
+// REQUIRES: availability-synchronization_library-missing
// Test the availability markup on std::counting_semaphore and std::binary_semaphore.
#include <chrono>
#include <semaphore>
-
-int main(int, char**)
-{
+void f() {
{
// Tests for std::counting_semaphore with non-default template argument
std::counting_semaphore<20> sem(10);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
index 7890787..fb80bb0 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
@@ -18,8 +18,3 @@
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
#endif
-
-int main(int, char**)
-{
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
index 0d682cd..fd863fb 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
@@ -14,7 +14,7 @@
// UNSUPPORTED: c++03
// PR30202 was fixed starting in macosx10.13.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// <condition_variable>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
index 374aa2f..13d1bfc 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
@@ -17,8 +17,10 @@
// typedef pthread_cond_t* native_handle_type;
// native_handle_type native_handle();
-#include <condition_variable>
#include <cassert>
+#include <condition_variable>
+#include <pthread.h>
+#include <type_traits>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
index 365ee92..559c827 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
@@ -18,8 +18,3 @@
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
#endif
-
-int main(int, char**)
-{
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
index c0cad32..5fe68c8 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
@@ -23,9 +23,8 @@
#include <mutex>
-int main(int, char**) {
+void f() {
std::mutex m;
std::lock_guard<std::mutex>{m}; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
std::lock_guard<std::mutex>{m, std::adopt_lock}; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
index 02072f5..5d40fa7 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
index 3f59448..9eaf1ad 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
@@ -18,8 +18,3 @@
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
#endif
-
-int main(int, char**)
-{
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
index 59bcec4..9031359 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
@@ -11,7 +11,7 @@
// Until 58a0a70fb2f1, this_thread::sleep_for could sometimes get interrupted
// by signals and this test would fail spuriously. Disable the test on the
// corresponding system libraries.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// ALLOW_RETRIES: 3
diff --git a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
index 5e5005c..ad62e0c 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
@@ -14,7 +14,7 @@
// Until 58a0a70fb2f1, this_thread::sleep_for misbehaves when interrupted by
// a signal, as tested here. Disable the test on the corresponding system
// libraries.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// ALLOW_RETRIES: 3
diff --git a/third_party/llvm-project/libcxx/test/libcxx/time/convert_to_tm.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/time/convert_to_tm.pass.cpp
new file mode 100644
index 0000000..9e52b5b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/time/convert_to_tm.pass.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// <chrono>
+
+// template <class _Tm, class _ChronoT>
+// _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const _ChronoT& __value)
+
+// Most of the code is tested indirectly in the chrono formatters. This only
+// tests the hour overflow.
+
+#include <chrono>
+#include <cassert>
+#include <format>
+#include <string_view>
+
+#include "test_macros.h"
+
+// libc++ uses a long as representation in std::chrono::hours.
+// std::tm uses an int for its integral members. The overflow in the hour
+// conversion can only occur on platforms where sizeof(long) > sizeof(int).
+// Instead emulate this error by using a "tm" with shorts.
+// (The function is already templated to this is quite easy to do,)
+struct minimal_short_tm {
+ short tm_sec;
+ short tm_min;
+ short tm_hour;
+ const char* tm_zone;
+};
+
+int main(int, char**) {
+ { // Test with the maximum number of hours that fit in a short.
+ std::chrono::hh_mm_ss time{std::chrono::hours{32767}};
+ minimal_short_tm result = std::__convert_to_tm<minimal_short_tm>(time);
+ assert(result.tm_sec == 0);
+ assert(result.tm_min == 0);
+ assert(result.tm_hour == 32767);
+ }
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ { // Test above the maximum number of hours that fit in a short.
+ std::chrono::hh_mm_ss time{std::chrono::hours{32768}};
+ try {
+ TEST_IGNORE_NODISCARD std::__convert_to_tm<minimal_short_tm>(time);
+ assert(false);
+ } catch ([[maybe_unused]] const std::format_error& e) {
+ LIBCPP_ASSERT(e.what() == std::string_view("Formatting hh_mm_ss, encountered an hour overflow"));
+ return 0;
+ }
+ assert(false);
+ }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes.sh.cpp
index 5eaca97..28a1ed5 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes.sh.cpp
@@ -27,9 +27,6 @@
// This test uses --trace-includes, which is not supported by GCC.
// UNSUPPORTED: gcc
-// This test doesn't work on AIX, but it should. Needs investigation.
-// XFAIL: buildhost=aix
-
// This test is not supported when we remove the transitive includes provided for backwards
// compatibility. When we bulk-remove them, we'll adjust the includes that are expected by
// this test instead.
@@ -60,7 +57,7 @@
continue
normalized_header = re.sub('/', '_', header)
- print(f"// {RUN}: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_{i} 2> %t/header.{normalized_header}")
+ print(f"// {RUN}: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess -DTEST_{i} 2> %t/header.{normalized_header}")
print(f"#if defined(TEST_{i})")
print(f"#include <{header}>")
print("#endif")
@@ -77,492 +74,480 @@
// DO NOT MANUALLY EDIT ANYTHING BETWEEN THE MARKERS BELOW
// GENERATED-MARKER
// RUN: mkdir %t
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_0 2> %t/header.algorithm
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_0 2> %t/header.algorithm
#if defined(TEST_0)
#include <algorithm>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_1 2> %t/header.any
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_1 2> %t/header.any
#if defined(TEST_1)
#include <any>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_2 2> %t/header.array
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_2 2> %t/header.array
#if defined(TEST_2)
#include <array>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_3 2> %t/header.atomic
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_3 2> %t/header.atomic
#if defined(TEST_3)
#include <atomic>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_4 2> %t/header.barrier
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_4 2> %t/header.barrier
#if defined(TEST_4)
#include <barrier>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_5 2> %t/header.bit
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_5 2> %t/header.bit
#if defined(TEST_5)
#include <bit>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_6 2> %t/header.bitset
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_6 2> %t/header.bitset
#if defined(TEST_6)
#include <bitset>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_7 2> %t/header.cassert
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_7 2> %t/header.cassert
#if defined(TEST_7)
#include <cassert>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_8 2> %t/header.ccomplex
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_8 2> %t/header.ccomplex
#if defined(TEST_8)
#include <ccomplex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_9 2> %t/header.cctype
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_9 2> %t/header.cctype
#if defined(TEST_9)
#include <cctype>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_10 2> %t/header.cerrno
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_10 2> %t/header.cerrno
#if defined(TEST_10)
#include <cerrno>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_11 2> %t/header.cfenv
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_11 2> %t/header.cfenv
#if defined(TEST_11)
#include <cfenv>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_12 2> %t/header.cfloat
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_12 2> %t/header.cfloat
#if defined(TEST_12)
#include <cfloat>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_13 2> %t/header.charconv
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_13 2> %t/header.charconv
#if defined(TEST_13)
#include <charconv>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_14 2> %t/header.chrono
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_14 2> %t/header.chrono
#if defined(TEST_14)
#include <chrono>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_15 2> %t/header.cinttypes
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_15 2> %t/header.cinttypes
#if defined(TEST_15)
#include <cinttypes>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_16 2> %t/header.ciso646
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_16 2> %t/header.ciso646
#if defined(TEST_16)
#include <ciso646>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_17 2> %t/header.climits
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_17 2> %t/header.climits
#if defined(TEST_17)
#include <climits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_18 2> %t/header.clocale
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_18 2> %t/header.clocale
#if defined(TEST_18)
#include <clocale>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_19 2> %t/header.cmath
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_19 2> %t/header.cmath
#if defined(TEST_19)
#include <cmath>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_20 2> %t/header.codecvt
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_20 2> %t/header.codecvt
#if defined(TEST_20)
#include <codecvt>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_21 2> %t/header.compare
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_21 2> %t/header.compare
#if defined(TEST_21)
#include <compare>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_22 2> %t/header.complex
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_22 2> %t/header.complex
#if defined(TEST_22)
#include <complex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_24 2> %t/header.concepts
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_24 2> %t/header.concepts
#if defined(TEST_24)
#include <concepts>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_25 2> %t/header.condition_variable
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_25 2> %t/header.condition_variable
#if defined(TEST_25)
#include <condition_variable>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_26 2> %t/header.coroutine
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_26 2> %t/header.coroutine
#if defined(TEST_26)
#include <coroutine>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_27 2> %t/header.csetjmp
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_27 2> %t/header.csetjmp
#if defined(TEST_27)
#include <csetjmp>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_28 2> %t/header.csignal
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_28 2> %t/header.csignal
#if defined(TEST_28)
#include <csignal>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_29 2> %t/header.cstdarg
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_29 2> %t/header.cstdarg
#if defined(TEST_29)
#include <cstdarg>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_30 2> %t/header.cstdbool
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_30 2> %t/header.cstdbool
#if defined(TEST_30)
#include <cstdbool>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_31 2> %t/header.cstddef
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_31 2> %t/header.cstddef
#if defined(TEST_31)
#include <cstddef>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_32 2> %t/header.cstdint
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_32 2> %t/header.cstdint
#if defined(TEST_32)
#include <cstdint>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_33 2> %t/header.cstdio
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_33 2> %t/header.cstdio
#if defined(TEST_33)
#include <cstdio>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_34 2> %t/header.cstdlib
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_34 2> %t/header.cstdlib
#if defined(TEST_34)
#include <cstdlib>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_35 2> %t/header.cstring
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_35 2> %t/header.cstring
#if defined(TEST_35)
#include <cstring>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_36 2> %t/header.ctgmath
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_36 2> %t/header.ctgmath
#if defined(TEST_36)
#include <ctgmath>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_37 2> %t/header.ctime
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_37 2> %t/header.ctime
#if defined(TEST_37)
#include <ctime>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_39 2> %t/header.cuchar
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_39 2> %t/header.cuchar
#if defined(TEST_39)
#include <cuchar>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_40 2> %t/header.cwchar
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_40 2> %t/header.cwchar
#if defined(TEST_40)
#include <cwchar>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_41 2> %t/header.cwctype
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_41 2> %t/header.cwctype
#if defined(TEST_41)
#include <cwctype>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_42 2> %t/header.deque
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_42 2> %t/header.deque
#if defined(TEST_42)
#include <deque>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_44 2> %t/header.exception
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_44 2> %t/header.exception
#if defined(TEST_44)
#include <exception>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_45 2> %t/header.execution
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_45 2> %t/header.execution
#if defined(TEST_45)
#include <execution>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_46 2> %t/header.expected
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_46 2> %t/header.expected
#if defined(TEST_46)
#include <expected>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_48 2> %t/header.filesystem
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_48 2> %t/header.filesystem
#if defined(TEST_48)
#include <filesystem>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_50 2> %t/header.format
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_50 2> %t/header.format
#if defined(TEST_50)
#include <format>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_51 2> %t/header.forward_list
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_51 2> %t/header.forward_list
#if defined(TEST_51)
#include <forward_list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_52 2> %t/header.fstream
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_52 2> %t/header.fstream
#if defined(TEST_52)
#include <fstream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_53 2> %t/header.functional
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_53 2> %t/header.functional
#if defined(TEST_53)
#include <functional>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_54 2> %t/header.future
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_54 2> %t/header.future
#if defined(TEST_54)
#include <future>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_55 2> %t/header.initializer_list
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_55 2> %t/header.initializer_list
#if defined(TEST_55)
#include <initializer_list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_57 2> %t/header.iomanip
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_57 2> %t/header.iomanip
#if defined(TEST_57)
#include <iomanip>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_58 2> %t/header.ios
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_58 2> %t/header.ios
#if defined(TEST_58)
#include <ios>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_59 2> %t/header.iosfwd
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_59 2> %t/header.iosfwd
#if defined(TEST_59)
#include <iosfwd>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_60 2> %t/header.iostream
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_60 2> %t/header.iostream
#if defined(TEST_60)
#include <iostream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_61 2> %t/header.istream
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_61 2> %t/header.istream
#if defined(TEST_61)
#include <istream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_62 2> %t/header.iterator
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_62 2> %t/header.iterator
#if defined(TEST_62)
#include <iterator>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_63 2> %t/header.latch
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_63 2> %t/header.latch
#if defined(TEST_63)
#include <latch>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_64 2> %t/header.limits
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_64 2> %t/header.limits
#if defined(TEST_64)
#include <limits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_66 2> %t/header.list
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_66 2> %t/header.list
#if defined(TEST_66)
#include <list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_67 2> %t/header.locale
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_67 2> %t/header.locale
#if defined(TEST_67)
#include <locale>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_69 2> %t/header.map
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_69 2> %t/header.map
#if defined(TEST_69)
#include <map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_71 2> %t/header.memory
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_71 2> %t/header.memory
#if defined(TEST_71)
#include <memory>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_72 2> %t/header.memory_resource
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_72 2> %t/header.memory_resource
#if defined(TEST_72)
#include <memory_resource>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_73 2> %t/header.mutex
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_73 2> %t/header.mutex
#if defined(TEST_73)
#include <mutex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_74 2> %t/header.new
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_74 2> %t/header.new
#if defined(TEST_74)
#include <new>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_75 2> %t/header.numbers
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_75 2> %t/header.numbers
#if defined(TEST_75)
#include <numbers>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_76 2> %t/header.numeric
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_76 2> %t/header.numeric
#if defined(TEST_76)
#include <numeric>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_77 2> %t/header.optional
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_77 2> %t/header.optional
#if defined(TEST_77)
#include <optional>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_78 2> %t/header.ostream
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_78 2> %t/header.ostream
#if defined(TEST_78)
#include <ostream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_79 2> %t/header.queue
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_79 2> %t/header.queue
#if defined(TEST_79)
#include <queue>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_80 2> %t/header.random
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_80 2> %t/header.random
#if defined(TEST_80)
#include <random>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_81 2> %t/header.ranges
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_81 2> %t/header.ranges
#if defined(TEST_81)
#include <ranges>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_82 2> %t/header.ratio
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_82 2> %t/header.ratio
#if defined(TEST_82)
#include <ratio>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_83 2> %t/header.regex
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_83 2> %t/header.regex
#if defined(TEST_83)
#include <regex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_84 2> %t/header.scoped_allocator
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_84 2> %t/header.scoped_allocator
#if defined(TEST_84)
#include <scoped_allocator>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_85 2> %t/header.semaphore
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_85 2> %t/header.semaphore
#if defined(TEST_85)
#include <semaphore>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_86 2> %t/header.set
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_86 2> %t/header.set
#if defined(TEST_86)
#include <set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_88 2> %t/header.shared_mutex
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_88 2> %t/header.shared_mutex
#if defined(TEST_88)
#include <shared_mutex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_89 2> %t/header.source_location
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_89 2> %t/header.source_location
#if defined(TEST_89)
#include <source_location>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_90 2> %t/header.span
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_90 2> %t/header.span
#if defined(TEST_90)
#include <span>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_91 2> %t/header.sstream
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_91 2> %t/header.sstream
#if defined(TEST_91)
#include <sstream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_92 2> %t/header.stack
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_92 2> %t/header.stack
#if defined(TEST_92)
#include <stack>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_96 2> %t/header.stdexcept
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_96 2> %t/header.stdexcept
#if defined(TEST_96)
#include <stdexcept>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_100 2> %t/header.streambuf
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_100 2> %t/header.streambuf
#if defined(TEST_100)
#include <streambuf>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_101 2> %t/header.string
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_101 2> %t/header.string
#if defined(TEST_101)
#include <string>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_103 2> %t/header.string_view
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_103 2> %t/header.string_view
#if defined(TEST_103)
#include <string_view>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_104 2> %t/header.strstream
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_104 2> %t/header.strstream
#if defined(TEST_104)
#include <strstream>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_105 2> %t/header.system_error
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_105 2> %t/header.system_error
#if defined(TEST_105)
#include <system_error>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_107 2> %t/header.thread
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_107 2> %t/header.thread
#if defined(TEST_107)
#include <thread>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_108 2> %t/header.tuple
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_108 2> %t/header.tuple
#if defined(TEST_108)
#include <tuple>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_109 2> %t/header.type_traits
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_109 2> %t/header.type_traits
#if defined(TEST_109)
#include <type_traits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_110 2> %t/header.typeindex
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_110 2> %t/header.typeindex
#if defined(TEST_110)
#include <typeindex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_111 2> %t/header.typeinfo
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_111 2> %t/header.typeinfo
#if defined(TEST_111)
#include <typeinfo>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_113 2> %t/header.unordered_map
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_113 2> %t/header.unordered_map
#if defined(TEST_113)
#include <unordered_map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_114 2> %t/header.unordered_set
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_114 2> %t/header.unordered_set
#if defined(TEST_114)
#include <unordered_set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_115 2> %t/header.utility
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_115 2> %t/header.utility
#if defined(TEST_115)
#include <utility>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_116 2> %t/header.valarray
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_116 2> %t/header.valarray
#if defined(TEST_116)
#include <valarray>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_117 2> %t/header.variant
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_117 2> %t/header.variant
#if defined(TEST_117)
#include <variant>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_118 2> %t/header.vector
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_118 2> %t/header.vector
#if defined(TEST_118)
#include <vector>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_119 2> %t/header.version
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_119 2> %t/header.version
#if defined(TEST_119)
#include <version>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_122 2> %t/header.experimental_algorithm
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_122 2> %t/header.experimental_deque
#if defined(TEST_122)
-#include <experimental/algorithm>
-#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_123 2> %t/header.experimental_coroutine
-#if defined(TEST_123)
-#include <experimental/coroutine>
-#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_124 2> %t/header.experimental_deque
-#if defined(TEST_124)
#include <experimental/deque>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_125 2> %t/header.experimental_forward_list
-#if defined(TEST_125)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_123 2> %t/header.experimental_forward_list
+#if defined(TEST_123)
#include <experimental/forward_list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_126 2> %t/header.experimental_functional
-#if defined(TEST_126)
-#include <experimental/functional>
-#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_127 2> %t/header.experimental_iterator
-#if defined(TEST_127)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_124 2> %t/header.experimental_iterator
+#if defined(TEST_124)
#include <experimental/iterator>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_128 2> %t/header.experimental_list
-#if defined(TEST_128)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_125 2> %t/header.experimental_list
+#if defined(TEST_125)
#include <experimental/list>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_129 2> %t/header.experimental_map
-#if defined(TEST_129)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_126 2> %t/header.experimental_map
+#if defined(TEST_126)
#include <experimental/map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_130 2> %t/header.experimental_memory_resource
-#if defined(TEST_130)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_127 2> %t/header.experimental_memory_resource
+#if defined(TEST_127)
#include <experimental/memory_resource>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_131 2> %t/header.experimental_propagate_const
-#if defined(TEST_131)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_128 2> %t/header.experimental_propagate_const
+#if defined(TEST_128)
#include <experimental/propagate_const>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_132 2> %t/header.experimental_regex
-#if defined(TEST_132)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_129 2> %t/header.experimental_regex
+#if defined(TEST_129)
#include <experimental/regex>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_133 2> %t/header.experimental_set
-#if defined(TEST_133)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_130 2> %t/header.experimental_set
+#if defined(TEST_130)
#include <experimental/set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_134 2> %t/header.experimental_simd
-#if defined(TEST_134)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_131 2> %t/header.experimental_simd
+#if defined(TEST_131)
#include <experimental/simd>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_135 2> %t/header.experimental_string
-#if defined(TEST_135)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_132 2> %t/header.experimental_string
+#if defined(TEST_132)
#include <experimental/string>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_136 2> %t/header.experimental_type_traits
-#if defined(TEST_136)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_133 2> %t/header.experimental_type_traits
+#if defined(TEST_133)
#include <experimental/type_traits>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_137 2> %t/header.experimental_unordered_map
-#if defined(TEST_137)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_134 2> %t/header.experimental_unordered_map
+#if defined(TEST_134)
#include <experimental/unordered_map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_138 2> %t/header.experimental_unordered_set
-#if defined(TEST_138)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_135 2> %t/header.experimental_unordered_set
+#if defined(TEST_135)
#include <experimental/unordered_set>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_139 2> %t/header.experimental_utility
-#if defined(TEST_139)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_136 2> %t/header.experimental_utility
+#if defined(TEST_136)
#include <experimental/utility>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_140 2> %t/header.experimental_vector
-#if defined(TEST_140)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_137 2> %t/header.experimental_vector
+#if defined(TEST_137)
#include <experimental/vector>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_141 2> %t/header.ext_hash_map
-#if defined(TEST_141)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_138 2> %t/header.ext_hash_map
+#if defined(TEST_138)
#include <ext/hash_map>
#endif
-// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes -fsyntax-only -DTEST_142 2> %t/header.ext_hash_set
-#if defined(TEST_142)
+// RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fshow-skipped-includes --preprocess -DTEST_139 2> %t/header.ext_hash_set
+#if defined(TEST_139)
#include <ext/hash_set>
#endif
// RUN: %{python} %S/transitive_includes_to_csv.py %t > %t/transitive_includes.csv
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx03.csv b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx03.csv
index 58fe49c..782e3f8 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx03.csv
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx03.csv
@@ -51,6 +51,7 @@
atomic compare
atomic cstddef
atomic cstdint
+atomic cstdlib
atomic cstring
atomic ctime
atomic iosfwd
@@ -73,6 +74,7 @@
barrier stdexcept
barrier type_traits
barrier variant
+barrier version
bit cstdint
bit cstdlib
bit iosfwd
@@ -105,11 +107,13 @@
charconv iosfwd
charconv limits
charconv type_traits
+chrono bit
chrono compare
chrono concepts
chrono cstddef
chrono cstdint
chrono cstdlib
+chrono cstring
chrono ctime
chrono limits
chrono ratio
@@ -154,17 +158,20 @@
concepts type_traits
concepts version
condition_variable atomic
+condition_variable cerrno
condition_variable concepts
condition_variable cstddef
condition_variable cstdint
condition_variable cstdlib
condition_variable cstring
+condition_variable ctime
condition_variable initializer_list
condition_variable iosfwd
condition_variable limits
condition_variable new
condition_variable ratio
condition_variable stdexcept
+condition_variable string
condition_variable system_error
condition_variable type_traits
condition_variable typeinfo
@@ -207,46 +214,13 @@
exception version
execution version
expected cstddef
-expected cstdlib
-expected exception
expected initializer_list
expected new
expected version
-experimental/algorithm algorithm
-experimental/algorithm cstddef
-experimental/algorithm type_traits
-experimental/coroutine atomic
-experimental/coroutine climits
-experimental/coroutine cmath
-experimental/coroutine compare
-experimental/coroutine concepts
-experimental/coroutine cstddef
-experimental/coroutine cstdint
-experimental/coroutine cstring
-experimental/coroutine ctime
-experimental/coroutine initializer_list
-experimental/coroutine iosfwd
-experimental/coroutine iterator
-experimental/coroutine limits
-experimental/coroutine memory
-experimental/coroutine new
-experimental/coroutine ratio
-experimental/coroutine stdexcept
-experimental/coroutine tuple
-experimental/coroutine type_traits
-experimental/coroutine typeinfo
-experimental/coroutine utility
-experimental/coroutine variant
experimental/deque deque
experimental/deque experimental/memory_resource
experimental/forward_list experimental/memory_resource
experimental/forward_list forward_list
-experimental/functional array
-experimental/functional cstddef
-experimental/functional functional
-experimental/functional type_traits
-experimental/functional unordered_map
-experimental/functional vector
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
@@ -325,7 +299,6 @@
ext/hash_set new
ext/hash_set string
ext/hash_set type_traits
-filesystem cerrno
filesystem compare
filesystem concepts
filesystem cstddef
@@ -344,12 +317,10 @@
filesystem type_traits
filesystem version
format array
-format bit
-format charconv
+format cmath
format cstddef
format cstdint
format cstdlib
-format cstring
format initializer_list
format limits
format locale
@@ -360,7 +331,6 @@
format string
format string_view
format tuple
-format type_traits
format vector
format version
forward_list algorithm
@@ -424,16 +394,26 @@
functional utility
functional vector
functional version
+future atomic
+future cerrno
future chrono
future cstddef
+future cstdint
+future cstdlib
+future cstring
future exception
+future initializer_list
+future iosfwd
future limits
future mutex
future new
future ratio
+future stdexcept
+future string
future system_error
future thread
future type_traits
+future typeinfo
future version
initializer_list cstddef
iomanip istream
@@ -483,7 +463,14 @@
iterator variant
iterator version
latch atomic
+latch cstddef
+latch cstdint
+latch cstring
+latch ctime
+latch iosfwd
latch limits
+latch ratio
+latch type_traits
latch version
limits type_traits
limits version
@@ -508,6 +495,7 @@
list version
locale atomic
locale cctype
+locale cerrno
locale concepts
locale cstdarg
locale cstddef
@@ -571,11 +559,13 @@
memory_resource tuple
memory_resource version
mutex atomic
+mutex cerrno
mutex concepts
mutex cstddef
mutex cstdint
mutex cstdlib
mutex cstring
+mutex ctime
mutex functional
mutex initializer_list
mutex iosfwd
@@ -583,6 +573,7 @@
mutex new
mutex ratio
mutex stdexcept
+mutex string
mutex system_error
mutex type_traits
mutex typeinfo
@@ -626,6 +617,7 @@
optional version
ostream atomic
ostream bitset
+ostream cerrno
ostream concepts
ostream cstddef
ostream cstdint
@@ -640,6 +632,7 @@
ostream new
ostream stdexcept
ostream streambuf
+ostream string
ostream type_traits
ostream typeinfo
ostream version
@@ -726,6 +719,8 @@
scoped_allocator version
semaphore atomic
semaphore cstddef
+semaphore cstdint
+semaphore cstring
semaphore ctime
semaphore iosfwd
semaphore limits
@@ -746,6 +741,16 @@
set tuple
set type_traits
set version
+shared_mutex cerrno
+shared_mutex cstddef
+shared_mutex ctime
+shared_mutex iosfwd
+shared_mutex limits
+shared_mutex ratio
+shared_mutex stdexcept
+shared_mutex string
+shared_mutex system_error
+shared_mutex type_traits
shared_mutex version
source_location cstdint
source_location version
@@ -833,6 +838,8 @@
system_error string
system_error type_traits
system_error version
+thread array
+thread cerrno
thread chrono
thread compare
thread cstddef
@@ -842,11 +849,16 @@
thread functional
thread iosfwd
thread limits
+thread locale
thread new
thread ratio
+thread stdexcept
+thread string
+thread string_view
thread system_error
thread tuple
thread type_traits
+thread vector
thread version
tuple compare
tuple cstddef
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx11.csv b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx11.csv
index 2f9ef7d..e54fe47 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx11.csv
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx11.csv
@@ -51,6 +51,7 @@
atomic compare
atomic cstddef
atomic cstdint
+atomic cstdlib
atomic cstring
atomic ctime
atomic iosfwd
@@ -73,6 +74,7 @@
barrier stdexcept
barrier type_traits
barrier variant
+barrier version
bit cstdint
bit cstdlib
bit iosfwd
@@ -105,11 +107,13 @@
charconv iosfwd
charconv limits
charconv type_traits
+chrono bit
chrono compare
chrono concepts
chrono cstddef
chrono cstdint
chrono cstdlib
+chrono cstring
chrono ctime
chrono limits
chrono ratio
@@ -154,17 +158,20 @@
concepts type_traits
concepts version
condition_variable atomic
+condition_variable cerrno
condition_variable concepts
condition_variable cstddef
condition_variable cstdint
condition_variable cstdlib
condition_variable cstring
+condition_variable ctime
condition_variable initializer_list
condition_variable iosfwd
condition_variable limits
condition_variable new
condition_variable ratio
condition_variable stdexcept
+condition_variable string
condition_variable system_error
condition_variable type_traits
condition_variable typeinfo
@@ -207,46 +214,13 @@
exception version
execution version
expected cstddef
-expected cstdlib
-expected exception
expected initializer_list
expected new
expected version
-experimental/algorithm algorithm
-experimental/algorithm cstddef
-experimental/algorithm type_traits
-experimental/coroutine atomic
-experimental/coroutine climits
-experimental/coroutine cmath
-experimental/coroutine compare
-experimental/coroutine concepts
-experimental/coroutine cstddef
-experimental/coroutine cstdint
-experimental/coroutine cstring
-experimental/coroutine ctime
-experimental/coroutine initializer_list
-experimental/coroutine iosfwd
-experimental/coroutine iterator
-experimental/coroutine limits
-experimental/coroutine memory
-experimental/coroutine new
-experimental/coroutine ratio
-experimental/coroutine stdexcept
-experimental/coroutine tuple
-experimental/coroutine type_traits
-experimental/coroutine typeinfo
-experimental/coroutine utility
-experimental/coroutine variant
experimental/deque deque
experimental/deque experimental/memory_resource
experimental/forward_list experimental/memory_resource
experimental/forward_list forward_list
-experimental/functional array
-experimental/functional cstddef
-experimental/functional functional
-experimental/functional type_traits
-experimental/functional unordered_map
-experimental/functional vector
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
@@ -325,7 +299,6 @@
ext/hash_set new
ext/hash_set string
ext/hash_set type_traits
-filesystem cerrno
filesystem compare
filesystem concepts
filesystem cstddef
@@ -344,12 +317,10 @@
filesystem type_traits
filesystem version
format array
-format bit
-format charconv
+format cmath
format cstddef
format cstdint
format cstdlib
-format cstring
format initializer_list
format limits
format locale
@@ -360,7 +331,6 @@
format string
format string_view
format tuple
-format type_traits
format vector
format version
forward_list algorithm
@@ -424,16 +394,26 @@
functional utility
functional vector
functional version
+future atomic
+future cerrno
future chrono
future cstddef
+future cstdint
+future cstdlib
+future cstring
future exception
+future initializer_list
+future iosfwd
future limits
future mutex
future new
future ratio
+future stdexcept
+future string
future system_error
future thread
future type_traits
+future typeinfo
future version
initializer_list cstddef
iomanip istream
@@ -483,7 +463,14 @@
iterator variant
iterator version
latch atomic
+latch cstddef
+latch cstdint
+latch cstring
+latch ctime
+latch iosfwd
latch limits
+latch ratio
+latch type_traits
latch version
limits type_traits
limits version
@@ -508,6 +495,7 @@
list version
locale atomic
locale cctype
+locale cerrno
locale concepts
locale cstdarg
locale cstddef
@@ -571,11 +559,13 @@
memory_resource tuple
memory_resource version
mutex atomic
+mutex cerrno
mutex concepts
mutex cstddef
mutex cstdint
mutex cstdlib
mutex cstring
+mutex ctime
mutex functional
mutex initializer_list
mutex iosfwd
@@ -583,6 +573,7 @@
mutex new
mutex ratio
mutex stdexcept
+mutex string
mutex system_error
mutex tuple
mutex type_traits
@@ -627,6 +618,7 @@
optional version
ostream atomic
ostream bitset
+ostream cerrno
ostream concepts
ostream cstddef
ostream cstdint
@@ -641,6 +633,7 @@
ostream new
ostream stdexcept
ostream streambuf
+ostream string
ostream type_traits
ostream typeinfo
ostream version
@@ -727,6 +720,8 @@
scoped_allocator version
semaphore atomic
semaphore cstddef
+semaphore cstdint
+semaphore cstring
semaphore ctime
semaphore iosfwd
semaphore limits
@@ -747,6 +742,16 @@
set tuple
set type_traits
set version
+shared_mutex cerrno
+shared_mutex cstddef
+shared_mutex ctime
+shared_mutex iosfwd
+shared_mutex limits
+shared_mutex ratio
+shared_mutex stdexcept
+shared_mutex string
+shared_mutex system_error
+shared_mutex type_traits
shared_mutex version
source_location cstdint
source_location version
@@ -834,6 +839,8 @@
system_error string
system_error type_traits
system_error version
+thread array
+thread cerrno
thread chrono
thread compare
thread cstddef
@@ -843,11 +850,16 @@
thread functional
thread iosfwd
thread limits
+thread locale
thread new
thread ratio
+thread stdexcept
+thread string
+thread string_view
thread system_error
thread tuple
thread type_traits
+thread vector
thread version
tuple compare
tuple cstddef
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx14.csv b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx14.csv
index 0d10e23..3de4afa 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx14.csv
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx14.csv
@@ -51,6 +51,7 @@
atomic compare
atomic cstddef
atomic cstdint
+atomic cstdlib
atomic cstring
atomic ctime
atomic iosfwd
@@ -73,6 +74,7 @@
barrier stdexcept
barrier type_traits
barrier variant
+barrier version
bit cstdint
bit cstdlib
bit iosfwd
@@ -105,11 +107,13 @@
charconv iosfwd
charconv limits
charconv type_traits
+chrono bit
chrono compare
chrono concepts
chrono cstddef
chrono cstdint
chrono cstdlib
+chrono cstring
chrono ctime
chrono limits
chrono ratio
@@ -154,17 +158,20 @@
concepts type_traits
concepts version
condition_variable atomic
+condition_variable cerrno
condition_variable concepts
condition_variable cstddef
condition_variable cstdint
condition_variable cstdlib
condition_variable cstring
+condition_variable ctime
condition_variable initializer_list
condition_variable iosfwd
condition_variable limits
condition_variable new
condition_variable ratio
condition_variable stdexcept
+condition_variable string
condition_variable system_error
condition_variable type_traits
condition_variable typeinfo
@@ -207,46 +214,13 @@
exception version
execution version
expected cstddef
-expected cstdlib
-expected exception
expected initializer_list
expected new
expected version
-experimental/algorithm algorithm
-experimental/algorithm cstddef
-experimental/algorithm type_traits
-experimental/coroutine atomic
-experimental/coroutine climits
-experimental/coroutine cmath
-experimental/coroutine compare
-experimental/coroutine concepts
-experimental/coroutine cstddef
-experimental/coroutine cstdint
-experimental/coroutine cstring
-experimental/coroutine ctime
-experimental/coroutine initializer_list
-experimental/coroutine iosfwd
-experimental/coroutine iterator
-experimental/coroutine limits
-experimental/coroutine memory
-experimental/coroutine new
-experimental/coroutine ratio
-experimental/coroutine stdexcept
-experimental/coroutine tuple
-experimental/coroutine type_traits
-experimental/coroutine typeinfo
-experimental/coroutine utility
-experimental/coroutine variant
experimental/deque deque
experimental/deque experimental/memory_resource
experimental/forward_list experimental/memory_resource
experimental/forward_list forward_list
-experimental/functional array
-experimental/functional cstddef
-experimental/functional functional
-experimental/functional type_traits
-experimental/functional unordered_map
-experimental/functional vector
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
@@ -327,7 +301,6 @@
ext/hash_set new
ext/hash_set string
ext/hash_set type_traits
-filesystem cerrno
filesystem compare
filesystem concepts
filesystem cstddef
@@ -346,12 +319,10 @@
filesystem type_traits
filesystem version
format array
-format bit
-format charconv
+format cmath
format cstddef
format cstdint
format cstdlib
-format cstring
format initializer_list
format limits
format locale
@@ -362,7 +333,6 @@
format string
format string_view
format tuple
-format type_traits
format vector
format version
forward_list algorithm
@@ -426,16 +396,26 @@
functional utility
functional vector
functional version
+future atomic
+future cerrno
future chrono
future cstddef
+future cstdint
+future cstdlib
+future cstring
future exception
+future initializer_list
+future iosfwd
future limits
future mutex
future new
future ratio
+future stdexcept
+future string
future system_error
future thread
future type_traits
+future typeinfo
future version
initializer_list cstddef
iomanip istream
@@ -485,7 +465,14 @@
iterator variant
iterator version
latch atomic
+latch cstddef
+latch cstdint
+latch cstring
+latch ctime
+latch iosfwd
latch limits
+latch ratio
+latch type_traits
latch version
limits type_traits
limits version
@@ -510,6 +497,7 @@
list version
locale atomic
locale cctype
+locale cerrno
locale concepts
locale cstdarg
locale cstddef
@@ -573,11 +561,13 @@
memory_resource tuple
memory_resource version
mutex atomic
+mutex cerrno
mutex concepts
mutex cstddef
mutex cstdint
mutex cstdlib
mutex cstring
+mutex ctime
mutex functional
mutex initializer_list
mutex iosfwd
@@ -585,6 +575,7 @@
mutex new
mutex ratio
mutex stdexcept
+mutex string
mutex system_error
mutex tuple
mutex type_traits
@@ -629,6 +620,7 @@
optional version
ostream atomic
ostream bitset
+ostream cerrno
ostream concepts
ostream cstddef
ostream cstdint
@@ -643,6 +635,7 @@
ostream new
ostream stdexcept
ostream streambuf
+ostream string
ostream type_traits
ostream typeinfo
ostream version
@@ -729,6 +722,8 @@
scoped_allocator version
semaphore atomic
semaphore cstddef
+semaphore cstdint
+semaphore cstring
semaphore ctime
semaphore iosfwd
semaphore limits
@@ -749,11 +744,14 @@
set tuple
set type_traits
set version
+shared_mutex cerrno
shared_mutex cstddef
shared_mutex ctime
shared_mutex iosfwd
shared_mutex limits
shared_mutex ratio
+shared_mutex stdexcept
+shared_mutex string
shared_mutex system_error
shared_mutex type_traits
shared_mutex version
@@ -843,6 +841,8 @@
system_error string
system_error type_traits
system_error version
+thread array
+thread cerrno
thread chrono
thread compare
thread cstddef
@@ -852,11 +852,16 @@
thread functional
thread iosfwd
thread limits
+thread locale
thread new
thread ratio
+thread stdexcept
+thread string
+thread string_view
thread system_error
thread tuple
thread type_traits
+thread vector
thread version
tuple compare
tuple cstddef
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx17.csv b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx17.csv
index 0d10e23..3de4afa 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx17.csv
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx17.csv
@@ -51,6 +51,7 @@
atomic compare
atomic cstddef
atomic cstdint
+atomic cstdlib
atomic cstring
atomic ctime
atomic iosfwd
@@ -73,6 +74,7 @@
barrier stdexcept
barrier type_traits
barrier variant
+barrier version
bit cstdint
bit cstdlib
bit iosfwd
@@ -105,11 +107,13 @@
charconv iosfwd
charconv limits
charconv type_traits
+chrono bit
chrono compare
chrono concepts
chrono cstddef
chrono cstdint
chrono cstdlib
+chrono cstring
chrono ctime
chrono limits
chrono ratio
@@ -154,17 +158,20 @@
concepts type_traits
concepts version
condition_variable atomic
+condition_variable cerrno
condition_variable concepts
condition_variable cstddef
condition_variable cstdint
condition_variable cstdlib
condition_variable cstring
+condition_variable ctime
condition_variable initializer_list
condition_variable iosfwd
condition_variable limits
condition_variable new
condition_variable ratio
condition_variable stdexcept
+condition_variable string
condition_variable system_error
condition_variable type_traits
condition_variable typeinfo
@@ -207,46 +214,13 @@
exception version
execution version
expected cstddef
-expected cstdlib
-expected exception
expected initializer_list
expected new
expected version
-experimental/algorithm algorithm
-experimental/algorithm cstddef
-experimental/algorithm type_traits
-experimental/coroutine atomic
-experimental/coroutine climits
-experimental/coroutine cmath
-experimental/coroutine compare
-experimental/coroutine concepts
-experimental/coroutine cstddef
-experimental/coroutine cstdint
-experimental/coroutine cstring
-experimental/coroutine ctime
-experimental/coroutine initializer_list
-experimental/coroutine iosfwd
-experimental/coroutine iterator
-experimental/coroutine limits
-experimental/coroutine memory
-experimental/coroutine new
-experimental/coroutine ratio
-experimental/coroutine stdexcept
-experimental/coroutine tuple
-experimental/coroutine type_traits
-experimental/coroutine typeinfo
-experimental/coroutine utility
-experimental/coroutine variant
experimental/deque deque
experimental/deque experimental/memory_resource
experimental/forward_list experimental/memory_resource
experimental/forward_list forward_list
-experimental/functional array
-experimental/functional cstddef
-experimental/functional functional
-experimental/functional type_traits
-experimental/functional unordered_map
-experimental/functional vector
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
@@ -327,7 +301,6 @@
ext/hash_set new
ext/hash_set string
ext/hash_set type_traits
-filesystem cerrno
filesystem compare
filesystem concepts
filesystem cstddef
@@ -346,12 +319,10 @@
filesystem type_traits
filesystem version
format array
-format bit
-format charconv
+format cmath
format cstddef
format cstdint
format cstdlib
-format cstring
format initializer_list
format limits
format locale
@@ -362,7 +333,6 @@
format string
format string_view
format tuple
-format type_traits
format vector
format version
forward_list algorithm
@@ -426,16 +396,26 @@
functional utility
functional vector
functional version
+future atomic
+future cerrno
future chrono
future cstddef
+future cstdint
+future cstdlib
+future cstring
future exception
+future initializer_list
+future iosfwd
future limits
future mutex
future new
future ratio
+future stdexcept
+future string
future system_error
future thread
future type_traits
+future typeinfo
future version
initializer_list cstddef
iomanip istream
@@ -485,7 +465,14 @@
iterator variant
iterator version
latch atomic
+latch cstddef
+latch cstdint
+latch cstring
+latch ctime
+latch iosfwd
latch limits
+latch ratio
+latch type_traits
latch version
limits type_traits
limits version
@@ -510,6 +497,7 @@
list version
locale atomic
locale cctype
+locale cerrno
locale concepts
locale cstdarg
locale cstddef
@@ -573,11 +561,13 @@
memory_resource tuple
memory_resource version
mutex atomic
+mutex cerrno
mutex concepts
mutex cstddef
mutex cstdint
mutex cstdlib
mutex cstring
+mutex ctime
mutex functional
mutex initializer_list
mutex iosfwd
@@ -585,6 +575,7 @@
mutex new
mutex ratio
mutex stdexcept
+mutex string
mutex system_error
mutex tuple
mutex type_traits
@@ -629,6 +620,7 @@
optional version
ostream atomic
ostream bitset
+ostream cerrno
ostream concepts
ostream cstddef
ostream cstdint
@@ -643,6 +635,7 @@
ostream new
ostream stdexcept
ostream streambuf
+ostream string
ostream type_traits
ostream typeinfo
ostream version
@@ -729,6 +722,8 @@
scoped_allocator version
semaphore atomic
semaphore cstddef
+semaphore cstdint
+semaphore cstring
semaphore ctime
semaphore iosfwd
semaphore limits
@@ -749,11 +744,14 @@
set tuple
set type_traits
set version
+shared_mutex cerrno
shared_mutex cstddef
shared_mutex ctime
shared_mutex iosfwd
shared_mutex limits
shared_mutex ratio
+shared_mutex stdexcept
+shared_mutex string
shared_mutex system_error
shared_mutex type_traits
shared_mutex version
@@ -843,6 +841,8 @@
system_error string
system_error type_traits
system_error version
+thread array
+thread cerrno
thread chrono
thread compare
thread cstddef
@@ -852,11 +852,16 @@
thread functional
thread iosfwd
thread limits
+thread locale
thread new
thread ratio
+thread stdexcept
+thread string
+thread string_view
thread system_error
thread tuple
thread type_traits
+thread vector
thread version
tuple compare
tuple cstddef
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx20.csv b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx20.csv
index 8f47b61..81a3b0c 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx20.csv
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx20.csv
@@ -49,6 +49,7 @@
atomic compare
atomic cstddef
atomic cstdint
+atomic cstdlib
atomic cstring
atomic ctime
atomic iosfwd
@@ -71,6 +72,7 @@
barrier stdexcept
barrier type_traits
barrier variant
+barrier version
bit cstdint
bit cstdlib
bit iosfwd
@@ -163,17 +165,20 @@
concepts type_traits
concepts version
condition_variable atomic
+condition_variable cerrno
condition_variable concepts
condition_variable cstddef
condition_variable cstdint
condition_variable cstdlib
condition_variable cstring
+condition_variable ctime
condition_variable initializer_list
condition_variable iosfwd
condition_variable limits
condition_variable new
condition_variable ratio
condition_variable stdexcept
+condition_variable string
condition_variable system_error
condition_variable type_traits
condition_variable typeinfo
@@ -216,46 +221,13 @@
exception version
execution version
expected cstddef
-expected cstdlib
-expected exception
expected initializer_list
expected new
expected version
-experimental/algorithm algorithm
-experimental/algorithm cstddef
-experimental/algorithm type_traits
-experimental/coroutine atomic
-experimental/coroutine climits
-experimental/coroutine cmath
-experimental/coroutine compare
-experimental/coroutine concepts
-experimental/coroutine cstddef
-experimental/coroutine cstdint
-experimental/coroutine cstring
-experimental/coroutine ctime
-experimental/coroutine initializer_list
-experimental/coroutine iosfwd
-experimental/coroutine iterator
-experimental/coroutine limits
-experimental/coroutine memory
-experimental/coroutine new
-experimental/coroutine ratio
-experimental/coroutine stdexcept
-experimental/coroutine tuple
-experimental/coroutine type_traits
-experimental/coroutine typeinfo
-experimental/coroutine utility
-experimental/coroutine variant
experimental/deque deque
experimental/deque experimental/memory_resource
experimental/forward_list experimental/memory_resource
experimental/forward_list forward_list
-experimental/functional array
-experimental/functional cstddef
-experimental/functional functional
-experimental/functional type_traits
-experimental/functional unordered_map
-experimental/functional vector
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
@@ -336,7 +308,6 @@
ext/hash_set new
ext/hash_set string
ext/hash_set type_traits
-filesystem cerrno
filesystem compare
filesystem concepts
filesystem cstddef
@@ -355,12 +326,10 @@
filesystem type_traits
filesystem version
format array
-format bit
-format charconv
+format cmath
format cstddef
format cstdint
format cstdlib
-format cstring
format initializer_list
format limits
format locale
@@ -371,7 +340,6 @@
format string
format string_view
format tuple
-format type_traits
format vector
format version
forward_list algorithm
@@ -435,15 +403,25 @@
functional utility
functional vector
functional version
+future atomic
+future cerrno
future cstddef
+future cstdint
+future cstdlib
+future cstring
future exception
+future initializer_list
+future iosfwd
future limits
future mutex
future new
future ratio
+future stdexcept
+future string
future system_error
future thread
future type_traits
+future typeinfo
future version
initializer_list cstddef
iomanip istream
@@ -493,7 +471,14 @@
iterator variant
iterator version
latch atomic
+latch cstddef
+latch cstdint
+latch cstring
+latch ctime
+latch iosfwd
latch limits
+latch ratio
+latch type_traits
latch version
limits type_traits
limits version
@@ -518,6 +503,7 @@
list version
locale atomic
locale cctype
+locale cerrno
locale concepts
locale cstdarg
locale cstddef
@@ -581,11 +567,13 @@
memory_resource tuple
memory_resource version
mutex atomic
+mutex cerrno
mutex concepts
mutex cstddef
mutex cstdint
mutex cstdlib
mutex cstring
+mutex ctime
mutex functional
mutex initializer_list
mutex iosfwd
@@ -593,6 +581,7 @@
mutex new
mutex ratio
mutex stdexcept
+mutex string
mutex system_error
mutex tuple
mutex type_traits
@@ -637,6 +626,7 @@
optional version
ostream atomic
ostream bitset
+ostream cerrno
ostream concepts
ostream cstddef
ostream cstdint
@@ -651,6 +641,7 @@
ostream new
ostream stdexcept
ostream streambuf
+ostream string
ostream type_traits
ostream typeinfo
ostream version
@@ -737,6 +728,8 @@
scoped_allocator version
semaphore atomic
semaphore cstddef
+semaphore cstdint
+semaphore cstring
semaphore ctime
semaphore iosfwd
semaphore limits
@@ -757,11 +750,14 @@
set tuple
set type_traits
set version
+shared_mutex cerrno
shared_mutex cstddef
shared_mutex ctime
shared_mutex iosfwd
shared_mutex limits
shared_mutex ratio
+shared_mutex stdexcept
+shared_mutex string
shared_mutex system_error
shared_mutex type_traits
shared_mutex version
@@ -851,19 +847,27 @@
system_error string
system_error type_traits
system_error version
+thread array
+thread cerrno
thread compare
thread cstddef
thread cstdint
+thread cstdlib
thread cstring
thread ctime
thread functional
thread iosfwd
thread limits
+thread locale
thread new
thread ratio
+thread stdexcept
+thread string
+thread string_view
thread system_error
thread tuple
thread type_traits
+thread vector
thread version
tuple compare
tuple cstddef
diff --git a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx2b.csv
index 23cc6d7..c444ff9 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx2b.csv
+++ b/third_party/llvm-project/libcxx/test/libcxx/transitive_includes/cxx2b.csv
@@ -1,43 +1,36 @@
-algorithm bit
algorithm climits
algorithm cstddef
algorithm cstdint
-algorithm cstdlib
algorithm cstring
algorithm initializer_list
algorithm iosfwd
algorithm limits
algorithm new
-algorithm type_traits
algorithm version
any cstddef
any cstdint
-any cstdlib
any cstring
any initializer_list
any limits
any new
any stdexcept
-any type_traits
any typeinfo
any version
array compare
array cstddef
-array cstdlib
array initializer_list
array limits
array stdexcept
-array type_traits
array version
atomic cstddef
atomic cstdint
+atomic cstdlib
atomic cstring
atomic ctime
atomic iosfwd
atomic limits
atomic ratio
atomic version
-barrier atomic
barrier cstddef
barrier cstdint
barrier cstring
@@ -46,14 +39,13 @@
barrier limits
barrier new
barrier ratio
+barrier version
bit cstdint
-bit cstdlib
bit limits
bit version
bitset climits
bitset cstddef
bitset cstdint
-bitset cstdlib
bitset cstring
bitset initializer_list
bitset iosfwd
@@ -61,27 +53,20 @@
bitset new
bitset stdexcept
bitset string
-bitset type_traits
bitset version
ccomplex complex
charconv cerrno
charconv cmath
charconv cstddef
charconv cstdint
-charconv cstdlib
-charconv cstring
charconv initializer_list
charconv limits
-charconv type_traits
chrono array
-chrono bit
-chrono charconv
chrono cmath
chrono compare
chrono cstddef
chrono cstdint
chrono cstdlib
-chrono cstring
chrono ctime
chrono initializer_list
chrono limits
@@ -94,7 +79,6 @@
chrono string
chrono string_view
chrono tuple
-chrono type_traits
chrono vector
chrono version
cinttypes cstdint
@@ -102,6 +86,7 @@
codecvt cctype
codecvt cstddef
codecvt cstdint
+codecvt cstdlib
codecvt cstring
codecvt mutex
codecvt string
@@ -115,22 +100,18 @@
complex iosfwd
complex sstream
complex stdexcept
-complex type_traits
complex version
concepts cstddef
concepts version
-condition_variable atomic
+condition_variable cerrno
condition_variable cstddef
-condition_variable cstdint
-condition_variable cstdlib
-condition_variable cstring
-condition_variable initializer_list
+condition_variable ctime
condition_variable iosfwd
condition_variable limits
condition_variable new
condition_variable ratio
condition_variable stdexcept
-condition_variable system_error
+condition_variable string
condition_variable typeinfo
condition_variable version
coroutine compare
@@ -147,44 +128,25 @@
deque compare
deque cstddef
deque cstdint
-deque cstdlib
deque cstring
deque initializer_list
deque limits
deque new
deque stdexcept
deque tuple
-deque type_traits
deque version
exception cstddef
exception cstdlib
exception version
execution version
expected cstddef
-expected cstdlib
-expected exception
expected initializer_list
expected new
expected version
-experimental/algorithm algorithm
-experimental/algorithm cstddef
-experimental/algorithm type_traits
-experimental/coroutine cstddef
-experimental/coroutine cstdint
-experimental/coroutine cstring
-experimental/coroutine limits
-experimental/coroutine new
-experimental/coroutine type_traits
experimental/deque deque
experimental/deque experimental/memory_resource
experimental/forward_list experimental/memory_resource
experimental/forward_list forward_list
-experimental/functional array
-experimental/functional cstddef
-experimental/functional functional
-experimental/functional type_traits
-experimental/functional unordered_map
-experimental/functional vector
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
@@ -193,15 +155,12 @@
experimental/map experimental/memory_resource
experimental/map map
experimental/memory_resource cstddef
-experimental/memory_resource cstdlib
experimental/memory_resource experimental/utility
experimental/memory_resource limits
experimental/memory_resource new
experimental/memory_resource stdexcept
experimental/memory_resource tuple
-experimental/memory_resource type_traits
experimental/propagate_const cstddef
-experimental/propagate_const type_traits
experimental/regex experimental/memory_resource
experimental/regex experimental/string
experimental/regex regex
@@ -232,7 +191,6 @@
ext/hash_map new
ext/hash_map stdexcept
ext/hash_map string
-ext/hash_map type_traits
ext/hash_set algorithm
ext/hash_set cmath
ext/hash_set cstddef
@@ -243,12 +201,9 @@
ext/hash_set limits
ext/hash_set new
ext/hash_set string
-ext/hash_set type_traits
-filesystem cerrno
filesystem compare
filesystem cstddef
filesystem cstdint
-filesystem cstdlib
filesystem ctime
filesystem iomanip
filesystem iosfwd
@@ -258,16 +213,12 @@
filesystem ratio
filesystem string
filesystem string_view
-filesystem system_error
-filesystem type_traits
filesystem version
format array
-format bit
-format charconv
+format cmath
format cstddef
format cstdint
format cstdlib
-format cstring
format initializer_list
format limits
format locale
@@ -278,20 +229,17 @@
format string
format string_view
format tuple
-format type_traits
format vector
format version
forward_list compare
forward_list cstddef
forward_list cstdint
-forward_list cstdlib
forward_list cstring
forward_list initializer_list
forward_list limits
forward_list new
forward_list stdexcept
forward_list tuple
-forward_list type_traits
forward_list version
fstream cctype
fstream cstddef
@@ -308,12 +256,9 @@
fstream typeinfo
fstream version
functional array
-functional atomic
functional cstddef
functional cstdint
-functional cstdlib
functional cstring
-functional exception
functional initializer_list
functional iosfwd
functional limits
@@ -321,32 +266,37 @@
functional new
functional stdexcept
functional tuple
-functional type_traits
functional typeinfo
functional unordered_map
functional vector
functional version
+future cerrno
future cstddef
-future exception
+future cstdint
+future cstdlib
+future cstring
+future initializer_list
+future iosfwd
future limits
future mutex
future new
future ratio
-future system_error
+future stdexcept
+future string
future thread
+future typeinfo
future version
initializer_list cstddef
iomanip istream
iomanip version
-ios atomic
ios cctype
ios cstddef
ios cstdint
+ios cstdlib
ios cstring
ios iosfwd
ios mutex
ios string
-ios system_error
ios version
iosfwd version
iostream ios
@@ -361,29 +311,32 @@
iterator compare
iterator concepts
iterator cstddef
-iterator cstdlib
iterator initializer_list
iterator iosfwd
iterator limits
iterator variant
iterator version
-latch atomic
+latch cstddef
+latch cstdint
+latch cstring
+latch ctime
+latch iosfwd
latch limits
+latch ratio
latch version
limits version
list compare
list cstddef
list cstdint
-list cstdlib
list cstring
list initializer_list
list limits
list new
list stdexcept
list tuple
-list type_traits
list version
locale cctype
+locale cerrno
locale cstddef
locale cstdint
locale cstdio
@@ -401,20 +354,16 @@
locale version
map compare
map cstddef
-map cstdlib
map initializer_list
map limits
map new
map optional
map stdexcept
map tuple
-map type_traits
map version
-memory atomic
memory compare
memory cstddef
memory cstdint
-memory cstdlib
memory cstring
memory initializer_list
memory iosfwd
@@ -432,24 +381,21 @@
memory_resource stdexcept
memory_resource tuple
memory_resource version
-mutex atomic
+mutex cerrno
mutex cstddef
mutex cstdint
-mutex cstdlib
-mutex cstring
-mutex initializer_list
+mutex ctime
mutex iosfwd
mutex limits
mutex new
mutex ratio
mutex stdexcept
-mutex system_error
+mutex string
mutex tuple
mutex typeinfo
mutex version
new cstddef
new cstdlib
-new exception
new version
numbers version
numeric cmath
@@ -464,13 +410,11 @@
optional limits
optional new
optional stdexcept
-optional type_traits
optional version
-ostream atomic
ostream bitset
+ostream cerrno
ostream cstddef
ostream cstdint
-ostream cstdlib
ostream cstring
ostream initializer_list
ostream ios
@@ -480,33 +424,28 @@
ostream new
ostream stdexcept
ostream streambuf
+ostream string
ostream typeinfo
ostream version
queue compare
queue cstddef
-queue cstdlib
queue deque
queue initializer_list
queue limits
-queue type_traits
queue vector
queue version
-random bit
random cmath
random cstddef
random cstdint
-random cstdlib
random initializer_list
random iosfwd
random limits
random numeric
random string
-random type_traits
random vector
random version
ranges compare
ranges cstddef
-ranges cstdlib
ranges initializer_list
ranges iosfwd
ranges iterator
@@ -515,7 +454,6 @@
ranges optional
ranges span
ranges tuple
-ranges type_traits
ranges variant
ranges version
ratio climits
@@ -533,7 +471,6 @@
regex mutex
regex stdexcept
regex string
-regex type_traits
regex vector
regex version
scoped_allocator cstddef
@@ -541,8 +478,9 @@
scoped_allocator new
scoped_allocator tuple
scoped_allocator version
-semaphore atomic
semaphore cstddef
+semaphore cstdint
+semaphore cstring
semaphore ctime
semaphore iosfwd
semaphore limits
@@ -550,21 +488,21 @@
semaphore version
set compare
set cstddef
-set cstdlib
set initializer_list
set limits
set new
set optional
set stdexcept
set tuple
-set type_traits
set version
+shared_mutex cerrno
shared_mutex cstddef
shared_mutex ctime
shared_mutex iosfwd
shared_mutex limits
shared_mutex ratio
-shared_mutex system_error
+shared_mutex stdexcept
+shared_mutex string
shared_mutex version
source_location cstdint
source_location version
@@ -572,7 +510,6 @@
span cstddef
span initializer_list
span limits
-span type_traits
span version
sstream cstddef
sstream istream
@@ -583,10 +520,7 @@
stack cstddef
stack deque
stack initializer_list
-stack type_traits
stack version
-stdexcept cstdlib
-stdexcept exception
stdexcept iosfwd
streambuf cstdint
streambuf ios
@@ -597,7 +531,6 @@
string cstddef
string cstdint
string cstdio
-string cstdlib
string cstring
string cwchar
string initializer_list
@@ -607,20 +540,17 @@
string stdexcept
string string_view
string tuple
-string type_traits
string version
string_view compare
string_view cstddef
string_view cstdint
string_view cstdio
-string_view cstdlib
string_view cstring
string_view cwchar
string_view initializer_list
string_view iosfwd
string_view limits
string_view stdexcept
-string_view type_traits
string_view version
strstream istream
strstream ostream
@@ -628,25 +558,25 @@
system_error cerrno
system_error compare
system_error cstddef
-system_error cstdint
-system_error cstring
-system_error limits
system_error stdexcept
system_error string
-system_error type_traits
system_error version
+thread array
+thread cerrno
thread compare
thread cstddef
thread cstdint
-thread cstring
+thread cstdlib
thread ctime
thread iosfwd
thread limits
-thread new
+thread locale
thread ratio
-thread system_error
+thread stdexcept
+thread string
+thread string_view
thread tuple
-thread type_traits
+thread vector
thread version
tuple compare
tuple cstddef
@@ -659,14 +589,10 @@
typeindex version
typeinfo cstddef
typeinfo cstdint
-typeinfo cstdlib
-typeinfo exception
-typeinfo type_traits
unordered_map cmath
unordered_map compare
unordered_map cstddef
unordered_map cstdint
-unordered_map cstdlib
unordered_map cstring
unordered_map initializer_list
unordered_map limits
@@ -674,13 +600,11 @@
unordered_map optional
unordered_map stdexcept
unordered_map tuple
-unordered_map type_traits
unordered_map version
unordered_set cmath
unordered_set compare
unordered_set cstddef
unordered_set cstdint
-unordered_set cstdlib
unordered_set cstring
unordered_set initializer_list
unordered_set limits
@@ -688,7 +612,6 @@
unordered_set optional
unordered_set stdexcept
unordered_set tuple
-unordered_set type_traits
unordered_set version
utility compare
utility cstddef
@@ -697,18 +620,16 @@
utility version
valarray cmath
valarray cstddef
-valarray cstdlib
+valarray cstdint
valarray initializer_list
valarray limits
valarray new
valarray stdexcept
-valarray type_traits
valarray version
variant compare
variant cstddef
variant cstdint
variant cstring
-variant exception
variant initializer_list
variant limits
variant new
@@ -718,7 +639,6 @@
vector compare
vector cstddef
vector cstdint
-vector cstdlib
vector cstring
vector initializer_list
vector iosfwd
@@ -726,5 +646,4 @@
vector new
vector stdexcept
vector tuple
-vector type_traits
vector version
diff --git a/third_party/llvm-project/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
index 2972191..f1036b3 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
@@ -94,12 +94,12 @@
#endif
check_integral_types<char16_t, int>();
// On some platforms, unsigned int and long are the same size. These
- // platforms have a choice of making uint32_t an int or a long. However
+ // platforms have a choice of making std::uint32_t an int or a long. However
// char32_t must promote to an unsigned int on these platforms [conv.prom].
// Use the following logic to make the test work on such platforms.
- // (sizeof(uint32_t) == sizeof(unsigned int)) ? unsigned int : uint32_t;
- typedef std::conditional<sizeof(uint32_t) == sizeof(unsigned int),
- unsigned int, uint32_t>::type char_integral;
+ // (sizeof(std::uint32_t) == sizeof(unsigned int)) ? unsigned int : std::uint32_t;
+ typedef std::conditional<sizeof(std::uint32_t) == sizeof(unsigned int),
+ unsigned int, std::uint32_t>::type char_integral;
check_integral_types<char32_t, char_integral>();
check_integral_types<short, int>();
check_integral_types<unsigned short, int>();
diff --git a/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_always_bitcastable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_always_bitcastable.compile.pass.cpp
index 4e78fa1..9bbb85f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_always_bitcastable.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_always_bitcastable.compile.pass.cpp
@@ -52,8 +52,8 @@
template <bool Expected, class Types1, class Types2 = Types1>
constexpr void check() {
- meta::for_each(Types1{}, []<class T>() {
- meta::for_each(Types2{}, []<class U>() {
+ types::for_each(Types1{}, []<class T>() {
+ types::for_each(Types2{}, []<class U>() {
check_with_cv<Expected, T, U>();
});
});
@@ -71,91 +71,91 @@
// Bit-castable arithmetic types.
// 8-bit types.
- using integral_8 = meta::type_list<char8_t, int8_t, uint8_t>;
- using chars = meta::type_list<char, unsigned char, signed char>;
+ using integral_8 = types::type_list<char8_t, std::int8_t, std::uint8_t>;
+ using chars = types::type_list<char, unsigned char, signed char>;
#if CHAR_BIT == 8
- check<true, meta::concatenate_t<integral_8, chars>>();
+ check<true, types::concatenate_t<integral_8, chars>>();
#else
check<true, integral_8>();
check<true, chars>();
#endif
// 16-bit types.
- using integral_16 = meta::type_list<char16_t, int16_t, uint16_t>;
+ using integral_16 = types::type_list<char16_t, std::int16_t, std::uint16_t>;
#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && __WCHAR_WIDTH__ == 16
- check<true, meta::concatenate_t<integral_16, meta::type_list<wchar_t>>>();
+ check<true, types::concatenate_t<integral_16, types::type_list<wchar_t>>>();
#else
check<true, integral_16>();
#endif
// 32-bit types.
- using integral_32 = meta::type_list<char32_t, int32_t, uint32_t>;
+ using integral_32 = types::type_list<char32_t, std::int32_t, std::uint32_t>;
#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && __WCHAR_WIDTH__ == 32
- check<true, meta::concatenate_t<integral_32, meta::type_list<wchar_t>>>();
+ check<true, types::concatenate_t<integral_32, types::type_list<wchar_t>>>();
#else
check<true, integral_32>();
#endif
// 64-bit types.
- using integral_64 = meta::type_list<int64_t, uint64_t>;
+ using integral_64 = types::type_list<std::int64_t, std::uint64_t>;
check<true, integral_64>();
// 128-bit types.
#ifndef TEST_HAS_NO_INT128
- check<true, meta::type_list<__int128_t, __uint128_t>>();
+ check<true, types::type_list<__int128_t, __uint128_t>>();
#endif
// Bool.
- check<true, meta::type_list<bool>, meta::concatenate_t<meta::type_list<bool>, integral_8>>();
+ check<true, types::type_list<bool>, types::concatenate_t<types::type_list<bool>, integral_8>>();
// Non-bit-castable arithmetic types.
// Floating-point.
- check_both_ways<false, meta::floating_point_types, meta::integral_types>();
- check_both_ways<false, meta::type_list<float>, meta::type_list<double, long double>>();
- check_both_ways<false, meta::type_list<double>, meta::type_list<float, long double>>();
- check_both_ways<false, meta::type_list<long double>, meta::type_list<float, double>>();
+ check_both_ways<false, types::floating_point_types, types::integral_types>();
+ check_both_ways<false, types::type_list<float>, types::type_list<double, long double>>();
+ check_both_ways<false, types::type_list<double>, types::type_list<float, long double>>();
+ check_both_ways<false, types::type_list<long double>, types::type_list<float, double>>();
// Different sizes.
- check_both_ways<false, integral_8, meta::concatenate_t<integral_16, integral_32, integral_64>>();
- check_both_ways<false, integral_16, meta::concatenate_t<integral_8, integral_32, integral_64>>();
- check_both_ways<false, integral_32, meta::concatenate_t<integral_8, integral_16, integral_64>>();
- check_both_ways<false, integral_64, meta::concatenate_t<integral_8, integral_16, integral_32>>();
+ check_both_ways<false, integral_8, types::concatenate_t<integral_16, integral_32, integral_64>>();
+ check_both_ways<false, integral_16, types::concatenate_t<integral_8, integral_32, integral_64>>();
+ check_both_ways<false, integral_32, types::concatenate_t<integral_8, integral_16, integral_64>>();
+ check_both_ways<false, integral_64, types::concatenate_t<integral_8, integral_16, integral_32>>();
// Different representations -- can convert from bool to other integral types, but not vice versa.
- check<true, meta::type_list<bool>, integral_8>();
- using larger_than_bool = meta::concatenate_t<
+ check<true, types::type_list<bool>, integral_8>();
+ using larger_than_bool = types::concatenate_t<
integral_16,
integral_32,
integral_64,
- meta::floating_point_types>;
- check<false, meta::type_list<bool>, larger_than_bool>();
- check<false, meta::concatenate_t<integral_8, larger_than_bool>, meta::type_list<bool>>();
+ types::floating_point_types>;
+ check<false, types::type_list<bool>, larger_than_bool>();
+ check<false, types::concatenate_t<integral_8, larger_than_bool>, types::type_list<bool>>();
// Different representations -- floating point vs. integral.
- check_both_ways<false, meta::floating_point_types, meta::integral_types>();
+ check_both_ways<false, types::floating_point_types, types::integral_types>();
}
// Enumerations.
{
enum E1 { Value1 };
enum E2 { Value2 };
- check<true, meta::type_list<E1>>();
- check_both_ways<false, meta::type_list<E1>, meta::type_list<E2>>();
+ check<true, types::type_list<E1>>();
+ check_both_ways<false, types::type_list<E1>, types::type_list<E2>>();
enum class ScopedE1 { Value1 };
enum class ScopedE2 { Value1 };
- check<true, meta::type_list<ScopedE1>>();
- check_both_ways<false, meta::type_list<ScopedE1>, meta::type_list<ScopedE2>>();
+ check<true, types::type_list<ScopedE1>>();
+ check_both_ways<false, types::type_list<ScopedE1>, types::type_list<ScopedE2>>();
}
// Pointers.
{
- check<true, meta::type_list<int*>>();
- check_both_ways<false, meta::type_list<int*>, meta::type_list<const int*, long*, void*>>();
+ check<true, types::type_list<int*>>();
+ check_both_ways<false, types::type_list<int*>, types::type_list<const int*, long*, void*>>();
- check<true, meta::type_list<FuncPtr1>>();
- check_both_ways<false, meta::type_list<FuncPtr1>, meta::type_list<FuncPtr2>>();
+ check<true, types::type_list<FuncPtr1>>();
+ check_both_ways<false, types::type_list<FuncPtr1>, types::type_list<FuncPtr2>>();
}
// Pointers to members.
@@ -171,49 +171,49 @@
using MemFuncPtr1 = decltype(&S::MemFunc1);
using MemFuncPtr2 = decltype(&S::MemFunc2);
- check<true, meta::type_list<MemObjPtr1>>();
- check<true, meta::type_list<MemFuncPtr1>>();
- check_both_ways<false, meta::type_list<MemObjPtr1>, meta::type_list<MemObjPtr2>>();
- check_both_ways<false, meta::type_list<MemFuncPtr1>, meta::type_list<MemFuncPtr2>>();
+ check<true, types::type_list<MemObjPtr1>>();
+ check<true, types::type_list<MemFuncPtr1>>();
+ check_both_ways<false, types::type_list<MemObjPtr1>, types::type_list<MemObjPtr2>>();
+ check_both_ways<false, types::type_list<MemFuncPtr1>, types::type_list<MemFuncPtr2>>();
}
// Trivial classes.
{
struct S1 {};
- check<true, meta::type_list<S1>>();
+ check<true, types::type_list<S1>>();
struct S2 {};
- check_both_ways<false, meta::type_list<S1>, meta::type_list<S2>>();
+ check_both_ways<false, types::type_list<S1>, types::type_list<S2>>();
// Having a `volatile` member doesn't prevent a class type from being considered trivially copyable. This is
// unfortunate behavior but it is consistent with the Standard.
struct VolatileMembersS {
volatile int x;
};
- check<true, meta::type_list<VolatileMembersS>>();
+ check<true, types::type_list<VolatileMembersS>>();
}
// Trivial unions.
{
union U1 {};
- check<true, meta::type_list<U1>>();
+ check<true, types::type_list<U1>>();
union U2 {};
- check_both_ways<false, meta::type_list<U1>, meta::type_list<U2>>();
+ check_both_ways<false, types::type_list<U1>, types::type_list<U2>>();
union VolatileMembersU {
volatile int x;
};
- check<true, meta::type_list<VolatileMembersU>>();
+ check<true, types::type_list<VolatileMembersU>>();
}
// References are not objects, and thus are not bit-castable.
{
- check_both_ways<false, meta::type_list<int&>, meta::type_list<int&>>();
+ check_both_ways<false, types::type_list<int&>, types::type_list<int&>>();
}
// Arrays.
{
- check<true, meta::type_list<int[8]>>();
+ check<true, types::type_list<int[8]>>();
}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp b/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
index 0dbdbf5..2fd1176 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
@@ -19,4 +19,4 @@
#include <utility>
// expected-error@+1 {{template template argument has different template parameters than its corresponding template template parameter}}
-static_assert(!std::__is_specialization_v<std::pair<int, size_t>, std::array>);
+static_assert(!std::__is_specialization_v<std::pair<int, std::size_t>, std::array>);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
new file mode 100644
index 0000000..6473c003
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// ADDITIONAL_COMPILE_FLAGS: -Wno-private-header
+
+#include <__type_traits/is_equality_comparable.h>
+
+enum Enum : int {};
+enum class EnumClass : int {};
+
+static_assert(std::__libcpp_is_trivially_equality_comparable<int, int>::value, "");
+static_assert(std::__libcpp_is_trivially_equality_comparable<const int, int>::value, "");
+static_assert(std::__libcpp_is_trivially_equality_comparable<int, const int>::value, "");
+
+static_assert(std::__libcpp_is_trivially_equality_comparable<unsigned int, unsigned int>::value, "");
+static_assert(std::__libcpp_is_trivially_equality_comparable<const unsigned int, unsigned int>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<unsigned int, int>::value, "");
+
+static_assert(!std::__libcpp_is_trivially_equality_comparable<long, int>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<int, long>::value, "");
+
+static_assert(std::__libcpp_is_trivially_equality_comparable<int*, int*>::value, "");
+static_assert(std::__libcpp_is_trivially_equality_comparable<int*, void*>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<int*, long*>::value, "");
+
+static_assert(!std::__libcpp_is_trivially_equality_comparable<Enum, int>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<EnumClass, int>::value, "");
+
+static_assert(!std::__libcpp_is_trivially_equality_comparable<float, int>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<double, long long>::value, "");
+
+static_assert(!std::__libcpp_is_trivially_equality_comparable<float, int>::value, "");
+
+static_assert(!std::__libcpp_is_trivially_equality_comparable<float, float>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<double, double>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<long double, long double>::value, "");
+
+struct S {
+ char c;
+};
+
+struct S2 {
+ char c;
+};
+
+struct VirtualBase : virtual S {};
+struct NonVirtualBase : S, S2 {};
+
+static_assert(!std::__libcpp_is_trivially_equality_comparable<S*, VirtualBase*>::value, "");
+static_assert(!std::__libcpp_is_trivially_equality_comparable<S2*, VirtualBase*>::value, "");
+
+// This is trivially_equality_comparable, but we can't detect it currently
+static_assert(!std::__libcpp_is_trivially_equality_comparable<S*, NonVirtualBase*>::value, "");
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp
index 5c9cc38..c8dad0a 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -fno-exceptions -D_LIBCPP_ENABLE_ASSERTIONS
// ADDITIONAL_COMPILE_FLAGS: -Wno-private-header
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.no_exceptions.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.no_exceptions.pass.cpp
index 0b6233e..d844f3c 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.no_exceptions.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.no_exceptions.pass.cpp
@@ -16,4 +16,6 @@
auto guard = std::__make_exception_guard([] {});
auto guard2 = std::move(guard);
guard2.__complete();
+
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp
new file mode 100644
index 0000000..cfdda9a
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// This test relies on `typeid` and thus requires `-frtti`.
+// UNSUPPORTED: no-rtti
+
+// Make sure that we don't get ODR violations with __exception_guard when
+// linking together TUs compiled with different values of -f[no-]exceptions.
+
+// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.except.o -O1 -Wno-private-header -fexceptions
+// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.noexcept.o -O1 -Wno-private-header -fno-exceptions
+// RUN: %{cxx} %{flags} %{link_flags} -o %t.exe %t.except.o %t.noexcept.o
+// RUN: %{run}
+
+#include <__utility/exception_guard.h>
+#include <cassert>
+#include <cstring>
+#include <typeinfo>
+
+struct Rollback {
+ void operator()() {}
+};
+
+#if defined(__cpp_exceptions) && __cpp_exceptions >= 199711L
+
+const char* func();
+
+int main(int, char**) {
+ assert(std::strcmp(typeid(std::__exception_guard<Rollback>).name(), func()) != 0);
+
+ return 0;
+}
+
+#else
+
+const char* func() { return typeid(std::__exception_guard<Rollback>).name(); }
+
+#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp
index 82fb35a..3dd1ed6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// constexpr const T* operator->() const noexcept;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp
index d1ab321..04f1a7d 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// constexpr const T& operator*() const & noexcept;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp
index 814b47d..274e207 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// constexpr const E& error() const & noexcept;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp
index d75f15d..90757f3 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// constexpr void operator*() const noexcept;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp
index 1e20cc5..211635d 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// constexpr const E& error() const & noexcept;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp
index 7f21f13..2775539 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp
@@ -18,21 +18,21 @@
#include "test_macros.h"
-static_assert(std::is_same_v<std::underlying_type_t<std::__format::__arg_t>, uint8_t>);
+static_assert(std::is_same_v<std::underlying_type_t<std::__format::__arg_t>, std::uint8_t>);
-static_assert(uint8_t(std::__format::__arg_t::__none) == 0);
-static_assert(uint8_t(std::__format::__arg_t::__boolean) == 1);
-static_assert(uint8_t(std::__format::__arg_t::__char_type) == 2);
-static_assert(uint8_t(std::__format::__arg_t::__int) == 3);
-static_assert(uint8_t(std::__format::__arg_t::__long_long) == 4);
-static_assert(uint8_t(std::__format::__arg_t::__i128) == 5);
-static_assert(uint8_t(std::__format::__arg_t::__unsigned) == 6);
-static_assert(uint8_t(std::__format::__arg_t::__unsigned_long_long) == 7);
-static_assert(uint8_t(std::__format::__arg_t::__u128) == 8);
-static_assert(uint8_t(std::__format::__arg_t::__float) == 9);
-static_assert(uint8_t(std::__format::__arg_t::__double) == 10);
-static_assert(uint8_t(std::__format::__arg_t::__long_double) == 11);
-static_assert(uint8_t(std::__format::__arg_t::__const_char_type_ptr) == 12);
-static_assert(uint8_t(std::__format::__arg_t::__string_view) == 13);
-static_assert(uint8_t(std::__format::__arg_t::__ptr) == 14);
-static_assert(uint8_t(std::__format::__arg_t::__handle) == 15);
+static_assert(std::uint8_t(std::__format::__arg_t::__none) == 0);
+static_assert(std::uint8_t(std::__format::__arg_t::__boolean) == 1);
+static_assert(std::uint8_t(std::__format::__arg_t::__char_type) == 2);
+static_assert(std::uint8_t(std::__format::__arg_t::__int) == 3);
+static_assert(std::uint8_t(std::__format::__arg_t::__long_long) == 4);
+static_assert(std::uint8_t(std::__format::__arg_t::__i128) == 5);
+static_assert(std::uint8_t(std::__format::__arg_t::__unsigned) == 6);
+static_assert(std::uint8_t(std::__format::__arg_t::__unsigned_long_long) == 7);
+static_assert(std::uint8_t(std::__format::__arg_t::__u128) == 8);
+static_assert(std::uint8_t(std::__format::__arg_t::__float) == 9);
+static_assert(std::uint8_t(std::__format::__arg_t::__double) == 10);
+static_assert(std::uint8_t(std::__format::__arg_t::__long_double) == 11);
+static_assert(std::uint8_t(std::__format::__arg_t::__const_char_type_ptr) == 12);
+static_assert(std::uint8_t(std::__format::__arg_t::__string_view) == 13);
+static_assert(std::uint8_t(std::__format::__arg_t::__ptr) == 14);
+static_assert(std::uint8_t(std::__format::__arg_t::__handle) == 15);
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.formatter/format.context/types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.formatter/format.context/types.compile.pass.cpp
index 159ad5b..63c25b6 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.formatter/format.context/types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.formatter/format.context/types.compile.pass.cpp
@@ -24,6 +24,7 @@
// using wformat_context = basic_format_context<unspecified, wchar_t>;
#include <format>
+#include <iterator>
#include <string_view>
#include <type_traits>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
index f281222..204dcac 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
// WARNING, this entire header is generated by
-// utiles/generate_extended_grapheme_cluster_test.py
+// utils/generate_extended_grapheme_cluster_test.py
// DO NOT MODIFY!
// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
@@ -78,7 +78,7 @@
/// The offset of the last code units of the extended grapheme clusters in the input.
///
/// The vector has the same number of entries as \ref code_points.
- std::vector<size_t> breaks;
+ std::vector<std::size_t> breaks;
};
/// The data for UTF-8.
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
index 0592c08..512d278 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
@@ -62,11 +62,11 @@
for (const auto& d : data) {
assert(d.code_points.size() == d.breaks.size());
- std::__unicode::__extended_grapheme_cluster_view view{d.input.data(), d.input.data() + d.input.size()};
- for (size_t i = 0; i < d.breaks.size(); ++i) {
+ std::__unicode::__extended_grapheme_cluster_view view{d.input.begin(), d.input.end()};
+ for (std::size_t i = 0; i < d.breaks.size(); ++i) {
auto r = view.__consume();
assert(r.__code_point_ == d.code_points[i]);
- assert(r.__last_ == d.input.data() + d.breaks[i]);
+ assert(r.__last_ == d.input.begin() + d.breaks[i]);
}
}
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
index 4c1be77..f4fa839 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
@@ -17,6 +17,3 @@
#ifndef _LIBCPP_VERSION
# error _LIBCPP_VERSION not defined
#endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp
deleted file mode 100644
index 11384d8..0000000
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: clang || apple-clang
-// XFAIL: *
-
-// This tests is meant to demonstrate an existing ABI bug between the
-// C++03 and C++11 implementations of std::function. It is not a real test.
-
-// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags} -std=c++03 -g
-// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags} -g -std=c++11
-// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags} -g
-// RUN: %{run}
-
-#include <functional>
-#include <cassert>
-
-typedef std::function<void(int)> Func;
-
-Func CreateFunc();
-
-#ifndef WITH_MAIN
-// In C++03, the functions call operator, which is a part of the vtable,
-// is defined as 'void operator()(int)', but in C++11 it's
-// void operator()(int&&)'. So when the C++03 version is passed to C++11 code
-// the value of the integer is interpreted as its address.
-void test(int x) {
- assert(x == 42);
-}
-Func CreateFunc() {
- Func f(&test);
- return f;
-}
-#else
-int main(int, char**) {
- Func f = CreateFunc();
- f(42);
- return 0;
-}
-#endif
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
index 1f29528..11f0724 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
@@ -17,8 +17,8 @@
#include "test_macros.h"
-typedef std::__murmur2_or_cityhash<uint32_t> Hash32;
-typedef std::__murmur2_or_cityhash<uint64_t> Hash64;
+typedef std::__murmur2_or_cityhash<std::uint32_t> Hash32;
+typedef std::__murmur2_or_cityhash<std::uint64_t> Hash64;
void test(const void* key, int len) {
for (int i=1; i <= len; ++i) {
@@ -35,8 +35,8 @@
"00000000000000000000000000000000000000000000000000000000000000000000000",
"1237546895+54+4554985416849484213464984765465464654564565645645646546456546546"
};
- const size_t NumCases = sizeof(TestCases)/sizeof(TestCases[0]);
- for (size_t i=0; i < NumCases; ++i)
+ const std::size_t NumCases = sizeof(TestCases)/sizeof(TestCases[0]);
+ for (std::size_t i=0; i < NumCases; ++i)
test(TestCases[i].data(), TestCases[i].length());
return 0;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
index 77d7ddc..9934527 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
@@ -19,7 +19,7 @@
constexpr bool test() {
int count = 0;
- std::__for_each_index_sequence(std::make_index_sequence<8>(), [&]<size_t _Index> { count += _Index; });
+ std::__for_each_index_sequence(std::make_index_sequence<8>(), [&]<std::size_t _Index> { count += _Index; });
assert(count == 28);
return true;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
index 6fdd023..58b9db4 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
@@ -42,7 +42,7 @@
#include "test_macros.h"
#include "template_cost_testing.h"
-template <size_t Idx>
+template <std::size_t Idx>
struct TestType {};
template <class T>
@@ -54,7 +54,7 @@
struct OverloadBase { void operator()() const; };
-template <class Tp, size_t Idx>
+template <class Tp, std::size_t Idx>
struct Overload {
auto operator()(Tp, Tp) const -> ID<Tp>;
};
@@ -65,7 +65,7 @@
template <class IdxSeq>
struct MakeOverloads;
-template <size_t ..._Idx>
+template <std::size_t ..._Idx>
struct MakeOverloads<std::__tuple_indices<_Idx...> > {
template <class ...Types>
using Apply = AllOverloads<Overload<Types, _Idx>...>;
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
index 068b2e7..0bca838 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
@@ -15,7 +15,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <optional>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
index dc3eda8..f0c2cf1 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
@@ -13,7 +13,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <optional>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.abi-v1.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.abi-v1.pass.cpp
new file mode 100644
index 0000000..cdaaaca
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.abi-v1.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// Test that the CityHash implementation returns the results we expect.
+//
+// Note that this implementation is technically incorrect, however changing it is
+// an ABI break. This test ensures that we don't unintentionally break the ABI v1
+// by "fixing" the hash implementation.
+// REQUIRES: libcpp-abi-version=1
+
+#include <cassert>
+#include <string>
+#include <utility>
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define CHOOSE_BY_ENDIANESS(little, big) (little)
+#else
+# define CHOOSE_BY_ENDIANESS(little, big) (big)
+#endif
+
+std::string CityHash[] = {
+ {/* "abcdefgh" */ "\x61\x62\x63\x64\x65\x66\x67\x68"},
+ {/* "abcDefgh" */ "\x61\x62\x63\x44\x65\x66\x67\x68"},
+ {/* "CityHash" */ "\x43\x69\x74\x79\x48\x61\x73\x68"},
+ {/* "CitYHash" */ "\x43\x69\x74\x59\x48\x61\x73\x68"},
+};
+
+int main(int, char**) {
+ const std::pair<std::string, std::uint64_t> TestCases[] = {
+ {CityHash[0], CHOOSE_BY_ENDIANESS(0x87c69099911bab7eULL, 0x297621d7fa436a3ULL)},
+ {CityHash[1], CHOOSE_BY_ENDIANESS(0x87c69099911bab7eULL, 0xb17be531dde56e57ULL)},
+ {CityHash[2], CHOOSE_BY_ENDIANESS(0x85322632e188694aULL, 0xe14f578b688e266dULL)},
+ {CityHash[3], CHOOSE_BY_ENDIANESS(0x85322632e188694aULL, 0xca5a764a0450eac6ULL)},
+ };
+
+ std::__murmur2_or_cityhash<std::uint64_t> h64;
+ for (const auto& test_case : TestCases) {
+ assert(h64(test_case.first.data(), test_case.first.size()) == test_case.second);
+ }
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.abi-v2.pass.cpp
similarity index 82%
rename from third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
rename to third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.abi-v2.pass.cpp
index e2905a4..25c0b9f 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.abi-v2.pass.cpp
@@ -6,10 +6,14 @@
//
//===----------------------------------------------------------------------===//
-// Test the CityHash implementation is correct.
-
// UNSUPPORTED: c++03
+// Test that the CityHash implementation is correct.
+//
+// In ABI v1, our CityHash implementation is incorrect and fixing it would
+// be an ABI break.
+// REQUIRES: libcpp-abi-version=2
+
#include <cassert>
#include <string>
#include <utility>
@@ -28,14 +32,14 @@
};
int main(int, char**) {
- const std::pair<std::string, uint64_t> TestCases[] = {
+ const std::pair<std::string, std::uint64_t> TestCases[] = {
{CityHash[0], CHOOSE_BY_ENDIANESS(0x4382a8d0fe8edb17ULL, 0xca84e809bef16fbcULL)},
{CityHash[1], CHOOSE_BY_ENDIANESS(0xecefb080a6854061ULL, 0xd7feb824250272dcULL)},
{CityHash[2], CHOOSE_BY_ENDIANESS(0x169ea3aebf908d6dULL, 0xea8cef3ca6f6e368ULL)},
{CityHash[3], CHOOSE_BY_ENDIANESS(0xe18298a2760f09faULL, 0xf33a7700bb7a94a8ULL)},
};
- std::__murmur2_or_cityhash<uint64_t> h64;
+ std::__murmur2_or_cityhash<std::uint64_t> h64;
for (const auto& test_case : TestCases) {
assert(h64(test_case.first.data(), test_case.first.size()) == test_case.second);
}
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
index 28884a9..3d260ba 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
index a997435..ffebab0 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
index 4b9160c..dba79a2 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
index 84f11f1..c1d612e 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
index 4e2d787..a2dc58b 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
@@ -22,13 +22,13 @@
template <class Sequence>
struct make_variant_imp;
-template <size_t ...Indices>
-struct make_variant_imp<std::integer_sequence<size_t, Indices...>> {
- template <size_t> using AlwaysChar = char;
+template <std::size_t ...Indices>
+struct make_variant_imp<std::integer_sequence<std::size_t, Indices...>> {
+ template <std::size_t> using AlwaysChar = char;
using type = std::variant<AlwaysChar<Indices>...>;
};
-template <size_t N>
+template <std::size_t N>
using make_variant_t = typename make_variant_imp<std::make_index_sequence<N>>::type;
constexpr bool ExpectEqual =
diff --git a/third_party/llvm-project/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp b/third_party/llvm-project/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
index aaa9ad7..e155013 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
@@ -15,9 +15,10 @@
//
// RUN: stat "%{include}/__config"
-// Make sure we install libc++.1.dylib in the right location.
+// Make sure we install libc++.1.dylib and libc++experimental.a in the right location.
//
// RUN: stat "%{lib}/libc++.1.dylib"
+// RUN: stat "%{lib}/libc++experimental.a"
// Make sure we install a symlink from libc++.dylib to libc++.1.dylib.
//
diff --git a/third_party/llvm-project/libcxx/test/libcxx/vendor/ibm/bad_function_call.pass.cpp b/third_party/llvm-project/libcxx/test/libcxx/vendor/ibm/bad_function_call.pass.cpp
new file mode 100644
index 0000000..2b68446
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/libcxx/vendor/ibm/bad_function_call.pass.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: target={{powerpc.*-ibm-aix.*}}
+// ADDITIONAL_COMPILE_FLAGS: -fvisibility-inlines-hidden
+
+// When there is a weak hidden symbol in user code and a strong definition
+// in the library, we test that the linker relies on the library version,
+// as the default weak resolution semantics don't favour weak local definitions
+// for XCOFF. This creates a conflict on std::bad_function_call, which is used
+// by the std::function template instantiated in main.
+#include <functional>
+#include "test_macros.h"
+#include "assert.h"
+
+void foo() {}
+
+void test_call() {
+ std::function<void()> r(foo);
+ r();
+}
+
+void test_throw() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ std::function<int()> f;
+ try {
+ f();
+ assert(false);
+ } catch (const std::bad_function_call&) {
+ return;
+ }
+ assert(false);
+#endif // TEST_HAS_NO_EXCEPTIONS
+}
+
+int main(int, char**) {
+ test_call();
+ test_throw();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp
index 7a5c0a7..bc9c278 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp
@@ -100,13 +100,13 @@
// clang-format on
constexpr bool test() {
- meta::for_each(meta::forward_iterator_list<int*>{}, []<class Out>() {
+ types::for_each(types::forward_iterator_list<int*>{}, []<class Out>() {
test_iterators<cpp20_input_iterator<int*>, Out, sentinel_wrapper<cpp20_input_iterator<int*>>>();
test_iterators<ProxyIterator<cpp20_input_iterator<int*>>,
ProxyIterator<Out>,
sentinel_wrapper<ProxyIterator<cpp20_input_iterator<int*>>>>();
- meta::for_each(meta::forward_iterator_list<int*>{}, []<class In>() {
+ types::for_each(types::forward_iterator_list<int*>{}, []<class In>() {
test_iterators<In, Out>();
test_iterators<In, Out, sized_sentinel<In>>();
test_iterators<In, Out, sentinel_wrapper<In>>();
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.segmented.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.segmented.pass.cpp
index 5b8d8b8..9291c0a 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.segmented.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.segmented.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// TODO: make `join_view` non-experimental once D2770 is implemented.
+// UNSUPPORTED: !c++experimental
#include <algorithm>
#include <array>
@@ -98,7 +100,7 @@
test_containers<std::vector<int>, std::vector<int>>();
}
- meta::for_each(meta::forward_iterator_list<int*>{}, []<class Iter> {
+ types::for_each(types::forward_iterator_list<int*>{}, []<class Iter> {
test_join_view<Iter, Iter>();
test_join_view<Iter, sentinel_wrapper<Iter>>();
test_join_view<Iter, sized_sentinel<Iter>>();
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
index 036dfe5..9cad71d 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
@@ -9,7 +9,8 @@
// <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
-
+// TODO: make `join_view` non-experimental once D2770 is implemented.
+// UNSUPPORTED: !c++experimental
// template<bidirectional_iterator I1, sentinel_for<I1> S1, bidirectional_iterator I2>
// requires indirectly_copyable<I1, I2>
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
index 4a8963e..237d1ef 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
@@ -23,7 +23,7 @@
#include "almost_satisfies_types.h"
#include "test_iterators.h"
-template <class In, class Out = In, class Count = size_t>
+template <class In, class Out = In, class Count = std::size_t>
concept HasCopyNIt = requires(In in, Count count, Out out) { std::ranges::copy_n(in, count, out); };
static_assert(HasCopyNIt<int*>);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
index 6bb7842..7d6770d 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
@@ -22,7 +22,7 @@
#if TEST_STD_VER > 17
TEST_CONSTEXPR bool test_constexpr() {
- const size_t N = 5;
+ const std::size_t N = 5;
int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N
auto it = std::fill_n(std::begin(ib), N, 5);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
index 3eb361a..13fd1cb 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
@@ -31,7 +31,7 @@
#if TEST_STD_VER > 17
TEST_CONSTEXPR bool test_constexpr() {
- const size_t N = 5;
+ const std::size_t N = 5;
int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N
auto it = std::generate_n(std::begin(ib), N, gen_test());
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
index 7cd53dc..56fbe58 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
@@ -99,7 +99,7 @@
static_assert(!HasGenerateRange<InputRangeNotInputOrOutputIterator>);
static_assert(!HasGenerateRange<R<int*>, IntPtrGen>);
-template <class Iter, class Sent, size_t N, class Gen>
+template <class Iter, class Sent, std::size_t N, class Gen>
constexpr void test_one(const std::array<int, N> input, Gen gen, std::array<int, N> expected) {
{ // (iterator, sentinel) overload.
auto in = input;
@@ -174,7 +174,7 @@
{ // (iterator, sentinel) overload.
int gen_invocations = 0;
auto gen = [&gen_invocations] { ++gen_invocations; return AssignedOnce(); };
- constexpr size_t N = 10;
+ constexpr std::size_t N = 10;
std::array<AssignedOnce, N> in;
std::ranges::generate(in.begin(), in.end(), gen);
@@ -185,7 +185,7 @@
{ // (range) overload.
int gen_invocations = 0;
auto gen = [&gen_invocations] { ++gen_invocations; return AssignedOnce(); };
- constexpr size_t N = 10;
+ constexpr std::size_t N = 10;
std::array<AssignedOnce, N> in;
std::ranges::generate(in, gen);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
index 6a67832..e6af011 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
@@ -66,8 +66,8 @@
// !indirectly_writable<O, invoke_result_t<F&>>
static_assert(!HasGenerateNIter<int*, IntPtrGen>);
-template <class Iter, size_t N, class Gen>
-constexpr void test_one(std::array<int, N> in, size_t n, Gen gen, std::array<int, N> expected) {
+template <class Iter, std::size_t N, class Gen>
+constexpr void test_one(std::array<int, N> in, std::size_t n, Gen gen, std::array<int, N> expected) {
assert(n <= N);
auto begin = Iter(in.data());
@@ -120,8 +120,8 @@
int gen_invocations = 0;
auto gen = [&gen_invocations] { ++gen_invocations; return AssignedOnce(); };
- constexpr size_t N1 = 10;
- constexpr size_t N2 = N1 / 2;
+ constexpr std::size_t N1 = 10;
+ constexpr std::size_t N2 = N1 / 2;
std::array<AssignedOnce, N1> in;
auto result = std::ranges::generate_n(in.begin(), N2, gen);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
index 6779f78..6d9be04 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
@@ -82,8 +82,8 @@
static_assert(!HasPartitionRange<R<PermutableNotSwappable>, UnaryPred>);
// `partition` isn't a stable algorithm so this function cannot test the exact output.
-template <class Iter, class Sent, size_t N, class Pred>
-constexpr void test_one(std::array<int, N> input, Pred pred, size_t partition_point) {
+template <class Iter, class Sent, std::size_t N, class Pred>
+constexpr void test_one(std::array<int, N> input, Pred pred, std::size_t partition_point) {
auto neg_pred = [&](int x) { return !pred(x); };
{ // (iterator, sentinel) overload.
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
index ba8a347..7b5b80d 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
@@ -118,7 +118,7 @@
static_assert(std::is_same_v<std::ranges::partition_copy_result<int, int, int>,
std::ranges::in_out_out_result<int, int, int>>);
-template <class Iter, class Sent, class OutIter1, class OutIter2, size_t N1, size_t N2, size_t N3, class Pred>
+template <class Iter, class Sent, class OutIter1, class OutIter2, std::size_t N1, size_t N2, size_t N3, class Pred>
constexpr void test_one(std::array<int, N1> input, Pred pred, std::array<int, N2> expected_true,
std::array<int, N3> expected_false) {
static_assert(N2 + N3 == N1);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
index f9dadc2..932e833 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
@@ -76,8 +76,8 @@
static_assert(!HasPartitionPointRange<R<int*>, IndirectUnaryPredicateNotPredicate>);
static_assert(!HasPartitionPointRange<R<int*>, IndirectUnaryPredicateNotCopyConstructible>);
-template <class Iter, class Sent, size_t N, class Pred>
-constexpr void test_one(std::array<int, N> input, Pred pred, size_t partition_point) {
+template <class Iter, class Sent, std::size_t N, class Pred>
+constexpr void test_one(std::array<int, N> input, Pred pred, std::size_t partition_point) {
assert(std::ranges::is_partitioned(input, pred));
auto begin = Iter(input.data());
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
index b624abc..5c72105 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
@@ -84,8 +84,8 @@
static_assert(!HasStablePartitionRange<R<PermutableNotForwardIterator>, UnaryPred>);
static_assert(!HasStablePartitionRange<R<PermutableNotSwappable>, UnaryPred>);
-template <class Iter, class Sent, size_t N, class Pred>
-void test_one(std::array<int, N> input, Pred pred, size_t partition_point, std::array<int, N> expected) {
+template <class Iter, class Sent, std::size_t N, class Pred>
+void test_one(std::array<int, N> input, Pred pred, std::size_t partition_point, std::array<int, N> expected) {
auto neg_pred = [&](int x) { return !pred(x); };
{ // (iterator, sentinel) overload.
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
index 0a5d83e..69db960 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
@@ -36,10 +36,10 @@
class RandGen {
public:
- constexpr static size_t min() { return 0; }
- constexpr static size_t max() { return 255; }
+ constexpr static std::size_t min() { return 0; }
+ constexpr static std::size_t max() { return 255; }
- constexpr size_t operator()() {
+ constexpr std::size_t operator()() {
flip = !flip;
return flip;
}
@@ -54,9 +54,9 @@
LIBCPP_STATIC_ASSERT(!std::__libcpp_random_is_valid_urng<RandGen>::value);
struct BadGen {
- constexpr static size_t min() { return 255; }
- constexpr static size_t max() { return 0; }
- constexpr size_t operator()() const;
+ constexpr static std::size_t min() { return 255; }
+ constexpr static std::size_t max() { return 0; }
+ constexpr std::size_t operator()() const;
};
static_assert(!std::uniform_random_bit_generator<BadGen>);
@@ -148,9 +148,9 @@
// !uniform_random_bit_generator<remove_reference_t<Gen>>
static_assert(!HasSampleRange<R<int*>, int*, BadGen>);
-template <class Iter, class Sent, class Out, size_t N, class Gen>
-void test_one(std::array<int, N> in, size_t n, Gen gen) {
- assert(n <= static_cast<size_t>(N));
+template <class Iter, class Sent, class Out, std::size_t N, class Gen>
+void test_one(std::array<int, N> in, std::size_t n, Gen gen) {
+ assert(n <= static_cast<std::size_t>(N));
auto verify_is_subsequence = [&] (auto output) {
auto sorted_input = in;
@@ -276,18 +276,18 @@
// generator class has a const or non-const invocation operator (or both).
void test_generators() {
struct GenBase {
- constexpr static size_t min() { return 0; }
- constexpr static size_t max() { return 255; }
+ constexpr static std::size_t min() { return 0; }
+ constexpr static std::size_t max() { return 255; }
};
struct NonconstGen : GenBase {
- size_t operator()() { return 1; }
+ std::size_t operator()() { return 1; }
};
struct ConstGen : GenBase {
- size_t operator()() const { return 1; }
+ std::size_t operator()() const { return 1; }
};
struct ConstAndNonconstGen : GenBase {
- size_t operator()() { return 1; }
- size_t operator()() const { return 1; }
+ std::size_t operator()() { return 1; }
+ std::size_t operator()() const { return 1; }
};
test_generator<ConstGen>();
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
index 6f6be6d..24237b9 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
@@ -34,10 +34,10 @@
class RandGen {
public:
- constexpr static size_t min() { return 0; }
- constexpr static size_t max() { return 255; }
+ constexpr static std::size_t min() { return 0; }
+ constexpr static std::size_t max() { return 255; }
- constexpr size_t operator()() {
+ constexpr std::size_t operator()() {
flip = !flip;
return flip;
}
@@ -52,9 +52,9 @@
LIBCPP_STATIC_ASSERT(!std::__libcpp_random_is_valid_urng<RandGen>::value);
struct BadGen {
- constexpr static size_t min() { return 255; }
- constexpr static size_t max() { return 0; }
- constexpr size_t operator()() const;
+ constexpr static std::size_t min() { return 255; }
+ constexpr static std::size_t max() { return 0; }
+ constexpr std::size_t operator()() const;
};
static_assert(!std::uniform_random_bit_generator<BadGen>);
@@ -109,7 +109,7 @@
// !uniform_random_bit_generator<remove_reference_t<Gen>>
static_assert(!HasShuffleRange<R<int*>, BadGen>);
-template <class Iter, class Sent, size_t N, class Gen>
+template <class Iter, class Sent, std::size_t N, class Gen>
void test_one(const std::array<int, N> input, Gen gen) {
{ // (iterator, sentinel) overload.
auto shuffled = input;
@@ -219,18 +219,18 @@
// generator class has a const or non-const invocation operator (or both).
void test_generators() {
struct GenBase {
- constexpr static size_t min() { return 0; }
- constexpr static size_t max() { return 255; }
+ constexpr static std::size_t min() { return 0; }
+ constexpr static std::size_t max() { return 255; }
};
struct NonconstGen : GenBase {
- size_t operator()() { return 1; }
+ std::size_t operator()() { return 1; }
};
struct ConstGen : GenBase {
- size_t operator()() const { return 1; }
+ std::size_t operator()() const { return 1; }
};
struct ConstAndNonconstGen : GenBase {
- size_t operator()() { return 1; }
- size_t operator()() const { return 1; }
+ std::size_t operator()() { return 1; }
+ std::size_t operator()() const { return 1; }
};
test_generator<ConstGen>();
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
index fbeb8a4..c1011f3 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
@@ -45,7 +45,7 @@
static_assert(!HasReverseR<PermutableRangeNotForwardIterator>);
static_assert(!HasReverseR<PermutableRangeNotSwappable>);
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test(std::array<int, N> value, std::array<int, N> expected) {
{
auto val = value;
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
index b41ff4e..1f18d78 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
@@ -51,7 +51,7 @@
static_assert(std::is_same_v<std::ranges::rotate_copy_result<int, int>, std::ranges::in_out_result<int, int>>);
template <class Iter, class OutIter, class Sent, int N>
-constexpr void test(std::array<int, N> value, size_t middle, std::array<int, N> expected) {
+constexpr void test(std::array<int, N> value, std::size_t middle, std::array<int, N> expected) {
{
std::array<int, N> out;
std::same_as<std::ranges::in_out_result<Iter, OutIter>> decltype(auto) ret =
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
index c34dac1..1506ce7 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
@@ -68,8 +68,8 @@
static_assert(!HasRotateRange<PermutableRangeNotForwardIterator>);
static_assert(!HasRotateRange<PermutableRangeNotSwappable>);
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(const std::array<int, N> input, size_t mid_index, std::array<int, N> expected) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(const std::array<int, N> input, std::size_t mid_index, std::array<int, N> expected) {
assert(mid_index <= N);
{ // (iterator, sentinel) overload.
@@ -159,7 +159,7 @@
auto begin = adl::Iterator::TrackSwaps(in.data(), swaps);
auto end = adl::Iterator::TrackSwaps(in.data() + in.size(), swaps);
- for (size_t mid = 0; mid != input.size(); ++mid) {
+ for (std::size_t mid = 0; mid != input.size(); ++mid) {
std::ranges::rotate(begin, begin + mid, end);
assert(swaps <= expected);
}
@@ -172,7 +172,7 @@
auto end = adl::Iterator::TrackSwaps(in.data() + in.size(), swaps);
auto range = std::ranges::subrange(begin, end);
- for (size_t mid = 0; mid != input.size(); ++mid) {
+ for (std::size_t mid = 0; mid != input.size(); ++mid) {
std::ranges::rotate(range, begin + mid);
assert(swaps <= expected);
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
index cba0d3b..c19f44a 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
@@ -115,7 +115,7 @@
int const n_ints = sizeof(ints)/sizeof(int);
int zeros[n_ints] = {0};
- const size_t N = 2;
+ const std::size_t N = 2;
const auto middle = std::begin(ints) + N;
auto it = std::rotate_copy(std::begin(ints), middle, std::end(ints), std::begin(zeros));
assert(std::distance(std::begin(zeros), it) == n_ints);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.iterator.pass.cpp
new file mode 100644
index 0000000..9420902
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.iterator.pass.cpp
@@ -0,0 +1,227 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <algorithm>
+
+// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
+// weakly_incrementable O, copy_constructible F, class Proj1 = identity,
+// class Proj2 = identity>
+// requires indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>,
+// projected<I2, Proj2>>>
+// constexpr ranges::binary_transform_result<I1, I2, O>
+// ranges::transform(I1 first1, S1 last1, I2 first2, S2 last2, O result,
+// F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {});
+
+// The range overloads are tested in ranges.tranform.binary.range.pass.cpp.
+
+#include <algorithm>
+#include <array>
+#include <cassert>
+#include <functional>
+#include <ranges>
+
+#include "test_iterators.h"
+#include "almost_satisfies_types.h"
+
+struct BinaryFunc {
+ int operator()(int, int);
+};
+
+template <class It, class Sent = It>
+concept HasTransformIt =
+ requires(It it, Sent sent, int* out) { std::ranges::transform(it, sent, it, sent, out, BinaryFunc{}); };
+static_assert(HasTransformIt<int*>);
+static_assert(!HasTransformIt<InputIteratorNotDerivedFrom>);
+static_assert(!HasTransformIt<InputIteratorNotIndirectlyReadable>);
+static_assert(!HasTransformIt<InputIteratorNotInputOrOutputIterator>);
+static_assert(!HasTransformIt<cpp20_input_iterator<int*>, SentinelForNotSemiregular>);
+static_assert(!HasTransformIt<cpp20_input_iterator<int*>, InputRangeNotSentinelEqualityComparableWith>);
+
+template <class It>
+concept HasTransformOut = requires(int* it, int* sent, It out, std::array<int, 2> range) {
+ std::ranges::transform(it, sent, it, sent, out, BinaryFunc{});
+};
+static_assert(HasTransformOut<int*>);
+static_assert(!HasTransformOut<WeaklyIncrementableNotMovable>);
+
+// check indirectly_readable
+static_assert(HasTransformOut<char*>);
+static_assert(!HasTransformOut<int**>);
+
+struct MoveOnlyFunctor {
+ MoveOnlyFunctor(const MoveOnlyFunctor&) = delete;
+ MoveOnlyFunctor(MoveOnlyFunctor&&) = default;
+ int operator()(int, int);
+};
+
+template <class Func>
+concept HasTransformFuncBinary = requires(int* it, int* sent, int* out, std::array<int, 2> range, Func func) {
+ std::ranges::transform(it, sent, it, sent, out, func);
+};
+static_assert(HasTransformFuncBinary<BinaryFunc>);
+static_assert(!HasTransformFuncBinary<MoveOnlyFunctor>);
+
+static_assert(std::is_same_v<std::ranges::binary_transform_result<int, long, char>,
+ std::ranges::in_in_out_result<int, long, char>>);
+
+// clang-format off
+template <class In1, class In2, class Out, class Sent1, class Sent2>
+constexpr bool test_iterators() {
+ { // simple
+ int a[] = {1, 2, 3, 4, 5};
+ int b[] = {5, 4, 3, 2, 1};
+ int c[5];
+
+ std::same_as<std::ranges::in_in_out_result<In1, In2, Out>> decltype(auto) ret = std::ranges::transform(
+ In1(a), Sent1(In1(a + 5)), In2(b), Sent2(In2(b + 5)), Out(c), [](int i, int j) { return i + j; });
+
+ assert((std::to_array(c) == std::array{6, 6, 6, 6, 6}));
+ assert(base(ret.in1) == a + 5);
+ assert(base(ret.in2) == b + 5);
+ assert(base(ret.out) == c + 5);
+ }
+
+ { // first range empty
+ int a[] = {};
+ int b[] = {5, 4, 3, 2, 1};
+ int c[5];
+
+ auto ret = std::ranges::transform(
+ In1(a), Sent1(In1(a)), In2(b), Sent2(In2(b + 5)), Out(c), [](int i, int j) { return i + j; });
+
+ assert(base(ret.in1) == a);
+ assert(base(ret.in2) == b);
+ assert(base(ret.out) == c);
+ }
+
+ { // second range empty
+ int a[] = {5, 4, 3, 2, 1};
+ int b[] = {};
+ int c[5];
+
+ auto ret = std::ranges::transform(
+ In1(a), Sent1(In1(a + 5)), In2(b), Sent2(In2(b)), Out(c), [](int i, int j) { return i + j; });
+
+ assert(base(ret.in1) == a);
+ assert(base(ret.in2) == b);
+ assert(base(ret.out) == c);
+ }
+
+ { // both ranges empty
+ int a[] = {};
+ int b[] = {};
+ int c[5];
+
+ auto ret = std::ranges::transform(
+ In1(a), Sent1(In1(a)), In2(b), Sent2(In2(b)), Out(c), [](int i, int j) { return i + j; });
+
+ assert(base(ret.in1) == a);
+ assert(base(ret.in2) == b);
+ assert(base(ret.out) == c);
+ }
+
+ { // first range one element
+ int a[] = {2};
+ int b[] = {5, 4, 3, 2, 1};
+ int c[5];
+
+ auto ret = std::ranges::transform(
+ In1(a), Sent1(In1(a + 1)), In2(b), Sent2(In2(b + 5)), Out(c), [](int i, int j) { return i + j; });
+
+ assert(c[0] == 7);
+ assert(base(ret.in1) == a + 1);
+ assert(base(ret.in2) == b + 1);
+ assert(base(ret.out) == c + 1);
+ }
+
+ { // second range contains one element
+ int a[] = {5, 4, 3, 2, 1};
+ int b[] = {4};
+ int c[5];
+
+ auto ret = std::ranges::transform(
+ In1(a), Sent1(In1(a + 5)), In2(b), Sent2(In2(b + 1)), Out(c), [](int i, int j) { return i + j; });
+
+ assert(c[0] == 9);
+ assert(base(ret.in1) == a + 1);
+ assert(base(ret.in2) == b + 1);
+ assert(base(ret.out) == c + 1);
+ }
+
+ { // check that the transform function and projection call counts are correct
+ int predCount = 0;
+ int proj1Count = 0;
+ int proj2Count = 0;
+ auto pred = [&](int, int) { ++predCount; return 1; };
+ auto proj1 = [&](int) { ++proj1Count; return 0; };
+ auto proj2 = [&](int) { ++proj2Count; return 0; };
+ int a[] = {1, 2, 3, 4};
+ int b[] = {1, 2, 3, 4};
+ std::array<int, 4> c;
+ std::ranges::transform(In1(a), Sent1(In1(a + 4)), In2(b), Sent2(In2(b + 4)), Out(c.data()), pred, proj1, proj2);
+ assert(predCount == 4);
+ assert(proj1Count == 4);
+ assert(proj2Count == 4);
+ assert((c == std::array{1, 1, 1, 1}));
+ }
+
+ return true;
+}
+// clang-format on
+
+template <class In2, class Out, class Sent2 = In2>
+constexpr void test_iterator_in1() {
+ test_iterators<cpp17_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp17_input_iterator<int*>>, Sent2>();
+ test_iterators<cpp20_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp20_input_iterator<int*>>, Sent2>();
+ test_iterators<forward_iterator<int*>, In2, Out, forward_iterator<int*>, Sent2>();
+ test_iterators<bidirectional_iterator<int*>, In2, Out, bidirectional_iterator<int*>, Sent2>();
+ test_iterators<random_access_iterator<int*>, In2, Out, random_access_iterator<int*>, Sent2>();
+ test_iterators<contiguous_iterator<int*>, In2, Out, contiguous_iterator<int*>, Sent2>();
+ test_iterators<int*, In2, Out, int*, Sent2>();
+}
+
+template <class Out>
+constexpr void test_iterators_in1_in2() {
+ test_iterator_in1<cpp17_input_iterator<int*>, Out, sentinel_wrapper<cpp17_input_iterator<int*>>>();
+ test_iterator_in1<cpp20_input_iterator<int*>, Out, sentinel_wrapper<cpp20_input_iterator<int*>>>();
+ test_iterator_in1<forward_iterator<int*>, Out>();
+ test_iterator_in1<bidirectional_iterator<int*>, Out>();
+ test_iterator_in1<random_access_iterator<int*>, Out>();
+ test_iterator_in1<contiguous_iterator<int*>, Out>();
+ test_iterator_in1<int*, Out>();
+}
+
+constexpr bool test() {
+ test_iterators_in1_in2<cpp17_output_iterator<int*>>();
+ test_iterators_in1_in2<cpp20_output_iterator<int*>>();
+ test_iterators_in1_in2<forward_iterator<int*>>();
+ test_iterators_in1_in2<bidirectional_iterator<int*>>();
+ test_iterators_in1_in2<random_access_iterator<int*>>();
+ test_iterators_in1_in2<contiguous_iterator<int*>>();
+ test_iterators_in1_in2<int*>();
+
+ { // check that returning another type from the projection works
+ struct S { int i; int other; };
+ S a[] = { S{0, 0}, S{1, 0}, S{3, 0}, S{10, 0} };
+ S b[] = { S{0, 10}, S{1, 20}, S{3, 30}, S{10, 40} };
+ std::array<int, 4> c;
+ std::ranges::transform(a, a + 4, b, b + 4, c.begin(), [](S s1, S s2) { return s1.i + s2.other; });
+ assert((c == std::array{10, 21, 33, 50}));
+ }
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.pass.cpp
deleted file mode 100644
index 3031646..0000000
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.pass.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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, c++17
-
-// <algorithm>
-
-// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
-// weakly_incrementable O, copy_constructible F, class Proj1 = identity,
-// class Proj2 = identity>
-// requires indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>,
-// projected<I2, Proj2>>>
-// constexpr ranges::binary_transform_result<I1, I2, O>
-// ranges::transform(I1 first1, S1 last1, I2 first2, S2 last2, O result,
-// F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {});
-// template<input_range R1, input_range R2, weakly_incrementable O,
-// copy_constructible F, class Proj1 = identity, class Proj2 = identity>
-// requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>,
-// projected<iterator_t<R2>, Proj2>>>
-// constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
-// ranges::transform(R1&& r1, R2&& r2, O result,
-// F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {});
-
-#include <algorithm>
-#include <array>
-#include <cassert>
-#include <functional>
-#include <ranges>
-
-#include "test_iterators.h"
-#include "almost_satisfies_types.h"
-
-struct BinaryFunc {
- int operator()(int, int);
-};
-
-template <class Range>
-concept HasTranformR = requires(Range r, int* out) { std::ranges::transform(r, r, out, BinaryFunc{}); };
-
-static_assert(HasTranformR<std::array<int, 1>>);
-static_assert(!HasTranformR<int>);
-static_assert(!HasTranformR<InputRangeNotDerivedFrom>);
-static_assert(!HasTranformR<InputRangeNotIndirectlyReadable>);
-static_assert(!HasTranformR<InputRangeNotInputOrOutputIterator>);
-static_assert(!HasTranformR<InputRangeNotSentinelSemiregular>);
-static_assert(!HasTranformR<InputRangeNotSentinelEqualityComparableWith>);
-
-template <class It, class Sent = It>
-concept HasTransformIt =
- requires(It it, Sent sent, int* out) { std::ranges::transform(it, sent, it, sent, out, BinaryFunc{}); };
-static_assert(HasTransformIt<int*>);
-static_assert(!HasTransformIt<InputIteratorNotDerivedFrom>);
-static_assert(!HasTransformIt<InputIteratorNotIndirectlyReadable>);
-static_assert(!HasTransformIt<InputIteratorNotInputOrOutputIterator>);
-static_assert(!HasTransformIt<cpp20_input_iterator<int*>, SentinelForNotSemiregular>);
-static_assert(!HasTransformIt<cpp20_input_iterator<int*>, InputRangeNotSentinelEqualityComparableWith>);
-
-template <class It>
-concept HasTransformOut = requires(int* it, int* sent, It out, std::array<int, 2> range) {
- std::ranges::transform(it, sent, it, sent, out, BinaryFunc{});
- std::ranges::transform(range, range, out, BinaryFunc{});
-};
-static_assert(HasTransformOut<int*>);
-static_assert(!HasTransformOut<WeaklyIncrementableNotMovable>);
-
-// check indirectly_readable
-static_assert(HasTransformOut<char*>);
-static_assert(!HasTransformOut<int**>);
-
-struct MoveOnlyFunctor {
- MoveOnlyFunctor(const MoveOnlyFunctor&) = delete;
- MoveOnlyFunctor(MoveOnlyFunctor&&) = default;
- int operator()(int, int);
-};
-
-template <class Func>
-concept HasTransformFuncBinary = requires(int* it, int* sent, int* out, std::array<int, 2> range, Func func) {
- std::ranges::transform(it, sent, it, sent, out, func);
- std::ranges::transform(range, range, out, func);
-};
-static_assert(HasTransformFuncBinary<BinaryFunc>);
-static_assert(!HasTransformFuncBinary<MoveOnlyFunctor>);
-
-static_assert(std::is_same_v<std::ranges::binary_transform_result<int, long, char>,
- std::ranges::in_in_out_result<int, long, char>>);
-
-// clang-format off
-template <class In1, class In2, class Out, class Sent1, class Sent2>
-constexpr bool test_iterators() {
- { // simple
- {
- int a[] = {1, 2, 3, 4, 5};
- int b[] = {5, 4, 3, 2, 1};
- int c[5];
-
- std::same_as<std::ranges::in_in_out_result<In1, In2, Out>> decltype(auto) ret = std::ranges::transform(
- In1(a), Sent1(In1(a + 5)), In2(b), Sent2(In2(b + 5)), Out(c), [](int i, int j) { return i + j; });
-
- assert((std::to_array(c) == std::array{6, 6, 6, 6, 6}));
- assert(base(ret.in1) == a + 5);
- assert(base(ret.in2) == b + 5);
- assert(base(ret.out) == c + 5);
- }
-
- {
- int a[] = {1, 2, 3, 4, 5};
- int b[] = {5, 4, 3, 2, 1};
- int c[5];
-
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 5)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 5)));
-
- std::same_as<std::ranges::in_in_out_result<In1, In2, Out>> decltype(auto) ret = std::ranges::transform(
- range1, range2, Out(c), [](int i, int j) { return i + j; });
-
- assert((std::to_array(c) == std::array{6, 6, 6, 6, 6}));
- assert(base(ret.in1) == a + 5);
- assert(base(ret.in2) == b + 5);
- assert(base(ret.out) == c + 5);
- }
- }
-
- { // first range empty
- {
- int a[] = {};
- int b[] = {5, 4, 3, 2, 1};
- int c[5];
-
- auto ret = std::ranges::transform(
- In1(a), Sent1(In1(a)), In2(b), Sent2(In2(b + 5)), Out(c), [](int i, int j) { return i + j; });
-
- assert(base(ret.in1) == a);
- assert(base(ret.in2) == b);
- assert(base(ret.out) == c);
- }
-
- {
- int a[] = {};
- int b[] = {5, 4, 3, 2, 1};
- int c[5];
-
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 5)));
-
- auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
-
- assert(base(ret.in1) == a);
- assert(base(ret.in2) == b);
- assert(base(ret.out) == c);
- }
- }
-
- { // second range empty
- {
- int a[] = {5, 4, 3, 2, 1};
- int b[] = {};
- int c[5];
-
- auto ret = std::ranges::transform(
- In1(a), Sent1(In1(a + 5)), In2(b), Sent2(In2(b)), Out(c), [](int i, int j) { return i + j; });
-
- assert(base(ret.in1) == a);
- assert(base(ret.in2) == b);
- assert(base(ret.out) == c);
- }
-
- {
- int a[] = {5, 4, 3, 2, 1};
- int b[] = {};
- int c[5];
-
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 5)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b)));
-
- auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
-
- assert(base(ret.in1) == a);
- assert(base(ret.in2) == b);
- assert(base(ret.out) == c);
- }
- }
-
- { // both ranges empty
- {
- int a[] = {};
- int b[] = {};
- int c[5];
-
- auto ret = std::ranges::transform(
- In1(a), Sent1(In1(a)), In2(b), Sent2(In2(b)), Out(c), [](int i, int j) { return i + j; });
-
- assert(base(ret.in1) == a);
- assert(base(ret.in2) == b);
- assert(base(ret.out) == c);
- }
-
- {
- int a[] = {};
- int b[] = {};
- int c[5];
-
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b)));
-
- auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
-
- assert(base(ret.in1) == a);
- assert(base(ret.in2) == b);
- assert(base(ret.out) == c);
- }
- }
-
- { // first range one element
- {
- int a[] = {2};
- int b[] = {5, 4, 3, 2, 1};
- int c[5];
-
- auto ret = std::ranges::transform(
- In1(a), Sent1(In1(a + 1)), In2(b), Sent2(In2(b + 5)), Out(c), [](int i, int j) { return i + j; });
-
- assert(c[0] == 7);
- assert(base(ret.in1) == a + 1);
- assert(base(ret.in2) == b + 1);
- assert(base(ret.out) == c + 1);
- }
-
- {
- int a[] = {2};
- int b[] = {5, 4, 3, 2, 1};
- int c[5];
-
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 1)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 5)));
-
- auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
-
- assert(c[0] == 7);
- assert(base(ret.in1) == a + 1);
- assert(base(ret.in2) == b + 1);
- assert(base(ret.out) == c + 1);
- }
- }
-
- { // second range contains one element
- {
- int a[] = {5, 4, 3, 2, 1};
- int b[] = {4};
- int c[5];
-
- auto ret = std::ranges::transform(
- In1(a), Sent1(In1(a + 5)), In2(b), Sent2(In2(b + 1)), Out(c), [](int i, int j) { return i + j; });
-
- assert(c[0] == 9);
- assert(base(ret.in1) == a + 1);
- assert(base(ret.in2) == b + 1);
- assert(base(ret.out) == c + 1);
- }
-
- {
- int a[] = {5, 4, 3, 2, 1};
- int b[] = {4};
- int c[5];
-
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 5)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 1)));
-
- auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
-
- assert(c[0] == 9);
- assert(base(ret.in1) == a + 1);
- assert(base(ret.in2) == b + 1);
- assert(base(ret.out) == c + 1);
- }
- }
-
- { // check that the transform function and projection call counts are correct
- {
- int predCount = 0;
- int proj1Count = 0;
- int proj2Count = 0;
- auto pred = [&](int, int) { ++predCount; return 1; };
- auto proj1 = [&](int) { ++proj1Count; return 0; };
- auto proj2 = [&](int) { ++proj2Count; return 0; };
- int a[] = {1, 2, 3, 4};
- int b[] = {1, 2, 3, 4};
- std::array<int, 4> c;
- std::ranges::transform(In1(a), Sent1(In1(a + 4)), In2(b), Sent2(In2(b + 4)), Out(c.data()), pred, proj1, proj2);
- assert(predCount == 4);
- assert(proj1Count == 4);
- assert(proj2Count == 4);
- assert((c == std::array{1, 1, 1, 1}));
- }
- {
- int predCount = 0;
- int proj1Count = 0;
- int proj2Count = 0;
- auto pred = [&](int, int) { ++predCount; return 1; };
- auto proj1 = [&](int) { ++proj1Count; return 0; };
- auto proj2 = [&](int) { ++proj2Count; return 0; };
- int a[] = {1, 2, 3, 4};
- int b[] = {1, 2, 3, 4};
- std::array<int, 4> c;
- auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 4)));
- auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 4)));
- std::ranges::transform(range1, range2, Out(c.data()), pred, proj1, proj2);
- assert(predCount == 4);
- assert(proj1Count == 4);
- assert(proj2Count == 4);
- assert((c == std::array{1, 1, 1, 1}));
- }
- }
-
- return true;
-}
-// clang-format on
-
-template <class In2, class Out, class Sent2 = In2>
-constexpr void test_iterator_in1() {
- test_iterators<cpp17_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp17_input_iterator<int*>>, Sent2>();
- test_iterators<cpp20_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp20_input_iterator<int*>>, Sent2>();
- test_iterators<forward_iterator<int*>, In2, Out, forward_iterator<int*>, Sent2>();
- test_iterators<bidirectional_iterator<int*>, In2, Out, bidirectional_iterator<int*>, Sent2>();
- test_iterators<random_access_iterator<int*>, In2, Out, random_access_iterator<int*>, Sent2>();
- test_iterators<contiguous_iterator<int*>, In2, Out, contiguous_iterator<int*>, Sent2>();
- test_iterators<int*, In2, Out, int*, Sent2>();
- // static_asserting here to avoid hitting the constant evaluation step limit
- static_assert(test_iterators<cpp17_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp17_input_iterator<int*>>, Sent2>());
- static_assert(test_iterators<cpp20_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp20_input_iterator<int*>>, Sent2>());
- static_assert(test_iterators<forward_iterator<int*>, In2, Out, forward_iterator<int*>, Sent2>());
- static_assert(test_iterators<bidirectional_iterator<int*>, In2, Out, bidirectional_iterator<int*>, Sent2>());
- static_assert(test_iterators<random_access_iterator<int*>, In2, Out, random_access_iterator<int*>, Sent2>());
- static_assert(test_iterators<contiguous_iterator<int*>, In2, Out, contiguous_iterator<int*>, Sent2>());
- static_assert(test_iterators<int*, In2, Out, int*, Sent2>());
-}
-
-template <class Out>
-void test_iterators_in1_in2() {
- test_iterator_in1<cpp17_input_iterator<int*>, Out, sentinel_wrapper<cpp17_input_iterator<int*>>>();
- test_iterator_in1<cpp20_input_iterator<int*>, Out, sentinel_wrapper<cpp20_input_iterator<int*>>>();
- test_iterator_in1<forward_iterator<int*>, Out>();
- test_iterator_in1<bidirectional_iterator<int*>, Out>();
- test_iterator_in1<random_access_iterator<int*>, Out>();
- test_iterator_in1<contiguous_iterator<int*>, Out>();
- test_iterator_in1<int*, Out>();
-}
-
-constexpr bool test() {
- { // check that std::ranges::dangling is returned properly
- {
- int b[] = {2, 5, 4, 3, 1};
- std::array<int, 5> c;
- std::same_as<std::ranges::in_in_out_result<std::ranges::dangling, int*, int*>> auto ret =
- std::ranges::transform(std::array{1, 2, 3, 5, 4}, b, c.data(), [](int i, int j) { return i * j; });
- assert((c == std::array{2, 10, 12, 15, 4}));
- assert(ret.in2 == b + 5);
- assert(ret.out == c.data() + c.size());
- }
- {
- int a[] = {2, 5, 4, 3, 1, 4, 5, 6};
- std::array<int, 8> c;
- std::same_as<std::ranges::in_in_out_result<int*, std::ranges::dangling, int*>> auto ret =
- std::ranges::transform(a, std::array{1, 2, 3, 5, 4, 5, 6, 7}, c.data(), [](int i, int j) { return i * j; });
- assert((c == std::array{2, 10, 12, 15, 4, 20, 30, 42}));
- assert(ret.in1 == a + 8);
- assert(ret.out == c.data() + c.size());
- }
- {
- std::array<int, 3> c;
- std::same_as<std::ranges::in_in_out_result<std::ranges::dangling, std::ranges::dangling, int*>> auto ret =
- std::ranges::transform(std::array{4, 4, 4}, std::array{4, 4, 4}, c.data(), [](int i, int j) { return i * j; });
- assert((c == std::array{16, 16, 16}));
- assert(ret.out == c.data() + c.size());
- }
- }
-
- { // check that returning another type from the projection works
- {
- struct S { int i; int other; };
- S a[] = { S{0, 0}, S{1, 0}, S{3, 0}, S{10, 0} };
- S b[] = { S{0, 10}, S{1, 20}, S{3, 30}, S{10, 40} };
- std::array<int, 4> c;
- std::ranges::transform(a, a + 4, b, b + 4, c.begin(), [](S s1, S s2) { return s1.i + s2.other; });
- assert((c == std::array{10, 21, 33, 50}));
- }
- {
- struct S { int i; int other; };
- S a[] = { S{0, 0}, S{1, 0}, S{3, 0}, S{10, 0} };
- S b[] = { S{0, 10}, S{1, 20}, S{3, 30}, S{10, 40} };
- std::array<int, 4> c;
- std::ranges::transform(a, b, c.begin(), [](S s1, S s2) { return s1.i + s2.other; });
- assert((c == std::array{10, 21, 33, 50}));
- }
- }
-
- { // check that std::invoke is used
- struct S { int i; };
- S a[] = { S{1}, S{3}, S{2} };
- S b[] = { S{2}, S{5}, S{3} };
- std::array<int, 3> c;
- auto ret = std::ranges::transform(a, b, c.data(), [](int i, int j) { return i + j + 2; }, &S::i, &S::i);
- assert((c == std::array{5, 10, 7}));
- assert(ret.out == c.data() + 3);
- }
-
- return true;
-}
-
-int main(int, char**) {
- test_iterators_in1_in2<cpp17_output_iterator<int*>>();
- test_iterators_in1_in2<cpp20_output_iterator<int*>>();
- test_iterators_in1_in2<forward_iterator<int*>>();
- test_iterators_in1_in2<bidirectional_iterator<int*>>();
- test_iterators_in1_in2<random_access_iterator<int*>>();
- test_iterators_in1_in2<contiguous_iterator<int*>>();
- test_iterators_in1_in2<int*>();
- test();
- static_assert(test());
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.range.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.range.pass.cpp
new file mode 100644
index 0000000..bebe456
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.range.pass.cpp
@@ -0,0 +1,288 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <algorithm>
+
+// template<input_range R1, input_range R2, weakly_incrementable O,
+// copy_constructible F, class Proj1 = identity, class Proj2 = identity>
+// requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>,
+// projected<iterator_t<R2>, Proj2>>>
+// constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
+// ranges::transform(R1&& r1, R2&& r2, O result,
+// F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {});
+
+// The iterator overloads are tested in ranges.tranform.binary.iterator.pass.cpp.
+
+#include <algorithm>
+#include <array>
+#include <cassert>
+#include <functional>
+#include <ranges>
+
+#include "test_iterators.h"
+#include "almost_satisfies_types.h"
+
+struct BinaryFunc {
+ int operator()(int, int);
+};
+
+template <class Range>
+concept HasTranformR = requires(Range r, int* out) { std::ranges::transform(r, r, out, BinaryFunc{}); };
+
+static_assert(HasTranformR<std::array<int, 1>>);
+static_assert(!HasTranformR<int>);
+static_assert(!HasTranformR<InputRangeNotDerivedFrom>);
+static_assert(!HasTranformR<InputRangeNotIndirectlyReadable>);
+static_assert(!HasTranformR<InputRangeNotInputOrOutputIterator>);
+static_assert(!HasTranformR<InputRangeNotSentinelSemiregular>);
+static_assert(!HasTranformR<InputRangeNotSentinelEqualityComparableWith>);
+
+template <class It>
+concept HasTransformOut = requires(int* it, int* sent, It out, std::array<int, 2> range) {
+ std::ranges::transform(range, range, out, BinaryFunc{});
+};
+static_assert(HasTransformOut<int*>);
+static_assert(!HasTransformOut<WeaklyIncrementableNotMovable>);
+
+// check indirectly_readable
+static_assert(HasTransformOut<char*>);
+static_assert(!HasTransformOut<int**>);
+
+struct MoveOnlyFunctor {
+ MoveOnlyFunctor(const MoveOnlyFunctor&) = delete;
+ MoveOnlyFunctor(MoveOnlyFunctor&&) = default;
+ int operator()(int, int);
+};
+
+template <class Func>
+concept HasTransformFuncBinary = requires(int* it, int* sent, int* out, std::array<int, 2> range, Func func) {
+ std::ranges::transform(range, range, out, func);
+};
+static_assert(HasTransformFuncBinary<BinaryFunc>);
+static_assert(!HasTransformFuncBinary<MoveOnlyFunctor>);
+
+static_assert(std::is_same_v<std::ranges::binary_transform_result<int, long, char>,
+ std::ranges::in_in_out_result<int, long, char>>);
+
+// clang-format off
+template <class In1, class In2, class Out, class Sent1, class Sent2>
+constexpr bool test_iterators() {
+ { // simple
+ int a[] = {1, 2, 3, 4, 5};
+ int b[] = {5, 4, 3, 2, 1};
+ int c[5];
+
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 5)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 5)));
+
+ std::same_as<std::ranges::in_in_out_result<In1, In2, Out>> decltype(auto) ret = std::ranges::transform(
+ range1, range2, Out(c), [](int i, int j) { return i + j; });
+
+ assert((std::to_array(c) == std::array{6, 6, 6, 6, 6}));
+ assert(base(ret.in1) == a + 5);
+ assert(base(ret.in2) == b + 5);
+ assert(base(ret.out) == c + 5);
+ }
+
+ { // first range empty
+ int a[] = {};
+ int b[] = {5, 4, 3, 2, 1};
+ int c[5];
+
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 5)));
+
+ auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
+
+ assert(base(ret.in1) == a);
+ assert(base(ret.in2) == b);
+ assert(base(ret.out) == c);
+ }
+
+ { // second range empty
+ int a[] = {5, 4, 3, 2, 1};
+ int b[] = {};
+ int c[5];
+
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 5)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b)));
+
+ auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
+
+ assert(base(ret.in1) == a);
+ assert(base(ret.in2) == b);
+ assert(base(ret.out) == c);
+ }
+
+ { // both ranges empty
+ int a[] = {};
+ int b[] = {};
+ int c[5];
+
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b)));
+
+ auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
+
+ assert(base(ret.in1) == a);
+ assert(base(ret.in2) == b);
+ assert(base(ret.out) == c);
+ }
+
+ { // first range one element
+ int a[] = {2};
+ int b[] = {5, 4, 3, 2, 1};
+ int c[5];
+
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 1)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 5)));
+
+ auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
+
+ assert(c[0] == 7);
+ assert(base(ret.in1) == a + 1);
+ assert(base(ret.in2) == b + 1);
+ assert(base(ret.out) == c + 1);
+ }
+
+ { // second range contains one element
+ int a[] = {5, 4, 3, 2, 1};
+ int b[] = {4};
+ int c[5];
+
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 5)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 1)));
+
+ auto ret = std::ranges::transform(range1, range2, Out(c), [](int i, int j) { return i + j; });
+
+ assert(c[0] == 9);
+ assert(base(ret.in1) == a + 1);
+ assert(base(ret.in2) == b + 1);
+ assert(base(ret.out) == c + 1);
+ }
+
+ { // check that the transform function and projection call counts are correct
+ int predCount = 0;
+ int proj1Count = 0;
+ int proj2Count = 0;
+ auto pred = [&](int, int) { ++predCount; return 1; };
+ auto proj1 = [&](int) { ++proj1Count; return 0; };
+ auto proj2 = [&](int) { ++proj2Count; return 0; };
+ int a[] = {1, 2, 3, 4};
+ int b[] = {1, 2, 3, 4};
+ std::array<int, 4> c;
+ auto range1 = std::ranges::subrange(In1(a), Sent1(In1(a + 4)));
+ auto range2 = std::ranges::subrange(In2(b), Sent2(In2(b + 4)));
+ std::ranges::transform(range1, range2, Out(c.data()), pred, proj1, proj2);
+ assert(predCount == 4);
+ assert(proj1Count == 4);
+ assert(proj2Count == 4);
+ assert((c == std::array{1, 1, 1, 1}));
+ }
+
+ return true;
+}
+// clang-format on
+
+template <class In2, class Out, class Sent2 = In2>
+constexpr void test_iterator_in1() {
+ test_iterators<cpp17_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp17_input_iterator<int*>>, Sent2>();
+ test_iterators<cpp20_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp20_input_iterator<int*>>, Sent2>();
+ test_iterators<forward_iterator<int*>, In2, Out, forward_iterator<int*>, Sent2>();
+ test_iterators<bidirectional_iterator<int*>, In2, Out, bidirectional_iterator<int*>, Sent2>();
+ test_iterators<random_access_iterator<int*>, In2, Out, random_access_iterator<int*>, Sent2>();
+ test_iterators<contiguous_iterator<int*>, In2, Out, contiguous_iterator<int*>, Sent2>();
+ test_iterators<int*, In2, Out, int*, Sent2>();
+ // static_asserting here to avoid hitting the constant evaluation step limit
+ static_assert(test_iterators<cpp17_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp17_input_iterator<int*>>, Sent2>());
+ static_assert(test_iterators<cpp20_input_iterator<int*>, In2, Out, sentinel_wrapper<cpp20_input_iterator<int*>>, Sent2>());
+ static_assert(test_iterators<forward_iterator<int*>, In2, Out, forward_iterator<int*>, Sent2>());
+ static_assert(test_iterators<bidirectional_iterator<int*>, In2, Out, bidirectional_iterator<int*>, Sent2>());
+ static_assert(test_iterators<random_access_iterator<int*>, In2, Out, random_access_iterator<int*>, Sent2>());
+ static_assert(test_iterators<contiguous_iterator<int*>, In2, Out, contiguous_iterator<int*>, Sent2>());
+ static_assert(test_iterators<int*, In2, Out, int*, Sent2>());
+}
+
+template <class Out>
+constexpr void test_iterators_in1_in2() {
+ test_iterator_in1<cpp17_input_iterator<int*>, Out, sentinel_wrapper<cpp17_input_iterator<int*>>>();
+ test_iterator_in1<cpp20_input_iterator<int*>, Out, sentinel_wrapper<cpp20_input_iterator<int*>>>();
+ test_iterator_in1<forward_iterator<int*>, Out>();
+ test_iterator_in1<bidirectional_iterator<int*>, Out>();
+ test_iterator_in1<random_access_iterator<int*>, Out>();
+ test_iterator_in1<contiguous_iterator<int*>, Out>();
+ test_iterator_in1<int*, Out>();
+}
+
+constexpr bool test() {
+ test_iterators_in1_in2<cpp17_output_iterator<int*>>();
+ test_iterators_in1_in2<cpp20_output_iterator<int*>>();
+ test_iterators_in1_in2<forward_iterator<int*>>();
+ test_iterators_in1_in2<bidirectional_iterator<int*>>();
+ test_iterators_in1_in2<random_access_iterator<int*>>();
+ test_iterators_in1_in2<contiguous_iterator<int*>>();
+ test_iterators_in1_in2<int*>();
+
+ { // check that std::ranges::dangling is returned properly
+ {
+ int b[] = {2, 5, 4, 3, 1};
+ std::array<int, 5> c;
+ std::same_as<std::ranges::in_in_out_result<std::ranges::dangling, int*, int*>> auto ret =
+ std::ranges::transform(std::array{1, 2, 3, 5, 4}, b, c.data(), [](int i, int j) { return i * j; });
+ assert((c == std::array{2, 10, 12, 15, 4}));
+ assert(ret.in2 == b + 5);
+ assert(ret.out == c.data() + c.size());
+ }
+ {
+ int a[] = {2, 5, 4, 3, 1, 4, 5, 6};
+ std::array<int, 8> c;
+ std::same_as<std::ranges::in_in_out_result<int*, std::ranges::dangling, int*>> auto ret =
+ std::ranges::transform(a, std::array{1, 2, 3, 5, 4, 5, 6, 7}, c.data(), [](int i, int j) { return i * j; });
+ assert((c == std::array{2, 10, 12, 15, 4, 20, 30, 42}));
+ assert(ret.in1 == a + 8);
+ assert(ret.out == c.data() + c.size());
+ }
+ {
+ std::array<int, 3> c;
+ std::same_as<std::ranges::in_in_out_result<std::ranges::dangling, std::ranges::dangling, int*>> auto ret =
+ std::ranges::transform(std::array{4, 4, 4}, std::array{4, 4, 4}, c.data(), [](int i, int j) { return i * j; });
+ assert((c == std::array{16, 16, 16}));
+ assert(ret.out == c.data() + c.size());
+ }
+ }
+
+ { // check that returning another type from the projection works
+ struct S { int i; int other; };
+ S a[] = { S{0, 0}, S{1, 0}, S{3, 0}, S{10, 0} };
+ S b[] = { S{0, 10}, S{1, 20}, S{3, 30}, S{10, 40} };
+ std::array<int, 4> c;
+ std::ranges::transform(a, b, c.begin(), [](S s1, S s2) { return s1.i + s2.other; });
+ assert((c == std::array{10, 21, 33, 50}));
+ }
+
+ { // check that std::invoke is used
+ struct S { int i; };
+ S a[] = { S{1}, S{3}, S{2} };
+ S b[] = { S{2}, S{5}, S{3} };
+ std::array<int, 3> c;
+ auto ret = std::ranges::transform(a, b, c.data(), [](int i, int j) { return i + j + 2; }, &S::i, &S::i);
+ assert((c == std::array{5, 10, 7}));
+ assert(ret.out == c.data() + 3);
+ }
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
index 7046d6a..b145d56 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
@@ -25,7 +25,7 @@
TEST_CONSTEXPR bool test_constexpr() {
int ia[] = {0, 1, 1, 3, 4};
const int expected[] = {0, 1, 3, 4};
- const size_t N = 4;
+ const std::size_t N = 4;
auto it = std::unique(std::begin(ia), std::end(ia));
return it == (std::begin(ia) + N)
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
index 9f0c695..91535f0 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
@@ -25,7 +25,7 @@
TEST_CONSTEXPR bool test_constexpr() {
int ia[] = {0, 1, 1, 3, 4};
const int expected[] = {0, 1, 3, 4};
- const size_t N = 4;
+ const std::size_t N = 4;
auto it = std::unique(std::begin(ia), std::end(ia), [](int a, int b) {return a == b; });
return it == (std::begin(ia) + N)
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
index c040e27..d2e0bb5 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
@@ -51,13 +51,13 @@
static_assert(!HasAdjacentFindR<ForwardRangeNotSentinelEqualityComparableWith>);
static_assert(!HasAdjacentFindR<UncheckedRange<NotComparable>>);
-template <size_t N>
+template <std::size_t N>
struct Data {
std::array<int, N> input;
int expected;
};
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test(Data<N> d) {
{
std::same_as<Iter> decltype(auto) ret =
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
index dfa425d..e40f1ed 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
@@ -20,68 +20,119 @@
#include <algorithm>
#include <cassert>
+#include <functional>
-#include "test_macros.h"
#include "test_iterators.h"
+#include "test_macros.h"
+#include "type_algorithms.h"
-template <class Iter1, class Iter2 = Iter1>
-void test_equal() {
- int a[] = {0, 1, 2, 3, 4, 5};
- const unsigned s = sizeof(a) / sizeof(a[0]);
- int b[s] = {0, 1, 2, 5, 4, 5};
+template <class UnderlyingType, class Iter1>
+struct Test {
+ template <class Iter2>
+ TEST_CONSTEXPR_CXX20 void operator()() {
+ UnderlyingType a[] = {0, 1, 2, 3, 4, 5};
+ const unsigned s = sizeof(a) / sizeof(a[0]);
+ UnderlyingType b[s] = {0, 1, 2, 5, 4, 5};
- assert(std::equal(Iter1(a), Iter1(a + s), Iter2(a)));
- assert(std::equal(Iter2(a), Iter2(a + s), Iter1(a)));
- assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(b)));
+ assert(std::equal(Iter1(a), Iter1(a + s), Iter2(a)));
+ assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(b)));
#if TEST_STD_VER >= 14
- assert(std::equal(Iter1(a), Iter1(a + s), Iter2(a), Iter2(a + s)));
- assert(std::equal(Iter2(a), Iter2(a + s), Iter1(a), Iter1(a + s)));
- assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(a), Iter2(a + s - 1)));
- assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(b), Iter2(b + s)));
+ assert(std::equal(Iter1(a), Iter1(a + s), Iter2(a), std::equal_to<>()));
+ assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(b), std::equal_to<>()));
+
+ assert(std::equal(Iter1(a), Iter1(a + s), Iter2(a), Iter2(a + s)));
+ assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(a), Iter2(a + s - 1)));
+ assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(b), Iter2(b + s)));
+
+ assert(std::equal(Iter1(a), Iter1(a + s), Iter2(a), Iter2(a + s), std::equal_to<>()));
+ assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(a), Iter2(a + s - 1), std::equal_to<>()));
+ assert(!std::equal(Iter1(a), Iter1(a + s), Iter2(b), Iter2(b + s), std::equal_to<>()));
#endif
+ }
+};
+
+struct TestNarrowingEqualTo {
+ template <class UnderlyingType>
+ TEST_CONSTEXPR_CXX20 void operator()() {
+ UnderlyingType a[] = {
+ UnderlyingType(0x1000),
+ UnderlyingType(0x1001),
+ UnderlyingType(0x1002),
+ UnderlyingType(0x1003),
+ UnderlyingType(0x1004)};
+ UnderlyingType b[] = {
+ UnderlyingType(0x1600),
+ UnderlyingType(0x1601),
+ UnderlyingType(0x1602),
+ UnderlyingType(0x1603),
+ UnderlyingType(0x1604)};
+
+ assert(std::equal(a, a + 5, b, std::equal_to<char>()));
+#if TEST_STD_VER >= 14
+ assert(std::equal(a, a + 5, b, b + 5, std::equal_to<char>()));
+#endif
+ }
+};
+
+template <class UnderlyingType, class TypeList>
+struct TestIter2 {
+ template <class Iter1>
+ TEST_CONSTEXPR_CXX20 void operator()() {
+ types::for_each(TypeList(), Test<UnderlyingType, Iter1>());
+ }
+};
+
+struct AddressCompare {
+ int i = 0;
+ TEST_CONSTEXPR_CXX20 AddressCompare(int) {}
+
+ operator char() { return static_cast<char>(i); }
+
+ friend TEST_CONSTEXPR_CXX20 bool operator==(const AddressCompare& lhs, const AddressCompare& rhs) {
+ return &lhs == &rhs;
+ }
+
+ friend TEST_CONSTEXPR_CXX20 bool operator!=(const AddressCompare& lhs, const AddressCompare& rhs) {
+ return &lhs != &rhs;
+ }
+};
+
+TEST_CONSTEXPR_CXX20 bool test() {
+ types::for_each(types::cpp17_input_iterator_list<int*>(), TestIter2<int, types::cpp17_input_iterator_list<int*> >());
+ types::for_each(types::cpp17_input_iterator_list<char*>(), TestIter2<char, types::cpp17_input_iterator_list<char*> >());
+ types::for_each(types::cpp17_input_iterator_list<AddressCompare*>(),
+ TestIter2<AddressCompare, types::cpp17_input_iterator_list<AddressCompare*> >());
+
+ types::for_each(types::integral_types(), TestNarrowingEqualTo());
+
+ return true;
}
-#if TEST_STD_VER > 17
-TEST_CONSTEXPR bool test_constexpr() {
- int ia[] = {1, 3, 6, 7};
- int ib[] = {1, 3};
- int ic[] = {1, 3, 5, 7};
- typedef cpp17_input_iterator<int*> II;
- typedef bidirectional_iterator<int*> BI;
+struct Base {};
+struct Derived : virtual Base {};
- return !std::equal(std::begin(ia), std::end(ia), std::begin(ic))
- && !std::equal(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic))
- && std::equal(std::begin(ib), std::end(ib), std::begin(ic))
- && !std::equal(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic))
-
- && std::equal(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)))
- && !std::equal(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)))
- ;
- }
+int main(int, char**) {
+ test();
+#if TEST_STD_VER >= 20
+ static_assert(test());
#endif
+ types::for_each(types::as_pointers<types::cv_qualified_versions<int> >(),
+ TestIter2<int, types::as_pointers<types::cv_qualified_versions<int> > >());
+ types::for_each(types::as_pointers<types::cv_qualified_versions<char> >(),
+ TestIter2<char, types::as_pointers<types::cv_qualified_versions<char> > >());
-int main(int, char**)
-{
- test_equal<cpp17_input_iterator<const int*> >();
- test_equal<random_access_iterator<const int*> >();
+ {
+ Derived d;
+ Derived* a[] = {&d, nullptr};
+ Base* b[] = {&d, nullptr};
- // Test all combinations of cv-qualifiers:
- test_equal<int*>();
- test_equal<int*, const int*>();
- test_equal<int*, volatile int*>();
- test_equal<int*, const volatile int*>();
- test_equal<const int*>();
- test_equal<const int*, volatile int*>();
- test_equal<const int*, const volatile int*>();
- test_equal<volatile int*>();
- test_equal<volatile int*, const volatile int*>();
- test_equal<const volatile int*>();
-
-#if TEST_STD_VER > 17
- static_assert(test_constexpr());
+ assert(std::equal(a, a + 2, b));
+#if TEST_STD_VER >= 14
+ assert(std::equal(a, a + 2, b, b + 2));
#endif
+ }
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp
index 9e9f82e..828f75e 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp
@@ -88,6 +88,21 @@
}
}
+ { // check that false is returned for non-equal ranges
+ {
+ int a[] = {1, 2, 3, 4};
+ int b[] = {1, 2, 4, 4};
+ assert(!std::ranges::equal(Iter1(a), Sent1(Iter1(a + 4)), Iter2(b), Sent2(Iter2(b + 4))));
+ }
+ {
+ int a[] = {1, 2, 3, 4};
+ int b[] = {1, 2, 4, 4};
+ auto range1 = std::ranges::subrange(Iter1(a), Sent1(Iter1(a + 4)));
+ auto range2 = std::ranges::subrange(Iter2(b), Sent2(Iter2(b + 4)));
+ assert(!std::ranges::equal(range1, range2));
+ }
+ }
+
{ // check that the predicate is used (return true)
{
int a[] = {1, 2, 3, 4};
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp
index 5673c70..cea3042 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp
@@ -71,7 +71,7 @@
struct Data {
std::array<int, N1> input1;
std::array<int, N2> input2;
- ptrdiff_t expected;
+ std::ptrdiff_t expected;
};
template <class Iter1, class Sent1, class Iter2, class Sent2, int N1, int N2>
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
index 6eb5c24..371f6c9 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
@@ -25,7 +25,7 @@
TEST_CONSTEXPR bool test_constexpr() {
int ia[] = {1, 3, 6, 7};
int expected[] = {3, 5, 8, 9};
- const size_t N = 4;
+ const std::size_t N = 4;
auto it = std::for_each_n(std::begin(ia), N, [](int &a) { a += 2; });
return it == (std::begin(ia) + N)
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp
index a1abdaf..cbeb7eb 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp
@@ -131,6 +131,13 @@
auto range = std::ranges::subrange(It(a), Sent(It(a + 5)));
assert(std::ranges::binary_search(range, 1));
}
+
+ { // check that false is returned when the element doesn't exist, but an element with a greater value is in the range
+ int a[] = {1, 2, 4};
+ assert(!std::ranges::binary_search(It(a), Sent(It(a + 3)), 3));
+ auto range = std::ranges::subrange(It(a), Sent(It(a + 3)));
+ assert(!std::ranges::binary_search(range, 3));
+ }
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/ranges.lower_bound.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/ranges.lower_bound.pass.cpp
index e7af57b..cffce51 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/ranges.lower_bound.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/ranges.lower_bound.pass.cpp
@@ -194,6 +194,22 @@
assert(base(ret) == a);
}
}
+
+ { // check that the middle of a range is returned when there are smaller and larger elements
+ {
+ int a[] = {1, 2, 3, 4, 6, 7, 8};
+ auto ret = std::ranges::lower_bound(It(a), It(a + 7), 5);
+ assert(base(ret) == a + 4);
+ assert(*ret == 6);
+ }
+ {
+ int a[] = {1, 2, 3, 4, 6, 7, 8};
+ auto range = std::ranges::subrange(It(a), It(a + 7));
+ auto ret = std::ranges::lower_bound(range, 5);
+ assert(base(ret) == a + 4);
+ assert(*ret == 6);
+ }
+ }
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/ranges.upper_bound.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/ranges.upper_bound.pass.cpp
index 762fd78..cab7831 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/ranges.upper_bound.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/ranges.upper_bound.pass.cpp
@@ -193,6 +193,22 @@
assert(base(ret) == a + 1);
}
}
+
+ { // check that the middle of a range is returned when there are smaller and larger elements
+ {
+ int a[] = {1, 2, 3, 4, 6, 7, 8};
+ auto ret = std::ranges::upper_bound(It(a), It(a + 7), 5);
+ assert(base(ret) == a + 4);
+ assert(*ret == 6);
+ }
+ {
+ int a[] = {1, 2, 3, 4, 6, 7, 8};
+ auto range = std::ranges::subrange(It(a), It(a + 7));
+ auto ret = std::ranges::upper_bound(range, 5);
+ assert(base(ret) == a + 4);
+ assert(*ret == 6);
+ }
+ }
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp
index 1ea5199..9756a6f 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <algorithm>
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
index f294d9d..fc207c9 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
@@ -72,7 +72,7 @@
// !indirect_strict_weak_order<Comp, projected<iterator_t<R>, Proj>>
static_assert(!HasIsHeapRange<R<NoComparator*>>);
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_one(std::array<int, N> input, bool expected) {
auto begin = Iter(input.data());
auto end = Sent(Iter(input.data() + input.size()));
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
index e6a74fe..f1dc6ad 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
@@ -72,8 +72,8 @@
// !indirect_strict_weak_order<Comp, projected<iterator_t<R>, Proj>>
static_assert(!HasIsHeapUntilRange<R<NoComparator*>>);
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(std::array<int, N> input, size_t until_index) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(std::array<int, N> input, std::size_t until_index) {
auto begin = Iter(input.data());
auto end = Sent(Iter(input.data() + input.size()));
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
index 59b8283..5d8086d 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
@@ -58,14 +58,14 @@
static_assert(!HasMakeHeapR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasMakeHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
assert(heapified == expected);
assert(base(last) == heapified.data() + heapified.size());
assert(std::is_heap(heapified.begin(), heapified.end()));
}
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
{ // (iterator, sentinel) overload.
auto heapified = input;
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp
index ba11faa..cc10d05 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <algorithm>
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp
index 336b4ac..3820b67 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// <algorithm>
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
index 6ce05db..e190586 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
@@ -58,7 +58,7 @@
static_assert(!HasPopHeapR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasPopHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
assert(heapified == expected);
assert(base(last) == heapified.data() + heapified.size());
@@ -66,7 +66,7 @@
assert(*std::max_element(heapified.begin(), heapified.end()) == heapified.back());
}
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
assert(!input.empty());
assert(std::is_heap(input.begin(), input.end()));
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
index e2dc0ac..331f077 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
@@ -58,14 +58,14 @@
static_assert(!HasPushHeapR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasPushHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
assert(heapified == expected);
assert(base(last) == heapified.data() + heapified.size());
assert(std::is_heap(heapified.begin(), heapified.end()));
}
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
if (!input.empty()) {
assert(std::is_heap(input.begin(), input.end() - 1));
diff --git a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp
similarity index 63%
rename from third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp
index 0ed37a2..e3cb233 100644
--- a/third_party/llvm-project/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp
@@ -21,8 +21,8 @@
struct Stats {
int compared = 0;
- int copied = 0;
- int moved = 0;
+ int copied = 0;
+ int moved = 0;
} stats;
struct MyInt {
@@ -46,30 +46,30 @@
}
};
-int main(int, char**)
-{
- const int N = 100'000;
+int main(int, char**) {
+ constexpr int N = (1 << 20);
std::vector<MyInt> v;
v.reserve(N);
std::mt19937 g;
- for (int i = 0; i < N; ++i)
- v.emplace_back(g());
- std::make_heap(v.begin(), v.end());
-
- // The exact stats of our current implementation are recorded here.
- // If something changes to make them go a bit up or down, that's probably fine,
- // and we can just update this test.
- // But if they suddenly leap upward, that's a bad thing.
-
- stats = {};
- std::sort_heap(v.begin(), v.end());
- assert(stats.copied == 0);
- assert(stats.moved == 1'764'997);
+ for (int i = 0; i < N; ++i) {
+ v.emplace_back(i);
+ }
+ for (int logn = 10; logn <= 20; ++logn) {
+ const int n = (1 << logn);
+ auto first = v.begin();
+ auto last = v.begin() + n;
+ std::shuffle(first, last, g);
+ std::make_heap(first, last);
+ // The exact stats of our current implementation are recorded here.
+ stats = {};
+ std::sort_heap(first, last);
+ LIBCPP_ASSERT(stats.copied == 0);
+ LIBCPP_ASSERT(stats.moved <= 2 * n + n * logn);
#ifndef _LIBCPP_ENABLE_DEBUG_MODE
- assert(stats.compared == 1'534'701);
+ LIBCPP_ASSERT(stats.compared <= n * logn);
#endif
-
- assert(std::is_sorted(v.begin(), v.end()));
-
+ LIBCPP_ASSERT(std::is_sorted(first, last));
+ LIBCPP_ASSERT(stats.compared <= 2 * n * logn);
+ }
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
index faf1e23..128ff80 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
@@ -25,6 +25,7 @@
#include <array>
#include <concepts>
#include <functional>
+#include <random>
#include <ranges>
#include "almost_satisfies_types.h"
@@ -58,14 +59,14 @@
static_assert(!HasSortHeapR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasSortHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
constexpr void verify_sorted(const std::array<T, N>& sorted, Iter last, std::array<T, N> expected) {
assert(sorted == expected);
assert(base(last) == sorted.data() + sorted.size());
assert(std::is_sorted(sorted.begin(), sorted.end()));
}
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
assert(std::is_heap(input.begin(), input.end()));
@@ -212,9 +213,63 @@
return true;
}
+struct Stats {
+ int compared = 0;
+ int copied = 0;
+ int moved = 0;
+} stats;
+
+struct MyInt {
+ int value;
+ explicit MyInt(int xval) : value(xval) {}
+ MyInt(const MyInt& other) : value(other.value) { ++stats.copied; }
+ MyInt(MyInt&& other) : value(other.value) { ++stats.moved; }
+ MyInt& operator=(const MyInt& other) {
+ value = other.value;
+ ++stats.copied;
+ return *this;
+ }
+ MyInt& operator=(MyInt&& other) {
+ value = other.value;
+ ++stats.moved;
+ return *this;
+ }
+ static bool Comp(const MyInt& a, const MyInt& b) {
+ ++stats.compared;
+ return a.value < b.value;
+ }
+};
+
+void test_complexity() {
+ constexpr int N = (1 << 20);
+ std::vector<MyInt> v;
+ v.reserve(N);
+ std::mt19937 g;
+ for (int i = 0; i < N; ++i) {
+ v.emplace_back(i);
+ }
+ for (int logn = 10; logn <= 20; ++logn) {
+ const int n = (1 << logn);
+ auto first = v.begin();
+ auto last = v.begin() + n;
+ std::shuffle(first, last, g);
+ std::make_heap(first, last, &MyInt::Comp);
+ // The exact stats of our current implementation are recorded here.
+ stats = {};
+ std::ranges::sort_heap(first, last, &MyInt::Comp);
+ LIBCPP_ASSERT(stats.copied == 0);
+ LIBCPP_ASSERT(stats.moved <= 2 * n + n * logn);
+#ifndef _LIBCPP_ENABLE_DEBUG_MODE
+ LIBCPP_ASSERT(stats.compared <= n * logn);
+#endif
+ LIBCPP_ASSERT(std::is_sorted(first, last, &MyInt::Comp));
+ LIBCPP_ASSERT(stats.compared <= 2 * n * logn);
+ }
+}
+
int main(int, char**) {
test();
static_assert(test());
-
+ test_complexity();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.max.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.max.pass.cpp
index 3e0d82d..e9e5240 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.max.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.max.pass.cpp
@@ -176,19 +176,38 @@
template <class It, class Sent = It>
constexpr void test_range_types() {
- int a[] = {7, 6, 9, 3, 5, 1, 2, 4};
+ std::iter_value_t<It> a[] = {7, 6, 9, 3, 5, 1, 2, 4};
auto range = std::ranges::subrange(It(a), Sent(It(a + 8)));
- int ret = std::ranges::max(range);
+ auto ret = std::ranges::max(range);
assert(ret == 9);
}
constexpr void test_range() {
- { // check that all range types work
- test_range_types<cpp20_input_iterator<int*>, sentinel_wrapper<cpp20_input_iterator<int*>>>();
- test_range_types<forward_iterator<int*>>();
- test_range_types<bidirectional_iterator<int*>>();
- test_range_types<random_access_iterator<int*>>();
- test_range_types<contiguous_iterator<int*>>();
+ // check that all range types work
+ {
+ struct NonTrivialInt {
+ int val_;
+ constexpr NonTrivialInt(int val) : val_(val) {}
+ constexpr NonTrivialInt(const NonTrivialInt& other) : val_(other.val_) {}
+ constexpr NonTrivialInt& operator=(const NonTrivialInt& other) {
+ val_ = other.val_;
+ return *this;
+ }
+
+ constexpr ~NonTrivialInt() {}
+
+ auto operator<=>(const NonTrivialInt&) const = default;
+ };
+
+ auto call_with_sentinels = []<class Iter> {
+ if constexpr (std::forward_iterator<Iter>)
+ test_range_types<Iter, Iter>();
+ test_range_types<Iter, sentinel_wrapper<Iter>>();
+ test_range_types<Iter, sized_sentinel<Iter>>();
+ };
+
+ types::for_each(types::cpp20_input_iterator_list<int*>{}, call_with_sentinels);
+ types::for_each(types::cpp20_input_iterator_list<NonTrivialInt*>{}, call_with_sentinels);
}
int a[] = {7, 6, 9, 3, 5, 1, 2, 4};
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.min.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.min.pass.cpp
index a211fe6..3d92964 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.min.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.min.pass.cpp
@@ -171,19 +171,38 @@
template <class It, class Sent = It>
constexpr void test_range_types() {
- int a[] = {7, 6, 9, 3, 5, 1, 2, 4};
+ std::iter_value_t<It> a[] = {7, 6, 9, 3, 5, 1, 2, 4};
auto range = std::ranges::subrange(It(a), Sent(It(a + 8)));
- int ret = std::ranges::min(range);
+ auto ret = std::ranges::min(range);
assert(ret == 1);
}
constexpr void test_range() {
- { // check that all range types work
- test_range_types<cpp20_input_iterator<int*>, sentinel_wrapper<cpp20_input_iterator<int*>>>();
- test_range_types<forward_iterator<int*>>();
- test_range_types<bidirectional_iterator<int*>>();
- test_range_types<random_access_iterator<int*>>();
- test_range_types<contiguous_iterator<int*>>();
+ // check that all range types work
+ {
+ struct NonTrivialInt {
+ int val_;
+ constexpr NonTrivialInt(int val) : val_(val) {}
+ constexpr NonTrivialInt(const NonTrivialInt& other) : val_(other.val_) {}
+ constexpr NonTrivialInt& operator=(const NonTrivialInt& other) {
+ val_ = other.val_;
+ return *this;
+ }
+
+ constexpr ~NonTrivialInt() {}
+
+ auto operator<=>(const NonTrivialInt&) const = default;
+ };
+
+ auto call_with_sentinels = []<class Iter> {
+ if constexpr (std::forward_iterator<Iter>)
+ test_range_types<Iter, Iter>();
+ test_range_types<Iter, sentinel_wrapper<Iter>>();
+ test_range_types<Iter, sized_sentinel<Iter>>();
+ };
+
+ types::for_each(types::cpp20_input_iterator_list<int*>{}, call_with_sentinels);
+ types::for_each(types::cpp20_input_iterator_list<NonTrivialInt*>{}, call_with_sentinels);
}
int a[] = {7, 6, 9, 3, 5, 1, 2, 4};
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp
index 828a820..fd0d6df 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp
@@ -30,6 +30,7 @@
#include <functional>
#include <memory>
#include <ranges>
+#include <string>
#include "test_iterators.h"
@@ -324,6 +325,26 @@
assert(ret.min == 1);
assert(ret.max == 4);
}
+ {
+ // check that the input iterator isn't moved from multiple times
+ const std::string str{"this long string will be dynamically allocated"};
+ std::string a[] = {str};
+ auto range = std::ranges::subrange(
+ cpp20_input_iterator(std::move_iterator(a)), sentinel_wrapper(cpp20_input_iterator(std::move_iterator(a + 1))));
+ auto ret = std::ranges::minmax(range);
+ assert(ret.min == str);
+ assert(ret.max == str);
+ }
+ {
+ // check that the forward iterator isn't moved from multiple times
+ const std::string str{"this long string will be dynamically allocated"};
+ std::string a[] = {str};
+ auto range =
+ std::ranges::subrange(forward_iterator(std::move_iterator(a)), forward_iterator(std::move_iterator(a + 1)));
+ auto ret = std::ranges::minmax(range);
+ assert(ret.min == str);
+ assert(ret.max == str);
+ }
}
constexpr bool test() {
@@ -338,15 +359,5 @@
test();
static_assert(test());
- {
- // check that the iterator isn't moved from multiple times
- std::shared_ptr<int> a[] = { std::make_shared<int>(42) };
- auto range = std::ranges::subrange(std::move_iterator(a), std::move_iterator(a + 1));
- auto [min, max] = std::ranges::minmax(range);
- assert(a[0] == nullptr);
- assert(min != nullptr);
- assert(max == min);
- }
-
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
index a648e7d..ad3c8ab 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
@@ -64,8 +64,8 @@
static_assert(!HasNthElementR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasNthElementR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <size_t N, class T, class Iter>
-constexpr void verify_nth(const std::array<T, N>& partially_sorted, size_t nth_index, Iter last, T expected_nth) {
+template <std::size_t N, class T, class Iter>
+constexpr void verify_nth(const std::array<T, N>& partially_sorted, std::size_t nth_index, Iter last, T expected_nth) {
// Note that the exact output of `nth_element` is unspecified and may vary between implementations.
assert(base(last) == partially_sorted.end());
@@ -92,8 +92,8 @@
}
}
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(std::array<int, N> input, size_t nth_index, std::optional<int> expected_nth = {}) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(std::array<int, N> input, std::size_t nth_index, std::optional<int> expected_nth = {}) {
assert(expected_nth || nth_index == N);
{ // (iterator, sentinel) overload.
@@ -126,7 +126,7 @@
}
}
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_all_cases(std::array<int, N> input) {
auto sorted = input;
std::sort(sorted.begin(), sorted.end());
@@ -162,7 +162,7 @@
{ // nth element is in the right place.
std::array input = {6, 5, 3, 1, 4, 2};
- constexpr size_t N = input.size();
+ constexpr std::size_t N = input.size();
test_one<Iter, Sent, N>(input, 2, /*expected_nth=*/3);
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
index 5e7b839..77a7799 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
@@ -50,7 +50,7 @@
static_assert(!HasNextPermutationR<BidirectionalRangeNotSentinelWeaklyEqualityComparableWith>);
static_assert(!HasNextPermutationR<UncheckedRange<const int*>>); // not sortable
-constexpr size_t factorial(size_t i) {
+constexpr std::size_t factorial(size_t i) {
std::array memoized = {1, 1, 2, 6, 24, 120, 720, 5040, 40320};
return memoized[i];
}
@@ -87,8 +87,8 @@
// lexicographically greater than the previous. If these two conditions hold (the number of permutations is `N!`, and
// each permutation is lexicographically greater than the previous one), it follows that the
// `ranges::next_permutation` algorithm works correctly.
- for (size_t i = 0; i <= current_permutation.size(); ++i) {
- size_t count = 0;
+ for (std::size_t i = 0; i <= current_permutation.size(); ++i) {
+ std::size_t count = 0;
bool next_found = true;
while (next_found) {
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
index 3ec1af1..a62138e 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
@@ -50,7 +50,7 @@
static_assert(!HasPrevPermutationR<BidirectionalRangeNotSentinelWeaklyEqualityComparableWith>);
static_assert(!HasPrevPermutationR<UncheckedRange<const int*>>); // not sortable
-constexpr size_t factorial(size_t i) {
+constexpr std::size_t factorial(size_t i) {
std::array memoized = {1, 1, 2, 6, 24, 120, 720, 5040, 40320};
return memoized[i];
}
@@ -87,8 +87,8 @@
// lexicographically less than the previous. If these two conditions hold (the number of permutations is `N!`, and
// each permutation is lexicographically less than the previous one), it follows that the `ranges::prev_permutation`
// algorithm works correctly.
- for (size_t i = 0; i <= current_permutation.size(); ++i) {
- size_t count = 0;
+ for (std::size_t i = 0; i <= current_permutation.size(); ++i) {
+ std::size_t count = 0;
bool next_found = true;
while (next_found) {
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
index 7a4ebd9..532ee9b 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
@@ -119,17 +119,17 @@
static_assert(std::is_same_v<std::ranges::partial_sort_copy_result<int, int>, std::ranges::in_out_result<int, int>>);
-template <class Iter, class Sent, class OutIter, class OutSent, size_t N>
+template <class Iter, class Sent, class OutIter, class OutSent, std::size_t N>
constexpr void test_one(
- std::array<int, N> input, size_t input_size, size_t output_size, std::array<int, N> sorted) {
+ std::array<int, N> input, std::size_t input_size, size_t output_size, std::array<int, N> sorted) {
assert(input_size <= N);
assert(output_size <= N + 1); // To support testing the case where output size exceeds input size.
using ResultT = std::ranges::partial_sort_copy_result<Iter, OutIter>;
// To support testing the case where output size exceeds input size; also makes sure calling `out.data() + int()` is
// valid.
- constexpr size_t OutputSize = N + 1;
- size_t result_size = std::ranges::min(input_size, output_size);
+ constexpr std::size_t OutputSize = N + 1;
+ std::size_t result_size = std::ranges::min(input_size, output_size);
auto begin = input.data();
auto end = input.data() + input_size;
@@ -167,13 +167,13 @@
}
-template <class Iter, class Sent, class OutIter, class OutSent, size_t N>
+template <class Iter, class Sent, class OutIter, class OutSent, std::size_t N>
constexpr void test_all_subsequences(const std::array<int, N> input) {
auto sorted = input;
std::sort(sorted.begin(), sorted.end());
// Whole input, increasing output size. Also check the case when `output_size` exceeds input size.
- for (size_t out_size = 0; out_size <= N + 1; ++out_size) {
+ for (std::size_t out_size = 0; out_size <= N + 1; ++out_size) {
test_one<Iter, Sent, OutIter, OutSent>(input, N, out_size, sorted);
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
index e70828f..af30466 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
@@ -62,8 +62,8 @@
static_assert(!HasPartialSortR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasPartialSortR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(std::array<int, N> input, size_t mid_index, std::array<int, N> sorted) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(std::array<int, N> input, std::size_t mid_index, std::array<int, N> sorted) {
{ // (iterator, sentinel) overload.
auto partially_sorted = input;
auto begin = Iter(partially_sorted.data());
@@ -89,12 +89,12 @@
}
}
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_all_subsequences(std::array<int, N> input) {
auto sorted = input;
std::sort(sorted.begin(), sorted.end());
- for (size_t n = 0; n <= N; ++n) {
+ for (std::size_t n = 0; n <= N; ++n) {
test_one<Iter, Sent, N>(input, n, sorted);
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
index 96f4c1c..2463bf7 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
@@ -58,7 +58,7 @@
static_assert(!HasSortR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasSortR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
constexpr void test_one(std::array<int, N> input, std::array<int, N> expected) {
{ // (iterator, sentinel) overload.
auto sorted = input;
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
index f83d093..ea0a3eb 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
@@ -57,7 +57,7 @@
static_assert(!HasStableSortR<UncheckedRange<int*>, BadComparator>);
static_assert(!HasStableSortR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
void test_one(std::array<int, N> input, std::array<int, N> expected) {
{ // (iterator, sentinel) overload.
auto sorted = input;
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp
new file mode 100644
index 0000000..4c940eb
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp
@@ -0,0 +1,122 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <algorithm>
+
+// template<class InputIterator1, class InputIterator2, class Cmp>
+// constexpr auto
+// lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+// InputIterator2 first2, InputIterator2 last2)
+
+#include <array>
+#include <algorithm>
+#include <cassert>
+#include <compare>
+#include <concepts>
+
+#include "test_macros.h"
+#include "test_comparisons.h"
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2, typename C1, typename C2, typename Order>
+constexpr void test_lexicographical_compare(C1 a, C2 b, Order expected) {
+ std::same_as<Order> decltype(auto) result =
+ std::lexicographical_compare_three_way(Iter1{a.begin()}, Iter1{a.end()}, Iter2{b.begin()}, Iter2{b.end()});
+ assert(expected == result);
+}
+
+template <typename Iter1, typename Iter2>
+constexpr void test_given_iterator_types() {
+ // Both inputs empty
+ test_lexicographical_compare<Iter1, Iter2>(std::array<int, 0>{}, std::array<int, 0>{}, std::strong_ordering::equal);
+ // Left input empty
+ test_lexicographical_compare<Iter1, Iter2>(std::array<int, 0>{}, std::array{0, 1}, std::strong_ordering::less);
+ // Right input empty
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array<int, 0>{}, std::strong_ordering::greater);
+
+ // Identical arrays
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array{0, 1}, std::strong_ordering::equal);
+ // "Less" on 2nd element
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array{0, 2}, std::strong_ordering::less);
+ // "Greater" on 2nd element
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 2}, std::array{0, 1}, std::strong_ordering::greater);
+ // "Greater" on 2nd element, but "less" on first entry
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 2}, std::array{1, 1}, std::strong_ordering::less);
+ // Identical elements, but longer
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array{0, 1, 2}, std::strong_ordering::less);
+ // Identical elements, but shorter
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1, 2}, std::array{0, 1}, std::strong_ordering::greater);
+}
+
+template <typename Iter1>
+constexpr void test_iterator_types1() {
+ test_given_iterator_types<Iter1, int*>();
+ test_given_iterator_types<Iter1, const int*>();
+ test_given_iterator_types<Iter1, cpp17_input_iterator<const int*>>();
+ test_given_iterator_types<Iter1, forward_iterator<const int*>>();
+ test_given_iterator_types<Iter1, bidirectional_iterator<const int*>>();
+ test_given_iterator_types<Iter1, random_access_iterator<const int*>>();
+ test_given_iterator_types<Iter1, contiguous_iterator<const int*>>();
+}
+
+constexpr void test_iterator_types() {
+ // Exhaustively test all combinations of `int*`, `const int*`, `cpp17_input_iterator`,
+ // `forward_iterator`, `bidirectional_iterator`, `random_access_iterator`,
+ // `contiguous_iterator`.
+ //
+ // `lexicographical_compare_three_way` has a fast path which triggers if both
+ // iterators are random access iterators.
+
+ test_iterator_types1<int*>();
+ test_iterator_types1<const int*>();
+ test_iterator_types1<cpp17_input_iterator<const int*>>();
+ test_iterator_types1<forward_iterator<const int*>>();
+ test_iterator_types1<bidirectional_iterator<const int*>>();
+ test_iterator_types1<random_access_iterator<const int*>>();
+ test_iterator_types1<contiguous_iterator<const int*>>();
+}
+
+// Check for other comparison categories
+constexpr void test_comparison_categories() {
+ // Check all comparison categories for inputs with a difference in the contained elements
+ test_lexicographical_compare<const StrongOrder*, const StrongOrder*>(
+ std::array<StrongOrder, 2>{0, 1}, std::array<StrongOrder, 2>{1, 1}, std::strong_ordering::less);
+ test_lexicographical_compare<const WeakOrder*, const WeakOrder*>(
+ std::array<WeakOrder, 2>{0, 1}, std::array<WeakOrder, 2>{1, 1}, std::weak_ordering::less);
+ test_lexicographical_compare<const PartialOrder*, const PartialOrder*>(
+ std::array<PartialOrder, 2>{0, 1}, std::array<PartialOrder, 2>{1, 1}, std::partial_ordering::less);
+
+ // Check comparison categories with arrays of different sizes
+ test_lexicographical_compare<const StrongOrder*, const StrongOrder*>(
+ std::array<StrongOrder, 2>{0, 1}, std::array<StrongOrder, 3>{0, 1, 2}, std::strong_ordering::less);
+ test_lexicographical_compare<const WeakOrder*, const WeakOrder*>(
+ std::array<WeakOrder, 2>{0, 1}, std::array<WeakOrder, 3>{0, 1, 2}, std::weak_ordering::less);
+ test_lexicographical_compare<const PartialOrder*, const PartialOrder*>(
+ std::array<PartialOrder, 2>{0, 1}, std::array<PartialOrder, 3>{0, 1, 2}, std::partial_ordering::less);
+
+ // Check for a `partial_ordering::unordered` result
+ test_lexicographical_compare<const PartialOrder*, const PartialOrder*>(
+ std::array<PartialOrder, 2>{std::numeric_limits<int>::min(), 1},
+ std::array<PartialOrder, 3>{0, 1, 2},
+ std::partial_ordering::unordered);
+}
+
+constexpr bool test() {
+ test_iterator_types();
+ test_comparison_categories();
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.pass.cpp
new file mode 100644
index 0000000..201ff9e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.pass.cpp
@@ -0,0 +1,174 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <algorithm>
+
+// template<class InputIterator1, class InputIterator2, class Cmp>
+// constexpr auto
+// lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+// InputIterator2 first2, InputIterator2 last2,
+// Cmp comp)
+// -> decltype(comp(*b1, *b2));
+
+#include <array>
+#include <algorithm>
+#include <cassert>
+#include <compare>
+#include <concepts>
+#include <limits>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+using std::array;
+
+constexpr auto compare_last_digit_strong = [](int a, int b) -> std::strong_ordering { return (a % 10) <=> (b % 10); };
+constexpr auto compare_last_digit_weak = [](int a, int b) -> std::weak_ordering { return (a % 10) <=> (b % 10); };
+constexpr auto compare_last_digit_partial = [](int a, int b) -> std::partial_ordering {
+ if (a == std::numeric_limits<int>::min() || b == std::numeric_limits<int>::min())
+ return std::partial_ordering::unordered;
+ return (a % 10) <=> (b % 10);
+};
+constexpr auto compare_int_result = [](int a, int b) -> int { return (a % 10) - (b % 10); };
+
+struct StructWithoutCallOperator {};
+
+template <class T>
+concept has_lexicographical_compare =
+ requires(int* ptr, T comp) { std::lexicographical_compare_three_way(ptr, ptr, ptr, ptr, comp); };
+
+// `std::lexicographical_compare_three_way` accepts valid types
+static_assert(has_lexicographical_compare<decltype(compare_last_digit_strong)>);
+static_assert(has_lexicographical_compare<decltype(compare_last_digit_weak)>);
+static_assert(has_lexicographical_compare<decltype(compare_last_digit_partial)>);
+// `std::lexicographical_compare_three_way` rejects non-invocable comparators
+static_assert(!has_lexicographical_compare<StructWithoutCallOperator>);
+// `std::lexicographical_compare_three_way` accepts invalid comparators returning a wrong type.
+// This will trigger a `static_assert` only when actually invoking `has_lexicographical_compare`.
+static_assert(has_lexicographical_compare<decltype(compare_int_result)>);
+
+template <typename Iter1, typename Iter2, typename C1, typename C2, typename Order, typename Comparator>
+constexpr void test_lexicographical_compare(C1 a, C2 b, Comparator comp, Order expected) {
+ std::same_as<Order> decltype(auto) result =
+ std::lexicographical_compare_three_way(Iter1{a.begin()}, Iter1{a.end()}, Iter2{b.begin()}, Iter2{b.end()}, comp);
+ assert(expected == result);
+}
+
+template <typename Iter1, typename Iter2>
+constexpr void test_given_iterator_types() {
+ auto cmp = compare_last_digit_strong;
+ // Both inputs empty
+ test_lexicographical_compare<Iter1, Iter2>(
+ std::array<int, 0>{}, std::array<int, 0>{}, cmp, std::strong_ordering::equal);
+ // Left input empty
+ test_lexicographical_compare<Iter1, Iter2>(std::array<int, 0>{}, std::array{0, 1}, cmp, std::strong_ordering::less);
+ // Right input empty
+ test_lexicographical_compare<Iter1, Iter2>(
+ std::array{0, 1}, std::array<int, 0>{}, cmp, std::strong_ordering::greater);
+
+ // Identical arrays
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array{0, 1}, cmp, std::strong_ordering::equal);
+ // "Less" on 2nd element
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array{0, 2}, cmp, std::strong_ordering::less);
+ // "Greater" on 2nd element
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 2}, std::array{0, 1}, cmp, std::strong_ordering::greater);
+ // "Greater" on 2nd element, but "less" on first entry
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 2}, std::array{1, 1}, cmp, std::strong_ordering::less);
+ // Identical elements, but longer
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1}, std::array{0, 1, 2}, cmp, std::strong_ordering::less);
+ // Identical elements, but shorter
+ test_lexicographical_compare<Iter1, Iter2>(std::array{0, 1, 2}, std::array{0, 1}, cmp, std::strong_ordering::greater);
+ // Identical arrays, but only if we take the comparator
+ // into account instead of using the default comparator
+ test_lexicographical_compare<Iter1, Iter2>(std::array{10, 21}, std::array{10, 31}, cmp, std::strong_ordering::equal);
+}
+
+template <typename Iter1>
+constexpr void test_iterator_types1() {
+ test_given_iterator_types<Iter1, int*>();
+ test_given_iterator_types<Iter1, const int*>();
+ test_given_iterator_types<Iter1, cpp17_input_iterator<const int*>>();
+ test_given_iterator_types<Iter1, forward_iterator<const int*>>();
+ test_given_iterator_types<Iter1, bidirectional_iterator<const int*>>();
+ test_given_iterator_types<Iter1, random_access_iterator<const int*>>();
+ test_given_iterator_types<Iter1, contiguous_iterator<const int*>>();
+}
+
+constexpr void test_iterator_types() {
+ // Exhaustively test all combinations of `int*`, `const int*`, `cpp17_input_iterator`,
+ // `forward_iterator`, `bidirectional_iterator`, `random_access_iterator`,
+ // `contiguous_iterator`.
+ //
+ // `lexicographical_compare_three_way` has a fast path which triggers if both
+ // iterators are random access iterators.
+
+ test_iterator_types1<int*>();
+ test_iterator_types1<const int*>();
+ test_iterator_types1<cpp17_input_iterator<const int*>>();
+ test_iterator_types1<forward_iterator<const int*>>();
+ test_iterator_types1<bidirectional_iterator<const int*>>();
+ test_iterator_types1<random_access_iterator<const int*>>();
+ test_iterator_types1<contiguous_iterator<const int*>>();
+}
+
+// Check for other comparison categories
+constexpr void test_comparison_categories() {
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0, 1}, std::array{10, 11}, compare_last_digit_weak, std::weak_ordering::equivalent);
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0, 1}, std::array{20, 11}, compare_last_digit_partial, std::partial_ordering::equivalent);
+
+ // Check for all comparison categories with arrays of different sizes
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0}, std::array{0, 1}, compare_last_digit_strong, std::strong_ordering::less);
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0}, std::array{0, 1}, compare_last_digit_weak, std::weak_ordering::less);
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0}, std::array{0, 1}, compare_last_digit_partial, std::partial_ordering::less);
+
+ // Check for a `partial_ordering::unordered` result
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{std::numeric_limits<int>::min(), 1},
+ std::array{0, 1, 2},
+ compare_last_digit_partial,
+ std::partial_ordering::unordered);
+}
+
+// Test for "Complexity: At most N applications of comp."
+constexpr void test_comparator_invocation_count() {
+ int compare_invocation_count = 0;
+ auto compare_last_digit_counting = [&](int a, int b) -> std::strong_ordering {
+ ++compare_invocation_count;
+ return (a % 10) <=> (b % 10);
+ };
+ // If one of the ranges is empty, the comparator must not be called at all
+ compare_invocation_count = 0;
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0, 1, 2, 3}, std::array<int, 0>{}, compare_last_digit_counting, std::strong_ordering::greater);
+ assert(compare_invocation_count == 0);
+ // The comparator is invoked only `min(left.size(), right.size())` times
+ test_lexicographical_compare<const int*, const int*>(
+ std::array{0, 1, 2}, std::array{0, 1, 2, 3}, compare_last_digit_counting, std::strong_ordering::less);
+ assert(compare_invocation_count == 3);
+}
+
+constexpr bool test() {
+ test_iterator_types();
+ test_comparison_categories();
+ test_comparator_invocation_count();
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.verify.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.verify.cpp
new file mode 100644
index 0000000..bac3ec5
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.verify.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <algorithm>
+
+// template<class InputIterator1, class InputIterator2, class Cmp>
+// constexpr auto
+// lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1,
+// InputIterator2 first2, InputIterator2 last2,
+// Cmp comp)
+// -> decltype(comp(*b1, *b2));
+
+#include <array>
+#include <algorithm>
+#include <cassert>
+#include <compare>
+
+#include "test_macros.h"
+#include "almost_satisfies_types.h"
+
+constexpr bool incorrect_comparator(int a, int b) { return a < b; }
+
+auto test_incorrect_comparator() {
+ std::array a{90, 81};
+ std::array b{10, 11};
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}The comparator passed to lexicographical_compare_three_way must return a comparison category type}}
+ // expected-error@*:* {{no viable conversion}}
+ return std::lexicographical_compare_three_way(a.begin(), a.end(), b.begin(), b.end(), incorrect_comparator);
+}
+
+auto test_invalid_difference_type_first(
+ RandomAccessIteratorBadDifferenceType a, RandomAccessIteratorBadDifferenceType b, int* c, int* d) {
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Using a non-integral difference_type is undefined behavior}}}}
+ return std::lexicographical_compare_three_way(a, b, c, d, std::compare_three_way());
+}
+
+auto test_invalid_difference_type_second(
+ int* a, int* b, RandomAccessIteratorBadDifferenceType c, RandomAccessIteratorBadDifferenceType d) {
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Using a non-integral difference_type is undefined behavior}}}}
+ return std::lexicographical_compare_three_way(a, b, c, d, std::compare_three_way());
+}
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
index 31385bd..d8cc781 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
@@ -9,6 +9,7 @@
#ifndef SORTABLE_HELPERS_H
#define SORTABLE_HELPERS_H
+#include <cstddef>
#include <type_traits>
#include "test_macros.h"
@@ -108,7 +109,7 @@
template <class Iter>
struct NonBorrowedRange {
int* data_;
- size_t size_;
+ std::size_t size_;
// TODO: some algorithms calls std::__copy
// std::__copy(contiguous_iterator<int*>, sentinel_wrapper<contiguous_iterator<int*>>, contiguous_iterator<int*>) doesn't seem to work.
@@ -116,7 +117,7 @@
// sentinel_wrapper<contiguous_iterator<int*>>
using Sent = std::conditional_t<std::contiguous_iterator<Iter>, Iter, sentinel_wrapper<Iter>>;
- constexpr NonBorrowedRange(int* d, size_t s) : data_{d}, size_{s} {}
+ constexpr NonBorrowedRange(int* d, std::size_t s) : data_{d}, size_{s} {}
constexpr Iter begin() const { return Iter{data_}; };
constexpr Sent end() const { return Sent{Iter{data_ + size_}}; };
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
index b19f42f..c71b57e 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
@@ -29,9 +29,9 @@
using Sent = sentinel_wrapper<Iter>;
int* data_;
- size_t size_;
+ std::size_t size_;
- template <size_t N>
+ template <std::size_t N>
constexpr explicit NonBorrowedRange(std::array<int, N>& arr) : data_{arr.data()}, size_{arr.size()} {}
constexpr Iter begin() const { return data_; };
@@ -109,7 +109,7 @@
auto out2 = output.begin() + 1;
int x = 2;
- size_t count = 1;
+ std::size_t count = 1;
dangling_1st(std::ranges::find, in, x);
dangling_1st(std::ranges::find_if, in, unary_pred);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
index 35b9f92..c5e8502 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
@@ -69,7 +69,7 @@
Bar c{Foo{3}};
Foo x{2};
- size_t count = 1;
+ std::size_t count = 1;
test(std::ranges::any_of, in, &Foo::unary_pred, &Bar::val);
test(std::ranges::all_of, in, &Foo::unary_pred, &Bar::val);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
index d457baf..1411796 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl.compile.pass.cpp
@@ -8,6 +8,11 @@
// <algorithm>
+// https://buildkite.com/llvm-project/libcxx-ci/builds/15823#0184fc0b-d56b-4774-9e1d-35fe24e09e37
+// It seems like the CI gcc version is buggy. I can't reproduce the failure on my system or on
+// godbolt (https://godbolt.org/z/rsPv8e8fn).
+// UNSUPPORTED: gcc-12
+
#include <algorithm>
#include <cstddef>
#include <functional>
@@ -108,7 +113,10 @@
// RELIES ON ADL SWAP (void)std::iter_swap(first, mid);
(void)std::lexicographical_compare(first, last, first2, last2);
(void)std::lexicographical_compare(first, last, first2, last2, std::less<void*>());
- // TODO: lexicographical_compare_three_way
+#if TEST_STD_VER > 17
+ (void)std::lexicographical_compare_three_way(first, last, first2, last2);
+ (void)std::lexicographical_compare_three_way(first, last, first2, last2, std::compare_three_way());
+#endif
(void)std::lower_bound(first, last, value);
(void)std::lower_bound(first, last, value, std::less<void*>());
(void)std::make_heap(first, last);
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
index 5dcfde3..6bd2abd 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
@@ -19,7 +19,7 @@
static bool isEven(const A& a) { return a.i % 2 == 0; }
};
-void *operator new(size_t, A*) = delete;
+void *operator new(std::size_t, A*) = delete;
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
index 166806e..3a15d25 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
@@ -547,15 +547,15 @@
#endif // TEST_STD_VER > 17
-template <class T, size_t N = 32>
+template <class T, std::size_t N = 32>
class Input {
using Array = std::array<T, N>;
- size_t size_ = 0;
+ std::size_t size_ = 0;
Array values_ = {};
public:
- template <size_t N2>
+ template <std::size_t N2>
TEST_CONSTEXPR_CXX20 Input(std::array<T, N2> from) {
static_assert(N2 <= N, "");
@@ -565,7 +565,7 @@
TEST_CONSTEXPR_CXX20 typename Array::iterator begin() { return values_.begin(); }
TEST_CONSTEXPR_CXX20 typename Array::iterator end() { return values_.begin() + size_; }
- TEST_CONSTEXPR_CXX20 size_t size() const { return size_; }
+ TEST_CONSTEXPR_CXX20 std::size_t size() const { return size_; }
};
// TODO: extend `Value` and `Reference` so that it's possible to pass plain integers to all the algorithms.
@@ -624,14 +624,14 @@
return result;
}
-template <class Input, size_t N, class Func>
+template <class Input, std::size_t N, class Func>
TEST_CONSTEXPR_CXX20 void test(std::array<Input, N> inputs, Func func) {
for (auto&& in : inputs) {
func(in.begin(), in.end());
}
}
-template <class Input, size_t N, class Func>
+template <class Input, std::size_t N, class Func>
TEST_CONSTEXPR_CXX20 void test_n(std::array<Input, N> inputs, Func func) {
for (auto&& in : inputs) {
func(in.begin(), in.size());
@@ -698,17 +698,17 @@
// TODO: is_permutation
test(simple_in, [&](I b, I e) { (void) std::for_each(b, e, is_neg); });
#if TEST_STD_VER > 14
- test_n(simple_in, [&](I b, size_t n) { (void) std::for_each_n(b, n, is_neg); });
+ test_n(simple_in, [&](I b, std::size_t n) { (void) std::for_each_n(b, n, is_neg); });
#endif
test(simple_in, [&](I b, I e) { (void) std::copy(b, e, out); });
- test_n(simple_in, [&](I b, size_t n) { (void) std::copy_n(b, n, out); });
+ test_n(simple_in, [&](I b, std::size_t n) { (void) std::copy_n(b, n, out); });
test(simple_in, [&](I b, I e) { (void) std::copy_backward(b, e, out + N); });
test(simple_in, [&](I b, I e) { (void) std::copy_if(b, e, out, is_neg); });
test(simple_in, [&](I b, I e) { (void) std::move(b, e, out); });
test(simple_in, [&](I b, I e) { (void) std::move_backward(b, e, out + N); });
test(simple_in, [&](I b, I e) { (void) std::transform(b, e, out, identity); });
test(simple_in, [&](I b, I e) { (void) std::generate(b, e, gen); });
- test_n(simple_in, [&](I b, size_t n) { (void) std::generate_n(b, n, gen); });
+ test_n(simple_in, [&](I b, std::size_t n) { (void) std::generate_n(b, n, gen); });
test(simple_in, [&](I b, I e) { (void) std::remove_copy(b, e, out, x); });
test(simple_in, [&](I b, I e) { (void) std::remove_copy_if(b, e, out, is_neg); });
test(simple_in, [&](I b, I e) { (void) std::replace(b, e, x, y); });
diff --git a/third_party/llvm-project/libcxx/test/std/algorithms/robust_re_difference_type.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/algorithms/robust_re_difference_type.compile.pass.cpp
index c060f46..8016cd7 100644
--- a/third_party/llvm-project/libcxx/test/std/algorithms/robust_re_difference_type.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/algorithms/robust_re_difference_type.compile.pass.cpp
@@ -145,7 +145,12 @@
(void)std::iter_swap(first, mid);
(void)std::lexicographical_compare(first, last, first2, last2);
(void)std::lexicographical_compare(first, last, first2, last2, std::less<void*>());
- // TODO: lexicographical_compare_three_way
+#if TEST_STD_VER > 17
+ // `lexicographical_compare_three_way` static_asserts that the difference type is an integer, as
+ // required by https://eel.is/c++draft/iterator.iterators#2.2
+ //(void)std::lexicographical_compare_three_way(first, last, first2, last2);
+ //(void)std::lexicographical_compare_three_way(first, last, first2, last2, std::compare_three_way());
+#endif
(void)std::lower_bound(first, last, value);
(void)std::lower_bound(first, last, value, std::less<void*>());
(void)std::make_heap(first, last);
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
index de24bc2..b2d83f0 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
@@ -14,6 +14,7 @@
#include <atomic>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
new file mode 100644
index 0000000..9f2a282
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
@@ -0,0 +1,99 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// XFAIL: availability-synchronization_library-missing
+
+// <atomic>
+
+// Tests the basic features and makes sure they work with a hijacking operator&.
+
+// template<class T> struct atomic {
+// using value_type = T;
+//
+// static constexpr bool is_always_lock_free = implementation-defined;
+// bool is_lock_free() const volatile noexcept;
+// bool is_lock_free() const noexcept;
+//
+// // [atomics.types.operations], operations on atomic types
+// constexpr atomic() noexcept(is_nothrow_default_constructible_v<T>);
+// constexpr atomic(T) noexcept;
+// atomic(const atomic&) = delete;
+// atomic& operator=(const atomic&) = delete;
+// atomic& operator=(const atomic&) volatile = delete;
+//
+// T load(memory_order = memory_order::seq_cst) const volatile noexcept;
+// T load(memory_order = memory_order::seq_cst) const noexcept;
+// operator T() const volatile noexcept;
+// operator T() const noexcept;
+// void store(T, memory_order = memory_order::seq_cst) volatile noexcept;
+// void store(T, memory_order = memory_order::seq_cst) noexcept;
+// T operator=(T) volatile noexcept;
+// T operator=(T) noexcept;
+//
+// T exchange(T, memory_order = memory_order::seq_cst) volatile noexcept;
+// T exchange(T, memory_order = memory_order::seq_cst) noexcept;
+// bool compare_exchange_weak(T&, T, memory_order, memory_order) volatile noexcept;
+// bool compare_exchange_weak(T&, T, memory_order, memory_order) noexcept;
+// bool compare_exchange_strong(T&, T, memory_order, memory_order) volatile noexcept;
+// bool compare_exchange_strong(T&, T, memory_order, memory_order) noexcept;
+// bool compare_exchange_weak(T&, T, memory_order = memory_order::seq_cst) volatile noexcept;
+// bool compare_exchange_weak(T&, T, memory_order = memory_order::seq_cst) noexcept;
+// bool compare_exchange_strong(T&, T, memory_order = memory_order::seq_cst) volatile noexcept;
+// bool compare_exchange_strong(T&, T, memory_order = memory_order::seq_cst) noexcept;
+//
+// void wait(T, memory_order = memory_order::seq_cst) const volatile noexcept;
+// void wait(T, memory_order = memory_order::seq_cst) const noexcept;
+// void notify_one() volatile noexcept;
+// void notify_one() noexcept;
+// void notify_all() volatile noexcept;
+// void notify_all() noexcept;
+// };
+
+#include <atomic>
+#include <type_traits>
+
+#include "operator_hijacker.h"
+#include "test_macros.h"
+
+template <class T>
+void test() {
+ T a;
+ typename T::value_type v;
+#if TEST_STD_VER >= 20
+ std::memory_order m = std::memory_order::seq_cst;
+#else
+ std::memory_order m = std::memory_order_seq_cst;
+#endif
+
+ TEST_IGNORE_NODISCARD a.is_lock_free();
+
+ TEST_IGNORE_NODISCARD T();
+ TEST_IGNORE_NODISCARD T(v);
+
+ TEST_IGNORE_NODISCARD a.load();
+ TEST_IGNORE_NODISCARD static_cast<typename T::value_type>(a);
+ a.store(v);
+ a = v;
+
+ TEST_IGNORE_NODISCARD a.exchange(v);
+ TEST_IGNORE_NODISCARD a.compare_exchange_weak(v, v, m, m);
+ TEST_IGNORE_NODISCARD a.compare_exchange_strong(v, v, m, m);
+ TEST_IGNORE_NODISCARD a.compare_exchange_weak(v, v);
+ TEST_IGNORE_NODISCARD a.compare_exchange_strong(v, v, m);
+
+ a.wait(v);
+ a.notify_one();
+ a.notify_all();
+}
+
+void test() {
+ test<std::atomic<operator_hijacker>>();
+ test<volatile std::atomic<operator_hijacker>>();
+}
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
index 34559f0..058db2d 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
@@ -84,8 +84,9 @@
// };
#include <atomic>
-#include <new>
#include <cassert>
+#include <cstdint>
+#include <new>
#include <cmpxchg_loop.h>
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
index 92bef95..5e52cde 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
@@ -64,8 +64,8 @@
static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), "");
// Added by LWG 2441
- static_assert((std::is_same<std::atomic<intptr_t>, std::atomic_intptr_t>::value), "");
- static_assert((std::is_same<std::atomic<uintptr_t>, std::atomic_uintptr_t>::value), "");
+ static_assert((std::is_same<std::atomic<std::intptr_t>, std::atomic_intptr_t>::value), "");
+ static_assert((std::is_same<std::atomic<std::uintptr_t>, std::atomic_uintptr_t>::value), "");
static_assert((std::is_same<std::atomic<int8_t>, std::atomic_int8_t>::value), "");
static_assert((std::is_same<std::atomic<uint8_t>, std::atomic_uint8_t>::value), "");
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
new file mode 100644
index 0000000..9049bea
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
@@ -0,0 +1,131 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// XFAIL: availability-synchronization_library-missing
+
+// <atomic>
+
+// Tests the basic features and makes sure they work with a hijacking operator&.
+
+// template<class T> struct atomic<T*> {
+// using value_type = T*;
+// using difference_type = ptrdiff_t;
+//
+// static constexpr bool is_always_lock_free = implementation-defined;
+// bool is_lock_free() const volatile noexcept;
+// bool is_lock_free() const noexcept;
+//
+// constexpr atomic() noexcept;
+// constexpr atomic(T*) noexcept;
+// atomic(const atomic&) = delete;
+// atomic& operator=(const atomic&) = delete;
+// atomic& operator=(const atomic&) volatile = delete;
+//
+// void store(T*, memory_order = memory_order::seq_cst) volatile noexcept;
+// void store(T*, memory_order = memory_order::seq_cst) noexcept;
+// T* operator=(T*) volatile noexcept;
+// T* operator=(T*) noexcept;
+// T* load(memory_order = memory_order::seq_cst) const volatile noexcept;
+// T* load(memory_order = memory_order::seq_cst) const noexcept;
+// operator T*() const volatile noexcept;
+// operator T*() const noexcept;
+//
+// T* exchange(T*, memory_order = memory_order::seq_cst) volatile noexcept;
+// T* exchange(T*, memory_order = memory_order::seq_cst) noexcept;
+// bool compare_exchange_weak(T*&, T*, memory_order, memory_order) volatile noexcept;
+// bool compare_exchange_weak(T*&, T*, memory_order, memory_order) noexcept;
+// bool compare_exchange_strong(T*&, T*, memory_order, memory_order) volatile noexcept;
+// bool compare_exchange_strong(T*&, T*, memory_order, memory_order) noexcept;
+// bool compare_exchange_weak(T*&, T*,
+// memory_order = memory_order::seq_cst) volatile noexcept;
+// bool compare_exchange_weak(T*&, T*,
+// memory_order = memory_order::seq_cst) noexcept;
+// bool compare_exchange_strong(T*&, T*,
+// memory_order = memory_order::seq_cst) volatile noexcept;
+// bool compare_exchange_strong(T*&, T*,
+// memory_order = memory_order::seq_cst) noexcept;
+//
+// T* fetch_add(ptrdiff_t, memory_order = memory_order::seq_cst) volatile noexcept;
+// T* fetch_add(ptrdiff_t, memory_order = memory_order::seq_cst) noexcept;
+// T* fetch_sub(ptrdiff_t, memory_order = memory_order::seq_cst) volatile noexcept;
+// T* fetch_sub(ptrdiff_t, memory_order = memory_order::seq_cst) noexcept;
+//
+// T* operator++(int) volatile noexcept;
+// T* operator++(int) noexcept;
+// T* operator--(int) volatile noexcept;
+// T* operator--(int) noexcept;
+// T* operator++() volatile noexcept;
+// T* operator++() noexcept;
+// T* operator--() volatile noexcept;
+// T* operator--() noexcept;
+// T* operator+=(ptrdiff_t) volatile noexcept;
+// T* operator+=(ptrdiff_t) noexcept;
+// T* operator-=(ptrdiff_t) volatile noexcept;
+// T* operator-=(ptrdiff_t) noexcept;
+//
+// void wait(T*, memory_order = memory_order::seq_cst) const volatile noexcept;
+// void wait(T*, memory_order = memory_order::seq_cst) const noexcept;
+// void notify_one() volatile noexcept;
+// void notify_one() noexcept;
+// void notify_all() volatile noexcept;
+// void notify_all() noexcept;
+// };
+
+#include <atomic>
+#include <type_traits>
+
+#include "operator_hijacker.h"
+#include "test_macros.h"
+
+template <class T>
+void test() {
+ T a;
+ typename T::value_type v = nullptr;
+#if TEST_STD_VER >= 20
+ std::memory_order m = std::memory_order::seq_cst;
+#else
+ std::memory_order m = std::memory_order_seq_cst;
+#endif
+
+ TEST_IGNORE_NODISCARD a.is_lock_free();
+
+ a.store(v);
+ a = v;
+ TEST_IGNORE_NODISCARD T();
+ TEST_IGNORE_NODISCARD T(v);
+ TEST_IGNORE_NODISCARD a.load();
+ TEST_IGNORE_NODISCARD static_cast<typename T::value_type>(a);
+ TEST_IGNORE_NODISCARD* a;
+
+ TEST_IGNORE_NODISCARD a.exchange(v);
+ TEST_IGNORE_NODISCARD a.compare_exchange_weak(v, v, m, m);
+ TEST_IGNORE_NODISCARD a.compare_exchange_strong(v, v, m, m);
+ TEST_IGNORE_NODISCARD a.compare_exchange_weak(v, v);
+ TEST_IGNORE_NODISCARD a.compare_exchange_strong(v, v, m);
+
+ TEST_IGNORE_NODISCARD a.fetch_add(0);
+ TEST_IGNORE_NODISCARD a.fetch_sub(0);
+
+ TEST_IGNORE_NODISCARD a++;
+ TEST_IGNORE_NODISCARD a--;
+ TEST_IGNORE_NODISCARD++ a;
+ TEST_IGNORE_NODISCARD-- a;
+ a += 0;
+ a -= 0;
+
+ a.wait(v);
+ a.notify_one();
+ a.notify_all();
+}
+
+void test() {
+ test<std::atomic<operator_hijacker*>>();
+ test<volatile std::atomic<operator_hijacker*>>();
+}
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
index d7987ca..ca17657 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
@@ -25,10 +25,8 @@
}
};
-int main(int, char**) {
+void tests() {
TestEachIntegralType<CheckStandardLayout>()();
TestEachFloatingPointType<CheckStandardLayout>()();
TestEachPointerType<CheckStandardLayout>()();
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
index 707333a..0955707 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
@@ -27,5 +27,5 @@
void f() {
NotTriviallyCopyable x(42);
- std::atomic<NotTriviallyCopyable> a(x); // expected-error@atomic:* {{std::atomic<T> requires that 'T' be a trivially copyable type}}
+ std::atomic<NotTriviallyCopyable> a(x); // expected-error@*:* {{std::atomic<T> requires that 'T' be a trivially copyable type}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
index 2d1acb6..d85f8a8 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
@@ -14,8 +14,7 @@
#include <atomic>
-int main(int, char**)
-{
+void f() {
volatile std::atomic<int*> obj1;
std::atomic<int*> obj2;
obj1 = obj2; // expected-error {{overload resolution selected deleted operator '='}}
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
index 07e1181..e72ccf1 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
@@ -14,8 +14,7 @@
#include <atomic>
-int main(int, char**)
-{
+void f() {
volatile std::atomic<int> obj1;
std::atomic<int> obj2;
obj1 = obj2; // expected-error {{overload resolution selected deleted operator '='}}
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp
index 92908bd..d22ea42 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp
@@ -10,8 +10,7 @@
// XFAIL: c++03
// XFAIL: !non-lockfree-atomics
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <atomic>
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp
index 5f8afa8..fbf8952 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp
@@ -10,8 +10,7 @@
// XFAIL: c++03
// XFAIL: !non-lockfree-atomics
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <atomic>
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
index 2d4890e..f0657a5 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
@@ -10,8 +10,7 @@
// XFAIL: c++03
// XFAIL: !non-lockfree-atomics
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <atomic>
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp
index 00d1ce0..0aba0a5 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp
@@ -10,8 +10,7 @@
// XFAIL: c++03
// XFAIL: !non-lockfree-atomics
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <atomic>
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
index 5d0a285..2bac7cb 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
@@ -200,12 +200,12 @@
static_assert(std::is_same_v<std::atomic<int_fast64_t>, ::atomic_int_fast64_t>);
static_assert(std::is_same_v<std::atomic<uint_fast64_t>, ::atomic_uint_fast64_t>);
- static_assert(std::is_same_v<std::atomic<intptr_t>, ::atomic_intptr_t>);
- static_assert(std::is_same_v<std::atomic<uintptr_t>, ::atomic_uintptr_t>);
- static_assert(std::is_same_v<std::atomic<size_t>, ::atomic_size_t>);
- static_assert(std::is_same_v<std::atomic<ptrdiff_t>, ::atomic_ptrdiff_t>);
- static_assert(std::is_same_v<std::atomic<intmax_t>, ::atomic_intmax_t>);
- static_assert(std::is_same_v<std::atomic<uintmax_t>, ::atomic_uintmax_t>);
+ static_assert(std::is_same_v<std::atomic<std::intptr_t>, ::atomic_intptr_t>);
+ static_assert(std::is_same_v<std::atomic<std::uintptr_t>, ::atomic_uintptr_t>);
+ static_assert(std::is_same_v<std::atomic<std::size_t>, ::atomic_size_t>);
+ static_assert(std::is_same_v<std::atomic<std::ptrdiff_t>, ::atomic_ptrdiff_t>);
+ static_assert(std::is_same_v<std::atomic<std::intmax_t>, ::atomic_intmax_t>);
+ static_assert(std::is_same_v<std::atomic<std::uintmax_t>, ::atomic_uintmax_t>);
// Just check that the symbols in the global namespace are visible.
using ::atomic_compare_exchange_strong;
diff --git a/third_party/llvm-project/libcxx/test/std/atomics/types.pass.cpp b/third_party/llvm-project/libcxx/test/std/atomics/types.pass.cpp
index f95f7a4..deaa45d 100644
--- a/third_party/llvm-project/libcxx/test/std/atomics/types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/atomics/types.pass.cpp
@@ -61,7 +61,7 @@
A a; (void)a;
#if TEST_STD_VER >= 17
static_assert((std::is_same_v<typename A::value_type, decltype(a.load())>), "");
- static_assert((std::is_same_v<typename A::difference_type, ptrdiff_t>), "");
+ static_assert((std::is_same_v<typename A::difference_type, std::ptrdiff_t>), "");
#endif
}
};
@@ -119,42 +119,42 @@
test<wchar_t> ();
#endif
- test<int_least8_t> ();
- test<uint_least8_t> ();
- test<int_least16_t> ();
- test<uint_least16_t> ();
- test<int_least32_t> ();
- test<uint_least32_t> ();
- test<int_least64_t> ();
- test<uint_least64_t> ();
+ test<std::int_least8_t> ();
+ test<std::uint_least8_t> ();
+ test<std::int_least16_t> ();
+ test<std::uint_least16_t> ();
+ test<std::int_least32_t> ();
+ test<std::uint_least32_t> ();
+ test<std::int_least64_t> ();
+ test<std::uint_least64_t> ();
- test<int_fast8_t> ();
- test<uint_fast8_t> ();
- test<int_fast16_t> ();
- test<uint_fast16_t> ();
- test<int_fast32_t> ();
- test<uint_fast32_t> ();
- test<int_fast64_t> ();
- test<uint_fast64_t> ();
+ test<std::int_fast8_t> ();
+ test<std::uint_fast8_t> ();
+ test<std::int_fast16_t> ();
+ test<std::uint_fast16_t> ();
+ test<std::int_fast32_t> ();
+ test<std::uint_fast32_t> ();
+ test<std::int_fast64_t> ();
+ test<std::uint_fast64_t> ();
- test< int8_t> ();
- test<uint8_t> ();
- test< int16_t> ();
- test<uint16_t> ();
- test< int32_t> ();
- test<uint32_t> ();
- test< int64_t> ();
- test<uint64_t> ();
+ test< std::int8_t> ();
+ test<std::uint8_t> ();
+ test< std::int16_t> ();
+ test<std::uint16_t> ();
+ test< std::int32_t> ();
+ test<std::uint32_t> ();
+ test< std::int64_t> ();
+ test<std::uint64_t> ();
- test<intptr_t> ();
- test<uintptr_t> ();
- test<size_t> ();
- test<ptrdiff_t> ();
- test<intmax_t> ();
- test<uintmax_t> ();
+ test<std::intptr_t> ();
+ test<std::uintptr_t> ();
+ test<std::size_t> ();
+ test<std::ptrdiff_t> ();
+ test<std::intmax_t> ();
+ test<std::uintmax_t> ();
- test<uintmax_t> ();
- test<uintmax_t> ();
+ test<std::uintmax_t> ();
+ test<std::uintmax_t> ();
test<TriviallyCopyable>();
test<PaddedTriviallyCopyable>();
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
index b58dae3..126606e 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
@@ -141,5 +141,3 @@
static_assert(std::equality_comparable<returns_true_type>);
static_assert(std::equality_comparable<returns_int_ptr>);
} // namespace types_fit_for_purpose
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
index ba8138f..e0edd1f 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
@@ -1120,5 +1120,3 @@
static_assert(
!check_equality_comparable_with<one_way_ne, explicit_operators>());
} // namespace types_fit_for_purpose
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
index c14634e..5d80c1c 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
@@ -990,5 +990,3 @@
: common_type<CommonWithIntButRefLong&, int&> {};
} // namespace std
static_assert(CheckCommonWith<CommonWithIntButRefLong, int>());
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
index e7ab520..7c37daf 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
@@ -343,5 +343,3 @@
} // namespace std
static_assert(!std::common_reference_with<HasCommonReference, int>);
static_assert(std::common_reference_with<HasCommonReference, int&>);
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
index 22a70bd..fe0ecec 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
@@ -148,5 +148,3 @@
test<std::array<int, 1>, int>();
test<std::array<int, 1>, int, int>();
}
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
index cc349be..4a14155 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
@@ -172,5 +172,3 @@
};
static_assert(!std::copy_constructible<ExplicitlyCopyable>);
} // namespace CopyConstructibleTests
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
index 340c29f..4921a48 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
@@ -261,8 +261,3 @@
test_true <std::weak_ptr<int>>();
}
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) {
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
index ec788ee..88a75d0 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
@@ -65,9 +65,3 @@
LIBCPP_STATIC_ASSERT(!std::__default_initializable<const int[]>);
static_assert(!std::default_initializable<const int[]>);
}
-
-int main(int, char**) {
- test();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
index aa86f59..10c6133 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
@@ -73,6 +73,3 @@
test<int>();
test<double>();
}
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
index b4003d9..d388248 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
@@ -76,5 +76,3 @@
static_assert(!std::move_constructible<NonMovable>);
static_assert(!std::move_constructible<DerivedFromNonMovable>);
static_assert(!std::move_constructible<HasANonMovable>);
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
index a92b6c4..accd614 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
@@ -113,5 +113,3 @@
!std::assignable_from<deleted_assignment_from_const_rvalue&,
deleted_assignment_from_const_rvalue const>);
static_assert(!std::copyable<deleted_assignment_from_const_rvalue>);
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
index c5879be..07a518d 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
@@ -133,5 +133,3 @@
// `move_constructible and assignable_from<T&, T>` implies `swappable<T>`,
// so there's nothing to test for the case of non-swappable.
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
index b1a1709..ab5472f 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
@@ -163,5 +163,3 @@
bool operator==(is_equality_comparable const&) const = default;
};
static_assert(std::regular<is_equality_comparable>);
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
index fed5f03..7151c1c 100644
--- a/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
@@ -126,5 +126,3 @@
static_assert(!std::semiregular<deleted_default_ctor>);
static_assert(!std::semiregular<derived_from_deleted_default_ctor>);
static_assert(!std::semiregular<has_deleted_default_ctor>);
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/allocator_mismatch.compile.fail.cpp
deleted file mode 100644
index faec5aa..0000000
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/allocator_mismatch.compile.fail.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <map>
-// The container's value type must be the same as the allocator's value type
-
-#include <map>
-
-int main(int, char**)
-{
- std::map<int, int, std::less<int>, std::allocator<long> > m;
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/allocator_mismatch.verify.cpp
similarity index 70%
rename from third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/associative/map/allocator_mismatch.verify.cpp
index 47dd64e..0a33f25 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <map>
-int main(int, char**)
-{
- std::multimap<int, int, std::less<int>, std::allocator<long> > m;
-
- return 0;
-}
+std::map<int, int, std::less<int>, std::allocator<long> > m;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/compare.three_way.pass.cpp
new file mode 100644
index 0000000..0e1c57f
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/compare.three_way.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <map>
+
+// class map
+
+// template<class Key, class T, class Compare, class Allocator>
+// synth-three-way-result<pair<const Key, T>>
+// operator<=>(const map<Key, T, Compare, Allocator>& x,
+// const map<Key, T, Compare, Allocator>& y);
+
+#include <cassert>
+#include <map>
+
+#include "test_container_comparisons.h"
+
+int main(int, char**) {
+ assert(test_ordered_map_container_spaceship<std::map>());
+ // `std::map` is not constexpr, so no `static_assert` test here.
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
index 1430591..27ca7c6 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <map>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::map<int, int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
index b38cf11..e10f203 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
@@ -31,7 +31,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<KV, (size_t)-1> A;
+ typedef limited_allocator<KV, (std::size_t)-1> A;
typedef std::map<int, int, std::less<int>, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
index 3fd051f..c8201e2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
@@ -42,12 +42,12 @@
template <class U> bool operator==(const counting_allocatorT<U>& other) const noexcept { return foo == other.foo; }
template <class U> bool operator!=(const counting_allocatorT<U>& other) const noexcept { return foo != other.foo; }
- T* allocate(size_t n) const {
+ T* allocate(std::size_t n) const {
ca_allocs.push_back(foo);
void * const pv = ::malloc(n * sizeof(T));
return static_cast<T *>(pv);
}
- void deallocate(T* p, size_t) const noexcept {
+ void deallocate(T* p, std::size_t) const noexcept {
ca_deallocs.push_back(foo);
free(p);
}
@@ -65,12 +65,12 @@
template <class U> bool operator==(const counting_allocatorF<U>& other) const noexcept { return foo == other.foo; }
template <class U> bool operator!=(const counting_allocatorF<U>& other) const noexcept { return foo != other.foo; }
- T* allocate(size_t n) const {
+ T* allocate(std::size_t n) const {
ca_allocs.push_back(foo);
void * const pv = ::malloc(n * sizeof(T));
return static_cast<T *>(pv);
}
- void deallocate(T* p, size_t) const noexcept {
+ void deallocate(T* p, std::size_t) const noexcept {
ca_deallocs.push_back(foo);
free(p);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
index bcfafe8..6363016 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
@@ -166,7 +166,7 @@
V(3, 2),
V(3, 3)
};
- const size_t num = sizeof(a1)/sizeof(a1[0]);
+ const std::size_t num = sizeof(a1)/sizeof(a1[0]);
assert(Counter_base::gConstructed == num);
M m1(I(a1), I(a1+num), C(), A());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
index ee55466..6dfbbfe 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
@@ -30,7 +30,7 @@
}
template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
M s = make<M>(vals);
ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
index b036531..6cdfac7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
auto some_key = c.cbegin()->first;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
index 80e7e1f..c0ffa34 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
index 1d09443..3ef0054 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
@@ -38,7 +38,7 @@
{
typename Container::node_type node = nf(i, i + 1);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(node.empty());
assert(prev + 1 == c.size());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.verify.cpp
similarity index 70%
copy from third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp
copy to third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.verify.cpp
index 47dd64e..122d656 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <map>
-int main(int, char**)
-{
- std::multimap<int, int, std::less<int>, std::allocator<long> > m;
-
- return 0;
-}
+std::multimap<int, int, std::less<int>, std::allocator<long> > m;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/compare.three_way.pass.cpp
new file mode 100644
index 0000000..c7febc3
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/compare.three_way.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <map>
+
+// class multimap
+
+// template<class Key, class T, class Compare, class Allocator>
+// synth-three-way-result<pair<const Key, T>>
+// operator<=>(const multimap<Key, T, Compare, Allocator>& x,
+// const multimap<Key, T, Compare, Allocator>& y);
+
+#include <cassert>
+#include <map>
+
+#include "test_container_comparisons.h"
+
+int main(int, char**) {
+ assert(test_ordered_map_container_spaceship<std::multimap>());
+ // `std::multimap` is not constexpr, so no `static_assert` test here.
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/empty.verify.cpp
index dcd3b58..8720497 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <map>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::multimap<int, int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
index a4537c3..f7b8b5e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
@@ -31,7 +31,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<KV, (size_t)-1> A;
+ typedef limited_allocator<KV, (std::size_t)-1> A;
typedef std::multimap<int, int, std::less<int>, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
index a4edd47..e246842 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
@@ -165,7 +165,7 @@
V(3, 2),
V(3, 3)
};
- const size_t num = sizeof(a1)/sizeof(a1[0]);
+ const std::size_t num = sizeof(a1)/sizeof(a1[0]);
assert(Counter_base::gConstructed == num);
M m1(I(a1), I(a1+num), C(), A());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
index f270c4e..89ab932 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
@@ -30,7 +30,7 @@
}
template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
M s = make<M>(vals);
ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
index c5f5b4d..c4751d8 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
auto some_key = c.cbegin()->first;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
index 891e78c..b558f4e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
index d4ba115..68e6b8b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@
{
typename Container::node_type node = nf(i, i + 1);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(node.empty());
assert(prev + 1 == c.size());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/allocator_mismatch.compile.fail.cpp
deleted file mode 100644
index 86e1b30..0000000
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/allocator_mismatch.compile.fail.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <set>
-// The container's value type must be the same as the allocator's value type
-
-#include <set>
-
-int main(int, char**)
-{
- std::multiset<int, std::less<int>, std::allocator<long> > ms;
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/allocator_mismatch.verify.cpp
similarity index 70%
copy from third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp
copy to third_party/llvm-project/libcxx/test/std/containers/associative/multiset/allocator_mismatch.verify.cpp
index 69e4935..8d45268 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <set>
-int main(int, char**)
-{
- std::set<int, std::less<int>, std::allocator<long> > s;
-
- return 0;
-}
+std::multiset<int, std::less<int>, std::allocator<long> > m;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/empty.verify.cpp
index 87c02e4..0de9305 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <set>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::multiset<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
index bce568e..ac8c5e3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
for (auto first = c.cbegin(); first != c.cend();)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
index d92d4ed..bad5d1b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
index 00d0b67..e5c628e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
@@ -36,7 +36,7 @@
{
typename Container::node_type node = nf(i);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(prev + 1 == c.size());
assert(*it == i);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
index 5986df2..09faf8f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
@@ -30,7 +30,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::multiset<int, std::less<int>, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
index d279dba..090be76 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
@@ -160,7 +160,7 @@
V(3),
V(3)
};
- const size_t num = sizeof(a1)/sizeof(a1[0]);
+ const std::size_t num = sizeof(a1)/sizeof(a1[0]);
assert(Counter_base::gConstructed == num);
M m1(I(a1), I(a1+num), C(), A());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
index f397975..476f4f5 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.verify.cpp
similarity index 71%
rename from third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.verify.cpp
index 69e4935..eac40e0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <set>
-int main(int, char**)
-{
- std::set<int, std::less<int>, std::allocator<long> > s;
-
- return 0;
-}
+std::set<int, std::less<int>, std::allocator<long> > m;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/empty.verify.cpp
index 0e7b28d..e0405f7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <set>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::set<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
index 91b97fc..c6ef113 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
for (auto first = c.cbegin(); first != c.cend();)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_key.pass.cpp
index 90ebbb7..f37665b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
index d58cbe3..6f4cbe9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@
{
typename Container::node_type node = nf(i);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(node.empty());
assert(prev + 1 == c.size());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/max_size.pass.cpp
index e37bfe7..f921378 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/max_size.pass.cpp
@@ -30,7 +30,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::set<int, std::less<int>, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp
index 597abbd..16f4de9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp
@@ -32,7 +32,7 @@
static_assert(std::ranges::bidirectional_range<range const>);
static_assert(!std::ranges::random_access_range<range const>);
static_assert(std::ranges::common_range<range const>);
-static_assert(std::ranges::input_range<range>);
+static_assert(std::ranges::input_range<range const>);
static_assert(!std::ranges::view<range const>);
static_assert(std::ranges::sized_range<range const>);
static_assert(!std::ranges::borrowed_range<range const>);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
index 59d536e..886cad9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
@@ -160,7 +160,7 @@
V(3),
V(3)
};
- const size_t num = sizeof(a1)/sizeof(a1[0]);
+ const std::size_t num = sizeof(a1)/sizeof(a1[0]);
assert(Counter_base::gConstructed == num);
M m1(I(a1), I(a1+num), C(), A());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
index 4c90955..2e0f026 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/check_consecutive.h b/third_party/llvm-project/libcxx/test/std/containers/check_consecutive.h
index 5f549c6..0fe46e7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/check_consecutive.h
+++ b/third_party/llvm-project/libcxx/test/std/containers/check_consecutive.h
@@ -18,9 +18,9 @@
// Check consecutive equal values in an unordered_multiset iterator
template <typename Iter>
-void CheckConsecutiveValues(Iter pos, Iter end, typename Iter::value_type value, size_t count)
+void CheckConsecutiveValues(Iter pos, Iter end, typename Iter::value_type value, std::size_t count)
{
- for ( size_t i = 0; i < count; ++i )
+ for ( std::size_t i = 0; i < count; ++i )
{
assert(pos != end);
assert(*pos == value);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.format.pass.cpp
index 7806576..e7f812c 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.format.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// [container.adaptors.format]
// For each of queue, priority_queue, and stack, the library provides the
@@ -35,13 +33,14 @@
#include "test_format_string.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
index 489de3a..584ac2b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
@@ -250,6 +250,14 @@
test_char_escaped_string<CharT>(
check, check_exception, std::priority_queue{input.begin(), input.end(), std::greater{}});
test_char_escaped_string<CharT>(check, check_exception, std::stack{input.begin(), input.end()});
+
+ // LWG3881 fixes formatting container adaptors backed by a std::string.
+ test_char_default<CharT>(check, check_exception, std::queue{std::basic_string<CharT>{input.begin(), input.end()}});
+ test_char_default<CharT>(
+ check,
+ check_exception,
+ std::priority_queue{std::greater{}, std::basic_string<CharT>{input.begin(), input.end()}});
+ test_char_default<CharT>(check, check_exception, std::stack{std::basic_string<CharT>{input.begin(), input.end()}});
}
//
@@ -399,8 +407,7 @@
void test_bool(TestFunction check, ExceptionTest check_exception) {
std::array input{true, true, false};
test_bool<CharT>(check, check_exception, std::queue{input.begin(), input.end()});
- // TODO FMT Use std::vector<bool> after it has been implemented.
- test_bool<CharT>(check, check_exception, std::priority_queue<bool, std::deque<bool>>{input.begin(), input.end()});
+ test_bool<CharT>(check, check_exception, std::priority_queue{input.begin(), input.end()});
test_bool<CharT>(check, check_exception, std::stack{input.begin(), input.end()});
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.vformat.pass.cpp
index 27c52fa..408b6f7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.vformat.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// [container.adaptors.format]
// For each of queue, priority_queue, and stack, the library provides the
@@ -32,13 +30,14 @@
#include "format.functions.tests.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -46,20 +45,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch (const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.pass.cpp
index 8950ece..9f978eb 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// [container.adaptors.format]
// For each of queue, priority_queue, and stack, the library provides the
// following formatter specialization where adaptor-type is the name of the
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/parse.pass.cpp
index b620279..c8ed123 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/parse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/container.adaptors.format/parse.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// [container.adaptors.format]
// For each of queue, priority_queue, and stack, the library provides the
// following formatter specialization where adaptor-type is the name of the
@@ -43,30 +39,30 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class Arg, class StringViewT>
-constexpr void test_parse(StringViewT fmt) {
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
using CharT = typename StringViewT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<Arg, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
}
template <class StringViewT>
-constexpr void test_parse(StringViewT fmt) {
- test_parse<std::queue<int>>(fmt);
- test_parse<std::priority_queue<int>>(fmt);
- test_parse<std::stack<int>>(fmt);
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
+ test_parse<std::queue<int>>(fmt, offset);
+ test_parse<std::priority_queue<int>>(fmt, offset);
+ test_parse<std::stack<int>>(fmt, offset);
}
template <class CharT>
constexpr void test_fmt() {
- test_parse(SV(""));
- test_parse(SV(":d"));
+ test_parse(SV(""), 0);
+ test_parse(SV(":d"), 0);
- test_parse(SV("}"));
- test_parse(SV(":d}"));
+ test_parse(SV("}"), 1);
+ test_parse(SV(":d}"), 1);
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
index 7976b96..793f47d 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <queue>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::priority_queue<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
index 9a8761a..5f24ef0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <queue>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::queue<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
index 8264092..e9af144 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <stack>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::stack<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/iterator.rel_ops.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/iterator.rel_ops.compile.pass.cpp
index 89f08e1..9898880 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/iterator.rel_ops.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/iterator.rel_ops.compile.pass.cpp
@@ -7,9 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-filesystem
-
-// std::filesystem is unavailable prior to macOS 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: availability-filesystem-missing
// Make sure the various containers' iterators are not broken by the use of `std::rel_ops`.
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/array.special/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/array.special/swap.pass.cpp
index 617641d..9497429 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/array.special/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/array.special/swap.pass.cpp
@@ -12,6 +12,7 @@
#include <array>
#include <cassert>
+#include <utility>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
index 9589e63..85e6ed7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
@@ -12,13 +12,14 @@
#include <array>
#include <cassert>
+#include <memory>
#include "test_macros.h"
template <class Container>
TEST_CONSTEXPR_CXX14 void assert_contiguous(Container const& c)
{
- for (size_t i = 0; i < c.size(); ++i)
+ for (std::size_t i = 0; i < c.size(); ++i)
assert(*(c.begin() + i) == *(std::addressof(*c.begin()) + i));
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/empty.verify.cpp
index 6fa851f..9cf8f11 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/empty.verify.cpp
@@ -16,15 +16,9 @@
#include <array>
-#include "test_macros.h"
-
-int main(int, char**)
-{
-
+void f() {
std::array<int, 1> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
std::array<int, 0> c0;
c0.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
index 2422156..6fbc844 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
@@ -25,12 +25,12 @@
#include "test_macros.h"
-template <class T, size_t Size>
+template <class T, std::size_t Size>
struct MyArray {
T elems[Size];
};
-template <class T, size_t Size>
+template <class T, std::size_t Size>
void test() {
typedef T CArrayT[Size == 0 ? 1 : Size];
typedef std::array<T, Size> ArrayT;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
index 74cbfe3..37e87d5 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
@@ -14,7 +14,7 @@
template <class T>
class small_pointer {
- uint16_t offset;
+ std::uint16_t offset;
};
template <class T>
@@ -22,8 +22,8 @@
public:
using value_type = T;
using pointer = small_pointer<T>;
- using size_type = int16_t;
- using difference_type = int16_t;
+ using size_type = std::int16_t;
+ using difference_type = std::int16_t;
small_iter_allocator() TEST_NOEXCEPT {}
@@ -82,5 +82,5 @@
static_assert(TEST_ALIGNOF(std::deque<char, small_iter_allocator<char> >) == 2, "");
#else
-# error size_t has an unexpected size
+# error std::size_t has an unexpected size
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/allocator_mismatch.verify.cpp
similarity index 72%
rename from third_party/llvm-project/libcxx/test/std/containers/sequences/deque/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/sequences/deque/allocator_mismatch.verify.cpp
index 287faf7..6e1310d 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <deque>
-int main(int, char**)
-{
- std::deque<int, std::allocator<long> > d;
-
- return 0;
-}
+std::deque<int, std::allocator<long> > d;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp
new file mode 100644
index 0000000..3d5646a
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <deque>
+
+// template<class T, class Allocator>
+// synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
+// const deque<T, Allocator>& y);
+
+#include <cassert>
+#include <deque>
+
+#include "test_container_comparisons.h"
+
+int main(int, char**) {
+ assert(test_sequence_container_spaceship<std::deque>());
+ // `std::deque` is not constexpr, so no `static_assert` test here.
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
index 01822e2..a229508 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <deque>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::deque<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
index 230a465..7e2f72e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
@@ -27,7 +27,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::deque<int, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
index 5bb3dc9..88672fa 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
index 8dfcebd..88fce25 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@
typedef T value_type;
some_alloc(const some_alloc&);
~some_alloc() noexcept(false);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
index a87c8e0..cbefbf6 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
index d90dd81..add19ec 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
index 4c5a14e..656884a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
assert(expected_erased_count == std::erase(s, val));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
index 7f6e4c5..57657e4 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
index 4c82b51..0ac48aa 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
@@ -21,7 +21,7 @@
#include "test_macros.h"
template <typename C>
-void del_at_start(C c, size_t num)
+void del_at_start(C c, std::size_t num)
{
typename C::iterator first = c.begin();
typename C::iterator last = first + num;
@@ -41,7 +41,7 @@
}
template <typename C>
-void del_at_end(C c, size_t num)
+void del_at_end(C c, std::size_t num)
{
typename C::iterator last = c.end();
typename C::iterator first = last - num;
@@ -69,7 +69,7 @@
while (queue.size() > 1)
{
- for (size_t i = 1; i < queue.size(); ++i)
+ for (std::size_t i = 1; i < queue.size(); ++i)
{
del_at_start(queue, i);
del_at_end (queue, i);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
index 4ce47f0..d6257b1 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
@@ -34,7 +34,7 @@
some_alloc() {}
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::true_type propagate_on_container_swap;
@@ -47,7 +47,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_swap;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.verify.cpp
similarity index 72%
rename from third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.verify.cpp
index 42fb8da..617c006 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <forward_list>
-int main(int, char**)
-{
- std::forward_list<int, std::allocator<long> > fl;
-
- return 0;
-}
+std::forward_list<int, std::allocator<long> > fl;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/compare.three_way.pass.cpp
new file mode 100644
index 0000000..52adfc4
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/compare.three_way.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <forward_list>
+
+// template<class T, class Allocator>
+// synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
+// const forward_list<T, Allocator>& y);
+
+#include <cassert>
+#include <forward_list>
+
+#include "test_container_comparisons.h"
+
+int main(int, char**) {
+ assert(test_sequence_container_spaceship<std::forward_list>());
+ // `std::forward_list` is not constexpr, so no `static_assert` test here.
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
index 4092f44..366094b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <forward_list>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::forward_list<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
index 772a985..b131cc9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
index ae6fd62..db8f0d2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@
typedef T value_type;
some_alloc(const some_alloc&);
~some_alloc() noexcept(false);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
index 63168c4..f361e37 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
index edd3449..f132f0e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
index ca3931d..3c27a6d 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
@@ -37,8 +37,8 @@
{
{ // test that the ctor is explicit
typedef std::forward_list<DefaultOnly> C;
- static_assert((std::is_constructible<C, size_t>::value), "");
- static_assert((!std::is_convertible<size_t, C>::value), "");
+ static_assert((std::is_constructible<C, std::size_t>::value), "");
+ static_assert((!std::is_convertible<std::size_t, C>::value), "");
}
{
typedef DefaultOnly T;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
index e6eb6f4..df9aa41 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
assert(expected_erased_count == std::erase(s, val));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
index 21de03a..756febd 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
index cb30b03..6e73b2f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
@@ -68,7 +68,7 @@
c1.merge(c2);
assert(c2.empty());
- for (size_t i = 0; i < 3; ++i) {
+ for (std::size_t i = 0; i < 3; ++i) {
assert(to[i] == *io[i]);
#if TEST_STD_VER >= 11
assert(to[i] == ro[i].get());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
index d8df4eb..fddf9f9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
@@ -68,7 +68,7 @@
c1.merge(c2, std::greater<T>());
assert(c2.empty());
- for (size_t i = 0; i < 3; ++i) {
+ for (std::size_t i = 0; i < 3; ++i) {
assert(to[i] == *io[i]);
#if TEST_STD_VER >= 11
assert(to[i] == ro[i].get());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
index f6db686..3a7a874 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
@@ -65,7 +65,7 @@
c1.merge(std::move(c2));
assert(c2.empty());
- for (size_t i = 0; i < 3; ++i) {
+ for (std::size_t i = 0; i < 3; ++i) {
assert(to[i] == *io[i]);
assert(to[i] == ro[i].get());
assert(to[i] == *po[i]);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
index 1b45946..f1ddbfb 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
@@ -65,7 +65,7 @@
c1.merge(std::move(c2), std::greater<T>());
assert(c2.empty());
- for (size_t i = 0; i < 3; ++i) {
+ for (std::size_t i = 0; i < 3; ++i) {
assert(to[i] == *io[i]);
assert(to[i] == ro[i].get());
assert(to[i] == *po[i]);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
index 7142c8a..7e26b8b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
@@ -120,7 +120,7 @@
int a2[] = { 2, 3, 5, 8, 11};
std::forward_list<PredLWG526> c(a1, a1 + 7);
do_remove_if(c, std::ref(c.front()), 2);
- for (size_t i = 0; i < 5; ++i)
+ for (std::size_t i = 0; i < 5; ++i)
{
assert(!c.empty());
assert(c.front() == a2[i]);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp
index 527c72c..f2ab6e5 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp
@@ -19,21 +19,21 @@
#include "test_macros.h"
#include "min_allocator.h"
-typedef ptrdiff_t T;
+typedef std::ptrdiff_t T;
const T t1[] = {0, 1, 2, 3, 4, 5, 6, 7};
const T t2[] = {10, 11, 12, 13, 14, 15};
-const ptrdiff_t size_t1 = std::end(t1) - std::begin(t1);
-const ptrdiff_t size_t2 = std::end(t2) - std::begin(t2);
+const std::ptrdiff_t size_t1 = std::end(t1) - std::begin(t1);
+const std::ptrdiff_t size_t2 = std::end(t2) - std::begin(t2);
template <class C>
void
-testd(const C& c, ptrdiff_t p, ptrdiff_t f, ptrdiff_t l)
+testd(const C& c, std::ptrdiff_t p, ptrdiff_t f, ptrdiff_t l)
{
typename C::const_iterator i = c.begin();
- ptrdiff_t n1 = 0;
+ std::ptrdiff_t n1 = 0;
for (; n1 < p; ++n1, ++i)
assert(*i == t1[n1]);
- for (ptrdiff_t n2 = f; n2 < l-1; ++n2, ++i)
+ for (std::ptrdiff_t n2 = f; n2 < l-1; ++n2, ++i)
assert(*i == t2[n2]);
for (; n1 < size_t1; ++n1, ++i)
assert(*i == t1[n1]);
@@ -42,11 +42,11 @@
template <class C>
void
-tests(const C& c, ptrdiff_t p, ptrdiff_t f, ptrdiff_t l)
+tests(const C& c, std::ptrdiff_t p, ptrdiff_t f, ptrdiff_t l)
{
typename C::const_iterator i = c.begin();
- ptrdiff_t n = 0;
- ptrdiff_t d = l > f+1 ? l-1-f : 0;
+ std::ptrdiff_t n = 0;
+ std::ptrdiff_t d = l > f+1 ? l-1-f : 0;
if (d == 0 || p == f)
{
for (n = 0; n < size_t1; ++n, ++i)
@@ -82,11 +82,11 @@
{
// splicing different containers
typedef std::forward_list<T> C;
- for (ptrdiff_t f = 0; f <= size_t2+1; ++f)
+ for (std::ptrdiff_t f = 0; f <= size_t2+1; ++f)
{
- for (ptrdiff_t l = f; l <= size_t2+1; ++l)
+ for (std::ptrdiff_t l = f; l <= size_t2+1; ++l)
{
- for (ptrdiff_t p = 0; p <= size_t1; ++p)
+ for (std::ptrdiff_t p = 0; p <= size_t1; ++p)
{
C c1(std::begin(t1), std::end(t1));
C c2(std::begin(t2), std::end(t2));
@@ -99,11 +99,11 @@
}
// splicing within same container
- for (ptrdiff_t f = 0; f <= size_t1+1; ++f)
+ for (std::ptrdiff_t f = 0; f <= size_t1+1; ++f)
{
- for (ptrdiff_t l = f; l <= size_t1; ++l)
+ for (std::ptrdiff_t l = f; l <= size_t1; ++l)
{
- for (ptrdiff_t p = 0; p <= f; ++p)
+ for (std::ptrdiff_t p = 0; p <= f; ++p)
{
C c1(std::begin(t1), std::end(t1));
@@ -111,7 +111,7 @@
std::next(c1.cbefore_begin(), f), std::next(c1.cbefore_begin(), l));
tests(c1, p, f, l);
}
- for (ptrdiff_t p = l; p <= size_t1; ++p)
+ for (std::ptrdiff_t p = l; p <= size_t1; ++p)
{
C c1(std::begin(t1), std::end(t1));
@@ -126,11 +126,11 @@
{
// splicing different containers
typedef std::forward_list<T, min_allocator<T>> C;
- for (ptrdiff_t f = 0; f <= size_t2+1; ++f)
+ for (std::ptrdiff_t f = 0; f <= size_t2+1; ++f)
{
- for (ptrdiff_t l = f; l <= size_t2+1; ++l)
+ for (std::ptrdiff_t l = f; l <= size_t2+1; ++l)
{
- for (ptrdiff_t p = 0; p <= size_t1; ++p)
+ for (std::ptrdiff_t p = 0; p <= size_t1; ++p)
{
C c1(std::begin(t1), std::end(t1));
C c2(std::begin(t2), std::end(t2));
@@ -143,11 +143,11 @@
}
// splicing within same container
- for (ptrdiff_t f = 0; f <= size_t1+1; ++f)
+ for (std::ptrdiff_t f = 0; f <= size_t1+1; ++f)
{
- for (ptrdiff_t l = f; l <= size_t1; ++l)
+ for (std::ptrdiff_t l = f; l <= size_t1; ++l)
{
- for (ptrdiff_t p = 0; p <= f; ++p)
+ for (std::ptrdiff_t p = 0; p <= f; ++p)
{
C c1(std::begin(t1), std::end(t1));
@@ -155,7 +155,7 @@
std::next(c1.cbefore_begin(), f), std::next(c1.cbefore_begin(), l));
tests(c1, p, f, l);
}
- for (ptrdiff_t p = l; p <= size_t1; ++p)
+ for (std::ptrdiff_t p = l; p <= size_t1; ++p)
{
C c1(std::begin(t1), std::end(t1));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
index bfadd6f..aed12da 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
@@ -105,7 +105,7 @@
int a2[] = {1, 2, 3, 5, 2, 11};
std::forward_list<PredLWG526> c1(a1, a1 + 8);
do_unique(c1, std::ref(c1.front()), 2);
- for (size_t i = 0; i < 6; ++i)
+ for (std::size_t i = 0; i < 6; ++i)
{
assert(!c1.empty());
assert(c1.front() == a2[i]);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
index e9450ec..b456883 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
@@ -35,7 +35,7 @@
some_alloc() {}
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::true_type propagate_on_container_swap;
@@ -48,7 +48,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_swap;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
index 08d21d6..c5145fd 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
@@ -28,7 +28,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::forward_list<int, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/allocator_mismatch.verify.cpp
similarity index 72%
rename from third_party/llvm-project/libcxx/test/std/containers/sequences/list/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/sequences/list/allocator_mismatch.verify.cpp
index 39dcde4..9a850a7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <list>
-int main(int, char**)
-{
- std::list<int, std::allocator<long> > l;
-
- return 0;
-}
+std::list<int, std::allocator<long> > l;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp
new file mode 100644
index 0000000..059fba3
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <list>
+
+// template <class T, class Allocator> constexpr
+// synth-three-way-result<T>
+// operator<=>(const list<T, Allocator>& x, const list<T, Allocator>& y);
+
+#include <list>
+#include <cassert>
+
+#include "test_container_comparisons.h"
+
+int main(int, char**) {
+ assert(test_sequence_container_spaceship<std::list>());
+ // `std::list` is not constexpr, so no `static_assert` test here.
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
index 4edf426..77d4e5a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <list>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::list<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
index 8560a6a..c39fefe 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
@@ -27,7 +27,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::list<int, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
index d34efac..f212257 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
index a6c9a83..ae7e264 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@
typedef T value_type;
some_alloc(const some_alloc&);
~some_alloc() noexcept(false);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
index daa2410..9df8413 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
index 6c1c89c..5c0b4c2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
index 6b08308..977cf24 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
assert(expected_erased_count == std::erase(s, val));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
index b6670cb..db8fd8b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
index b8503ef..c57d81b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
@@ -77,7 +77,7 @@
std::list<PredLWG526> c(a1, a1 + 7);
c.remove_if(std::ref(c.front()));
assert(c.size() == 5);
- for (size_t i = 0; i < c.size(); ++i)
+ for (std::size_t i = 0; i < c.size(); ++i)
{
assert(c.front() == a2[i]);
c.pop_front();
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
index a33cad8..e107254 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
@@ -59,7 +59,7 @@
c.unique(std::ref(c.front()));
#endif
assert(c.size() == 6);
- for (size_t i = 0; i < c.size(); ++i)
+ for (std::size_t i = 0; i < c.size(); ++i)
{
assert(c.front() == a2[i]);
c.pop_front();
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
index 228d3ef..ae76236 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
@@ -34,7 +34,7 @@
some_alloc() {}
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::true_type propagate_on_container_swap;
@@ -47,7 +47,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_swap;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
index 06c968e..167e095 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <vector>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::vector<bool> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
index d4756cd..d3e1297 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
@@ -57,7 +57,7 @@
{
std::vector<bool> v(100);
while(v.size() < v.capacity()) v.push_back(false);
- size_t sz = v.size();
+ std::size_t sz = v.size();
bool a[] = {1, 0, 0, 1, 1};
const unsigned N = sizeof(a)/sizeof(a[0]);
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const bool*>(a),
@@ -76,7 +76,7 @@
std::vector<bool> v(100);
while(v.size() < v.capacity()) v.push_back(false);
v.pop_back(); v.pop_back(); v.pop_back();
- size_t sz = v.size();
+ std::size_t sz = v.size();
bool a[] = {1, 0, 0, 1, 1};
const unsigned N = sizeof(a)/sizeof(a[0]);
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const bool*>(a),
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
index feea188..484c57e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
@@ -36,7 +36,7 @@
{
std::vector<bool> v(100);
while(v.size() < v.capacity()) v.push_back(false);
- size_t sz = v.size();
+ std::size_t sz = v.size();
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(i == v.begin() + 10);
@@ -52,7 +52,7 @@
std::vector<bool> v(100);
while(v.size() < v.capacity()) v.push_back(false);
v.pop_back(); v.pop_back();
- size_t sz = v.size();
+ std::size_t sz = v.size();
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(i == v.begin() + 10);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
index b9a926e..bb59de3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
@@ -35,7 +35,7 @@
{
std::vector<bool> v(100);
while(v.size() < v.capacity()) v.push_back(false);
- size_t sz = v.size();
+ std::size_t sz = v.size();
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
assert(i == v.begin() + 10);
@@ -50,7 +50,7 @@
std::vector<bool> v(100);
while(v.size() < v.capacity()) v.push_back(false);
v.pop_back(); v.pop_back();
- size_t sz = v.size();
+ std::size_t sz = v.size();
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
assert(i == v.begin() + 10);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp
index 61cbfea..c1fe1bb 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp
@@ -11,6 +11,9 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// <vector>
// template<class T, class charT>
@@ -29,13 +32,14 @@
#include "test_format_string.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
index 32b68b8..4f17a99 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
@@ -14,9 +14,7 @@
#include "test_macros.h"
template <class CharT, class TestFunction, class ExceptionTest>
-void format_tests(TestFunction check, ExceptionTest check_exception) {
- std::vector input{true, true, false};
-
+void format_test_vector_bool(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("[true, true, false]"), SV("{}"), input);
// ***** underlying has no format-spec
@@ -113,4 +111,15 @@
check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 32);
}
+template <class CharT, class TestFunction, class ExceptionTest>
+void format_tests(TestFunction check, ExceptionTest check_exception) {
+ format_test_vector_bool<CharT>(check, check_exception, std::vector{true, true, false});
+
+ // The const_reference shall be a bool.
+ // However libc++ uses a __bit_const_reference<vector> when
+ // _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL is defined.
+ const std::vector input{true, true, false};
+ format_test_vector_bool<CharT>(check, check_exception, input);
+}
+
#endif // TEST_STD_CONTAINERS_SEQUENCES_VECTOR_BOOL_VECTOR_BOOL_FMT_FORMAT_FUNCTIONS_TESTS_H
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp
index 9e6db80..20a7ddf 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <vector>
@@ -30,13 +28,14 @@
#include "format.functions.tests.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -44,20 +43,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch (const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.pass.cpp
index acb517a..e20ea9b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <vector>
// template<class T, class charT>
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/parse.pass.cpp
index c099cfe..1851b83 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/parse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/parse.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <vector>
// template<class T, class charT>
@@ -40,23 +36,23 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class StringViewT>
-constexpr void test_parse(StringViewT fmt) {
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
using CharT = typename StringViewT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<std::vector<bool, std::allocator<bool>>::reference, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
}
template <class CharT>
constexpr void test_fmt() {
- test_parse(SV(""));
- test_parse(SV("b"));
+ test_parse(SV(""), 0);
+ test_parse(SV("b"), 0);
- test_parse(SV("}"));
- test_parse(SV("b}"));
+ test_parse(SV("}"), 1);
+ test_parse(SV("b}"), 1);
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/access.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/access.pass.cpp
index 5989f1e..026cf92 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/access.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/access.pass.cpp
@@ -116,6 +116,7 @@
test<std::vector<int> >();
#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int> > >();
+ test<std::vector<int, safe_allocator<int> > >();
#endif
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/allocator_mismatch.verify.cpp
similarity index 72%
rename from third_party/llvm-project/libcxx/test/std/containers/sequences/vector/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/sequences/vector/allocator_mismatch.verify.cpp
index 0c57f16..d9619f2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <vector>
-int main(int, char**)
-{
- std::vector<int, std::allocator<long> > v;
-
- return 0;
-}
+std::vector<int, std::allocator<long> > v;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
index d9f557e..3c992ba 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
@@ -20,7 +20,7 @@
template <class C>
TEST_CONSTEXPR_CXX20 void test_contiguous(const C &c)
{
- for ( size_t i = 0; i < c.size(); ++i )
+ for ( std::size_t i = 0; i < c.size(); ++i )
assert ( *(c.begin() + static_cast<typename C::difference_type>(i)) == *(std::addressof(*c.begin()) + i));
}
@@ -48,6 +48,13 @@
test_contiguous(C(A{}));
test_contiguous(C(9, 11.0, A{}));
}
+ {
+ typedef double T;
+ typedef safe_allocator<T> A;
+ typedef std::vector<T, A> C;
+ test_contiguous(C(A{}));
+ test_contiguous(C(9, 11.0, A{}));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.pass.cpp
index cc5f3bc..ad4d7b3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.pass.cpp
@@ -40,6 +40,16 @@
c.clear();
assert(c.empty());
}
+ {
+ typedef std::vector<int, safe_allocator<int>> C;
+ C c;
+ ASSERT_NOEXCEPT(c.empty());
+ assert(c.empty());
+ c.push_back(C::value_type(1));
+ assert(!c.empty());
+ c.clear();
+ assert(c.empty());
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
index df3b496..4cea844 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <vector>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::vector<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
index 3f8d62e..33abaa0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
@@ -28,7 +28,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::vector<int, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
index 99c4896..b8548ad 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
@@ -51,7 +51,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
if (!TEST_IS_CONSTANT_EVALUATED) {
std::vector<int> v;
- size_t sz = v.max_size() + 1;
+ std::size_t sz = v.max_size() + 1;
try {
v.reserve(sz);
@@ -64,8 +64,8 @@
if (!TEST_IS_CONSTANT_EVALUATED) {
std::vector<int> v(10, 42);
int* previous_data = v.data();
- size_t previous_capacity = v.capacity();
- size_t sz = v.max_size() + 1;
+ std::size_t previous_capacity = v.capacity();
+ std::size_t sz = v.max_size() + 1;
try {
v.reserve(sz);
@@ -99,6 +99,23 @@
assert(v.capacity() == 150);
assert(is_contiguous_container_asan_correct(v));
}
+ {
+ std::vector<int, safe_allocator<int>> v;
+ v.reserve(10);
+ assert(v.capacity() >= 10);
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ assert(v.capacity() == 100);
+ v.reserve(50);
+ assert(v.size() == 100);
+ assert(v.capacity() == 100);
+ v.reserve(150);
+ assert(v.size() == 100);
+ assert(v.capacity() == 150);
+ assert(is_contiguous_container_asan_correct(v));
+ }
#endif
#ifndef TEST_HAS_NO_EXCEPTIONS
if (!TEST_IS_CONSTANT_EVALUATED) {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
index 0b9db8e..967daf9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
@@ -78,6 +78,17 @@
assert(v.capacity() >= 200);
assert(is_contiguous_container_asan_correct(v));
}
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ v.resize(50);
+ assert(v.size() == 50);
+ assert(v.capacity() == 100);
+ assert(is_contiguous_container_asan_correct(v));
+ v.resize(200);
+ assert(v.size() == 200);
+ assert(v.capacity() >= 200);
+ assert(is_contiguous_container_asan_correct(v));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
index c019798..a880bcf 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
@@ -72,6 +72,33 @@
assert(v.capacity() >= 200);
assert(is_contiguous_container_asan_correct(v));
}
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ v.resize(50, 1);
+ assert(v.size() == 50);
+ assert(v.capacity() == 100);
+ assert(is_contiguous_container_asan_correct(v));
+ assert((v == std::vector<int, safe_allocator<int>>(50)));
+ v.resize(200, 1);
+ assert(v.size() == 200);
+ assert(v.capacity() >= 200);
+ assert(is_contiguous_container_asan_correct(v));
+ for (unsigned i = 0; i < 50; ++i)
+ assert(v[i] == 0);
+ for (unsigned i = 50; i < 200; ++i)
+ assert(v[i] == 1);
+ }
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ v.resize(50, 1);
+ assert(v.size() == 50);
+ assert(v.capacity() == 100);
+ assert(is_contiguous_container_asan_correct(v));
+ v.resize(200, 1);
+ assert(v.size() == 200);
+ assert(v.capacity() >= 200);
+ assert(is_contiguous_container_asan_correct(v));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
index 3f24879..8851e2a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
@@ -57,6 +57,15 @@
assert(v.size() == 101);
assert(is_contiguous_container_asan_correct(v));
}
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ v.push_back(1);
+ assert(is_contiguous_container_asan_correct(v));
+ v.shrink_to_fit();
+ assert(v.capacity() == 101);
+ assert(v.size() == 101);
+ assert(is_contiguous_container_asan_correct(v));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/size.pass.cpp
index aa41da6..f38aab1 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/size.pass.cpp
@@ -57,6 +57,24 @@
c.erase(c.begin());
assert(c.size() == 0);
}
+ {
+ typedef std::vector<int, safe_allocator<int>> C;
+ C c;
+ ASSERT_NOEXCEPT(c.size());
+ assert(c.size() == 0);
+ c.push_back(C::value_type(2));
+ assert(c.size() == 1);
+ c.push_back(C::value_type(1));
+ assert(c.size() == 2);
+ c.push_back(C::value_type(3));
+ assert(c.size() == 3);
+ c.erase(c.begin());
+ assert(c.size() == 2);
+ c.erase(c.begin());
+ assert(c.size() == 1);
+ c.erase(c.begin());
+ assert(c.size() == 0);
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
index 47a0435..1b2ac76 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
@@ -45,6 +45,19 @@
assert(v2.capacity() == 100);
assert(is_contiguous_container_asan_correct(v2));
}
+ {
+ std::vector<int, safe_allocator<int>> v1(100);
+ std::vector<int, safe_allocator<int>> v2(200);
+ assert(is_contiguous_container_asan_correct(v1));
+ assert(is_contiguous_container_asan_correct(v2));
+ v1.swap(v2);
+ assert(v1.size() == 200);
+ assert(v1.capacity() == 200);
+ assert(is_contiguous_container_asan_correct(v1));
+ assert(v2.size() == 100);
+ assert(v2.capacity() == 100);
+ assert(is_contiguous_container_asan_correct(v2));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
index f5b461b..e0e227e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
@@ -78,6 +78,13 @@
assert(l2 == l);
assert(l2.get_allocator() == min_allocator<int>());
}
+ {
+ std::vector<int, safe_allocator<int> > l(3, 2, safe_allocator<int>());
+ std::vector<int, safe_allocator<int> > l2(l, safe_allocator<int>());
+ l2 = l;
+ assert(l2 == l);
+ assert(l2.get_allocator() == safe_allocator<int>());
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
index 4daa320..9b52885 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
@@ -71,7 +71,7 @@
std::vector<int> dst(10);
- size_t n = dst.capacity() * 2;
+ std::size_t n = dst.capacity() * 2;
std::vector<int> src(n);
dst.assign(It(src.data()), It(src.data() + src.size()));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
index e6eba51..58081fa 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
@@ -95,6 +95,24 @@
assert(l2.get_allocator() == lo.get_allocator());
assert(is_contiguous_container_asan_correct(l2));
}
+ {
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > l((safe_allocator<MoveOnly>()));
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > lo((safe_allocator<MoveOnly>()));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
+ for (int i = 1; i <= 3; ++i) {
+ l.push_back(i);
+ lo.push_back(i);
+ }
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > l2((safe_allocator<MoveOnly>()));
+ l2 = std::move(l);
+ assert(l2 == lo);
+ assert(l.empty());
+ assert(l2.get_allocator() == lo.get_allocator());
+ assert(is_contiguous_container_asan_correct(l2));
+ }
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
index 0f2fb36..5d71b8a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
@@ -81,6 +81,13 @@
random_access_iterator<const int*>(a),
random_access_iterator<const int*>(an));
test<std::vector<int> >(a, an);
+ test<std::vector<int, safe_allocator<int> > >(
+ cpp17_input_iterator<const int*>(a), cpp17_input_iterator<const int*>(an));
+ test<std::vector<int, safe_allocator<int> > >(forward_iterator<const int*>(a), forward_iterator<const int*>(an));
+ test<std::vector<int, safe_allocator<int> > >(
+ bidirectional_iterator<const int*>(a), bidirectional_iterator<const int*>(an));
+ test<std::vector<int, safe_allocator<int> > >(
+ random_access_iterator<const int*>(a), random_access_iterator<const int*>(an));
#endif
}
@@ -183,8 +190,8 @@
}
{
// Though the types are different, initialization can be done with `memcpy`.
- int32_t array[1] = { -1 };
- std::vector<uint32_t> v(array, array + 1);
+ std::int32_t array[1] = { -1 };
+ std::vector<std::uint32_t> v(array, array + 1);
assert(v[0] == 4294967295U);
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
index 5d38543..b1e34a5 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
@@ -83,6 +83,20 @@
test<std::vector<int, min_allocator<int> > >(a, an, alloc);
test<std::vector<int, implicit_conv_allocator<int> > >(a, an, nullptr);
}
+ {
+ int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
+ int* an = a + sizeof(a) / sizeof(a[0]);
+ safe_allocator<int> alloc;
+ test<std::vector<int, safe_allocator<int> > >(
+ cpp17_input_iterator<const int*>(a), cpp17_input_iterator<const int*>(an), alloc);
+ test<std::vector<int, safe_allocator<int> > >(
+ forward_iterator<const int*>(a), forward_iterator<const int*>(an), alloc);
+ test<std::vector<int, safe_allocator<int> > >(
+ bidirectional_iterator<const int*>(a), bidirectional_iterator<const int*>(an), alloc);
+ test<std::vector<int, safe_allocator<int> > >(
+ random_access_iterator<const int*>(a), random_access_iterator<const int*>(an), alloc);
+ test<std::vector<int, safe_allocator<int> > >(a, an, alloc);
+ }
#endif
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
index e4b1f43..1dc7cd9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
@@ -59,6 +59,8 @@
#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>>>(0);
test<std::vector<int, min_allocator<int>>>(50);
+ test<std::vector<int, safe_allocator<int>>>(0);
+ test<std::vector<int, safe_allocator<int>>>(50);
#endif
return true;
@@ -76,6 +78,8 @@
#if TEST_STD_VER >= 11
test<std::vector<DefaultOnly, min_allocator<DefaultOnly>>>(0);
test<std::vector<DefaultOnly, min_allocator<DefaultOnly>>>(500);
+ test<std::vector<DefaultOnly, safe_allocator<DefaultOnly>>>(0);
+ test<std::vector<DefaultOnly, safe_allocator<DefaultOnly>>>(500);
test<std::vector<DefaultOnly, test_allocator<DefaultOnly>>>(0, test_allocator<DefaultOnly>(23));
test<std::vector<DefaultOnly, test_allocator<DefaultOnly>>>(100, test_allocator<DefaultOnly>(23));
assert(DefaultOnly::count == 0);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
index 7f7777c..0f24e77 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
@@ -40,6 +40,8 @@
#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(0, 3);
test<std::vector<int, min_allocator<int>> >(50, 3);
+ test<std::vector<int, safe_allocator<int>> >(0, 3);
+ test<std::vector<int, safe_allocator<int>> >(50, 3);
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
index 17d3a58..eb34de8 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
@@ -37,6 +37,8 @@
#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(0, 3, min_allocator<int>());
test<std::vector<int, min_allocator<int>> >(50, 3, min_allocator<int>());
+ test<std::vector<int, safe_allocator<int>> >(0, 3, safe_allocator<int>());
+ test<std::vector<int, safe_allocator<int>> >(50, 3, safe_allocator<int>());
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
index 9130104..f716ecc 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
@@ -14,9 +14,7 @@
#include "MoveOnly.h"
-int main(int, char**)
-{
+void f() {
std::vector<MoveOnly> v;
std::vector<MoveOnly> copy = v; // expected-error-re@* {{{{(no matching function for call to 'construct_at')|(call to implicitly-deleted copy constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
index 88822e9..810ea4f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
@@ -73,6 +73,7 @@
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<int, min_allocator<int>>(a, an));
+ test(std::vector<int, safe_allocator<int>>(a, an));
}
{
std::vector<int, min_allocator<int> > v(3, 2, min_allocator<int>());
@@ -84,6 +85,16 @@
assert(is_contiguous_container_asan_correct(v));
assert(is_contiguous_container_asan_correct(v2));
}
+ {
+ std::vector<int, safe_allocator<int> > v(3, 2, safe_allocator<int>());
+ std::vector<int, safe_allocator<int> > v2 = v;
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
+ assert(v2 == v);
+ assert(v2.get_allocator() == v.get_allocator());
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
index 70434bc..0c03c50 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
@@ -61,6 +61,7 @@
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<int, min_allocator<int>>(a, an), min_allocator<int>());
+ test(std::vector<int, safe_allocator<int>>(a, an), safe_allocator<int>());
}
{
std::vector<int, min_allocator<int> > l(3, 2, min_allocator<int>());
@@ -68,6 +69,12 @@
assert(l2 == l);
assert(l2.get_allocator() == min_allocator<int>());
}
+ {
+ std::vector<int, safe_allocator<int> > l(3, 2, safe_allocator<int>());
+ std::vector<int, safe_allocator<int> > l2(l, safe_allocator<int>());
+ assert(l2 == l);
+ assert(l2.get_allocator() == safe_allocator<int>());
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
index 3bd4a16..054ea64 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
TEST_CONSTEXPR_CXX20 bool tests() {
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
index 7934759..1b98b75 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@
typedef T value_type;
some_alloc(const some_alloc&);
~some_alloc() noexcept(false);
- void allocate(size_t);
+ void allocate(std::size_t);
};
TEST_CONSTEXPR_CXX20 bool tests()
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
index 6454f87..af2f3e4 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
@@ -38,6 +38,15 @@
assert(d[2] == 5);
assert(d[3] == 6);
}
+ {
+ std::vector<int, safe_allocator<int>> d = {3, 4, 5, 6};
+ assert(d.size() == 4);
+ assert(is_contiguous_container_asan_correct(d));
+ assert(d[0] == 3);
+ assert(d[1] == 4);
+ assert(d[2] == 5);
+ assert(d[3] == 6);
+ }
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
index 157aefc..8396e84 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
@@ -48,6 +48,22 @@
assert(d.empty());
assert(is_contiguous_container_asan_correct(d));
}
+ {
+ std::vector<int, safe_allocator<int>> d({3, 4, 5, 6}, safe_allocator<int>());
+ assert(d.get_allocator() == safe_allocator<int>());
+ assert(d.size() == 4);
+ assert(is_contiguous_container_asan_correct(d));
+ assert(d[0] == 3);
+ assert(d[1] == 4);
+ assert(d[2] == 5);
+ assert(d[3] == 6);
+ }
+ {
+ std::vector<int, safe_allocator<int>> d({}, safe_allocator<int>());
+ assert(d.size() == 0);
+ assert(d.empty());
+ assert(is_contiguous_container_asan_correct(d));
+ }
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
index 0f3e737..95b896b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
@@ -101,6 +101,34 @@
assert(is_contiguous_container_asan_correct(c2));
}
{
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > l((safe_allocator<MoveOnly>()));
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > lo((safe_allocator<MoveOnly>()));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
+ for (int i = 1; i <= 3; ++i) {
+ l.push_back(i);
+ lo.push_back(i);
+ }
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > l2 = std::move(l);
+ assert(l2 == lo);
+ assert(l.empty());
+ assert(l2.get_allocator() == lo.get_allocator());
+ assert(is_contiguous_container_asan_correct(l2));
+ }
+ {
+ int a1[] = {1, 3, 7, 9, 10};
+ std::vector<int, safe_allocator<int> > c1(a1, a1 + sizeof(a1) / sizeof(a1[0]));
+ assert(is_contiguous_container_asan_correct(c1));
+ std::vector<int, safe_allocator<int> >::const_iterator i = c1.begin();
+ std::vector<int, safe_allocator<int> > c2 = std::move(c1);
+ assert(is_contiguous_container_asan_correct(c2));
+ std::vector<int, safe_allocator<int> >::iterator j = c2.erase(i);
+ assert(*j == 3);
+ assert(is_contiguous_container_asan_correct(c2));
+ }
+ {
alloc_stats.clear();
using Vect = std::vector<int, test_allocator<int> >;
Vect v(test_allocator<int>(42, 101, &alloc_stats));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
index 2b6705a..fd0b995 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
@@ -94,6 +94,23 @@
assert(l2.get_allocator() == min_allocator<MoveOnly>());
assert(is_contiguous_container_asan_correct(l2));
}
+ {
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > l((safe_allocator<MoveOnly>()));
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > lo((safe_allocator<MoveOnly>()));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
+ for (int i = 1; i <= 3; ++i) {
+ l.push_back(i);
+ lo.push_back(i);
+ }
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > l2(std::move(l), safe_allocator<MoveOnly>());
+ assert(l2 == lo);
+ assert(l.empty());
+ assert(l2.get_allocator() == safe_allocator<MoveOnly>());
+ assert(is_contiguous_container_asan_correct(l2));
+ }
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
index fdd74a3..f466809 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
template <class T>
@@ -39,7 +39,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
@@ -53,7 +53,7 @@
some_alloc3() {}
some_alloc3(const some_alloc3&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
index 30e9f46..c2bfa52 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
};
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data.pass.cpp
index 4d2cadc..64b8542 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data.pass.cpp
@@ -59,6 +59,21 @@
assert(v.data() == std::addressof(v.front()));
assert(is_contiguous_container_asan_correct(v));
}
+ {
+ std::vector<int, safe_allocator<int>> v;
+ assert(v.data() == 0);
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<Nasty, safe_allocator<Nasty>> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
index d314f90..885caf2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
@@ -59,6 +59,21 @@
assert(v.data() == std::addressof(v.front()));
assert(is_contiguous_container_asan_correct(v));
}
+ {
+ const std::vector<int, safe_allocator<int>> v;
+ assert(v.data() == 0);
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ const std::vector<int, safe_allocator<int>> v(100);
+ assert(v.data() == &v.front());
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<Nasty, safe_allocator<Nasty>> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
index 72441c1..88b27d9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class S, class U>
-TEST_CONSTEXPR_CXX20 void test0(S s, U val, S expected, size_t expected_erased_count) {
+TEST_CONSTEXPR_CXX20 void test0(S s, U val, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
assert(expected_erased_count == std::erase(s, val));
assert(s == expected);
@@ -68,6 +68,7 @@
test<std::vector<int>>();
test<std::vector<int, min_allocator<int>>> ();
test<std::vector<int, test_allocator<int>>> ();
+ test<std::vector<int, safe_allocator<int>>>();
test<std::vector<long>>();
test<std::vector<double>>();
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
index 1fcc1c9..015824a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-TEST_CONSTEXPR_CXX20 void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+TEST_CONSTEXPR_CXX20 void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
assert(s == expected);
@@ -70,6 +70,7 @@
test<std::vector<int>>();
test<std::vector<int, min_allocator<int>>> ();
test<std::vector<int, test_allocator<int>>> ();
+ test<std::vector<int, safe_allocator<int>>>();
test<std::vector<long>>();
test<std::vector<double>>();
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
index 5a1e134..9390b83 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
@@ -38,6 +38,15 @@
LIBCPP_ASSERT(c.__invariants());
LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
}
+ {
+ int a[] = {1, 2, 3};
+ std::vector<int, safe_allocator<int>> c(a, a + 3);
+ ASSERT_NOEXCEPT(c.clear());
+ c.clear();
+ assert(c.empty());
+ LIBCPP_ASSERT(c.__invariants());
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
index f2c656c..4f5e36a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
@@ -132,6 +132,30 @@
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
+ {
+ std::vector<A, safe_allocator<A> > c;
+ std::vector<A, safe_allocator<A> >::iterator i = c.emplace(c.cbegin(), 2, 3.5);
+ assert(i == c.begin());
+ assert(c.size() == 1);
+ assert(c.front().geti() == 2);
+ assert(c.front().getd() == 3.5);
+ i = c.emplace(c.cend(), 3, 4.5);
+ assert(i == c.end() - 1);
+ assert(c.size() == 2);
+ assert(c.front().geti() == 2);
+ assert(c.front().getd() == 3.5);
+ assert(c.back().geti() == 3);
+ assert(c.back().getd() == 4.5);
+ i = c.emplace(c.cbegin() + 1, 4, 6.5);
+ assert(i == c.begin() + 1);
+ assert(c.size() == 3);
+ assert(c.front().geti() == 2);
+ assert(c.front().getd() == 3.5);
+ assert(c[1].geti() == 4);
+ assert(c[1].getd() == 6.5);
+ assert(c.back().geti() == 3);
+ assert(c.back().getd() == 4.5);
+ }
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
index bb7fa74..730ed32 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
@@ -138,6 +138,33 @@
assert(is_contiguous_container_asan_correct(c));
}
{
+ std::vector<A, safe_allocator<A> > c;
+#if TEST_STD_VER > 14
+ A& r1 = c.emplace_back(2, 3.5);
+ assert(c.size() == 1);
+ assert(&r1 == &c.back());
+ assert(c.front().geti() == 2);
+ assert(c.front().getd() == 3.5);
+ assert(is_contiguous_container_asan_correct(c));
+ A& r2 = c.emplace_back(3, 4.5);
+ assert(c.size() == 2);
+ assert(&r2 == &c.back());
+#else
+ c.emplace_back(2, 3.5);
+ assert(c.size() == 1);
+ assert(c.front().geti() == 2);
+ assert(c.front().getd() == 3.5);
+ assert(is_contiguous_container_asan_correct(c));
+ c.emplace_back(3, 4.5);
+ assert(c.size() == 2);
+#endif
+ assert(c.front().geti() == 2);
+ assert(c.front().getd() == 3.5);
+ assert(c.back().geti() == 3);
+ assert(c.back().getd() == 4.5);
+ assert(is_contiguous_container_asan_correct(c));
+ }
+ {
std::vector<Tag_X, TaggingAllocator<Tag_X> > c;
c.emplace_back();
assert(c.size() == 1);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
index 3e1a1d8..f186a0d 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
@@ -57,9 +57,27 @@
assert(is_contiguous_container_asan_correct(v));
}
{
+ std::vector<int, safe_allocator<int>> v;
+ v.reserve(3);
+ assert(is_contiguous_container_asan_correct(v));
+ v = {1, 2, 3};
+ v.emplace(v.begin(), v.back());
+ assert(v[0] == 3);
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<int, safe_allocator<int>> v;
+ v.reserve(4);
+ assert(is_contiguous_container_asan_correct(v));
+ v = {1, 2, 3};
+ v.emplace(v.begin(), v.back());
+ assert(v[0] == 3);
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
std::vector<int> v;
v.reserve(8);
- size_t old_capacity = v.capacity();
+ std::size_t old_capacity = v.capacity();
assert(old_capacity >= 8);
v.resize(4); // keep the existing capacity
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
index fe18d2d..934b85c 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
@@ -68,7 +68,7 @@
typedef std::vector<int> V;
V v(100);
while(v.size() < v.capacity()) v.push_back(0); // force reallocation
- size_t sz = v.size();
+ std::size_t sz = v.size();
int a[] = {1, 2, 3, 4, 5};
const unsigned N = sizeof(a)/sizeof(a[0]);
V::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
@@ -87,7 +87,7 @@
typedef std::vector<int> V;
V v(100);
v.reserve(128); // force no reallocation
- size_t sz = v.size();
+ std::size_t sz = v.size();
int a[] = {1, 2, 3, 4, 5};
const unsigned N = sizeof(a)/sizeof(a[0]);
V::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
index c8bb994..b5582df 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
@@ -36,7 +36,7 @@
assert(v[j] == 0);
}
{
- const size_t n = 100;
+ const std::size_t n = 100;
std::vector<int> v(n);
v.reserve(n + 1);
const int lvalue = 1;
@@ -47,7 +47,7 @@
assert(v.size() == n + 1);
assert(is_contiguous_container_asan_correct(v));
assert(it == v.begin() + n);
- for (size_t i = 0; i < n; ++i) {
+ for (std::size_t i = 0; i < n; ++i) {
assert(v[i] == 0);
}
assert(v[n] == lvalue);
@@ -55,7 +55,7 @@
{
std::vector<int> v(100);
while(v.size() < v.capacity()) v.push_back(0); // force reallocation
- size_t sz = v.size();
+ std::size_t sz = v.size();
const int lvalue = 1;
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, lvalue);
assert(v.size() == sz + 1);
@@ -72,7 +72,7 @@
std::vector<int> v(100);
while(v.size() < v.capacity()) v.push_back(0);
v.pop_back(); v.pop_back(); // force no reallocation
- size_t sz = v.size();
+ std::size_t sz = v.size();
const int lvalue = 1;
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, lvalue);
assert(v.size() == sz + 1);
@@ -114,6 +114,20 @@
for (++j; j < 101; ++j)
assert(v[j] == 0);
}
+ {
+ std::vector<int, safe_allocator<int>> v(100);
+ const int lvalue = 1;
+ std::vector<int, safe_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, lvalue);
+ assert(v.size() == 101);
+ assert(is_contiguous_container_asan_correct(v));
+ assert(i == v.begin() + 10);
+ int j;
+ for (j = 0; j < 10; ++j)
+ assert(v[j] == 0);
+ assert(v[j] == 1);
+ for (++j; j < 101; ++j)
+ assert(v[j] == 0);
+ }
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
index 11a7175..4619d7a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
@@ -62,6 +62,19 @@
for (++j; j < 101; ++j)
assert(v[j] == MoveOnly());
}
+ {
+ std::vector<MoveOnly, safe_allocator<MoveOnly> > v(100);
+ std::vector<MoveOnly, safe_allocator<MoveOnly> >::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
+ assert(v.size() == 101);
+ assert(is_contiguous_container_asan_correct(v));
+ assert(i == v.begin() + 10);
+ int j;
+ for (j = 0; j < 10; ++j)
+ assert(v[j] == MoveOnly());
+ assert(v[j] == MoveOnly(3));
+ for (++j; j < 101; ++j)
+ assert(v[j] == MoveOnly());
+ }
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
index c629428..8325fcf 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
@@ -38,7 +38,7 @@
{
std::vector<int> v(100);
while(v.size() < v.capacity()) v.push_back(0); // force reallocation
- size_t sz = v.size();
+ std::size_t sz = v.size();
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(is_contiguous_container_asan_correct(v));
@@ -54,7 +54,7 @@
{
std::vector<int> v(100);
v.reserve(128); // force no reallocation
- size_t sz = v.size();
+ std::size_t sz = v.size();
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(is_contiguous_container_asan_correct(v));
@@ -97,18 +97,18 @@
assert(v[j] == 0);
}
{
- std::vector<int, min_allocator<int>> v(100);
- std::vector<int, min_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
- assert(v.size() == 105);
- assert(is_contiguous_container_asan_correct(v));
- assert(i == v.begin() + 10);
- int j;
- for (j = 0; j < 10; ++j)
- assert(v[j] == 0);
- for (; j < 15; ++j)
- assert(v[j] == 1);
- for (++j; j < 105; ++j)
- assert(v[j] == 0);
+ std::vector<int, safe_allocator<int>> v(100);
+ std::vector<int, safe_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
+ assert(v.size() == 105);
+ assert(is_contiguous_container_asan_correct(v));
+ assert(i == v.begin() + 10);
+ int j;
+ for (j = 0; j < 10; ++j)
+ assert(v[j] == 0);
+ for (; j < 15; ++j)
+ assert(v[j] == 1);
+ for (++j; j < 105; ++j)
+ assert(v[j] == 0);
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
index e1f4520..98aece6 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
@@ -19,6 +19,81 @@
#include "min_allocator.h"
#include "asan_testing.h"
+template <typename A>
+TEST_CONSTEXPR_CXX20 void test_with_allocator() {
+ {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::vector<int, A> c1(a1, a1 + sizeof(a1) / sizeof(a1[0]));
+ std::vector<int, A> c2(a2, a2 + sizeof(a2) / sizeof(a2[0]));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ swap(c1, c2);
+ assert((c1 == std::vector<int, A>(a2, a2 + sizeof(a2) / sizeof(a2[0]))));
+ assert((c2 == std::vector<int, A>(a1, a1 + sizeof(a1) / sizeof(a1[0]))));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ }
+ {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::vector<int, A> c1(a1, a1);
+ std::vector<int, A> c2(a2, a2 + sizeof(a2) / sizeof(a2[0]));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ swap(c1, c2);
+ assert((c1 == std::vector<int, A>(a2, a2 + sizeof(a2) / sizeof(a2[0]))));
+ assert(c2.empty());
+ assert(std::distance(c2.begin(), c2.end()) == 0);
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ }
+ {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::vector<int, A> c1(a1, a1 + sizeof(a1) / sizeof(a1[0]));
+ std::vector<int, A> c2(a2, a2);
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ swap(c1, c2);
+ assert(c1.empty());
+ assert(std::distance(c1.begin(), c1.end()) == 0);
+ assert((c2 == std::vector<int, A>(a1, a1 + sizeof(a1) / sizeof(a1[0]))));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ }
+ {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::vector<int, A> c1(a1, a1);
+ std::vector<int, A> c2(a2, a2);
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ swap(c1, c2);
+ assert(c1.empty());
+ assert(std::distance(c1.begin(), c1.end()) == 0);
+ assert(c2.empty());
+ assert(std::distance(c2.begin(), c2.end()) == 0);
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ }
+ {
+ int a1[] = {1, 3, 7, 9, 10};
+ int a2[] = {0, 2, 4, 5, 6, 8, 11};
+ std::vector<int, A> c1(a1, a1 + sizeof(a1) / sizeof(a1[0]), A());
+ std::vector<int, A> c2(a2, a2 + sizeof(a2) / sizeof(a2[0]), A());
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ swap(c1, c2);
+ assert((c1 == std::vector<int, A>(a2, a2 + sizeof(a2) / sizeof(a2[0]))));
+ assert(c1.get_allocator() == A());
+ assert((c2 == std::vector<int, A>(a1, a1 + sizeof(a1) / sizeof(a1[0]))));
+ assert(c2.get_allocator() == A());
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
+ }
+}
+
TEST_CONSTEXPR_CXX20 bool tests()
{
{
@@ -106,78 +181,8 @@
assert(is_contiguous_container_asan_correct(c2));
}
#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::vector<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::vector<int, min_allocator<int>> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- swap(c1, c2);
- assert((c1 == std::vector<int, min_allocator<int>>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
- assert((c2 == std::vector<int, min_allocator<int>>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- }
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::vector<int, min_allocator<int>> c1(a1, a1);
- std::vector<int, min_allocator<int>> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- swap(c1, c2);
- assert((c1 == std::vector<int, min_allocator<int>>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
- assert(c2.empty());
- assert(std::distance(c2.begin(), c2.end()) == 0);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- }
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::vector<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::vector<int, min_allocator<int>> c2(a2, a2);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- swap(c1, c2);
- assert(c1.empty());
- assert(std::distance(c1.begin(), c1.end()) == 0);
- assert((c2 == std::vector<int, min_allocator<int>>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- }
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::vector<int, min_allocator<int>> c1(a1, a1);
- std::vector<int, min_allocator<int>> c2(a2, a2);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- swap(c1, c2);
- assert(c1.empty());
- assert(std::distance(c1.begin(), c1.end()) == 0);
- assert(c2.empty());
- assert(std::distance(c2.begin(), c2.end()) == 0);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- }
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- typedef min_allocator<int> A;
- std::vector<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A());
- std::vector<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A());
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- swap(c1, c2);
- assert((c1 == std::vector<int, A>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
- assert(c1.get_allocator() == A());
- assert((c2 == std::vector<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(c2.get_allocator() == A());
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
- }
+ test_with_allocator<min_allocator<int>>();
+ test_with_allocator<safe_allocator<int>>();
#endif
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
index 830d05c..d38a00c 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
@@ -35,7 +35,7 @@
some_alloc() {}
some_alloc(const some_alloc&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::true_type propagate_on_container_swap;
@@ -48,7 +48,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- void allocate(size_t);
+ void allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_swap;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.compile.fail.cpp
deleted file mode 100644
index 7059220..0000000
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.compile.fail.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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>
-// The container's value type must be the same as the allocator's value type
-
-#include <unordered_map>
-
-int main(int, char**)
-{
- std::unordered_map<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.verify.cpp
similarity index 68%
rename from third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.verify.cpp
index ba24ca3..c8e0b8f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <unordered_map>
-int main(int, char**)
-{
- std::unordered_multimap<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
-
- return 0;
-}
+std::unordered_map<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
index 0f2e721..14e5b2f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
@@ -37,9 +37,9 @@
P(2, "four"),
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 5);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
@@ -57,9 +57,9 @@
P(2, "four"),
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 5);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
index 12364fa..200107c 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
@@ -30,7 +30,7 @@
template <>
struct hash<Key>
{
- size_t operator()(Key const &) const {return 0;}
+ std::size_t operator()(Key const &) const {return 0;}
};
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
index 269250b..ada96fd 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <unordered_map>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::unordered_map<int, int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
index 54a8b9b..329ead0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
@@ -31,7 +31,7 @@
}
template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
M s = make<M>(vals);
ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
index 7c2ec58..33c009b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
@@ -32,7 +32,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<KV, (size_t)-1> A;
+ typedef limited_allocator<KV, (std::size_t)-1> A;
typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, A>
C;
const C::size_type max_dist =
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
index c8f079f..737e40d 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
@@ -22,7 +22,7 @@
#include "min_allocator.h"
template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
{
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
index 622a969..358da35 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
@@ -31,14 +31,14 @@
assert(c.at(4) == "four");
}
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
{
- for (size_t i = 0; i < n; ++i)
+ for (std::size_t i = 0; i < n; ++i)
{
- std::unordered_map<size_t, size_t> c;
+ std::unordered_map<std::size_t, size_t> c;
c.reserve(n);
- size_t buckets = c.bucket_count();
- for (size_t j = 0; j < i; ++j)
+ std::size_t buckets = c.bucket_count();
+ for (std::size_t j = 0; j < i; ++j)
{
c[i] = i;
assert(buckets == c.bucket_count());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
index 1d0b18b..42cc9d1 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
@@ -28,7 +28,7 @@
};
bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
index 2ce9888..ac241c0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
auto some_key = c.cbegin()->first;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
index e1c893f..78721db 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
@@ -24,8 +24,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
index 821eec9..8677810 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
@@ -38,7 +38,7 @@
{
typename Container::node_type node = nf(i, i + 1);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(node.empty());
assert(prev + 1 == c.size());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
index 1b7c9e0..df21383 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
@@ -52,7 +52,7 @@
{return int_ == x.int_ && double_ == x.double_;}
bool operator<(const Moveable& x) const
{return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
- size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
+ std::size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
int get() const {return int_;}
bool moved() const {return int_ == -1;}
@@ -60,7 +60,7 @@
namespace std {
template <> struct hash<Moveable> {
- size_t operator () (const Moveable &m) const { return m.hash(); }
+ std::size_t operator () (const Moveable &m) const { return m.hash(); }
};
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
index 9953dc8..e5c29b1 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
@@ -40,7 +40,7 @@
throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
- size_t operator()(const T& p) const
+ std::size_t operator()(const T& p) const
{
if (should_throw_)
throw 0;
@@ -95,7 +95,7 @@
struct hasher
{
hasher() = default;
- size_t operator()(const Counter<int>& p) const
+ std::size_t operator()(const Counter<int>& p) const
{
return std::hash<Counter<int>>()(p);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
index bf2c317..b9c8239 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
@@ -51,7 +51,7 @@
{return int_ == x.int_ && double_ == x.double_;}
bool operator<(const Moveable& x) const
{return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
- size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
+ std::size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
int get() const {return int_;}
bool moved() const {return int_ == -1;}
@@ -59,7 +59,7 @@
namespace std {
template <> struct hash<Moveable> {
- size_t operator () (const Moveable &m) const { return m.hash(); }
+ std::size_t operator () (const Moveable &m) const { return m.hash(); }
};
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.verify.cpp
similarity index 68%
copy from third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp
copy to third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.verify.cpp
index ba24ca3..4f28dc4 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <unordered_map>
-int main(int, char**)
-{
- std::unordered_multimap<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
-
- return 0;
-}
+std::unordered_multimap<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
index 80c97dd..0344087 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
@@ -37,9 +37,9 @@
P(2, "four"),
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 7);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
@@ -57,9 +57,9 @@
P(2, "four"),
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 7);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
index aead051..999d43f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <unordered_map>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::unordered_multimap<int, int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
index 2da3b17..90a6cae 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
@@ -31,7 +31,7 @@
}
template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
M s = make<M>(vals);
ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
index d03cf67..182f5a3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
@@ -33,7 +33,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<KV, (size_t)-1> A;
+ typedef limited_allocator<KV, (std::size_t)-1> A;
typedef std::unordered_multimap<int, int, std::hash<int>,
std::equal_to<int>, A>
C;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
index 99538e3..33d2bc0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
@@ -26,7 +26,7 @@
#include "min_allocator.h"
template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
{
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
index 2d3d8f2..b658539 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
@@ -46,16 +46,16 @@
assert(c.find(4)->second == "four");
}
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
{
- for (size_t i = 0; i < n; ++i)
+ for (std::size_t i = 0; i < n; ++i)
{
- std::unordered_multimap<size_t, size_t> c;
+ std::unordered_multimap<std::size_t, size_t> c;
c.reserve(n);
- size_t buckets = c.bucket_count();
- for (size_t j = 0; j < i; ++j)
+ std::size_t buckets = c.bucket_count();
+ for (std::size_t j = 0; j < i; ++j)
{
- c.insert(std::unordered_multimap<size_t, size_t>::value_type(i,i));
+ c.insert(std::unordered_multimap<std::size_t, size_t>::value_type(i,i));
assert(buckets == c.bucket_count());
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
index b237e3a..24e9249 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
@@ -31,7 +31,7 @@
};
bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
index 1b9e741..8905dc2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
auto some_key = c.cbegin()->first;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
index 293e0c0..3f2f69f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
index 5b8cd8e..461f7a3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@
{
typename Container::node_type node = nf(i, i + 1);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(node.empty());
assert(prev + 1 == c.size());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
index 04b1126..e9c0c3f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
@@ -40,7 +40,7 @@
throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
- size_t operator()(const T& p) const
+ std::size_t operator()(const T& p) const
{
if (should_throw_)
throw 0;
@@ -95,7 +95,7 @@
struct hasher
{
hasher() = default;
- size_t operator()(const Counter<int>& p) const
+ std::size_t operator()(const Counter<int>& p) const
{
return std::hash<Counter<int>>()(p);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.verify.cpp
similarity index 68%
copy from third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp
copy to third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.verify.cpp
index 6183761..16590f0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <unordered_set>
-int main(int, char**)
-{
- std::unordered_multiset<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
-
- return 0;
-}
+std::unordered_multiset<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
index 5436c1e..dd48710 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
@@ -35,9 +35,9 @@
P(2)
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 7);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
@@ -55,9 +55,9 @@
P(2)
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 7);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
index 547dd81..8f5fa55 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <unordered_set>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::unordered_multiset<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
index 2dee501..ffdcde8 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
@@ -27,7 +27,7 @@
};
bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
index a7fe88d..7bdc4f8 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
@@ -32,7 +32,7 @@
}
template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
M s = make<M>(vals);
ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
index 153e56d..d88e33b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
for (auto first = c.cbegin(); first != c.cend();)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
index 3c4de6e..ec1ace8 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
index ff1fc98..2706899 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
@@ -36,7 +36,7 @@
{
typename Container::node_type node = nf(i);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(prev + 1 == c.size());
assert(*it == i);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
index d08cdb6..47b165f 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
@@ -32,7 +32,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
A>
C;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
index fc986ec..00435d8 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
@@ -40,7 +40,7 @@
throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
- size_t operator()(const T& p) const
+ std::size_t operator()(const T& p) const
{
if (should_throw_)
throw 0;
@@ -95,7 +95,7 @@
struct hasher
{
hasher() = default;
- size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
+ std::size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
};
{
typedef std::unordered_multiset<Counter<int>, std::hash<Counter<int>>, std::equal_to<Counter<int>>> first_set_type;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
index 8c6699b..1ef3bdc 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
{
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
index 54eada5..557a924 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
@@ -30,14 +30,14 @@
assert(c.count(4) == 1);
}
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
{
- for (size_t i = 0; i < n; ++i)
+ for (std::size_t i = 0; i < n; ++i)
{
- std::unordered_multiset<size_t> c;
+ std::unordered_multiset<std::size_t> c;
c.reserve(n);
- size_t buckets = c.bucket_count();
- for (size_t j = 0; j < i; ++j)
+ std::size_t buckets = c.bucket_count();
+ for (std::size_t j = 0; j < i; ++j)
{
c.insert(i);
assert(buckets == c.bucket_count());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.compile.fail.cpp
deleted file mode 100644
index 0d1341e..0000000
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.compile.fail.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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>
-// The container's value type must be the same as the allocator's value type
-
-#include <unordered_set>
-
-int main(int, char**)
-{
- std::unordered_set<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.verify.cpp
similarity index 69%
rename from third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.verify.cpp
index 6183761..94be4d7 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.verify.cpp
@@ -11,9 +11,5 @@
#include <unordered_set>
-int main(int, char**)
-{
- std::unordered_multiset<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
-
- return 0;
-}
+std::unordered_set<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
index bcaa77b..969c3f6 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
@@ -35,9 +35,9 @@
P(2)
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 5);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
@@ -54,9 +54,9 @@
P(2)
};
const C c(std::begin(a), std::end(a));
- size_t bc = c.bucket_count();
+ std::size_t bc = c.bucket_count();
assert(bc >= 5);
- for (size_t i = 0; i < 13; ++i)
+ for (std::size_t i = 0; i < 13; ++i)
LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
index 4a739a3..e216441 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <unordered_set>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::unordered_set<int> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
index cc70913..4a66329 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
@@ -27,7 +27,7 @@
};
bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
index a2c7325..ba5f3bf 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
@@ -32,7 +32,7 @@
}
template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
M s = make<M>(vals);
ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
index d4a0a7c..f638250 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
template <class Container>
void test(Container& c)
{
- size_t sz = c.size();
+ std::size_t sz = c.size();
for (auto first = c.cbegin(); first != c.cend();)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
index e0d4856..3bfb6c3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
@@ -22,8 +22,8 @@
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
- size_t sz = c.size();
- assert((size_t)std::distance(first, last) == sz);
+ std::size_t sz = c.size();
+ assert((std::size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
index 3bb7d4f..b4b3d88 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@
{
typename Container::node_type node = nf(i);
assert(!node.empty());
- size_t prev = c.size();
+ std::size_t prev = c.size();
auto it = c.insert(c.end(), std::move(node));
assert(node.empty());
assert(prev + 1 == c.size());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
index aeb1354..289c4d3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
@@ -30,7 +30,7 @@
LIBCPP_ASSERT(c.max_size() == 10);
}
{
- typedef limited_allocator<int, (size_t)-1> A;
+ typedef limited_allocator<int, (std::size_t)-1> A;
typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, A> C;
const C::size_type max_dist =
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
index ef06ca8..c1b0e17 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
@@ -40,7 +40,7 @@
throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
- size_t operator()(const T& p) const
+ std::size_t operator()(const T& p) const
{
if (should_throw_)
throw 0;
@@ -95,7 +95,7 @@
struct hasher
{
hasher() = default;
- size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
+ std::size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
};
{
typedef std::unordered_set<Counter<int>, std::hash<Counter<int>>, std::equal_to<Counter<int>>> first_set_type;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
index e45327a..a0482fc 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
{
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
index 7ea358e..afcccf9 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
@@ -30,14 +30,14 @@
assert(c.count(4) == 1);
}
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
{
- for (size_t i = 0; i < n; ++i)
+ for (std::size_t i = 0; i < n; ++i)
{
- std::unordered_set<size_t> c;
+ std::unordered_set<std::size_t> c;
c.reserve(n);
- size_t buckets = c.bucket_count();
- for (size_t j = 0; j < i; ++j)
+ std::size_t buckets = c.bucket_count();
+ for (std::size_t j = 0; j < i; ++j)
{
c.insert(i);
assert(buckets == c.bucket_count());
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
index 7481987..3f35811 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
@@ -241,8 +241,8 @@
{arr + 1, arr + 3} // same size as s2
};
- for (size_t i = 0; i < std::size(spans); ++i)
- for (size_t j = i; j < std::size(spans); ++j)
+ for (std::size_t i = 0; i < std::size(spans); ++i)
+ for (std::size_t j = i; j < std::size(spans); ++j)
assert((doAssign(spans[i], spans[j])));
}
@@ -255,8 +255,8 @@
spanType{arr + 2, arr + 4}
};
- for (size_t i = 0; i < std::size(spans); ++i)
- for (size_t j = i; j < std::size(spans); ++j)
+ for (std::size_t i = 0; i < std::size(spans); ++i)
+ for (std::size_t j = i; j < std::size(spans); ++j)
assert((doAssign(spans[i], spans[j])));
}
@@ -275,8 +275,8 @@
{strs + 3, strs + 3}
};
- for (size_t i = 0; i < std::size(spans); ++i)
- for (size_t j = i; j < std::size(spans); ++j)
+ for (std::size_t i = 0; i < std::size(spans); ++i)
+ for (std::size_t j = i; j < std::size(spans); ++j)
assert((doAssign(spans[i], spans[j])));
}
@@ -288,8 +288,8 @@
spanType{strs + 2, strs + 3}
};
- for (size_t i = 0; i < std::size(spans); ++i)
- for (size_t j = i; j < std::size(spans); ++j)
+ for (std::size_t i = 0; i < std::size(spans); ++i)
+ for (std::size_t j = i; j < std::size(spans); ++j)
assert((doAssign(spans[i], spans[j])));
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
index f197330..fbbd3d6 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
@@ -20,23 +20,23 @@
#include <iterator>
#include <type_traits>
-template <size_t Extent>
+template <std::size_t Extent>
constexpr void test_constructibility() {
struct Other {};
- static_assert(std::is_constructible_v<std::span<int, Extent>, int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<int, Extent>, const int*, size_t>);
- static_assert(std::is_constructible_v<std::span<const int, Extent>, int*, size_t>);
- static_assert(std::is_constructible_v<std::span<const int, Extent>, const int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<int, Extent>, volatile int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<int, Extent>, const volatile int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<const int, Extent>, volatile int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<const int, Extent>, const volatile int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const int*, size_t>);
- static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const volatile int*, size_t>);
+ static_assert(std::is_constructible_v<std::span<int, Extent>, int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<int, Extent>, const int*, std::size_t>);
+ static_assert(std::is_constructible_v<std::span<const int, Extent>, int*, std::size_t>);
+ static_assert(std::is_constructible_v<std::span<const int, Extent>, const int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<int, Extent>, volatile int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<int, Extent>, const volatile int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<const int, Extent>, volatile int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<const int, Extent>, const volatile int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const int*, std::size_t>);
+ static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const volatile int*, std::size_t>);
static_assert(
- !std::is_constructible_v<std::span<int, Extent>, double*, size_t>); // iterator type differs from span type
- static_assert(!std::is_constructible_v<std::span<int, Extent>, size_t, size_t>);
- static_assert(!std::is_constructible_v<std::span<int, Extent>, Other*, size_t>); // unrelated iterator type
+ !std::is_constructible_v<std::span<int, Extent>, double*, std::size_t>); // iterator type differs from span type
+ static_assert(!std::is_constructible_v<std::span<int, Extent>, std::size_t, size_t>);
+ static_assert(!std::is_constructible_v<std::span<int, Extent>, Other*, std::size_t>); // unrelated iterator type
}
template <class T>
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
index 0372e00..3836c97 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
@@ -17,12 +17,12 @@
#include <span>
#include <cstddef>
-template <class T, size_t extent>
-std::span<T, extent> createImplicitSpan(T* ptr, size_t len) {
+template <class T, std::size_t extent>
+std::span<T, extent> createImplicitSpan(T* ptr, std::size_t len) {
return {ptr, len}; // expected-error {{chosen constructor is explicit in copy-initialization}}
}
-int main(int, char**) {
+void f() {
// explicit constructor necessary
int arr[] = {1, 2, 3};
createImplicitSpan<int, 1>(arr, 3);
@@ -31,6 +31,4 @@
std::span<int, 2> sp2 = {0, 0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
std::span<const int> csp = {0, 0}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
std::span<const int, 2> csp2 = {0, 0}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 2>'}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
index f744af7..c2d650b 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
@@ -13,24 +13,28 @@
// constexpr explicit(Extent != dynamic_extent) span(It first, End last);
// Requires: [first, last) shall be a valid range.
// If Extent is not equal to dynamic_extent, then last - first shall be equal to Extent.
-//
+// Throws: When and what last - first throws.
+#include <array>
#include <span>
#include <cassert>
+#include <utility>
+#include "assert_macros.h"
#include "test_iterators.h"
+#include "test_macros.h"
template <class T, class Sentinel>
constexpr bool test_ctor() {
T val[2] = {};
- auto s1 = std::span<T>(std::begin(val), Sentinel(std::end(val)));
- auto s2 = std::span<T, 2>(std::begin(val), Sentinel(std::end(val)));
+ auto s1 = std::span<T>(std::begin(val), Sentinel(std::end(val)));
+ auto s2 = std::span<T, 2>(std::begin(val), Sentinel(std::end(val)));
assert(s1.data() == std::data(val) && s1.size() == std::size(val));
assert(s2.data() == std::data(val) && s2.size() == std::size(val));
return true;
}
-template <size_t Extent>
+template <std::size_t Extent>
constexpr void test_constructibility() {
static_assert(std::is_constructible_v<std::span<int, Extent>, int*, int*>);
static_assert(!std::is_constructible_v<std::span<int, Extent>, const int*, const int*>);
@@ -55,8 +59,85 @@
return true;
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
+// A stripped down contiguous iterator that throws when using operator-.
+template <class It>
+class throw_operator_minus {
+ It it_;
+
+public:
+ typedef std::contiguous_iterator_tag iterator_category;
+ typedef typename std::iterator_traits<It>::value_type value_type;
+ typedef typename std::iterator_traits<It>::difference_type difference_type;
+ typedef It pointer;
+ typedef typename std::iterator_traits<It>::reference reference;
+ typedef typename std::remove_pointer<It>::type element_type;
+
+ throw_operator_minus() : it_() {}
+ explicit throw_operator_minus(It it) : it_(it) {}
+
+ reference operator*() const { return *it_; }
+ pointer operator->() const { return it_; }
+ reference operator[](difference_type n) const { return it_[n]; }
+
+ throw_operator_minus& operator++() {
+ ++it_;
+ return *this;
+ }
+ throw_operator_minus& operator--() {
+ --it_;
+ return *this;
+ }
+ throw_operator_minus operator++(int) { return throw_operator_minus(it_++); }
+ throw_operator_minus operator--(int) { return throw_operator_minus(it_--); }
+
+ throw_operator_minus& operator+=(difference_type n) {
+ it_ += n;
+ return *this;
+ }
+ throw_operator_minus& operator-=(difference_type n) {
+ it_ -= n;
+ return *this;
+ }
+ friend throw_operator_minus operator+(throw_operator_minus x, difference_type n) {
+ x += n;
+ return x;
+ }
+ friend throw_operator_minus operator+(difference_type n, throw_operator_minus x) {
+ x += n;
+ return x;
+ }
+ friend throw_operator_minus operator-(throw_operator_minus x, difference_type n) {
+ x -= n;
+ return x;
+ }
+ friend difference_type operator-(throw_operator_minus, throw_operator_minus) { throw 42; };
+
+ friend bool operator==(const throw_operator_minus& x, const throw_operator_minus& y) { return x.it_ == y.it_; }
+ friend bool operator<=>(const throw_operator_minus& x, const throw_operator_minus& y) { return x.it_ <=> y.it_; }
+};
+
+template <class It>
+throw_operator_minus(It) -> throw_operator_minus<It>;
+
+void test_exceptions() {
+ std::array a{42};
+ TEST_VALIDATE_EXCEPTION(
+ int,
+ [](int i) { assert(i == 42); },
+ (std::span<int>{throw_operator_minus{a.begin()}, throw_operator_minus{a.end()}}));
+ TEST_VALIDATE_EXCEPTION(
+ int,
+ [](int i) { assert(i == 42); },
+ (std::span<int, 1>{throw_operator_minus{a.begin()}, throw_operator_minus{a.end()}}));
+}
+#endif // TEST_HAS_NO_EXCEPTIONS
+
int main(int, char**) {
test();
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ test_exceptions();
+#endif
static_assert(test());
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
index 9ac9a03..a31aa2a 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
@@ -18,16 +18,13 @@
#include <span>
#include <iterator>
-
-template<class T, size_t Extent>
+template<class T, std::size_t Extent>
std::span<T, Extent> createImplicitSpan(T* first, T* last) {
return {first, last}; // expected-error {{chosen constructor is explicit in copy-initialization}}
}
-int main(int, char**) {
+void f() {
// explicit constructor necessary
int arr[] = {1, 2, 3};
createImplicitSpan<int, 1>(std::begin(arr), std::end(arr));
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
index d484754..71fee43 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
@@ -22,7 +22,7 @@
#include "test_iterators.h"
-template <class T, size_t Extent>
+template <class T, std::size_t Extent>
constexpr void test_from_range() {
T val[3]{};
std::span<T, Extent> s{val};
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
index c3c3631..784530e 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
@@ -23,7 +23,7 @@
#include "test_macros.h"
-template<class T, size_t extent, size_t otherExtent>
+template<class T, std::size_t extent, size_t otherExtent>
std::span<T, extent> createImplicitSpan(std::span<T, otherExtent> s) {
return {s}; // expected-error {{chosen constructor is explicit in copy-initialization}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
index fdafbfc..e46fd26 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
@@ -21,7 +21,7 @@
template <typename Span>
-constexpr bool testConstexprSpan(Span sp, size_t idx)
+constexpr bool testConstexprSpan(Span sp, std::size_t idx)
{
LIBCPP_ASSERT(noexcept(sp[idx]));
@@ -32,7 +32,7 @@
template <typename Span>
-void testRuntimeSpan(Span sp, size_t idx)
+void testRuntimeSpan(Span sp, std::size_t idx)
{
LIBCPP_ASSERT(noexcept(sp[idx]));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
index d531537..d6aaf74 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
@@ -34,7 +34,7 @@
ret = ret && (&*( e-1) == last);
}
- ret = ret && (static_cast<size_t>(e - s.begin()) == s.size());
+ ret = ret && (static_cast<std::size_t>(e - s.begin()) == s.size());
return ret;
}
@@ -53,7 +53,7 @@
assert(&*( e-1) == last);
}
- assert(static_cast<size_t>(e - s.begin()) == s.size());
+ assert(static_cast<std::size_t>(e - s.begin()) == s.size());
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
index c2bd13a..ffec15c 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
@@ -32,7 +32,7 @@
ret = ret && (e != s.rbegin());
}
- ret = ret && (static_cast<size_t>(e - s.rbegin()) == s.size());
+ ret = ret && (static_cast<std::size_t>(e - s.rbegin()) == s.size());
return ret;
}
@@ -49,7 +49,7 @@
assert(e != s.rbegin());
}
- assert(static_cast<size_t>(e - s.rbegin()) == s.size());
+ assert(static_cast<std::size_t>(e - s.rbegin()) == s.size());
}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
index d32d591..45485b3 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
@@ -36,7 +36,7 @@
std::as_writable_bytes(std::span<const long, 0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const double, 0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const A, 0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
- std::as_writable_bytes(std::span<const std::string, (size_t)0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
+ std::as_writable_bytes(std::span<const std::string, (std::size_t)0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const int> (iArr2, 1)); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const int, 1>(iArr2 + 5, 1)); // expected-error {{no matching function for call to 'as_writable_bytes'}}
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
index 5be7b98..fa41d78 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
@@ -21,7 +21,7 @@
template <typename Span>
-constexpr bool testConstexprSpan(Span sp, size_t sz)
+constexpr bool testConstexprSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size());
return sp.size() == sz;
@@ -29,7 +29,7 @@
template <typename Span>
-void testRuntimeSpan(Span sp, size_t sz)
+void testRuntimeSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size());
assert(sp.size() == sz);
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
index 9ce6d26..c25eaaa2 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
@@ -22,18 +22,18 @@
template <typename Span>
-constexpr bool testConstexprSpan(Span sp, size_t sz)
+constexpr bool testConstexprSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size_bytes());
- return (size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
+ return (std::size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
}
template <typename Span>
-void testRuntimeSpan(Span sp, size_t sz)
+void testRuntimeSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size_bytes());
- assert((size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
+ assert((std::size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
}
struct A{};
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
index 2b04cb0..a354ade 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
@@ -14,8 +14,7 @@
//
// constexpr span<element_type, dynamic_extent> first(size_type count) const;
//
-// Requires: Count <= size().
-
+// Mandates: Count <= Extent is true.
#include <span>
#include <cassert>
@@ -24,7 +23,7 @@
#include "test_macros.h"
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
@@ -44,7 +43,7 @@
}
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.verify.cpp
index 8e011b5..39d04b0 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/first.verify.cpp
@@ -12,7 +12,7 @@
// template<size_t Count>
// constexpr span<element_type, Count> first() const;
//
-// Requires: Count <= size().
+// Mandates: Count <= Extent is true.
#include <span>
#include <cstddef>
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
index 6fa6edf..017c805 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
@@ -14,8 +14,7 @@
//
// constexpr span<element_type, dynamic_extent> last(size_type count) const;
//
-// Requires: Count <= size().
-
+// Mandates: Count <= Extent is true.
#include <span>
#include <cassert>
@@ -24,7 +23,7 @@
#include "test_macros.h"
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
@@ -44,7 +43,7 @@
}
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.verify.cpp
index 1594e68..9fc6deb 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/last.verify.cpp
@@ -12,7 +12,7 @@
// template<size_t Count>
// constexpr span<element_type, Count> last() const;
//
-// Requires: Count <= size().
+// Mandates: Count <= Extent is true.
#include <span>
#include <cstddef>
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
index f426ab6..4013630 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
@@ -15,8 +15,7 @@
// constexpr span<element_type, dynamic_extent> subspan(
// size_type offset, size_type count = dynamic_extent) const;
//
-// Requires: (0 <= Offset && Offset <= size())
-// && (Count == dynamic_extent || Count >= 0 && Offset + Count <= size())
+// Mandates: Offset <= Extent && (Count == dynamic_extent || Count <= Extent - Offset) is true.
#include <span>
#include <cassert>
@@ -25,7 +24,7 @@
#include "test_macros.h"
-template <typename Span, size_t Offset, size_t Count>
+template <typename Span, std::size_t Offset, size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
@@ -44,7 +43,7 @@
&& std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
}
-template <typename Span, size_t Offset>
+template <typename Span, std::size_t Offset>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
@@ -64,7 +63,7 @@
}
-template <typename Span, size_t Offset, size_t Count>
+template <typename Span, std::size_t Offset, size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
@@ -83,7 +82,7 @@
}
-template <typename Span, size_t Offset>
+template <typename Span, std::size_t Offset>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
diff --git a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
index 1e58162..d6bc211 100644
--- a/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
@@ -14,10 +14,9 @@
// <span>
// template<size_t Offset, size_t Count = dynamic_extent>
-// constexpr span<element_type, see below> subspan() const;
+// constexpr span<element_type, see-below> subspan() const;
//
-// Requires: offset <= size() &&
-// (count == dynamic_extent || count <= size() - offset)
+// Mandates: Offset <= Extent && (Count == dynamic_extent || Count <= Extent - Offset) is true.
#include <span>
#include <cstddef>
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
index 364e931..8d1b883 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/assert_h.pass.cpp
@@ -10,14 +10,12 @@
#include <assert.h>
-#include "test_macros.h"
-
#ifndef assert
#error assert not defined
#endif
-int main(int, char**)
-{
+int main(int, char**) {
+ assert(true);
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
similarity index 85%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
index b619499..4dff57f 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ciso646.compile.pass.cpp
@@ -9,11 +9,3 @@
// <ciso646>
#include <ciso646>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
similarity index 79%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
index 92dc58c..00118a6 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex_h.compile.pass.cpp
@@ -10,12 +10,4 @@
#include <complex.h>
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
-
- return 0;
-}
+std::complex<double> d;
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
index b5deeee..29ea1f8 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/ctype_h.pass.cpp
@@ -9,8 +9,6 @@
// <ctype.h>
#include <ctype.h>
-#include <type_traits>
-#include <cassert>
#include "test_macros.h"
@@ -70,37 +68,38 @@
#error toupper defined
#endif
-int main(int, char**)
-{
- static_assert((std::is_same<decltype(isalnum(0)), int>::value), "");
- static_assert((std::is_same<decltype(isalpha(0)), int>::value), "");
- static_assert((std::is_same<decltype(isblank(0)), int>::value), "");
- static_assert((std::is_same<decltype(iscntrl(0)), int>::value), "");
- static_assert((std::is_same<decltype(isdigit(0)), int>::value), "");
- static_assert((std::is_same<decltype(isgraph(0)), int>::value), "");
- static_assert((std::is_same<decltype(islower(0)), int>::value), "");
- static_assert((std::is_same<decltype(isprint(0)), int>::value), "");
- static_assert((std::is_same<decltype(ispunct(0)), int>::value), "");
- static_assert((std::is_same<decltype(isspace(0)), int>::value), "");
- static_assert((std::is_same<decltype(isupper(0)), int>::value), "");
- static_assert((std::is_same<decltype(isxdigit(0)), int>::value), "");
- static_assert((std::is_same<decltype(tolower(0)), int>::value), "");
- static_assert((std::is_same<decltype(toupper(0)), int>::value), "");
+ASSERT_SAME_TYPE(int, decltype(isalnum(0)));
+ASSERT_SAME_TYPE(int, decltype(isalpha(0)));
+ASSERT_SAME_TYPE(int, decltype(isblank(0)));
+ASSERT_SAME_TYPE(int, decltype(iscntrl(0)));
+ASSERT_SAME_TYPE(int, decltype(isdigit(0)));
+ASSERT_SAME_TYPE(int, decltype(isgraph(0)));
+ASSERT_SAME_TYPE(int, decltype(islower(0)));
+ASSERT_SAME_TYPE(int, decltype(isprint(0)));
+ASSERT_SAME_TYPE(int, decltype(ispunct(0)));
+ASSERT_SAME_TYPE(int, decltype(isspace(0)));
+ASSERT_SAME_TYPE(int, decltype(isupper(0)));
+ASSERT_SAME_TYPE(int, decltype(isxdigit(0)));
+ASSERT_SAME_TYPE(int, decltype(tolower(0)));
+ASSERT_SAME_TYPE(int, decltype(toupper(0)));
- assert(isalnum('a'));
- assert(isalpha('a'));
- assert(isblank(' '));
- assert(!iscntrl(' '));
- assert(!isdigit('a'));
- assert(isgraph('a'));
- assert(islower('a'));
- assert(isprint('a'));
- assert(!ispunct('a'));
- assert(!isspace('a'));
- assert(!isupper('a'));
- assert(isxdigit('a'));
- assert(tolower('A') == 'a');
- assert(toupper('a') == 'A');
+#include <cassert>
+
+int main(int, char**) {
+ assert(isalnum('a'));
+ assert(isalpha('a'));
+ assert(isblank(' '));
+ assert(!iscntrl(' '));
+ assert(!isdigit('a'));
+ assert(isgraph('a'));
+ assert(islower('a'));
+ assert(isprint('a'));
+ assert(!ispunct('a'));
+ assert(!isspace('a'));
+ assert(!isupper('a'));
+ assert(isxdigit('a'));
+ assert(tolower('A') == 'a');
+ assert(toupper('a') == 'A');
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
similarity index 89%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
index faa2c82..c2cc69e 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/errno_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/errno_h.compile.pass.cpp
@@ -10,8 +10,6 @@
#include <errno.h>
-#include "test_macros.h"
-
#ifndef EDOM
#error EDOM not defined
#endif
@@ -27,9 +25,3 @@
#ifndef errno
#error errno not defined
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
new file mode 100644
index 0000000..d1f56b8
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <fenv.h>
+
+#include <fenv.h>
+
+#include "test_macros.h"
+
+#ifndef FE_DIVBYZERO
+#error FE_DIVBYZERO not defined
+#endif
+
+#ifndef FE_INEXACT
+#error FE_INEXACT not defined
+#endif
+
+#ifndef FE_INVALID
+#error FE_INVALID not defined
+#endif
+
+#ifndef FE_OVERFLOW
+#error FE_OVERFLOW not defined
+#endif
+
+#ifndef FE_UNDERFLOW
+#error FE_UNDERFLOW not defined
+#endif
+
+#ifndef FE_ALL_EXCEPT
+#error FE_ALL_EXCEPT not defined
+#endif
+
+#ifndef FE_DOWNWARD
+#error FE_DOWNWARD not defined
+#endif
+
+#ifndef FE_TONEAREST
+#error FE_TONEAREST not defined
+#endif
+
+#ifndef FE_TOWARDZERO
+#error FE_TOWARDZERO not defined
+#endif
+
+#ifndef FE_UPWARD
+#error FE_UPWARD not defined
+#endif
+
+#ifndef FE_DFL_ENV
+#error FE_DFL_ENV not defined
+#endif
+
+fenv_t fenv = {};
+fexcept_t fex = 0;
+ASSERT_SAME_TYPE(int, decltype(::feclearexcept(0)));
+ASSERT_SAME_TYPE(int, decltype(::fegetexceptflag(&fex, 0)));
+ASSERT_SAME_TYPE(int, decltype(::feraiseexcept(0)));
+ASSERT_SAME_TYPE(int, decltype(::fesetexceptflag(&fex, 0)));
+ASSERT_SAME_TYPE(int, decltype(::fetestexcept(0)));
+ASSERT_SAME_TYPE(int, decltype(::fegetround()));
+ASSERT_SAME_TYPE(int, decltype(::fesetround(0)));
+ASSERT_SAME_TYPE(int, decltype(::fegetenv(&fenv)));
+ASSERT_SAME_TYPE(int, decltype(::feholdexcept(&fenv)));
+ASSERT_SAME_TYPE(int, decltype(::fesetenv(&fenv)));
+ASSERT_SAME_TYPE(int, decltype(::feupdateenv(&fenv)));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp
deleted file mode 100644
index 2898539..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/fenv_h.pass.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <fenv.h>
-
-#include <fenv.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef FE_DIVBYZERO
-#error FE_DIVBYZERO not defined
-#endif
-
-#ifndef FE_INEXACT
-#error FE_INEXACT not defined
-#endif
-
-#ifndef FE_INVALID
-#error FE_INVALID not defined
-#endif
-
-#ifndef FE_OVERFLOW
-#error FE_OVERFLOW not defined
-#endif
-
-#ifndef FE_UNDERFLOW
-#error FE_UNDERFLOW not defined
-#endif
-
-#ifndef FE_ALL_EXCEPT
-#error FE_ALL_EXCEPT not defined
-#endif
-
-#ifndef FE_DOWNWARD
-#error FE_DOWNWARD not defined
-#endif
-
-#ifndef FE_TONEAREST
-#error FE_TONEAREST not defined
-#endif
-
-#ifndef FE_TOWARDZERO
-#error FE_TOWARDZERO not defined
-#endif
-
-#ifndef FE_UPWARD
-#error FE_UPWARD not defined
-#endif
-
-#ifndef FE_DFL_ENV
-#error FE_DFL_ENV not defined
-#endif
-
-int main(int, char**)
-{
- fenv_t fenv = {};
- fexcept_t fex = 0;
- static_assert((std::is_same<decltype(::feclearexcept(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fegetexceptflag(&fex, 0)), int>::value), "");
- static_assert((std::is_same<decltype(::feraiseexcept(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fesetexceptflag(&fex, 0)), int>::value), "");
- static_assert((std::is_same<decltype(::fetestexcept(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fegetround()), int>::value), "");
- static_assert((std::is_same<decltype(::fesetround(0)), int>::value), "");
- static_assert((std::is_same<decltype(::fegetenv(&fenv)), int>::value), "");
- static_assert((std::is_same<decltype(::feholdexcept(&fenv)), int>::value), "");
- static_assert((std::is_same<decltype(::fesetenv(&fenv)), int>::value), "");
- static_assert((std::is_same<decltype(::feupdateenv(&fenv)), int>::value), "");
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
similarity index 98%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
index b3f4230..8a02934 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/float_h.compile.pass.cpp
@@ -177,9 +177,3 @@
#error LDBL_TRUE_MIN not defined
#endif
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/inttypes_h.compile.pass.cpp
similarity index 88%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/inttypes_h.compile.pass.cpp
index b9f9a58..eaae3aa 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/inttypes_h.compile.pass.cpp
@@ -9,7 +9,6 @@
// test <inttypes.h>
#include <inttypes.h>
-#include <type_traits>
#include "test_macros.h"
@@ -873,64 +872,51 @@
#error SCNxPTR not defined
#endif
-template <class T> void test()
-{
- T t = 0;
- ((void)t); // Prevent unused warning
-}
+void f() {
+ { int8_t x = 0; (void)x; }
+ { int16_t x = 0; (void)x; }
+ { int32_t x = 0; (void)x; }
+ { int64_t x = 0; (void)x; }
-int main(int, char**)
-{
- test<int8_t >();
- test<int16_t>();
- test<int32_t>();
- test<int64_t>();
+ { uint8_t x = 0; (void)x; }
+ { uint16_t x = 0; (void)x; }
+ { uint32_t x = 0; (void)x; }
+ { uint64_t x = 0; (void)x; }
- test<uint8_t >();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
+ { int_least8_t x = 0; (void)x; }
+ { int_least16_t x = 0; (void)x; }
+ { int_least32_t x = 0; (void)x; }
+ { int_least64_t x = 0; (void)x; }
- test<int_least8_t >();
- test<int_least16_t>();
- test<int_least32_t>();
- test<int_least64_t>();
+ { uint_least8_t x = 0; (void)x; }
+ { uint_least16_t x = 0; (void)x; }
+ { uint_least32_t x = 0; (void)x; }
+ { uint_least64_t x = 0; (void)x; }
- test<uint_least8_t >();
- test<uint_least16_t>();
- test<uint_least32_t>();
- test<uint_least64_t>();
+ { int_fast8_t x = 0; (void)x; }
+ { int_fast16_t x = 0; (void)x; }
+ { int_fast32_t x = 0; (void)x; }
+ { int_fast64_t x = 0; (void)x; }
- test<int_fast8_t >();
- test<int_fast16_t>();
- test<int_fast32_t>();
- test<int_fast64_t>();
+ { uint_fast8_t x = 0; (void)x; }
+ { uint_fast16_t x = 0; (void)x; }
+ { uint_fast32_t x = 0; (void)x; }
+ { uint_fast64_t x = 0; (void)x; }
- test<uint_fast8_t >();
- test<uint_fast16_t>();
- test<uint_fast32_t>();
- test<uint_fast64_t>();
+ { intptr_t x = 0; (void)x; }
+ { uintptr_t x = 0; (void)x; }
+ { intmax_t x = 0; (void)x; }
+ { uintmax_t x = 0; (void)x; }
- test<intptr_t >();
- test<uintptr_t>();
- test<intmax_t >();
- test<uintmax_t>();
+ { imaxdiv_t x = {}; (void)x; }
- {
- imaxdiv_t i1 = {};
- ((void)i1); // Prevent unused warning
- }
-
- intmax_t i = 0;
- ((void)i); // Prevent unused warning
- static_assert((std::is_same<decltype(imaxabs(i)), intmax_t>::value), "");
- static_assert((std::is_same<decltype(imaxdiv(i, i)), imaxdiv_t>::value), "");
- static_assert((std::is_same<decltype(strtoimax("", (char**)0, 0)), intmax_t>::value), "");
- static_assert((std::is_same<decltype(strtoumax("", (char**)0, 0)), uintmax_t>::value), "");
+ intmax_t i = 0; (void)i;
+ ASSERT_SAME_TYPE(intmax_t, decltype(imaxabs(i)));
+ ASSERT_SAME_TYPE(imaxdiv_t, decltype(imaxdiv(i, i)));
+ ASSERT_SAME_TYPE(intmax_t, decltype(strtoimax("", (char**)0, 0)));
+ ASSERT_SAME_TYPE(uintmax_t, decltype(strtoumax("", (char**)0, 0)));
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- static_assert((std::is_same<decltype(wcstoimax(L"", (wchar_t**)0, 0)), intmax_t>::value), "");
- static_assert((std::is_same<decltype(wcstoumax(L"", (wchar_t**)0, 0)), uintmax_t>::value), "");
+ ASSERT_SAME_TYPE(intmax_t, decltype(wcstoimax(L"", (wchar_t**)0, 0)));
+ ASSERT_SAME_TYPE(uintmax_t, decltype(wcstoumax(L"", (wchar_t**)0, 0)));
#endif
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
similarity index 81%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
index 61510fe..4531ce3 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/iso646_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/iso646_h.compile.pass.cpp
@@ -9,12 +9,3 @@
// <iso646.h>
#include <iso646.h>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- // Nothing to test
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
similarity index 95%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
index bd0c7b9..4738cc4 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/limits_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/limits_h.compile.pass.cpp
@@ -10,8 +10,6 @@
#include <limits.h>
-#include "test_macros.h"
-
#ifndef CHAR_BIT
#error CHAR_BIT not defined
#endif
@@ -87,9 +85,3 @@
#ifndef ULLONG_MAX
#error ULLONG_MAX not defined
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
similarity index 76%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
index 9848f07..d0e6420 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/locale_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/locale_h.compile.pass.cpp
@@ -11,7 +11,6 @@
// <locale.h>
#include <locale.h>
-#include <type_traits>
#include "test_macros.h"
@@ -43,11 +42,6 @@
#error NULL not defined
#endif
-int main(int, char**)
-{
- lconv lc; ((void)lc);
- static_assert((std::is_same<decltype(setlocale(0, "")), char*>::value), "");
- static_assert((std::is_same<decltype(localeconv()), lconv*>::value), "");
-
- return 0;
-}
+lconv lc;
+ASSERT_SAME_TYPE(char*, decltype(setlocale(0, "")));
+ASSERT_SAME_TYPE(lconv*, decltype(localeconv()));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
index db815f9..87767a2 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
@@ -107,26 +107,19 @@
template <class T>
struct has_abs : decltype(has_abs_imp<T>(0)) {};
-void test_abs()
-{
+void test_abs() {
TEST_DIAGNOSTIC_PUSH
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wabsolute-value")
- static_assert((std::is_same<decltype(abs((float)0)), float>::value), "");
- static_assert((std::is_same<decltype(abs((double)0)), double>::value), "");
- static_assert(
- (std::is_same<decltype(abs((long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(abs((int)0)), int>::value), "");
- static_assert((std::is_same<decltype(abs((long)0)), long>::value), "");
- static_assert((std::is_same<decltype(abs((long long)0)), long long>::value),
- "");
- static_assert((std::is_same<decltype(abs((unsigned char)0)), int>::value),
- "");
- static_assert((std::is_same<decltype(abs((unsigned short)0)), int>::value),
- "");
-
- static_assert((std::is_same<decltype(abs(Ambiguous())), Ambiguous>::value),
- "");
+ ASSERT_SAME_TYPE(decltype(abs((float)0)), float);
+ ASSERT_SAME_TYPE(decltype(abs((double)0)), double);
+ ASSERT_SAME_TYPE(decltype(abs((long double)0)), long double);
+ ASSERT_SAME_TYPE(decltype(abs((int)0)), int);
+ ASSERT_SAME_TYPE(decltype(abs((long)0)), long);
+ ASSERT_SAME_TYPE(decltype(abs((long long)0)), long long);
+ ASSERT_SAME_TYPE(decltype(abs((unsigned char)0)), int);
+ ASSERT_SAME_TYPE(decltype(abs((unsigned short)0)), int);
+ ASSERT_SAME_TYPE(decltype(abs(Ambiguous())), Ambiguous);
static_assert(!has_abs<unsigned>::value, "");
static_assert(!has_abs<unsigned long>::value, "");
@@ -137,260 +130,231 @@
assert(abs(-1.) == 1);
}
-void test_acos()
-{
- static_assert((std::is_same<decltype(acosf(0)), float>::value), "");
- static_assert((std::is_same<decltype(acosl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(acos(Ambiguous())), Ambiguous>::value), "");
+void test_acos() {
+ ASSERT_SAME_TYPE(decltype(acosf(0)), float);
+ ASSERT_SAME_TYPE(decltype(acosl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(acos(Ambiguous())), Ambiguous);
assert(acos(1) == 0);
}
-void test_asin()
-{
- static_assert((std::is_same<decltype(asinf(0)), float>::value), "");
- static_assert((std::is_same<decltype(asinl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(asin(Ambiguous())), Ambiguous>::value), "");
+void test_asin() {
+ ASSERT_SAME_TYPE(decltype(asinf(0)), float);
+ ASSERT_SAME_TYPE(decltype(asinl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(asin(Ambiguous())), Ambiguous);
assert(asin(0) == 0);
}
-void test_atan()
-{
- static_assert((std::is_same<decltype(atanf(0)), float>::value), "");
- static_assert((std::is_same<decltype(atanl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(atan(Ambiguous())), Ambiguous>::value), "");
+void test_atan() {
+ ASSERT_SAME_TYPE(decltype(atanf(0)), float);
+ ASSERT_SAME_TYPE(decltype(atanl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(atan(Ambiguous())), Ambiguous);
assert(atan(0) == 0);
}
-void test_atan2()
-{
- static_assert((std::is_same<decltype(atan2f(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(atan2l(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(atan2(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_atan2() {
+ ASSERT_SAME_TYPE(decltype(atan2f(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(atan2l(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(atan2(Ambiguous(), Ambiguous())), Ambiguous);
assert(atan2(0,1) == 0);
}
-void test_ceil()
-{
- static_assert((std::is_same<decltype(ceilf(0)), float>::value), "");
- static_assert((std::is_same<decltype(ceill(0)), long double>::value), "");
- static_assert((std::is_same<decltype(ceil(Ambiguous())), Ambiguous>::value), "");
+void test_ceil() {
+ ASSERT_SAME_TYPE(decltype(ceilf(0)), float);
+ ASSERT_SAME_TYPE(decltype(ceill(0)), long double);
+ ASSERT_SAME_TYPE(decltype(ceil(Ambiguous())), Ambiguous);
assert(ceil(0) == 0);
}
-void test_cos()
-{
- static_assert((std::is_same<decltype(cosf(0)), float>::value), "");
- static_assert((std::is_same<decltype(cosl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(cos(Ambiguous())), Ambiguous>::value), "");
+void test_cos() {
+ ASSERT_SAME_TYPE(decltype(cosf(0)), float);
+ ASSERT_SAME_TYPE(decltype(cosl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(cos(Ambiguous())), Ambiguous);
assert(cos(0) == 1);
}
-void test_cosh()
-{
- static_assert((std::is_same<decltype(coshf(0)), float>::value), "");
- static_assert((std::is_same<decltype(coshl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(cosh(Ambiguous())), Ambiguous>::value), "");
+void test_cosh() {
+ ASSERT_SAME_TYPE(decltype(coshf(0)), float);
+ ASSERT_SAME_TYPE(decltype(coshl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(cosh(Ambiguous())), Ambiguous);
assert(cosh(0) == 1);
}
-void test_exp()
-{
- static_assert((std::is_same<decltype(expf(0)), float>::value), "");
- static_assert((std::is_same<decltype(expl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(exp(Ambiguous())), Ambiguous>::value), "");
+void test_exp() {
+ ASSERT_SAME_TYPE(decltype(expf(0)), float);
+ ASSERT_SAME_TYPE(decltype(expl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(exp(Ambiguous())), Ambiguous);
assert(exp(0) == 1);
}
-void test_fabs()
-{
- static_assert((std::is_same<decltype(fabsf(0.0f)), float>::value), "");
- static_assert((std::is_same<decltype(fabsl(0.0L)), long double>::value), "");
- static_assert((std::is_same<decltype(fabs(Ambiguous())), Ambiguous>::value), "");
+void test_fabs() {
+ ASSERT_SAME_TYPE(decltype(fabsf(0.0f)), float);
+ ASSERT_SAME_TYPE(decltype(fabsl(0.0L)), long double);
+ ASSERT_SAME_TYPE(decltype(fabs(Ambiguous())), Ambiguous);
assert(fabs(-1) == 1);
}
-void test_floor()
-{
- static_assert((std::is_same<decltype(floorf(0)), float>::value), "");
- static_assert((std::is_same<decltype(floorl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(floor(Ambiguous())), Ambiguous>::value), "");
+void test_floor() {
+ ASSERT_SAME_TYPE(decltype(floorf(0)), float);
+ ASSERT_SAME_TYPE(decltype(floorl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(floor(Ambiguous())), Ambiguous);
assert(floor(1) == 1);
}
-void test_fmod()
-{
- static_assert((std::is_same<decltype(fmodf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(fmodl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(fmod(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_fmod() {
+ ASSERT_SAME_TYPE(decltype(fmodf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(fmodl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(fmod(Ambiguous(), Ambiguous())), Ambiguous);
assert(fmod(1.5,1) == .5);
}
-void test_frexp()
-{
+void test_frexp() {
int ip;
- static_assert((std::is_same<decltype(frexpf(0, &ip)), float>::value), "");
- static_assert((std::is_same<decltype(frexpl(0, &ip)), long double>::value), "");
- static_assert((std::is_same<decltype(frexp(Ambiguous(), &ip)), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(frexpf(0, &ip)), float);
+ ASSERT_SAME_TYPE(decltype(frexpl(0, &ip)), long double);
+ ASSERT_SAME_TYPE(decltype(frexp(Ambiguous(), &ip)), Ambiguous);
assert(frexp(0, &ip) == 0);
}
-void test_ldexp()
-{
+void test_ldexp() {
int ip = 1;
- static_assert((std::is_same<decltype(ldexpf(0, ip)), float>::value), "");
- static_assert((std::is_same<decltype(ldexpl(0, ip)), long double>::value), "");
- static_assert((std::is_same<decltype(ldexp(Ambiguous(), ip)), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(ldexpf(0, ip)), float);
+ ASSERT_SAME_TYPE(decltype(ldexpl(0, ip)), long double);
+ ASSERT_SAME_TYPE(decltype(ldexp(Ambiguous(), ip)), Ambiguous);
assert(ldexp(1, ip) == 2);
}
-void test_log()
-{
- static_assert((std::is_same<decltype(logf(0)), float>::value), "");
- static_assert((std::is_same<decltype(logl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(log(Ambiguous())), Ambiguous>::value), "");
+void test_log() {
+ ASSERT_SAME_TYPE(decltype(logf(0)), float);
+ ASSERT_SAME_TYPE(decltype(logl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(log(Ambiguous())), Ambiguous);
assert(log(1) == 0);
}
-void test_log10()
-{
- static_assert((std::is_same<decltype(log10f(0)), float>::value), "");
- static_assert((std::is_same<decltype(log10l(0)), long double>::value), "");
- static_assert((std::is_same<decltype(log10(Ambiguous())), Ambiguous>::value), "");
+void test_log10() {
+ ASSERT_SAME_TYPE(decltype(log10f(0)), float);
+ ASSERT_SAME_TYPE(decltype(log10l(0)), long double);
+ ASSERT_SAME_TYPE(decltype(log10(Ambiguous())), Ambiguous);
assert(log10(1) == 0);
}
-void test_modf()
-{
- static_assert((std::is_same<decltype(modf((float)0, (float*)0)), float>::value), "");
- static_assert((std::is_same<decltype(modf((double)0, (double*)0)), double>::value), "");
- static_assert((std::is_same<decltype(modf((long double)0, (long double*)0)), long double>::value), "");
- static_assert((std::is_same<decltype(modff(0, (float*)0)), float>::value), "");
- static_assert((std::is_same<decltype(modfl(0, (long double*)0)), long double>::value), "");
- static_assert((std::is_same<decltype(modf(Ambiguous(), (Ambiguous*)0)), Ambiguous>::value), "");
+void test_modf() {
+ ASSERT_SAME_TYPE(decltype(modf((float)0, (float*)0)), float);
+ ASSERT_SAME_TYPE(decltype(modf((double)0, (double*)0)), double);
+ ASSERT_SAME_TYPE(decltype(modf((long double)0, (long double*)0)), long double);
+ ASSERT_SAME_TYPE(decltype(modff(0, (float*)0)), float);
+ ASSERT_SAME_TYPE(decltype(modfl(0, (long double*)0)), long double);
+ ASSERT_SAME_TYPE(decltype(modf(Ambiguous(), (Ambiguous*)0)), Ambiguous);
double i;
assert(modf(1., &i) == 0);
}
-void test_pow()
-{
- static_assert((std::is_same<decltype(powf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(powl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(pow((int)0, (int)0)), double>::value), "");
-// static_assert((std::is_same<decltype(pow(Value<int>(), (int)0)), double>::value), "");
-// static_assert((std::is_same<decltype(pow(Value<long double>(), (float)0)), long double>::value), "");
-// static_assert((std::is_same<decltype(pow((float) 0, Value<float>())), float>::value), "");
- static_assert((std::is_same<decltype(pow(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_pow() {
+ ASSERT_SAME_TYPE(decltype(powf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(powl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(pow((int)0, (int)0)), double);
+ // ASSERT_SAME_TYPE(decltype(pow(Value<int>(), (int)0)), double);
+ // ASSERT_SAME_TYPE(decltype(pow(Value<long double>(), (float)0)), long double);
+ // ASSERT_SAME_TYPE(decltype(pow((float) 0, Value<float>())), float);
+ ASSERT_SAME_TYPE(decltype(pow(Ambiguous(), Ambiguous())), Ambiguous);
assert(pow(1,1) == 1);
-// assert(pow(Value<int,1>(), Value<float,1>()) == 1);
-// assert(pow(1.0f, Value<double,1>()) == 1);
-// assert(pow(1.0, Value<int,1>()) == 1);
-// assert(pow(Value<long double,1>(), 1LL) == 1);
+ // assert(pow(Value<int,1>(), Value<float,1>()) == 1);
+ // assert(pow(1.0f, Value<double,1>()) == 1);
+ // assert(pow(1.0, Value<int,1>()) == 1);
+ // assert(pow(Value<long double,1>(), 1LL) == 1);
}
-void test_sin()
-{
- static_assert((std::is_same<decltype(sinf(0)), float>::value), "");
- static_assert((std::is_same<decltype(sinl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(sin(Ambiguous())), Ambiguous>::value), "");
+void test_sin() {
+ ASSERT_SAME_TYPE(decltype(sinf(0)), float);
+ ASSERT_SAME_TYPE(decltype(sinl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(sin(Ambiguous())), Ambiguous);
assert(sin(0) == 0);
}
-void test_sinh()
-{
- static_assert((std::is_same<decltype(sinhf(0)), float>::value), "");
- static_assert((std::is_same<decltype(sinhl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(sinh(Ambiguous())), Ambiguous>::value), "");
+void test_sinh() {
+ ASSERT_SAME_TYPE(decltype(sinhf(0)), float);
+ ASSERT_SAME_TYPE(decltype(sinhl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(sinh(Ambiguous())), Ambiguous);
assert(sinh(0) == 0);
}
-void test_sqrt()
-{
- static_assert((std::is_same<decltype(sqrtf(0)), float>::value), "");
- static_assert((std::is_same<decltype(sqrtl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(sqrt(Ambiguous())), Ambiguous>::value), "");
+void test_sqrt() {
+ ASSERT_SAME_TYPE(decltype(sqrtf(0)), float);
+ ASSERT_SAME_TYPE(decltype(sqrtl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(sqrt(Ambiguous())), Ambiguous);
assert(sqrt(4) == 2);
}
-void test_tan()
-{
- static_assert((std::is_same<decltype(tanf(0)), float>::value), "");
- static_assert((std::is_same<decltype(tanl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(tan(Ambiguous())), Ambiguous>::value), "");
+void test_tan() {
+ ASSERT_SAME_TYPE(decltype(tanf(0)), float);
+ ASSERT_SAME_TYPE(decltype(tanl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(tan(Ambiguous())), Ambiguous);
assert(tan(0) == 0);
}
-void test_tanh()
-{
- static_assert((std::is_same<decltype(tanhf(0)), float>::value), "");
- static_assert((std::is_same<decltype(tanhl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(tanh(Ambiguous())), Ambiguous>::value), "");
+void test_tanh() {
+ ASSERT_SAME_TYPE(decltype(tanhf(0)), float);
+ ASSERT_SAME_TYPE(decltype(tanhl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(tanh(Ambiguous())), Ambiguous);
assert(tanh(0) == 0);
}
-void test_signbit()
-{
+void test_signbit() {
#ifdef signbit
#error signbit defined
#endif
- static_assert((std::is_same<decltype(signbit(Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(signbit(Ambiguous())), Ambiguous);
assert(signbit(-1.0) == true);
}
-void test_fpclassify()
-{
+void test_fpclassify() {
#ifdef fpclassify
#error fpclassify defined
#endif
- static_assert((std::is_same<decltype(fpclassify(Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(fpclassify(Ambiguous())), Ambiguous);
assert(fpclassify(-1.0) == FP_NORMAL);
}
-void test_isfinite()
-{
+void test_isfinite() {
#ifdef isfinite
#error isfinite defined
#endif
- static_assert((std::is_same<decltype(isfinite(Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(isfinite(Ambiguous())), Ambiguous);
assert(isfinite(-1.0) == true);
}
-void test_isnormal()
-{
+void test_isnormal() {
#ifdef isnormal
#error isnormal defined
#endif
- static_assert((std::is_same<decltype(isnormal(Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(isnormal(Ambiguous())), Ambiguous);
assert(isnormal(-1.0) == true);
}
-void test_isgreater()
-{
+void test_isgreater() {
#ifdef isgreater
#error isgreater defined
#endif
- static_assert((std::is_same<decltype(isgreater(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(isgreater(Ambiguous(), Ambiguous())), Ambiguous);
assert(isgreater(-1.0, 0.F) == false);
}
-void test_isgreaterequal()
-{
+void test_isgreaterequal() {
#ifdef isgreaterequal
#error isgreaterequal defined
#endif
- static_assert((std::is_same<decltype(isgreaterequal(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(isgreaterequal(Ambiguous(), Ambiguous())), Ambiguous);
assert(isgreaterequal(-1.0, 0.F) == false);
}
-void test_isinf()
-{
+void test_isinf() {
#ifdef isinf
#error isinf defined
#endif
- static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(isinf((float)0)), bool);
typedef decltype(isinf((double)0)) DoubleRetType;
#ifndef __linux__
- static_assert((std::is_same<DoubleRetType, bool>::value), "");
+ ASSERT_SAME_TYPE(DoubleRetType, bool);
#else
// GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in
// all C++ dialects. The test should tolerate this.
@@ -399,48 +363,44 @@
|| std::is_same<DoubleRetType, int>::value), "");
#endif
- static_assert((std::is_same<decltype(isinf(0)), bool>::value), "");
- static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(isinf(0)), bool);
+ ASSERT_SAME_TYPE(decltype(isinf((long double)0)), bool);
assert(isinf(-1.0) == false);
}
-void test_isless()
-{
+void test_isless() {
#ifdef isless
#error isless defined
#endif
- static_assert((std::is_same<decltype(isless(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(isless(Ambiguous(), Ambiguous())), Ambiguous);
assert(isless(-1.0, 0.F) == true);
}
-void test_islessequal()
-{
+void test_islessequal() {
#ifdef islessequal
#error islessequal defined
#endif
- static_assert((std::is_same<decltype(islessequal(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(islessequal(Ambiguous(), Ambiguous())), Ambiguous);
assert(islessequal(-1.0, 0.F) == true);
}
-void test_islessgreater()
-{
+void test_islessgreater() {
#ifdef islessgreater
#error islessgreater defined
#endif
- static_assert((std::is_same<decltype(islessgreater(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(islessgreater(Ambiguous(), Ambiguous())), Ambiguous);
assert(islessgreater(-1.0, 0.F) == true);
}
-void test_isnan()
-{
+void test_isnan() {
#ifdef isnan
#error isnan defined
#endif
- static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(isnan((float)0)), bool);
typedef decltype(isnan((double)0)) DoubleRetType;
#ifndef __linux__
- static_assert((std::is_same<DoubleRetType, bool>::value), "");
+ ASSERT_SAME_TYPE(DoubleRetType, bool);
#else
// GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in
// all C++ dialects. The test should tolerate this.
@@ -449,353 +409,316 @@
|| std::is_same<DoubleRetType, int>::value), "");
#endif
- static_assert((std::is_same<decltype(isnan(0)), bool>::value), "");
- static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(isnan(0)), bool);
+ ASSERT_SAME_TYPE(decltype(isnan((long double)0)), bool);
assert(isnan(-1.0) == false);
}
-void test_isunordered()
-{
+void test_isunordered() {
#ifdef isunordered
#error isunordered defined
#endif
- static_assert((std::is_same<decltype(isunordered(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(isunordered(Ambiguous(), Ambiguous())), Ambiguous);
assert(isunordered(-1.0, 0.F) == false);
}
-void test_acosh()
-{
- static_assert((std::is_same<decltype(acoshf(0)), float>::value), "");
- static_assert((std::is_same<decltype(acoshl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(acosh(Ambiguous())), Ambiguous>::value), "");
+void test_acosh() {
+ ASSERT_SAME_TYPE(decltype(acoshf(0)), float);
+ ASSERT_SAME_TYPE(decltype(acoshl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(acosh(Ambiguous())), Ambiguous);
assert(acosh(1) == 0);
}
-void test_asinh()
-{
- static_assert((std::is_same<decltype(asinhf(0)), float>::value), "");
- static_assert((std::is_same<decltype(asinhl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(asinh(Ambiguous())), Ambiguous>::value), "");
+void test_asinh() {
+ ASSERT_SAME_TYPE(decltype(asinhf(0)), float);
+ ASSERT_SAME_TYPE(decltype(asinhl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(asinh(Ambiguous())), Ambiguous);
assert(asinh(0) == 0);
}
-void test_atanh()
-{
- static_assert((std::is_same<decltype(atanhf(0)), float>::value), "");
- static_assert((std::is_same<decltype(atanhl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(atanh(Ambiguous())), Ambiguous>::value), "");
+void test_atanh() {
+ ASSERT_SAME_TYPE(decltype(atanhf(0)), float);
+ ASSERT_SAME_TYPE(decltype(atanhl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(atanh(Ambiguous())), Ambiguous);
assert(atanh(0) == 0);
}
void test_cbrt() {
- static_assert((std::is_same<decltype(cbrtf(0)), float>::value), "");
- static_assert((std::is_same<decltype(cbrtl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(cbrt(Ambiguous())), Ambiguous>::value),
- "");
+ ASSERT_SAME_TYPE(decltype(cbrtf(0)), float);
+ ASSERT_SAME_TYPE(decltype(cbrtl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(cbrt(Ambiguous())), Ambiguous);
assert(truncate_fp(cbrt(1)) == 1);
-
}
-void test_copysign()
-{
- static_assert((std::is_same<decltype(copysignf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(copysignl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(copysign((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(copysign(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_copysign() {
+ ASSERT_SAME_TYPE(decltype(copysignf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(copysignl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(copysign((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(copysign(Ambiguous(), Ambiguous())), Ambiguous);
assert(copysign(1,1) == 1);
}
-void test_erf()
-{
- static_assert((std::is_same<decltype(erff(0)), float>::value), "");
- static_assert((std::is_same<decltype(erfl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(erf(Ambiguous())), Ambiguous>::value), "");
+void test_erf() {
+ ASSERT_SAME_TYPE(decltype(erff(0)), float);
+ ASSERT_SAME_TYPE(decltype(erfl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(erf(Ambiguous())), Ambiguous);
assert(erf(0) == 0);
}
-void test_erfc()
-{
- static_assert((std::is_same<decltype(erfcf(0)), float>::value), "");
- static_assert((std::is_same<decltype(erfcl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(erfc(Ambiguous())), Ambiguous>::value), "");
+void test_erfc() {
+ ASSERT_SAME_TYPE(decltype(erfcf(0)), float);
+ ASSERT_SAME_TYPE(decltype(erfcl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(erfc(Ambiguous())), Ambiguous);
assert(erfc(0) == 1);
}
-void test_exp2()
-{
- static_assert((std::is_same<decltype(exp2f(0)), float>::value), "");
- static_assert((std::is_same<decltype(exp2l(0)), long double>::value), "");
- static_assert((std::is_same<decltype(exp2(Ambiguous())), Ambiguous>::value), "");
+void test_exp2() {
+ ASSERT_SAME_TYPE(decltype(exp2f(0)), float);
+ ASSERT_SAME_TYPE(decltype(exp2l(0)), long double);
+ ASSERT_SAME_TYPE(decltype(exp2(Ambiguous())), Ambiguous);
assert(exp2(1) == 2);
}
-void test_expm1()
-{
- static_assert((std::is_same<decltype(expm1f(0)), float>::value), "");
- static_assert((std::is_same<decltype(expm1l(0)), long double>::value), "");
- static_assert((std::is_same<decltype(expm1(Ambiguous())), Ambiguous>::value), "");
+void test_expm1() {
+ ASSERT_SAME_TYPE(decltype(expm1f(0)), float);
+ ASSERT_SAME_TYPE(decltype(expm1l(0)), long double);
+ ASSERT_SAME_TYPE(decltype(expm1(Ambiguous())), Ambiguous);
assert(expm1(0) == 0);
}
-void test_fdim()
-{
- static_assert((std::is_same<decltype(fdimf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(fdiml(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(fdim((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(fdim(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_fdim() {
+ ASSERT_SAME_TYPE(decltype(fdimf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(fdiml(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(fdim((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(fdim(Ambiguous(), Ambiguous())), Ambiguous);
assert(fdim(1,0) == 1);
}
-void test_fma()
-{
- static_assert((std::is_same<decltype(fma((bool)0, (float)0, (float)0)), double>::value), "");
- static_assert((std::is_same<decltype(fma((float)0, (float)0, (double)0)), double>::value), "");
- static_assert((std::is_same<decltype(fma((float)0, (float)0, (long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(fma((float)0, (float)0, (float)0)), float>::value), "");
+void test_fma() {
+ ASSERT_SAME_TYPE(decltype(fma((bool)0, (float)0, (float)0)), double);
+ ASSERT_SAME_TYPE(decltype(fma((float)0, (float)0, (double)0)), double);
+ ASSERT_SAME_TYPE(decltype(fma((float)0, (float)0, (long double)0)), long double);
+ ASSERT_SAME_TYPE(decltype(fma((float)0, (float)0, (float)0)), float);
- static_assert((std::is_same<decltype(fma((bool)0, (double)0, (double)0)), double>::value), "");
- static_assert((std::is_same<decltype(fma((double)0, (double)0, (float)0)), double>::value), "");
- static_assert((std::is_same<decltype(fma((double)0, (double)0, (long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(fma((double)0, (double)0, (double)0)), double>::value), "");
+ ASSERT_SAME_TYPE(decltype(fma((bool)0, (double)0, (double)0)), double);
+ ASSERT_SAME_TYPE(decltype(fma((double)0, (double)0, (float)0)), double);
+ ASSERT_SAME_TYPE(decltype(fma((double)0, (double)0, (long double)0)), long double);
+ ASSERT_SAME_TYPE(decltype(fma((double)0, (double)0, (double)0)), double);
- static_assert((std::is_same<decltype(fma((long double)0, (long double)0, (float)0)), long double>::value), "");
- static_assert((std::is_same<decltype(fma((double)0, (long double)0, (long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(fma((long double)0, (long double)0, (long double)0)), long double>::value), "");
+ ASSERT_SAME_TYPE(decltype(fma((long double)0, (long double)0, (float)0)), long double);
+ ASSERT_SAME_TYPE(decltype(fma((double)0, (long double)0, (long double)0)), long double);
+ ASSERT_SAME_TYPE(decltype(fma((long double)0, (long double)0, (long double)0)), long double);
- static_assert((std::is_same<decltype(fmaf(0,0,0)), float>::value), "");
- static_assert((std::is_same<decltype(fmal(0,0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(fma(Ambiguous(), Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(fmaf(0,0,0)), float);
+ ASSERT_SAME_TYPE(decltype(fmal(0,0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(fma(Ambiguous(), Ambiguous(), Ambiguous())), Ambiguous);
assert(fma(1,1,1) == 2);
}
-void test_fmax()
-{
- static_assert((std::is_same<decltype(fmaxf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(fmaxl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(fmax((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(fmax(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_fmax() {
+ ASSERT_SAME_TYPE(decltype(fmaxf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(fmaxl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(fmax((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(fmax(Ambiguous(), Ambiguous())), Ambiguous);
assert(fmax(1,0) == 1);
}
-void test_fmin()
-{
- static_assert((std::is_same<decltype(fminf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(fminl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(fmin((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(fmin(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_fmin() {
+ ASSERT_SAME_TYPE(decltype(fminf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(fminl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(fmin((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(fmin(Ambiguous(), Ambiguous())), Ambiguous);
assert(fmin(1,0) == 0);
}
-void test_hypot()
-{
- static_assert((std::is_same<decltype(hypotf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(hypotl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(hypot((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(hypot(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_hypot() {
+ ASSERT_SAME_TYPE(decltype(hypotf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(hypotl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(hypot((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(hypot(Ambiguous(), Ambiguous())), Ambiguous);
assert(hypot(3,4) == 5);
}
-void test_ilogb()
-{
- static_assert((std::is_same<decltype(ilogbf(0)), int>::value), "");
- static_assert((std::is_same<decltype(ilogbl(0)), int>::value), "");
- static_assert((std::is_same<decltype(ilogb(Ambiguous())), Ambiguous>::value), "");
+void test_ilogb() {
+ ASSERT_SAME_TYPE(decltype(ilogbf(0)), int);
+ ASSERT_SAME_TYPE(decltype(ilogbl(0)), int);
+ ASSERT_SAME_TYPE(decltype(ilogb(Ambiguous())), Ambiguous);
assert(ilogb(1) == 0);
}
-void test_lgamma()
-{
- static_assert((std::is_same<decltype(lgammaf(0)), float>::value), "");
- static_assert((std::is_same<decltype(lgammal(0)), long double>::value), "");
- static_assert((std::is_same<decltype(lgamma(Ambiguous())), Ambiguous>::value), "");
+void test_lgamma() {
+ ASSERT_SAME_TYPE(decltype(lgammaf(0)), float);
+ ASSERT_SAME_TYPE(decltype(lgammal(0)), long double);
+ ASSERT_SAME_TYPE(decltype(lgamma(Ambiguous())), Ambiguous);
assert(lgamma(1) == 0);
}
-void test_llrint()
-{
- static_assert((std::is_same<decltype(llrintf(0)), long long>::value), "");
- static_assert((std::is_same<decltype(llrintl(0)), long long>::value), "");
- static_assert((std::is_same<decltype(llrint(Ambiguous())), Ambiguous>::value), "");
+void test_llrint() {
+ ASSERT_SAME_TYPE(decltype(llrintf(0)), long long);
+ ASSERT_SAME_TYPE(decltype(llrintl(0)), long long);
+ ASSERT_SAME_TYPE(decltype(llrint(Ambiguous())), Ambiguous);
assert(llrint(1) == 1LL);
}
-void test_llround()
-{
- static_assert((std::is_same<decltype(llroundf(0)), long long>::value), "");
- static_assert((std::is_same<decltype(llroundl(0)), long long>::value), "");
- static_assert((std::is_same<decltype(llround(Ambiguous())), Ambiguous>::value), "");
+void test_llround() {
+ ASSERT_SAME_TYPE(decltype(llroundf(0)), long long);
+ ASSERT_SAME_TYPE(decltype(llroundl(0)), long long);
+ ASSERT_SAME_TYPE(decltype(llround(Ambiguous())), Ambiguous);
assert(llround(1) == 1LL);
}
-void test_log1p()
-{
- static_assert((std::is_same<decltype(log1pf(0)), float>::value), "");
- static_assert((std::is_same<decltype(log1pl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(log1p(Ambiguous())), Ambiguous>::value), "");
+void test_log1p() {
+ ASSERT_SAME_TYPE(decltype(log1pf(0)), float);
+ ASSERT_SAME_TYPE(decltype(log1pl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(log1p(Ambiguous())), Ambiguous);
assert(log1p(0) == 0);
}
-void test_log2()
-{
- static_assert((std::is_same<decltype(log2f(0)), float>::value), "");
- static_assert((std::is_same<decltype(log2l(0)), long double>::value), "");
- static_assert((std::is_same<decltype(log2(Ambiguous())), Ambiguous>::value), "");
+void test_log2() {
+ ASSERT_SAME_TYPE(decltype(log2f(0)), float);
+ ASSERT_SAME_TYPE(decltype(log2l(0)), long double);
+ ASSERT_SAME_TYPE(decltype(log2(Ambiguous())), Ambiguous);
assert(log2(1) == 0);
}
-void test_logb()
-{
- static_assert((std::is_same<decltype(logbf(0)), float>::value), "");
- static_assert((std::is_same<decltype(logbl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(logb(Ambiguous())), Ambiguous>::value), "");
+void test_logb() {
+ ASSERT_SAME_TYPE(decltype(logbf(0)), float);
+ ASSERT_SAME_TYPE(decltype(logbl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(logb(Ambiguous())), Ambiguous);
assert(logb(1) == 0);
}
-void test_lrint()
-{
- static_assert((std::is_same<decltype(lrintf(0)), long>::value), "");
- static_assert((std::is_same<decltype(lrintl(0)), long>::value), "");
- static_assert((std::is_same<decltype(lrint(Ambiguous())), Ambiguous>::value), "");
+void test_lrint() {
+ ASSERT_SAME_TYPE(decltype(lrintf(0)), long);
+ ASSERT_SAME_TYPE(decltype(lrintl(0)), long);
+ ASSERT_SAME_TYPE(decltype(lrint(Ambiguous())), Ambiguous);
assert(lrint(1) == 1L);
}
-void test_lround()
-{
- static_assert((std::is_same<decltype(lroundf(0)), long>::value), "");
- static_assert((std::is_same<decltype(lroundl(0)), long>::value), "");
- static_assert((std::is_same<decltype(lround(Ambiguous())), Ambiguous>::value), "");
+void test_lround() {
+ ASSERT_SAME_TYPE(decltype(lroundf(0)), long);
+ ASSERT_SAME_TYPE(decltype(lroundl(0)), long);
+ ASSERT_SAME_TYPE(decltype(lround(Ambiguous())), Ambiguous);
assert(lround(1) == 1L);
}
-void test_nan()
-{
- static_assert((std::is_same<decltype(nan("")), double>::value), "");
- static_assert((std::is_same<decltype(nanf("")), float>::value), "");
- static_assert((std::is_same<decltype(nanl("")), long double>::value), "");
+void test_nan() {
+ ASSERT_SAME_TYPE(decltype(nan("")), double);
+ ASSERT_SAME_TYPE(decltype(nanf("")), float);
+ ASSERT_SAME_TYPE(decltype(nanl("")), long double);
}
-void test_nearbyint()
-{
- static_assert((std::is_same<decltype(nearbyintf(0)), float>::value), "");
- static_assert((std::is_same<decltype(nearbyintl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(nearbyint(Ambiguous())), Ambiguous>::value), "");
+void test_nearbyint() {
+ ASSERT_SAME_TYPE(decltype(nearbyintf(0)), float);
+ ASSERT_SAME_TYPE(decltype(nearbyintl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(nearbyint(Ambiguous())), Ambiguous);
assert(nearbyint(1) == 1);
}
-void test_nextafter()
-{
- static_assert((std::is_same<decltype(nextafterf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(nextafterl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(nextafter((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(nextafter(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_nextafter() {
+ ASSERT_SAME_TYPE(decltype(nextafterf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(nextafterl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(nextafter((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(nextafter(Ambiguous(), Ambiguous())), Ambiguous);
assert(nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
}
-void test_nexttoward()
-{
- static_assert((std::is_same<decltype(nexttoward((float)0, (long double)0)), float>::value), "");
- static_assert((std::is_same<decltype(nexttoward((bool)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((unsigned short)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((int)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((unsigned int)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((long)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((unsigned long)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((long long)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((unsigned long long)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((double)0, (long double)0)), double>::value), "");
- static_assert((std::is_same<decltype(nexttoward((long double)0, (long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(nexttowardf(0, (long double)0)), float>::value), "");
- static_assert((std::is_same<decltype(nexttowardl(0, (long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(nexttoward(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_nexttoward() {
+ ASSERT_SAME_TYPE(decltype(nexttoward((float)0, (long double)0)), float);
+ ASSERT_SAME_TYPE(decltype(nexttoward((bool)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((unsigned short)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((int)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((unsigned int)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((long)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((unsigned long)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((long long)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((unsigned long long)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((double)0, (long double)0)), double);
+ ASSERT_SAME_TYPE(decltype(nexttoward((long double)0, (long double)0)), long double);
+ ASSERT_SAME_TYPE(decltype(nexttowardf(0, (long double)0)), float);
+ ASSERT_SAME_TYPE(decltype(nexttowardl(0, (long double)0)), long double);
+ ASSERT_SAME_TYPE(decltype(nexttoward(Ambiguous(), Ambiguous())), Ambiguous);
assert(nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
}
-void test_remainder()
-{
- static_assert((std::is_same<decltype(remainderf(0,0)), float>::value), "");
- static_assert((std::is_same<decltype(remainderl(0,0)), long double>::value), "");
- static_assert((std::is_same<decltype(remainder((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(remainder(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_remainder() {
+ ASSERT_SAME_TYPE(decltype(remainderf(0,0)), float);
+ ASSERT_SAME_TYPE(decltype(remainderl(0,0)), long double);
+ ASSERT_SAME_TYPE(decltype(remainder((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(remainder(Ambiguous(), Ambiguous())), Ambiguous);
assert(remainder(0.5,1) == 0.5);
}
-void test_remquo()
-{
+void test_remquo() {
int ip;
- static_assert((std::is_same<decltype(remquof(0,0, &ip)), float>::value), "");
- static_assert((std::is_same<decltype(remquol(0,0, &ip)), long double>::value), "");
- static_assert((std::is_same<decltype(remquo((int)0, (int)0, &ip)), double>::value), "");
- static_assert((std::is_same<decltype(remquo(Ambiguous(), Ambiguous(), &ip)), Ambiguous>::value), "");
+ ASSERT_SAME_TYPE(decltype(remquof(0,0, &ip)), float);
+ ASSERT_SAME_TYPE(decltype(remquol(0,0, &ip)), long double);
+ ASSERT_SAME_TYPE(decltype(remquo((int)0, (int)0, &ip)), double);
+ ASSERT_SAME_TYPE(decltype(remquo(Ambiguous(), Ambiguous(), &ip)), Ambiguous);
assert(remquo(0.5,1, &ip) == 0.5);
}
-void test_rint()
-{
- static_assert((std::is_same<decltype(rintf(0)), float>::value), "");
- static_assert((std::is_same<decltype(rintl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(rint(Ambiguous())), Ambiguous>::value), "");
+void test_rint() {
+ ASSERT_SAME_TYPE(decltype(rintf(0)), float);
+ ASSERT_SAME_TYPE(decltype(rintl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(rint(Ambiguous())), Ambiguous);
assert(rint(1) == 1);
}
-void test_round()
-{
- static_assert((std::is_same<decltype(roundf(0)), float>::value), "");
- static_assert((std::is_same<decltype(roundl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(round(Ambiguous())), Ambiguous>::value), "");
+void test_round() {
+ ASSERT_SAME_TYPE(decltype(roundf(0)), float);
+ ASSERT_SAME_TYPE(decltype(roundl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(round(Ambiguous())), Ambiguous);
assert(round(1) == 1);
}
-void test_scalbln()
-{
- static_assert((std::is_same<decltype(scalbln((float)0, (long)0)), float>::value), "");
- static_assert((std::is_same<decltype(scalbln((bool)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((unsigned short)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((int)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((unsigned int)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((long)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((unsigned long)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((long long)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((unsigned long long)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((double)0, (long)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbln((long double)0, (long)0)), long double>::value), "");
- static_assert((std::is_same<decltype(scalblnf(0, (long)0)), float>::value), "");
- static_assert((std::is_same<decltype(scalblnl(0, (long)0)), long double>::value), "");
- static_assert((std::is_same<decltype(scalbln(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_scalbln() {
+ ASSERT_SAME_TYPE(decltype(scalbln((float)0, (long)0)), float);
+ ASSERT_SAME_TYPE(decltype(scalbln((bool)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((unsigned short)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((int)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((unsigned int)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((long)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((unsigned long)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((long long)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((unsigned long long)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((double)0, (long)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbln((long double)0, (long)0)), long double);
+ ASSERT_SAME_TYPE(decltype(scalblnf(0, (long)0)), float);
+ ASSERT_SAME_TYPE(decltype(scalblnl(0, (long)0)), long double);
+ ASSERT_SAME_TYPE(decltype(scalbln(Ambiguous(), Ambiguous())), Ambiguous);
assert(scalbln(1, 1) == 2);
}
-void test_scalbn()
-{
- static_assert((std::is_same<decltype(scalbn((float)0, (int)0)), float>::value), "");
- static_assert((std::is_same<decltype(scalbn((bool)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((unsigned short)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((unsigned int)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((long)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((unsigned long)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((long long)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((unsigned long long)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((double)0, (int)0)), double>::value), "");
- static_assert((std::is_same<decltype(scalbn((long double)0, (int)0)), long double>::value), "");
- static_assert((std::is_same<decltype(scalbnf(0, (int)0)), float>::value), "");
- static_assert((std::is_same<decltype(scalbnl(0, (int)0)), long double>::value), "");
- static_assert((std::is_same<decltype(scalbn(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
+void test_scalbn() {
+ ASSERT_SAME_TYPE(decltype(scalbn((float)0, (int)0)), float);
+ ASSERT_SAME_TYPE(decltype(scalbn((bool)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((unsigned short)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((unsigned int)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((long)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((unsigned long)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((long long)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((unsigned long long)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((double)0, (int)0)), double);
+ ASSERT_SAME_TYPE(decltype(scalbn((long double)0, (int)0)), long double);
+ ASSERT_SAME_TYPE(decltype(scalbnf(0, (int)0)), float);
+ ASSERT_SAME_TYPE(decltype(scalbnl(0, (int)0)), long double);
+ ASSERT_SAME_TYPE(decltype(scalbn(Ambiguous(), Ambiguous())), Ambiguous);
assert(scalbn(1, 1) == 2);
}
-void test_tgamma()
-{
- static_assert((std::is_same<decltype(tgammaf(0)), float>::value), "");
- static_assert((std::is_same<decltype(tgammal(0)), long double>::value), "");
- static_assert((std::is_same<decltype(tgamma(Ambiguous())), Ambiguous>::value), "");
+void test_tgamma() {
+ ASSERT_SAME_TYPE(decltype(tgammaf(0)), float);
+ ASSERT_SAME_TYPE(decltype(tgammal(0)), long double);
+ ASSERT_SAME_TYPE(decltype(tgamma(Ambiguous())), Ambiguous);
assert(tgamma(1) == 1);
}
-void test_trunc()
-{
- static_assert((std::is_same<decltype(truncf(0)), float>::value), "");
- static_assert((std::is_same<decltype(truncl(0)), long double>::value), "");
- static_assert((std::is_same<decltype(trunc(Ambiguous())), Ambiguous>::value), "");
+void test_trunc() {
+ ASSERT_SAME_TYPE(decltype(truncf(0)), float);
+ ASSERT_SAME_TYPE(decltype(truncl(0)), long double);
+ ASSERT_SAME_TYPE(decltype(trunc(Ambiguous())), Ambiguous);
assert(trunc(1) == 1);
}
@@ -803,94 +726,94 @@
struct test_single_arg {
template <class T = Arg>
void operator()() {
- static_assert((std::is_same<decltype(::acos(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::acos(T())), PromoteResult);
(void)::acos(T());
- static_assert((std::is_same<decltype(::asin(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::asin(T())), PromoteResult);
(void)::asin(T());
- static_assert((std::is_same<decltype(::atan(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::atan(T())), PromoteResult);
(void)::atan(T());
- static_assert((std::is_same<decltype(::ceil(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::ceil(T())), PromoteResult);
(void)::ceil(T());
- static_assert((std::is_same<decltype(::cos(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::cos(T())), PromoteResult);
(void)::cos(T());
- static_assert((std::is_same<decltype(::cosh(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::cosh(T())), PromoteResult);
(void)::cosh(T());
- static_assert((std::is_same<decltype(::exp(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::exp(T())), PromoteResult);
(void)::exp(T());
- static_assert((std::is_same<decltype(::fabs(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fabs(T())), PromoteResult);
(void)::fabs(T());
- static_assert((std::is_same<decltype(::floor(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::floor(T())), PromoteResult);
(void)::floor(T());
int ip;
- static_assert((std::is_same<decltype(::frexp(T(), &ip)), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::frexp(T(), &ip)), PromoteResult);
(void)::frexp(T(), &ip);
- static_assert((std::is_same<decltype(::ldexp(T(), ip)), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::ldexp(T(), ip)), PromoteResult);
(void)::ldexp(T(), ip);
- static_assert((std::is_same<decltype(::log(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::log(T())), PromoteResult);
(void)::log(T());
- static_assert((std::is_same<decltype(::log10(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::log10(T())), PromoteResult);
(void)::log10(T());
- static_assert((std::is_same<decltype(::sin(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::sin(T())), PromoteResult);
(void)::sin(T());
- static_assert((std::is_same<decltype(::sinh(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::sinh(T())), PromoteResult);
(void)::sinh(T());
- static_assert((std::is_same<decltype(::sqrt(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::sqrt(T())), PromoteResult);
(void)::sqrt(T());
- static_assert((std::is_same<decltype(::tan(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::tan(T())), PromoteResult);
(void)::tan(T());
- static_assert((std::is_same<decltype(::tanh(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::tanh(T())), PromoteResult);
(void)::tanh(T());
- static_assert((std::is_same<decltype(::signbit(T())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::signbit(T())), bool);
(void)::signbit(T());
- static_assert((std::is_same<decltype(::fpclassify(T())), int>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fpclassify(T())), int);
(void)::fpclassify(T());
- static_assert((std::is_same<decltype(::isfinite(T())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::isfinite(T())), bool);
(void)::isfinite(T());
- static_assert((std::is_same<decltype(::isnormal(T())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::isnormal(T())), bool);
(void)::isnormal(T());
- static_assert((std::is_same<decltype(::acosh(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::acosh(T())), PromoteResult);
(void)::acosh(T());
- static_assert((std::is_same<decltype(::asinh(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::asinh(T())), PromoteResult);
(void)::asinh(T());
- static_assert((std::is_same<decltype(::atanh(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::atanh(T())), PromoteResult);
(void)::atanh(T());
- static_assert((std::is_same<decltype(::cbrt(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::cbrt(T())), PromoteResult);
(void)::cbrt(T());
- static_assert((std::is_same<decltype(::erf(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::erf(T())), PromoteResult);
(void)::erf(T());
- static_assert((std::is_same<decltype(::erfc(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::erfc(T())), PromoteResult);
(void)::erfc(T());
- static_assert((std::is_same<decltype(::exp2(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::exp2(T())), PromoteResult);
(void)::exp2(T());
- static_assert((std::is_same<decltype(::expm1(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::expm1(T())), PromoteResult);
(void)::expm1(T());
- static_assert((std::is_same<decltype(::ilogb(T())), int>::value), "");
+ ASSERT_SAME_TYPE(decltype(::ilogb(T())), int);
(void)::ilogb(T());
- static_assert((std::is_same<decltype(::lgamma(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::lgamma(T())), PromoteResult);
(void)::lgamma(T());
- static_assert((std::is_same<decltype(::llrint(T())), long long>::value), "");
+ ASSERT_SAME_TYPE(decltype(::llrint(T())), long long);
(void)::llrint(T());
- static_assert((std::is_same<decltype(::llround(T())), long long>::value), "");
+ ASSERT_SAME_TYPE(decltype(::llround(T())), long long);
(void)::llround(T());
- static_assert((std::is_same<decltype(::log1p(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::log1p(T())), PromoteResult);
(void)::log1p(T());
- static_assert((std::is_same<decltype(::log2(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::log2(T())), PromoteResult);
(void)::log2(T());
- static_assert((std::is_same<decltype(::logb(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::logb(T())), PromoteResult);
(void)::logb(T());
- static_assert((std::is_same<decltype(::lrint(T())), long>::value), "");
+ ASSERT_SAME_TYPE(decltype(::lrint(T())), long);
(void)::lrint(T());
- static_assert((std::is_same<decltype(::lround(T())), long>::value), "");
+ ASSERT_SAME_TYPE(decltype(::lround(T())), long);
(void)::lround(T());
- static_assert((std::is_same<decltype(::nearbyint(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::nearbyint(T())), PromoteResult);
(void)::nearbyint(T());
- static_assert((std::is_same<decltype(::rint(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::rint(T())), PromoteResult);
(void)::rint(T());
- static_assert((std::is_same<decltype(::round(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::round(T())), PromoteResult);
(void)::round(T());
- static_assert((std::is_same<decltype(::trunc(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::trunc(T())), PromoteResult);
(void)::trunc(T());
- static_assert((std::is_same<decltype(::tgamma(T())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::tgamma(T())), PromoteResult);
(void)::tgamma(T());
}
};
@@ -899,40 +822,40 @@
struct test_two_args {
template <class T = Arg1, class U = Arg2>
void operator()() {
- static_assert((std::is_same<decltype(::atan2(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::atan2(T(), U())), PromoteResult);
(void)::atan2(T(), U());
- static_assert((std::is_same<decltype(::fmod(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fmod(T(), U())), PromoteResult);
(void)::fmod(T(), U());
- static_assert((std::is_same<decltype(::pow(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::pow(T(), U())), PromoteResult);
(void)::pow(T(), U());
- static_assert((std::is_same<decltype(::isgreater(T(), U())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::isgreater(T(), U())), bool);
(void)::isgreater(T(), U());
- static_assert((std::is_same<decltype(::isgreaterequal(T(), U())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::isgreaterequal(T(), U())), bool);
(void)::isgreaterequal(T(), U());
- static_assert((std::is_same<decltype(::isless(T(), U())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::isless(T(), U())), bool);
(void)::isless(T(), U());
- static_assert((std::is_same<decltype(::islessequal(T(), U())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::islessequal(T(), U())), bool);
(void)::islessequal(T(), U());
- static_assert((std::is_same<decltype(::islessgreater(T(), U())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::islessgreater(T(), U())), bool);
(void)::islessgreater(T(), U());
- static_assert((std::is_same<decltype(::isunordered(T(), U())), bool>::value), "");
+ ASSERT_SAME_TYPE(decltype(::isunordered(T(), U())), bool);
(void)::isunordered(T(), U());
- static_assert((std::is_same<decltype(::copysign(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::copysign(T(), U())), PromoteResult);
(void)::copysign(T(), U());
- static_assert((std::is_same<decltype(::fdim(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fdim(T(), U())), PromoteResult);
(void)::fdim(T(), U());
- static_assert((std::is_same<decltype(::fmax(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fmax(T(), U())), PromoteResult);
(void)::fmax(T(), U());
- static_assert((std::is_same<decltype(::fmin(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fmin(T(), U())), PromoteResult);
(void)::fmin(T(), U());
- static_assert((std::is_same<decltype(::hypot(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::hypot(T(), U())), PromoteResult);
(void)::hypot(T(), U());
- static_assert((std::is_same<decltype(::nextafter(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::nextafter(T(), U())), PromoteResult);
(void)::nextafter(T(), U());
- static_assert((std::is_same<decltype(::remainder(T(), U())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::remainder(T(), U())), PromoteResult);
(void)::remainder(T(), U());
int ip;
- static_assert((std::is_same<decltype(::remquo(T(), U(), &ip)), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::remquo(T(), U(), &ip)), PromoteResult);
::remquo(T(), U(), &ip);
}
};
@@ -941,59 +864,58 @@
struct test_three_args {
template <class T = Arg1, class U = Arg2, class V = Arg3>
void operator()() {
- static_assert((std::is_same<decltype(::fma(T(), U(), V())), PromoteResult>::value), "");
+ ASSERT_SAME_TYPE(decltype(::fma(T(), U(), V())), PromoteResult);
(void)::fma(T(), U(), V());
}
};
struct CallTwoArgs {
- using integral_float_double = meta::concatenate_t<meta::integral_types, meta::type_list<float, double> >;
+ using integral_float_double = types::concatenate_t<types::integral_types, types::type_list<float, double> >;
template <class Arg2>
void operator()() {
- meta::for_each(integral_float_double(), test_two_args</*PromoteResult=*/double, /*Iterate*/void, Arg2>());
+ types::for_each(integral_float_double(), test_two_args</*PromoteResult=*/double, /*Iterate*/void, Arg2>());
}
};
template <class T>
struct CallThreeArgs {
- using integral_float_double = meta::concatenate_t<meta::integral_types, meta::type_list<float, double> >;
+ using integral_float_double = types::concatenate_t<types::integral_types, types::type_list<float, double> >;
template <class Arg3>
struct Helper {
template <class Arg2>
void operator()() {
- meta::for_each(integral_float_double(), test_three_args</*PromoteResult=*/double, /*Iterate*/void, Arg2, Arg3>());
+ types::for_each(integral_float_double(), test_three_args</*PromoteResult=*/double, /*Iterate*/void, Arg2, Arg3>());
}
};
template <class Arg3>
void operator()() {
- meta::for_each(integral_float_double(), Helper<Arg3>());
+ types::for_each(integral_float_double(), Helper<Arg3>());
}
};
-int main(int, char**)
-{
- meta::for_each(meta::integral_types(), test_single_arg</*PromoteResult=*/double>());
+int main(int, char**) {
+ types::for_each(types::integral_types(), test_single_arg</*PromoteResult=*/double>());
test_single_arg</*PromoteResult=*/float, /*Arg=*/float>();
test_single_arg</*PromoteResult=*/double, /*Arg=*/double>();
test_single_arg</*PromoteResult=*/long double, /*Arg=*/long double>();
- meta::for_each(meta::integral_types(), CallTwoArgs());
+ types::for_each(types::integral_types(), CallTwoArgs());
- meta::for_each(
- meta::integral_types(), test_two_args</*PromoteResult=*/long double, /*Arg1=*/void, /*Arg2=*/long double>());
+ types::for_each(
+ types::integral_types(), test_two_args</*PromoteResult=*/long double, /*Arg1=*/void, /*Arg2=*/long double>());
test_two_args</*PromoteResult=*/float, /*Args=*/float, float>();
test_two_args</*PromoteResult=*/float, /*Args=*/double, double>();
test_two_args</*PromoteResult=*/double, /*Args=*/float, double>();
test_two_args</*PromoteResult=*/double, /*Args=*/double, double>();
- meta::for_each(meta::integral_types(), CallThreeArgs<double>());
- meta::for_each(
- meta::integral_types(), test_three_args</*PromoteResult=*/long double, /*Iterate*/ void, long double, double>());
+ types::for_each(types::integral_types(), CallThreeArgs<double>());
+ types::for_each(
+ types::integral_types(), test_three_args</*PromoteResult=*/long double, /*Iterate*/ void, long double, double>());
test_three_args</*PromoteResult=*/float, /*Args=*/float, float, float>();
test_three_args</*PromoteResult=*/double, /*Args=*/double, double, double>();
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
similarity index 72%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
copy to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
index 92dc58c..7a49a85 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
@@ -6,16 +6,15 @@
//
//===----------------------------------------------------------------------===//
-// <complex.h>
+// test <setjmp.h>
-#include <complex.h>
+#include <setjmp.h>
#include "test_macros.h"
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
+#ifndef setjmp
+#error setjmp not defined
+#endif
- return 0;
-}
+jmp_buf jb;
+ASSERT_SAME_TYPE(void, decltype(longjmp(jb, 0)));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
deleted file mode 100644
index 3c93801..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// test <setjmp.h>
-
-#include <setjmp.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef setjmp
-#error setjmp not defined
-#endif
-
-int main(int, char**)
-{
- jmp_buf jb;
- ((void)jb); // Prevent unused warning
- static_assert((std::is_same<decltype(longjmp(jb, 0)), void>::value),
- "std::is_same<decltype(longjmp(jb, 0)), void>::value");
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
similarity index 75%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
index 07a729e..ace2eea 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
@@ -9,7 +9,6 @@
// test <signal.h>
#include <signal.h>
-#include <type_traits>
#include "test_macros.h"
@@ -49,12 +48,7 @@
#error SIGTERM not defined
#endif
-int main(int, char**)
-{
- sig_atomic_t sig; ((void)sig);
- typedef void (*func)(int);
- static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
- static_assert((std::is_same<decltype(raise(0)), int>::value), "");
-
- return 0;
-}
+sig_atomic_t sig;
+typedef void (*func)(int);
+ASSERT_SAME_TYPE(func, decltype(signal(0, (func)0)));
+ASSERT_SAME_TYPE(int, decltype(raise(0)));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
similarity index 90%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
index feb9c4a..8ded0f9 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdarg_h.compile.pass.cpp
@@ -30,10 +30,4 @@
#error va_start not defined
#endif
-int main(int, char**)
-{
- va_list va;
- ((void)va);
-
- return 0;
-}
+va_list va;
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
similarity index 90%
rename from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
index ca580a8..79d8b51 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdbool_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdbool_h.compile.pass.cpp
@@ -10,8 +10,6 @@
#include <stdbool.h>
-#include "test_macros.h"
-
#ifndef __bool_true_false_are_defined
#error __bool_true_false_are_defined not defined
#endif
@@ -27,9 +25,3 @@
#ifdef false
#error false should not be defined
#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.compile.pass.cpp
new file mode 100644
index 0000000..fed867f
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.compile.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <stddef.h>
+
+#include <stddef.h>
+
+#include "test_macros.h"
+
+void use() {
+ // Make sure we can use the following types without including anything else
+ (void)sizeof(size_t);
+ (void)sizeof(ptrdiff_t);
+#if TEST_STD_VER >= 11
+ (void)sizeof(nullptr);
+ (void)sizeof(nullptr_t);
+ (void)sizeof(max_align_t);
+#endif
+}
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef offsetof
+#error offsetof not defined
+#endif
+
+#include <type_traits>
+
+static_assert(sizeof(size_t) == sizeof(void*), "");
+static_assert(std::is_unsigned<size_t>::value, "");
+static_assert(std::is_integral<size_t>::value, "");
+static_assert(sizeof(ptrdiff_t) == sizeof(void*), "");
+static_assert(std::is_signed<ptrdiff_t>::value, "");
+static_assert(std::is_integral<ptrdiff_t>::value, "");
+static_assert((std::is_same<decltype(nullptr), nullptr_t>::value), "");
+static_assert(sizeof(nullptr_t) == sizeof(void*), "");
+#if TEST_STD_VER >= 11
+# if TEST_STD_VER >= 20
+// P0767
+static_assert(std::is_trivial<max_align_t>::value, "");
+static_assert(std::is_standard_layout<max_align_t>::value, "");
+# else
+static_assert(std::is_pod<max_align_t>::value, "");
+# endif
+static_assert(std::alignment_of<max_align_t>::value >= std::alignment_of<long long>::value, "");
+static_assert(std::alignment_of<max_align_t>::value >= std::alignment_of<long double>::value, "");
+static_assert(std::alignment_of<max_align_t>::value >= std::alignment_of<void*>::value, "");
+#endif // TEST_STD_VER >= 11
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.nullptr.pass.cpp
similarity index 68%
copy from third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
copy to third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.nullptr.pass.cpp
index 1efeba1..52cd7e6 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.nullptr.pass.cpp
@@ -6,10 +6,20 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
+// <stddef.h>
-// The "hash_value" function is tested as part of [path.compare]
-// in class.path/path.members/path.compare.pass.cpp
+#include <stddef.h>
+#include <cassert>
+
int main(int, char**) {
- return 0;
+ {
+ void *p = NULL;
+ assert(!p);
+ }
+ {
+ void *p = nullptr;
+ assert(!p);
+ }
+
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
deleted file mode 100644
index 1fe48b5..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stddef_h.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <stddef.h>
-
-#include <stddef.h>
-#include <cassert>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef NULL
-#error NULL not defined
-#endif
-
-#ifndef offsetof
-#error offsetof not defined
-#endif
-
-int main(int, char**)
-{
- void *p = NULL;
- assert(!p);
-
- static_assert(sizeof(size_t) == sizeof(void*),
- "sizeof(size_t) == sizeof(void*)");
- static_assert(std::is_unsigned<size_t>::value,
- "std::is_unsigned<size_t>::value");
- static_assert(std::is_integral<size_t>::value,
- "std::is_integral<size_t>::value");
- static_assert(sizeof(ptrdiff_t) == sizeof(void*),
- "sizeof(ptrdiff_t) == sizeof(void*)");
- static_assert(std::is_signed<ptrdiff_t>::value,
- "std::is_signed<ptrdiff_t>::value");
- static_assert(std::is_integral<ptrdiff_t>::value,
- "std::is_integral<ptrdiff_t>::value");
- static_assert((std::is_same<decltype(nullptr), nullptr_t>::value),
- "decltype(nullptr) == nullptr_t");
- static_assert(sizeof(nullptr_t) == sizeof(void*),
- "sizeof(nullptr_t) == sizeof(void*)");
-#if TEST_STD_VER >= 11
-#if TEST_STD_VER > 17
-// P0767
- static_assert(std::is_trivial<max_align_t>::value,
- "std::is_trivial<max_align_t>::value");
- static_assert(std::is_standard_layout<max_align_t>::value,
- "std::is_standard_layout<max_align_t>::value");
-#else
- static_assert(std::is_pod<max_align_t>::value,
- "std::is_pod<max_align_t>::value");
-#endif
- static_assert((std::alignment_of<max_align_t>::value >=
- std::alignment_of<long long>::value),
- "std::alignment_of<max_align_t>::value >= "
- "std::alignment_of<long long>::value");
- static_assert(std::alignment_of<max_align_t>::value >=
- std::alignment_of<long double>::value,
- "std::alignment_of<max_align_t>::value >= "
- "std::alignment_of<long double>::value");
- static_assert(std::alignment_of<max_align_t>::value >=
- std::alignment_of<void*>::value,
- "std::alignment_of<max_align_t>::value >= "
- "std::alignment_of<void*>::value");
-#endif
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
index 37945ee..080efcd 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
@@ -9,6 +9,45 @@
// test <stdint.h>
#include <stdint.h>
+
+void use() {
+ // Make sure we can use the following types without including anything else
+ (void)sizeof(int8_t);
+ (void)sizeof(int16_t);
+ (void)sizeof(int32_t);
+ (void)sizeof(int64_t);
+
+ (void)sizeof(uint8_t);
+ (void)sizeof(uint16_t);
+ (void)sizeof(uint32_t);
+ (void)sizeof(uint64_t);
+
+ (void)sizeof(int_least8_t);
+ (void)sizeof(int_least16_t);
+ (void)sizeof(int_least32_t);
+ (void)sizeof(int_least64_t);
+
+ (void)sizeof(uint_least8_t);
+ (void)sizeof(uint_least16_t);
+ (void)sizeof(uint_least32_t);
+ (void)sizeof(uint_least64_t);
+
+ (void)sizeof(int_fast8_t);
+ (void)sizeof(int_fast16_t);
+ (void)sizeof(int_fast32_t);
+ (void)sizeof(int_fast64_t);
+
+ (void)sizeof(uint_fast8_t);
+ (void)sizeof(uint_fast16_t);
+ (void)sizeof(uint_fast32_t);
+ (void)sizeof(uint_fast64_t);
+
+ (void)sizeof(intptr_t);
+ (void)sizeof(uintptr_t);
+ (void)sizeof(intmax_t);
+ (void)sizeof(uintmax_t);
+}
+
#include <cstddef>
#include <csignal>
#include <climits>
@@ -22,191 +61,134 @@
# include <cwctype>
#endif
-int main(int, char**)
-{
+int main(int, char**) {
// typedef int8_t
- static_assert(sizeof(int8_t)*CHAR_BIT == 8,
- "sizeof(int8_t)*CHAR_BIT == 8");
- static_assert(std::is_signed<int8_t>::value,
- "std::is_signed<int8_t>::value");
+ static_assert(sizeof(int8_t)*CHAR_BIT == 8, "");
+ static_assert(std::is_signed<int8_t>::value, "");
// typedef int16_t
- static_assert(sizeof(int16_t)*CHAR_BIT == 16,
- "sizeof(int16_t)*CHAR_BIT == 16");
- static_assert(std::is_signed<int16_t>::value,
- "std::is_signed<int16_t>::value");
+ static_assert(sizeof(int16_t)*CHAR_BIT == 16, "");
+ static_assert(std::is_signed<int16_t>::value, "");
// typedef int32_t
- static_assert(sizeof(int32_t)*CHAR_BIT == 32,
- "sizeof(int32_t)*CHAR_BIT == 32");
- static_assert(std::is_signed<int32_t>::value,
- "std::is_signed<int32_t>::value");
+ static_assert(sizeof(int32_t)*CHAR_BIT == 32, "");
+ static_assert(std::is_signed<int32_t>::value, "");
// typedef int64_t
- static_assert(sizeof(int64_t)*CHAR_BIT == 64,
- "sizeof(int64_t)*CHAR_BIT == 64");
- static_assert(std::is_signed<int64_t>::value,
- "std::is_signed<int64_t>::value");
+ static_assert(sizeof(int64_t)*CHAR_BIT == 64, "");
+ static_assert(std::is_signed<int64_t>::value, "");
// typedef uint8_t
- static_assert(sizeof(uint8_t)*CHAR_BIT == 8,
- "sizeof(uint8_t)*CHAR_BIT == 8");
- static_assert(std::is_unsigned<uint8_t>::value,
- "std::is_unsigned<uint8_t>::value");
+ static_assert(sizeof(uint8_t)*CHAR_BIT == 8, "");
+ static_assert(std::is_unsigned<uint8_t>::value, "");
// typedef uint16_t
- static_assert(sizeof(uint16_t)*CHAR_BIT == 16,
- "sizeof(uint16_t)*CHAR_BIT == 16");
- static_assert(std::is_unsigned<uint16_t>::value,
- "std::is_unsigned<uint16_t>::value");
+ static_assert(sizeof(uint16_t)*CHAR_BIT == 16, "");
+ static_assert(std::is_unsigned<uint16_t>::value, "");
// typedef uint32_t
- static_assert(sizeof(uint32_t)*CHAR_BIT == 32,
- "sizeof(uint32_t)*CHAR_BIT == 32");
- static_assert(std::is_unsigned<uint32_t>::value,
- "std::is_unsigned<uint32_t>::value");
+ static_assert(sizeof(uint32_t)*CHAR_BIT == 32, "");
+ static_assert(std::is_unsigned<uint32_t>::value, "");
// typedef uint64_t
- static_assert(sizeof(uint64_t)*CHAR_BIT == 64,
- "sizeof(uint64_t)*CHAR_BIT == 64");
- static_assert(std::is_unsigned<uint64_t>::value,
- "std::is_unsigned<uint64_t>::value");
+ static_assert(sizeof(uint64_t)*CHAR_BIT == 64, "");
+ static_assert(std::is_unsigned<uint64_t>::value, "");
// typedef int_least8_t
- static_assert(sizeof(int_least8_t)*CHAR_BIT >= 8,
- "sizeof(int_least8_t)*CHAR_BIT >= 8");
- static_assert(std::is_signed<int_least8_t>::value,
- "std::is_signed<int_least8_t>::value");
+ static_assert(sizeof(int_least8_t)*CHAR_BIT >= 8, "");
+ static_assert(std::is_signed<int_least8_t>::value, "");
// typedef int_least16_t
- static_assert(sizeof(int_least16_t)*CHAR_BIT >= 16,
- "sizeof(int_least16_t)*CHAR_BIT >= 16");
- static_assert(std::is_signed<int_least16_t>::value,
- "std::is_signed<int_least16_t>::value");
+ static_assert(sizeof(int_least16_t)*CHAR_BIT >= 16, "");
+ static_assert(std::is_signed<int_least16_t>::value, "");
// typedef int_least32_t
- static_assert(sizeof(int_least32_t)*CHAR_BIT >= 32,
- "sizeof(int_least32_t)*CHAR_BIT >= 32");
- static_assert(std::is_signed<int_least32_t>::value,
- "std::is_signed<int_least32_t>::value");
+ static_assert(sizeof(int_least32_t)*CHAR_BIT >= 32, "");
+ static_assert(std::is_signed<int_least32_t>::value, "");
// typedef int_least64_t
- static_assert(sizeof(int_least64_t)*CHAR_BIT >= 64,
- "sizeof(int_least64_t)*CHAR_BIT >= 64");
- static_assert(std::is_signed<int_least64_t>::value,
- "std::is_signed<int_least64_t>::value");
+ static_assert(sizeof(int_least64_t)*CHAR_BIT >= 64, "");
+ static_assert(std::is_signed<int_least64_t>::value, "");
// typedef uint_least8_t
- static_assert(sizeof(uint_least8_t)*CHAR_BIT >= 8,
- "sizeof(uint_least8_t)*CHAR_BIT >= 8");
- static_assert(std::is_unsigned<uint_least8_t>::value,
- "std::is_unsigned<uint_least8_t>::value");
+ static_assert(sizeof(uint_least8_t)*CHAR_BIT >= 8, "");
+ static_assert(std::is_unsigned<uint_least8_t>::value, "");
// typedef uint_least16_t
- static_assert(sizeof(uint_least16_t)*CHAR_BIT >= 16,
- "sizeof(uint_least16_t)*CHAR_BIT >= 16");
- static_assert(std::is_unsigned<uint_least16_t>::value,
- "std::is_unsigned<uint_least16_t>::value");
+ static_assert(sizeof(uint_least16_t)*CHAR_BIT >= 16, "");
+ static_assert(std::is_unsigned<uint_least16_t>::value, "");
// typedef uint_least32_t
- static_assert(sizeof(uint_least32_t)*CHAR_BIT >= 32,
- "sizeof(uint_least32_t)*CHAR_BIT >= 32");
- static_assert(std::is_unsigned<uint_least32_t>::value,
- "std::is_unsigned<uint_least32_t>::value");
+ static_assert(sizeof(uint_least32_t)*CHAR_BIT >= 32, "");
+ static_assert(std::is_unsigned<uint_least32_t>::value, "");
// typedef uint_least64_t
- static_assert(sizeof(uint_least64_t)*CHAR_BIT >= 64,
- "sizeof(uint_least64_t)*CHAR_BIT >= 64");
- static_assert(std::is_unsigned<uint_least64_t>::value,
- "std::is_unsigned<uint_least64_t>::value");
+ static_assert(sizeof(uint_least64_t)*CHAR_BIT >= 64, "");
+ static_assert(std::is_unsigned<uint_least64_t>::value, "");
// typedef int_fast8_t
- static_assert(sizeof(int_fast8_t)*CHAR_BIT >= 8,
- "sizeof(int_fast8_t)*CHAR_BIT >= 8");
- static_assert(std::is_signed<int_fast8_t>::value,
- "std::is_signed<int_fast8_t>::value");
+ static_assert(sizeof(int_fast8_t)*CHAR_BIT >= 8, "");
+ static_assert(std::is_signed<int_fast8_t>::value, "");
// typedef int_fast16_t
- static_assert(sizeof(int_fast16_t)*CHAR_BIT >= 16,
- "sizeof(int_fast16_t)*CHAR_BIT >= 16");
- static_assert(std::is_signed<int_fast16_t>::value,
- "std::is_signed<int_fast16_t>::value");
+ static_assert(sizeof(int_fast16_t)*CHAR_BIT >= 16, "");
+ static_assert(std::is_signed<int_fast16_t>::value, "");
// typedef int_fast32_t
- static_assert(sizeof(int_fast32_t)*CHAR_BIT >= 32,
- "sizeof(int_fast32_t)*CHAR_BIT >= 32");
- static_assert(std::is_signed<int_fast32_t>::value,
- "std::is_signed<int_fast32_t>::value");
+ static_assert(sizeof(int_fast32_t)*CHAR_BIT >= 32, "");
+ static_assert(std::is_signed<int_fast32_t>::value, "");
// typedef int_fast64_t
- static_assert(sizeof(int_fast64_t)*CHAR_BIT >= 64,
- "sizeof(int_fast64_t)*CHAR_BIT >= 64");
- static_assert(std::is_signed<int_fast64_t>::value,
- "std::is_signed<int_fast64_t>::value");
+ static_assert(sizeof(int_fast64_t)*CHAR_BIT >= 64, "");
+ static_assert(std::is_signed<int_fast64_t>::value, "");
// typedef uint_fast8_t
- static_assert(sizeof(uint_fast8_t)*CHAR_BIT >= 8,
- "sizeof(uint_fast8_t)*CHAR_BIT >= 8");
- static_assert(std::is_unsigned<uint_fast8_t>::value,
- "std::is_unsigned<uint_fast8_t>::value");
+ static_assert(sizeof(uint_fast8_t)*CHAR_BIT >= 8, "");
+ static_assert(std::is_unsigned<uint_fast8_t>::value, "");
// typedef uint_fast16_t
- static_assert(sizeof(uint_fast16_t)*CHAR_BIT >= 16,
- "sizeof(uint_fast16_t)*CHAR_BIT >= 16");
- static_assert(std::is_unsigned<uint_fast16_t>::value,
- "std::is_unsigned<uint_fast16_t>::value");
+ static_assert(sizeof(uint_fast16_t)*CHAR_BIT >= 16, "");
+ static_assert(std::is_unsigned<uint_fast16_t>::value, "");
// typedef uint_fast32_t
- static_assert(sizeof(uint_fast32_t)*CHAR_BIT >= 32,
- "sizeof(uint_fast32_t)*CHAR_BIT >= 32");
- static_assert(std::is_unsigned<uint_fast32_t>::value,
- "std::is_unsigned<uint_fast32_t>::value");
+ static_assert(sizeof(uint_fast32_t)*CHAR_BIT >= 32, "");
+ static_assert(std::is_unsigned<uint_fast32_t>::value, "");
// typedef uint_fast64_t
- static_assert(sizeof(uint_fast64_t)*CHAR_BIT >= 64,
- "sizeof(uint_fast64_t)*CHAR_BIT >= 64");
- static_assert(std::is_unsigned<uint_fast64_t>::value,
- "std::is_unsigned<uint_fast64_t>::value");
+ static_assert(sizeof(uint_fast64_t)*CHAR_BIT >= 64, "");
+ static_assert(std::is_unsigned<uint_fast64_t>::value, "");
// typedef intptr_t
- static_assert(sizeof(intptr_t) >= sizeof(void*),
- "sizeof(intptr_t) >= sizeof(void*)");
- static_assert(std::is_signed<intptr_t>::value,
- "std::is_signed<intptr_t>::value");
+ static_assert(sizeof(intptr_t) >= sizeof(void*), "");
+ static_assert(std::is_signed<intptr_t>::value, "");
// typedef uintptr_t
- static_assert(sizeof(uintptr_t) >= sizeof(void*),
- "sizeof(uintptr_t) >= sizeof(void*)");
- static_assert(std::is_unsigned<uintptr_t>::value,
- "std::is_unsigned<uintptr_t>::value");
+ static_assert(sizeof(uintptr_t) >= sizeof(void*), "");
+ static_assert(std::is_unsigned<uintptr_t>::value, "");
// typedef intmax_t
- static_assert(sizeof(intmax_t) >= sizeof(long long),
- "sizeof(intmax_t) >= sizeof(long long)");
- static_assert(std::is_signed<intmax_t>::value,
- "std::is_signed<intmax_t>::value");
+ static_assert(sizeof(intmax_t) >= sizeof(long long), "");
+ static_assert(std::is_signed<intmax_t>::value, "");
// typedef uintmax_t
- static_assert(sizeof(uintmax_t) >= sizeof(unsigned long long),
- "sizeof(uintmax_t) >= sizeof(unsigned long long)");
- static_assert(std::is_unsigned<uintmax_t>::value,
- "std::is_unsigned<uintmax_t>::value");
+ static_assert(sizeof(uintmax_t) >= sizeof(unsigned long long), "");
+ static_assert(std::is_unsigned<uintmax_t>::value, "");
// INTN_MIN
- static_assert(INT8_MIN == -128, "INT8_MIN == -128");
- static_assert(INT16_MIN == -32768, "INT16_MIN == -32768");
- static_assert(INT32_MIN == -2147483647 - 1, "INT32_MIN == -2147483648");
- static_assert(INT64_MIN == -9223372036854775807LL - 1, "INT64_MIN == -9223372036854775808LL");
+ static_assert(INT8_MIN == -128, "");
+ static_assert(INT16_MIN == -32768, "");
+ static_assert(INT32_MIN == -2147483647 - 1, "");
+ static_assert(INT64_MIN == -9223372036854775807LL - 1, "");
// INTN_MAX
- static_assert(INT8_MAX == 127, "INT8_MAX == 127");
- static_assert(INT16_MAX == 32767, "INT16_MAX == 32767");
- static_assert(INT32_MAX == 2147483647, "INT32_MAX == 2147483647");
- static_assert(INT64_MAX == 9223372036854775807LL, "INT64_MAX == 9223372036854775807LL");
+ static_assert(INT8_MAX == 127, "");
+ static_assert(INT16_MAX == 32767, "");
+ static_assert(INT32_MAX == 2147483647, "");
+ static_assert(INT64_MAX == 9223372036854775807LL, "");
// UINTN_MAX
- static_assert(UINT8_MAX == 255, "UINT8_MAX == 255");
- static_assert(UINT16_MAX == 65535, "UINT16_MAX == 65535");
- static_assert(UINT32_MAX == 4294967295U, "UINT32_MAX == 4294967295");
- static_assert(UINT64_MAX == 18446744073709551615ULL, "UINT64_MAX == 18446744073709551615ULL");
+ static_assert(UINT8_MAX == 255, "");
+ static_assert(UINT16_MAX == 65535, "");
+ static_assert(UINT32_MAX == 4294967295U, "");
+ static_assert(UINT64_MAX == 18446744073709551615ULL, "");
// INT_FASTN_MIN
- static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128");
- static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768");
- static_assert(INT_FAST32_MIN <= -2147483647 - 1, "INT_FAST32_MIN <= -2147483648");
- static_assert(INT_FAST64_MIN <= -9223372036854775807LL - 1, "INT_FAST64_MIN <= -9223372036854775808LL");
+ static_assert(INT_FAST8_MIN <= -128, "");
+ static_assert(INT_FAST16_MIN <= -32768, "");
+ static_assert(INT_FAST32_MIN <= -2147483647 - 1, "");
+ static_assert(INT_FAST64_MIN <= -9223372036854775807LL - 1, "");
// INT_FASTN_MAX
- static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127");
- static_assert(INT_FAST16_MAX >= 32767, "INT_FAST16_MAX >= 32767");
- static_assert(INT_FAST32_MAX >= 2147483647, "INT_FAST32_MAX >= 2147483647");
- static_assert(INT_FAST64_MAX >= 9223372036854775807LL, "INT_FAST64_MAX >= 9223372036854775807LL");
+ static_assert(INT_FAST8_MAX >= 127, "");
+ static_assert(INT_FAST16_MAX >= 32767, "");
+ static_assert(INT_FAST32_MAX >= 2147483647, "");
+ static_assert(INT_FAST64_MAX >= 9223372036854775807LL, "");
// UINT_FASTN_MAX
- static_assert(UINT_FAST8_MAX >= 255, "UINT_FAST8_MAX >= 255");
- static_assert(UINT_FAST16_MAX >= 65535, "UINT_FAST16_MAX >= 65535");
- static_assert(UINT_FAST32_MAX >= 4294967295U, "UINT_FAST32_MAX >= 4294967295");
- static_assert(UINT_FAST64_MAX >= 18446744073709551615ULL, "UINT_FAST64_MAX >= 18446744073709551615ULL");
+ static_assert(UINT_FAST8_MAX >= 255, "");
+ static_assert(UINT_FAST16_MAX >= 65535, "");
+ static_assert(UINT_FAST32_MAX >= 4294967295U, "");
+ static_assert(UINT_FAST64_MAX >= 18446744073709551615ULL, "");
// INTPTR_MIN
assert(INTPTR_MIN == std::numeric_limits<intptr_t>::min());
@@ -295,5 +277,5 @@
#error UINTMAX_C not defined
#endif
- return 0;
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp
new file mode 100644
index 0000000..27a9762
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp
@@ -0,0 +1,176 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// test <stdio.h>
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "test_macros.h"
+
+#ifdef getc
+#error getc is defined
+#endif
+
+#ifdef putc
+#error putc is defined
+#endif
+
+#ifdef clearerr
+#error clearerr is defined
+#endif
+
+#ifdef feof
+#error feof is defined
+#endif
+
+#ifdef ferror
+#error ferror is defined
+#endif
+
+#ifndef BUFSIZ
+#error BUFSIZ not defined
+#endif
+
+#ifndef EOF
+#error EOF not defined
+#endif
+
+#ifndef FILENAME_MAX
+#error FILENAME_MAX not defined
+#endif
+
+#ifndef FOPEN_MAX
+#error FOPEN_MAX not defined
+#endif
+
+#ifndef L_tmpnam
+#error L_tmpnam not defined
+#endif
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef SEEK_CUR
+#error SEEK_CUR not defined
+#endif
+
+#ifndef SEEK_END
+#error SEEK_END not defined
+#endif
+
+#ifndef SEEK_SET
+#error SEEK_SET not defined
+#endif
+
+#ifndef TMP_MAX
+#error TMP_MAX not defined
+#endif
+
+#ifndef _IOFBF
+#error _IOFBF not defined
+#endif
+
+#ifndef _IOLBF
+#error _IOLBF not defined
+#endif
+
+#ifndef _IONBF
+#error _IONBF not defined
+#endif
+
+#ifndef stderr
+#error stderr not defined
+#endif
+
+#ifndef stdin
+#error stdin not defined
+#endif
+
+#ifndef stdout
+#error stdout not defined
+#endif
+
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wformat-zero-length")
+TEST_GCC_DIAGNOSTIC_IGNORED("-Wformat-zero-length")
+
+FILE* fp = 0;
+fpos_t fpos = fpos_t();
+size_t s = 0;
+char* cp = 0;
+char arr[] = {'a', 'b'};
+va_list va;
+ASSERT_SAME_TYPE(int, decltype(remove("")));
+ASSERT_SAME_TYPE(int, decltype(rename("","")));
+ASSERT_SAME_TYPE(FILE*, decltype(tmpfile()));
+TEST_DIAGNOSTIC_PUSH
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+ASSERT_SAME_TYPE(char*, decltype(tmpnam(cp)));
+TEST_DIAGNOSTIC_POP
+ASSERT_SAME_TYPE(int, decltype(fclose(fp)));
+ASSERT_SAME_TYPE(int, decltype(fflush(fp)));
+ASSERT_SAME_TYPE(FILE*, decltype(fopen("", "")));
+ASSERT_SAME_TYPE(FILE*, decltype(freopen("", "", fp)));
+ASSERT_SAME_TYPE(void, decltype(setbuf(fp,cp)));
+ASSERT_SAME_TYPE(int, decltype(vfprintf(fp,"",va)));
+ASSERT_SAME_TYPE(int, decltype(fprintf(fp," ")));
+ASSERT_SAME_TYPE(int, decltype(fscanf(fp,"")));
+ASSERT_SAME_TYPE(int, decltype(printf("\n")));
+ASSERT_SAME_TYPE(int, decltype(scanf("\n")));
+ASSERT_SAME_TYPE(int, decltype(snprintf(cp,0,"p")));
+TEST_DIAGNOSTIC_PUSH
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+ASSERT_SAME_TYPE(int, decltype(sprintf(cp," ")));
+TEST_DIAGNOSTIC_POP
+ASSERT_SAME_TYPE(int, decltype(sscanf("","")));
+ASSERT_SAME_TYPE(int, decltype(vfprintf(fp,"",va)));
+ASSERT_SAME_TYPE(int, decltype(vfscanf(fp,"",va)));
+ASSERT_SAME_TYPE(int, decltype(vprintf(" ",va)));
+ASSERT_SAME_TYPE(int, decltype(vscanf("",va)));
+ASSERT_SAME_TYPE(int, decltype(vsnprintf(cp,0," ",va)));
+TEST_DIAGNOSTIC_PUSH
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+ASSERT_SAME_TYPE(int, decltype(vsprintf(cp," ",va)));
+TEST_DIAGNOSTIC_POP
+ASSERT_SAME_TYPE(int, decltype(vsscanf("","",va)));
+ASSERT_SAME_TYPE(int, decltype(fgetc(fp)));
+ASSERT_SAME_TYPE(char*, decltype(fgets(cp,0,fp)));
+ASSERT_SAME_TYPE(int, decltype(fputc(0,fp)));
+ASSERT_SAME_TYPE(int, decltype(fputs("",fp)));
+ASSERT_SAME_TYPE(int, decltype(getc(fp)));
+ASSERT_SAME_TYPE(int, decltype(getchar()));
+#if TEST_STD_VER < 14
+TEST_DIAGNOSTIC_PUSH
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+ASSERT_SAME_TYPE(char*, decltype(gets(cp)));
+TEST_DIAGNOSTIC_POP
+#endif
+ASSERT_SAME_TYPE(int, decltype(putc(0,fp)));
+ASSERT_SAME_TYPE(int, decltype(putchar(0)));
+ASSERT_SAME_TYPE(int, decltype(puts("")));
+ASSERT_SAME_TYPE(int, decltype(ungetc(0,fp)));
+ASSERT_SAME_TYPE(size_t, decltype(fread((void*)0,0,0,fp)));
+ASSERT_SAME_TYPE(size_t, decltype(fwrite((const void*)arr,1,0,fp)));
+#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
+ASSERT_SAME_TYPE(int, decltype(fgetpos(fp, &fpos)));
+#endif
+ASSERT_SAME_TYPE(int, decltype(fseek(fp, 0,0)));
+#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
+ASSERT_SAME_TYPE(int, decltype(fsetpos(fp, &fpos)));
+#endif
+ASSERT_SAME_TYPE(long, decltype(ftell(fp)));
+ASSERT_SAME_TYPE(void, decltype(rewind(fp)));
+ASSERT_SAME_TYPE(void, decltype(clearerr(fp)));
+ASSERT_SAME_TYPE(int, decltype(feof(fp)));
+ASSERT_SAME_TYPE(int, decltype(ferror(fp)));
+ASSERT_SAME_TYPE(void, decltype(perror("")));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
deleted file mode 100644
index effb633..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// test <stdio.h>
-
-#include <stdio.h>
-#include <type_traits>
-#include "test_macros.h"
-
-#ifdef getc
-#error getc is defined
-#endif
-
-#ifdef putc
-#error putc is defined
-#endif
-
-#ifdef clearerr
-#error clearerr is defined
-#endif
-
-#ifdef feof
-#error feof is defined
-#endif
-
-#ifdef ferror
-#error ferror is defined
-#endif
-
-#ifndef BUFSIZ
-#error BUFSIZ not defined
-#endif
-
-#ifndef EOF
-#error EOF not defined
-#endif
-
-#ifndef FILENAME_MAX
-#error FILENAME_MAX not defined
-#endif
-
-#ifndef FOPEN_MAX
-#error FOPEN_MAX not defined
-#endif
-
-#ifndef L_tmpnam
-#error L_tmpnam not defined
-#endif
-
-#ifndef NULL
-#error NULL not defined
-#endif
-
-#ifndef SEEK_CUR
-#error SEEK_CUR not defined
-#endif
-
-#ifndef SEEK_END
-#error SEEK_END not defined
-#endif
-
-#ifndef SEEK_SET
-#error SEEK_SET not defined
-#endif
-
-#ifndef TMP_MAX
-#error TMP_MAX not defined
-#endif
-
-#ifndef _IOFBF
-#error _IOFBF not defined
-#endif
-
-#ifndef _IOLBF
-#error _IOLBF not defined
-#endif
-
-#ifndef _IONBF
-#error _IONBF not defined
-#endif
-
-#ifndef stderr
-#error stderr not defined
-#endif
-
-#ifndef stdin
-#error stdin not defined
-#endif
-
-#ifndef stdout
-#error stdout not defined
-#endif
-
-#include <cstdarg>
-
-TEST_CLANG_DIAGNOSTIC_IGNORED("-Wformat-zero-length")
-TEST_GCC_DIAGNOSTIC_IGNORED("-Wformat-zero-length")
-
-int main(int, char**)
-{
- FILE* fp = 0;
- fpos_t fpos = fpos_t();
- size_t s = 0;
- char* cp = 0;
- char arr[] = {'a', 'b'};
- va_list va;
- ((void)fp); // Prevent unused warning
- ((void)fpos); // Prevent unused warning
- ((void)s); // Prevent unused warning
- ((void)cp); // Prevent unused warning
- ((void)arr); // Prevent unused warning
- ((void)va); // Prevent unused warning
- static_assert((std::is_same<decltype(remove("")), int>::value), "");
- static_assert((std::is_same<decltype(rename("","")), int>::value), "");
- static_assert((std::is_same<decltype(tmpfile()), FILE*>::value), "");
- TEST_DIAGNOSTIC_PUSH
- TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- static_assert((std::is_same<decltype(tmpnam(cp)), char*>::value), "");
- TEST_DIAGNOSTIC_POP
- static_assert((std::is_same<decltype(fclose(fp)), int>::value), "");
- static_assert((std::is_same<decltype(fflush(fp)), int>::value), "");
- static_assert((std::is_same<decltype(fopen("", "")), FILE*>::value), "");
- static_assert((std::is_same<decltype(freopen("", "", fp)), FILE*>::value), "");
- static_assert((std::is_same<decltype(setbuf(fp,cp)), void>::value), "");
- static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), "");
- static_assert((std::is_same<decltype(fprintf(fp," ")), int>::value), "");
- static_assert((std::is_same<decltype(fscanf(fp,"")), int>::value), "");
- static_assert((std::is_same<decltype(printf("\n")), int>::value), "");
- static_assert((std::is_same<decltype(scanf("\n")), int>::value), "");
- static_assert((std::is_same<decltype(snprintf(cp,0,"p")), int>::value), "");
- TEST_DIAGNOSTIC_PUSH
- TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- static_assert((std::is_same<decltype(sprintf(cp," ")), int>::value), "");
- TEST_DIAGNOSTIC_POP
- static_assert((std::is_same<decltype(sscanf("","")), int>::value), "");
- static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), "");
- static_assert((std::is_same<decltype(vfscanf(fp,"",va)), int>::value), "");
- static_assert((std::is_same<decltype(vprintf(" ",va)), int>::value), "");
- static_assert((std::is_same<decltype(vscanf("",va)), int>::value), "");
- static_assert((std::is_same<decltype(vsnprintf(cp,0," ",va)), int>::value), "");
- TEST_DIAGNOSTIC_PUSH
- TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- static_assert((std::is_same<decltype(vsprintf(cp," ",va)), int>::value), "");
- TEST_DIAGNOSTIC_POP
- static_assert((std::is_same<decltype(vsscanf("","",va)), int>::value), "");
- static_assert((std::is_same<decltype(fgetc(fp)), int>::value), "");
- static_assert((std::is_same<decltype(fgets(cp,0,fp)), char*>::value), "");
- static_assert((std::is_same<decltype(fputc(0,fp)), int>::value), "");
- static_assert((std::is_same<decltype(fputs("",fp)), int>::value), "");
- static_assert((std::is_same<decltype(getc(fp)), int>::value), "");
- static_assert((std::is_same<decltype(getchar()), int>::value), "");
-#if TEST_STD_VER < 14
- TEST_DIAGNOSTIC_PUSH
- TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
- static_assert((std::is_same<decltype(gets(cp)), char*>::value), "");
- TEST_DIAGNOSTIC_POP
-#endif
- static_assert((std::is_same<decltype(putc(0,fp)), int>::value), "");
- static_assert((std::is_same<decltype(putchar(0)), int>::value), "");
- static_assert((std::is_same<decltype(puts("")), int>::value), "");
- static_assert((std::is_same<decltype(ungetc(0,fp)), int>::value), "");
- static_assert((std::is_same<decltype(fread((void*)0,0,0,fp)), size_t>::value), "");
- static_assert((std::is_same<decltype(fwrite((const void*)arr,1,0,fp)), size_t>::value), "");
-#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
- static_assert((std::is_same<decltype(fgetpos(fp, &fpos)), int>::value), "");
-#endif
- static_assert((std::is_same<decltype(fseek(fp, 0,0)), int>::value), "");
-#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
- static_assert((std::is_same<decltype(fsetpos(fp, &fpos)), int>::value), "");
-#endif
- static_assert((std::is_same<decltype(ftell(fp)), long>::value), "");
- static_assert((std::is_same<decltype(rewind(fp)), void>::value), "");
- static_assert((std::is_same<decltype(clearerr(fp)), void>::value), "");
- static_assert((std::is_same<decltype(feof(fp)), int>::value), "");
- static_assert((std::is_same<decltype(ferror(fp)), int>::value), "");
- static_assert((std::is_same<decltype(perror("")), void>::value), "");
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.aligned_alloc.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.aligned_alloc.compile.pass.cpp
index a02a5bb..c040930 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.aligned_alloc.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.aligned_alloc.compile.pass.cpp
@@ -13,7 +13,7 @@
// ::aligned_alloc is provided by the C library, but it's marked as unavailable
// until macOS 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// ::aligned_alloc is not implemented on Windows
// XFAIL: target={{.+}}-windows-{{.+}}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
index 9d60f94..ee70ed0 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
@@ -69,26 +69,18 @@
void test_abs() {
TEST_DIAGNOSTIC_PUSH
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wabsolute-value")
- static_assert((std::is_same<decltype(abs((float)0)), float>::value), "");
- static_assert((std::is_same<decltype(abs((double)0)), double>::value), "");
- static_assert(
- (std::is_same<decltype(abs((long double)0)), long double>::value), "");
- static_assert((std::is_same<decltype(abs((int)0)), int>::value), "");
- static_assert((std::is_same<decltype(abs((long)0)), long>::value), "");
- static_assert((std::is_same<decltype(abs((long long)0)), long long>::value),
- "");
- static_assert((std::is_same<decltype(abs((unsigned char)0)), int>::value),
- "");
- static_assert((std::is_same<decltype(abs((unsigned short)0)), int>::value),
- "");
- static_assert((std::is_same<decltype(abs((signed char)0)), int>::value),
- "");
- static_assert((std::is_same<decltype(abs((short)0)), int>::value),
- "");
- static_assert((std::is_same<decltype(abs((unsigned char)0)), int>::value),
- "");
- static_assert((std::is_same<decltype(abs((char)0)), int>::value),
- "");
+ ASSERT_SAME_TYPE(float, decltype(abs((float)0)));
+ ASSERT_SAME_TYPE(double, decltype(abs((double)0)));
+ ASSERT_SAME_TYPE(long double, decltype(abs((long double)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((int)0)));
+ ASSERT_SAME_TYPE(long, decltype(abs((long)0)));
+ ASSERT_SAME_TYPE(long long, decltype(abs((long long)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((unsigned char)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((unsigned short)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((signed char)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((short)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((unsigned char)0)));
+ ASSERT_SAME_TYPE(int, decltype(abs((char)0)));
static_assert(!has_abs<unsigned>::value, "");
static_assert(!has_abs<unsigned long>::value, "");
@@ -100,60 +92,59 @@
assert(abs(-1.) == 1);
}
-int main(int, char**)
-{
+int main(int, char**) {
size_t s = 0; ((void)s);
div_t d; ((void)d);
ldiv_t ld; ((void)ld);
lldiv_t lld; ((void)lld);
char** endptr = 0;
- static_assert((std::is_same<decltype(atof("")), double>::value), "");
- static_assert((std::is_same<decltype(atoi("")), int>::value), "");
- static_assert((std::is_same<decltype(atol("")), long>::value), "");
- static_assert((std::is_same<decltype(atoll("")), long long>::value), "");
- static_assert((std::is_same<decltype(getenv("")), char*>::value), "");
- static_assert((std::is_same<decltype(strtod("", endptr)), double>::value), "");
- static_assert((std::is_same<decltype(strtof("", endptr)), float>::value), "");
- static_assert((std::is_same<decltype(strtold("", endptr)), long double>::value), "");
- static_assert((std::is_same<decltype(strtol("", endptr,0)), long>::value), "");
- static_assert((std::is_same<decltype(strtoll("", endptr,0)), long long>::value), "");
- static_assert((std::is_same<decltype(strtoul("", endptr,0)), unsigned long>::value), "");
- static_assert((std::is_same<decltype(strtoull("", endptr,0)), unsigned long long>::value), "");
- static_assert((std::is_same<decltype(rand()), int>::value), "");
- static_assert((std::is_same<decltype(srand(0)), void>::value), "");
+ ASSERT_SAME_TYPE(double, decltype(atof("")));
+ ASSERT_SAME_TYPE(int, decltype(atoi("")));
+ ASSERT_SAME_TYPE(long, decltype(atol("")));
+ ASSERT_SAME_TYPE(long long, decltype(atoll("")));
+ ASSERT_SAME_TYPE(char*, decltype(getenv("")));
+ ASSERT_SAME_TYPE(double, decltype(strtod("", endptr)));
+ ASSERT_SAME_TYPE(float, decltype(strtof("", endptr)));
+ ASSERT_SAME_TYPE(long double, decltype(strtold("", endptr)));
+ ASSERT_SAME_TYPE(long, decltype(strtol("", endptr,0)));
+ ASSERT_SAME_TYPE(long long, decltype(strtoll("", endptr,0)));
+ ASSERT_SAME_TYPE(unsigned long, decltype(strtoul("", endptr,0)));
+ ASSERT_SAME_TYPE(unsigned long long, decltype(strtoull("", endptr,0)));
+ ASSERT_SAME_TYPE(int, decltype(rand()));
+ ASSERT_SAME_TYPE(void, decltype(srand(0)));
// aligned_alloc tested in stdlib_h.aligned_alloc.compile.pass.cpp
void* pv = 0;
void (*handler)() = 0;
int (*comp)(void const*, void const*) = 0;
- static_assert((std::is_same<decltype(calloc(0,0)), void*>::value), "");
- static_assert((std::is_same<decltype(free(0)), void>::value), "");
- static_assert((std::is_same<decltype(malloc(0)), void*>::value), "");
- static_assert((std::is_same<decltype(realloc(0,0)), void*>::value), "");
- static_assert((std::is_same<decltype(abort()), void>::value), "");
- static_assert((std::is_same<decltype(atexit(handler)), int>::value), "");
- static_assert((std::is_same<decltype(exit(0)), void>::value), "");
- static_assert((std::is_same<decltype(_Exit(0)), void>::value), "");
- static_assert((std::is_same<decltype(getenv("")), char*>::value), "");
- static_assert((std::is_same<decltype(system("")), int>::value), "");
- static_assert((std::is_same<decltype(bsearch(pv,pv,0,0,comp)), void*>::value), "");
- static_assert((std::is_same<decltype(qsort(pv,0,0,comp)), void>::value), "");
- static_assert((std::is_same<decltype(abs(0)), int>::value), "");
- static_assert((std::is_same<decltype(labs((long)0)), long>::value), "");
- static_assert((std::is_same<decltype(llabs((long long)0)), long long>::value), "");
- static_assert((std::is_same<decltype(div(0,0)), div_t>::value), "");
- static_assert((std::is_same<decltype(ldiv(0L,0L)), ldiv_t>::value), "");
- static_assert((std::is_same<decltype(lldiv(0LL,0LL)), lldiv_t>::value), "");
+ ASSERT_SAME_TYPE(void*, decltype(calloc(0,0)));
+ ASSERT_SAME_TYPE(void, decltype(free(0)));
+ ASSERT_SAME_TYPE(void*, decltype(malloc(0)));
+ ASSERT_SAME_TYPE(void*, decltype(realloc(0,0)));
+ ASSERT_SAME_TYPE(void, decltype(abort()));
+ ASSERT_SAME_TYPE(int, decltype(atexit(handler)));
+ ASSERT_SAME_TYPE(void, decltype(exit(0)));
+ ASSERT_SAME_TYPE(void, decltype(_Exit(0)));
+ ASSERT_SAME_TYPE(char*, decltype(getenv("")));
+ ASSERT_SAME_TYPE(int, decltype(system("")));
+ ASSERT_SAME_TYPE(void*, decltype(bsearch(pv,pv,0,0,comp)));
+ ASSERT_SAME_TYPE(void, decltype(qsort(pv,0,0,comp)));
+ ASSERT_SAME_TYPE(int, decltype(abs(0)));
+ ASSERT_SAME_TYPE(long, decltype(labs((long)0)));
+ ASSERT_SAME_TYPE(long long, decltype(llabs((long long)0)));
+ ASSERT_SAME_TYPE(div_t, decltype(div(0,0)));
+ ASSERT_SAME_TYPE(ldiv_t, decltype(ldiv(0L,0L)));
+ ASSERT_SAME_TYPE(lldiv_t, decltype(lldiv(0LL,0LL)));
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
wchar_t* pw = 0;
const wchar_t* pwc = 0;
char* pc = 0;
- static_assert((std::is_same<decltype(mblen("",0)), int>::value), "");
- static_assert((std::is_same<decltype(mbtowc(pw,"",0)), int>::value), "");
- static_assert((std::is_same<decltype(wctomb(pc,L' ')), int>::value), "");
- static_assert((std::is_same<decltype(mbstowcs(pw,"",0)), size_t>::value), "");
- static_assert((std::is_same<decltype(wcstombs(pc,pwc,0)), size_t>::value), "");
+ ASSERT_SAME_TYPE(int, decltype(mblen("",0)));
+ ASSERT_SAME_TYPE(int, decltype(mbtowc(pw,"",0)));
+ ASSERT_SAME_TYPE(int, decltype(wctomb(pc,L' ')));
+ ASSERT_SAME_TYPE(size_t, decltype(mbstowcs(pw,"",0)));
+ ASSERT_SAME_TYPE(size_t, decltype(wcstombs(pc,pwc,0)));
#endif
test_abs();
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
index 5ccccd4..697b818 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
@@ -10,7 +10,6 @@
#include <string.h>
#include <cassert>
-#include <type_traits>
#include "test_macros.h"
@@ -18,8 +17,7 @@
#error NULL not defined
#endif
-int main(int, char**)
-{
+int main(int, char**) {
// Functions we get directly from the C library (just check the signature)
{
size_t s = 0;
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
index 88e42fb..e29c1a7 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
@@ -10,14 +10,11 @@
#include <tgmath.h>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+int main(int, char**) {
std::complex<double> cd;
(void)cd;
double x = sin(1.0);
(void)x; // to placate scan-build
- return 0;
+ return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp
new file mode 100644
index 0000000..b7eb77b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/time_h.compile.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// test <time.h>
+
+#include <time.h>
+
+#include "test_macros.h"
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#error CLOCKS_PER_SEC not defined
+#endif
+
+clock_t c = 0;
+size_t s = 0;
+time_t t = 0;
+tm tmv = {};
+char* c1 = 0;
+const char* c2 = 0;
+ASSERT_SAME_TYPE(clock_t, decltype(clock()));
+ASSERT_SAME_TYPE(double, decltype(difftime(t, t)));
+ASSERT_SAME_TYPE(time_t, decltype(mktime(&tmv)));
+ASSERT_SAME_TYPE(time_t, decltype(time(&t)));
+ASSERT_SAME_TYPE(char*, decltype(asctime(&tmv)));
+ASSERT_SAME_TYPE(char*, decltype(ctime(&t)));
+ASSERT_SAME_TYPE(tm*, decltype(gmtime(&t)));
+ASSERT_SAME_TYPE(tm*, decltype(localtime(&t)));
+ASSERT_SAME_TYPE(size_t, decltype(strftime(c1, s, c2, &tmv)));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
deleted file mode 100644
index 31aff19..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/time_h.pass.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// test <time.h>
-
-#include <time.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef NULL
-#error NULL not defined
-#endif
-
-#ifndef CLOCKS_PER_SEC
-#error CLOCKS_PER_SEC not defined
-#endif
-
-int main(int, char**)
-{
- clock_t c = 0; ((void)c);
- size_t s = 0;
- time_t t = 0;
- tm tmv = {};
- static_assert((std::is_same<decltype(clock()), clock_t>::value), "");
- static_assert((std::is_same<decltype(difftime(t,t)), double>::value), "");
- static_assert((std::is_same<decltype(mktime(&tmv)), time_t>::value), "");
- static_assert((std::is_same<decltype(time(&t)), time_t>::value), "");
- static_assert((std::is_same<decltype(asctime(&tmv)), char*>::value), "");
- static_assert((std::is_same<decltype(ctime(&t)), char*>::value), "");
- static_assert((std::is_same<decltype(gmtime(&t)), tm*>::value), "");
- static_assert((std::is_same<decltype(localtime(&t)), tm*>::value), "");
- char* c1 = 0;
- const char* c2 = 0;
- static_assert((std::is_same<decltype(strftime(c1,s,c2,&tmv)), size_t>::value), "");
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
index 016e51d..2b64554 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
@@ -11,9 +11,6 @@
// Apple platforms don't provide <uchar.h> yet, so these tests fail.
// XFAIL: target={{.+}}-apple-{{.+}}
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// <uchar.h>
#include <uchar.h>
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp
new file mode 100644
index 0000000..ae08ebd
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wchar_h.compile.pass.cpp
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: no-wide-characters
+
+// <wchar.h>
+
+#include <wchar.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <type_traits>
+
+#include "test_macros.h"
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef WCHAR_MAX
+#error WCHAR_MAX not defined
+#endif
+
+#ifndef WCHAR_MIN
+#error WCHAR_MIN not defined
+#endif
+
+#ifndef WEOF
+#error WEOF not defined
+#endif
+
+// mbstate_t comes from the underlying C library; it is defined (in C99) as:
+// a complete object type other than an array type that can hold the conversion
+// state information necessary to convert between sequences of multibyte
+// characters and wide characters
+mbstate_t mb = {};
+size_t s = 0;
+tm *tm = 0;
+wint_t w = 0;
+::FILE* fp = 0;
+::va_list va;
+char* ns = 0;
+wchar_t* ws = 0;
+const wchar_t* cws = 0;
+wchar_t** wsp = 0;
+
+ASSERT_SAME_TYPE(int, decltype(fwprintf(fp, L"")));
+ASSERT_SAME_TYPE(int, decltype(fwscanf(fp, L"")));
+ASSERT_SAME_TYPE(int, decltype(swprintf(ws, s, L"")));
+ASSERT_SAME_TYPE(int, decltype(swscanf(L"", L"")));
+ASSERT_SAME_TYPE(int, decltype(vfwprintf(fp, L"", va)));
+ASSERT_SAME_TYPE(int, decltype(vfwscanf(fp, L"", va)));
+ASSERT_SAME_TYPE(int, decltype(vswprintf(ws, s, L"", va)));
+ASSERT_SAME_TYPE(int, decltype(vswscanf(L"", L"", va)));
+ASSERT_SAME_TYPE(wint_t, decltype(fgetwc(fp)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(fgetws(ws, 0, fp)));
+ASSERT_SAME_TYPE(wint_t, decltype(fputwc(L' ', fp)));
+ASSERT_SAME_TYPE(int, decltype(fputws(L"", fp)));
+ASSERT_SAME_TYPE(int, decltype(fwide(fp, 0)));
+ASSERT_SAME_TYPE(wint_t, decltype(getwc(fp)));
+ASSERT_SAME_TYPE(wint_t, decltype(putwc(L' ', fp)));
+ASSERT_SAME_TYPE(wint_t, decltype(ungetwc(L' ', fp)));
+ASSERT_SAME_TYPE(double, decltype(wcstod(L"", wsp)));
+ASSERT_SAME_TYPE(float, decltype(wcstof(L"", wsp)));
+ASSERT_SAME_TYPE(long double, decltype(wcstold(L"", wsp)));
+ASSERT_SAME_TYPE(long, decltype(wcstol(L"", wsp, 0)));
+ASSERT_SAME_TYPE(long long, decltype(wcstoll(L"", wsp, 0)));
+ASSERT_SAME_TYPE(unsigned long, decltype(wcstoul(L"", wsp, 0)));
+ASSERT_SAME_TYPE(unsigned long long, decltype(wcstoull(L"", wsp, 0)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcscpy(ws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncpy(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcscat(ws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncat(ws, L"", s)));
+ASSERT_SAME_TYPE(int, decltype(wcscmp(L"", L"")));
+ASSERT_SAME_TYPE(int, decltype(wcscoll(L"", L"")));
+ASSERT_SAME_TYPE(int, decltype(wcsncmp(L"", L"", s)));
+ASSERT_SAME_TYPE(size_t, decltype(wcsxfrm(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcschr(ws, L' ')));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcschr(cws, L' ')));
+ASSERT_SAME_TYPE(size_t, decltype(wcscspn(L"", L"")));
+ASSERT_SAME_TYPE(size_t, decltype(wcslen(L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcspbrk(ws, L"")));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcspbrk(cws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsrchr(ws, L' ')));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsrchr(cws, L' ')));
+ASSERT_SAME_TYPE(size_t, decltype(wcsspn(L"", L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcsstr(ws, L"")));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsstr(cws, L"")));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wcstok(ws, L"", wsp)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemchr(ws, L' ', s)));
+ASSERT_SAME_TYPE(const wchar_t*, decltype(wmemchr(cws, L' ', s)));
+ASSERT_SAME_TYPE(int, decltype(wmemcmp(L"", L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemcpy(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemmove(ws, L"", s)));
+ASSERT_SAME_TYPE(wchar_t*, decltype(wmemset(ws, L' ', s)));
+ASSERT_SAME_TYPE(size_t, decltype(wcsftime(ws, s, L"", tm)));
+ASSERT_SAME_TYPE(wint_t, decltype(btowc(0)));
+ASSERT_SAME_TYPE(int, decltype(wctob(w)));
+ASSERT_SAME_TYPE(int, decltype(mbsinit(&mb)));
+ASSERT_SAME_TYPE(size_t, decltype(mbrlen("", s, &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(mbrtowc(ws, "", s, &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(wcrtomb(ns, L' ', &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(mbsrtowcs(ws, (const char**)0, s, &mb)));
+ASSERT_SAME_TYPE(size_t, decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)));
+ASSERT_SAME_TYPE(wint_t, decltype(getwchar()));
+ASSERT_SAME_TYPE(int, decltype(vwscanf(L"", va)));
+ASSERT_SAME_TYPE(int, decltype(wscanf(L"")));
+ASSERT_SAME_TYPE(wint_t, decltype(putwchar(L' ')));
+ASSERT_SAME_TYPE(int, decltype(vwprintf(L"", va)));
+ASSERT_SAME_TYPE(int, decltype(wprintf(L"")));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
deleted file mode 100644
index 78716da..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// XFAIL: no-wide-characters
-
-// <wchar.h>
-
-#include <wchar.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef NULL
-#error NULL not defined
-#endif
-
-#ifndef WCHAR_MAX
-#error WCHAR_MAX not defined
-#endif
-
-#ifndef WCHAR_MIN
-#error WCHAR_MIN not defined
-#endif
-
-#ifndef WEOF
-#error WEOF not defined
-#endif
-
-int main(int, char**)
-{
-// mbstate_t comes from the underlying C library; it is defined (in C99) as:
-// a complete object type other than an array type that can hold the conversion
-// state information necessary to convert between sequences of multibyte
-// characters and wide characters
- mbstate_t mb = {};
- size_t s = 0;
- tm *tm = 0;
- wint_t w = 0;
- ::FILE* fp = 0;
- ::va_list va;
- char* ns = 0;
- wchar_t* ws = 0;
- const wchar_t* cws = 0;
- wchar_t** wsp = 0;
- ((void)mb); // Prevent unused warning
- ((void)s); // Prevent unused warning
- ((void)tm); // Prevent unused warning
- ((void)w); // Prevent unused warning
- ((void)fp); // Prevent unused warning
- ((void)va); // Prevent unused warning
- ((void)ns); // Prevent unused warning
- ((void)ws); // Prevent unused warning
- ((void)cws); // Prevent unused warning
- ((void)wsp); // Prevent unused warning
- ASSERT_SAME_TYPE(int, decltype(fwprintf(fp, L"")));
- ASSERT_SAME_TYPE(int, decltype(fwscanf(fp, L"")));
- ASSERT_SAME_TYPE(int, decltype(swprintf(ws, s, L"")));
- ASSERT_SAME_TYPE(int, decltype(swscanf(L"", L"")));
- ASSERT_SAME_TYPE(int, decltype(vfwprintf(fp, L"", va)));
- ASSERT_SAME_TYPE(int, decltype(vfwscanf(fp, L"", va)));
- ASSERT_SAME_TYPE(int, decltype(vswprintf(ws, s, L"", va)));
- ASSERT_SAME_TYPE(int, decltype(vswscanf(L"", L"", va)));
- ASSERT_SAME_TYPE(wint_t, decltype(fgetwc(fp)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(fgetws(ws, 0, fp)));
- ASSERT_SAME_TYPE(wint_t, decltype(fputwc(L' ', fp)));
- ASSERT_SAME_TYPE(int, decltype(fputws(L"", fp)));
- ASSERT_SAME_TYPE(int, decltype(fwide(fp, 0)));
- ASSERT_SAME_TYPE(wint_t, decltype(getwc(fp)));
- ASSERT_SAME_TYPE(wint_t, decltype(putwc(L' ', fp)));
- ASSERT_SAME_TYPE(wint_t, decltype(ungetwc(L' ', fp)));
- ASSERT_SAME_TYPE(double, decltype(wcstod(L"", wsp)));
- ASSERT_SAME_TYPE(float, decltype(wcstof(L"", wsp)));
- ASSERT_SAME_TYPE(long double, decltype(wcstold(L"", wsp)));
- ASSERT_SAME_TYPE(long, decltype(wcstol(L"", wsp, 0)));
- ASSERT_SAME_TYPE(long long, decltype(wcstoll(L"", wsp, 0)));
- ASSERT_SAME_TYPE(unsigned long, decltype(wcstoul(L"", wsp, 0)));
- ASSERT_SAME_TYPE(unsigned long long, decltype(wcstoull(L"", wsp, 0)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcscpy(ws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncpy(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcscat(ws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsncat(ws, L"", s)));
- ASSERT_SAME_TYPE(int, decltype(wcscmp(L"", L"")));
- ASSERT_SAME_TYPE(int, decltype(wcscoll(L"", L"")));
- ASSERT_SAME_TYPE(int, decltype(wcsncmp(L"", L"", s)));
- ASSERT_SAME_TYPE(size_t, decltype(wcsxfrm(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcschr(ws, L' ')));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcschr(cws, L' ')));
- ASSERT_SAME_TYPE(size_t, decltype(wcscspn(L"", L"")));
- ASSERT_SAME_TYPE(size_t, decltype(wcslen(L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcspbrk(ws, L"")));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcspbrk(cws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsrchr(ws, L' ')));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsrchr(cws, L' ')));
- ASSERT_SAME_TYPE(size_t, decltype(wcsspn(L"", L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcsstr(ws, L"")));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wcsstr(cws, L"")));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wcstok(ws, L"", wsp)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemchr(ws, L' ', s)));
- ASSERT_SAME_TYPE(const wchar_t*, decltype(wmemchr(cws, L' ', s)));
- ASSERT_SAME_TYPE(int, decltype(wmemcmp(L"", L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemcpy(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemmove(ws, L"", s)));
- ASSERT_SAME_TYPE(wchar_t*, decltype(wmemset(ws, L' ', s)));
- ASSERT_SAME_TYPE(size_t, decltype(wcsftime(ws, s, L"", tm)));
- ASSERT_SAME_TYPE(wint_t, decltype(btowc(0)));
- ASSERT_SAME_TYPE(int, decltype(wctob(w)));
- ASSERT_SAME_TYPE(int, decltype(mbsinit(&mb)));
- ASSERT_SAME_TYPE(size_t, decltype(mbrlen("", s, &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(mbrtowc(ws, "", s, &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(wcrtomb(ns, L' ', &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(mbsrtowcs(ws, (const char**)0, s, &mb)));
- ASSERT_SAME_TYPE(size_t, decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)));
- ASSERT_SAME_TYPE(wint_t, decltype(getwchar()));
- ASSERT_SAME_TYPE(int, decltype(vwscanf(L"", va)));
- ASSERT_SAME_TYPE(int, decltype(wscanf(L"")));
- ASSERT_SAME_TYPE(wint_t, decltype(putwchar(L' ')));
- ASSERT_SAME_TYPE(int, decltype(vwprintf(L"", va)));
- ASSERT_SAME_TYPE(int, decltype(wprintf(L"")));
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp
new file mode 100644
index 0000000..094f771
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp
@@ -0,0 +1,113 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: no-wide-characters
+
+// <wctype.h>
+
+#include <wctype.h>
+
+#include "test_macros.h"
+
+#ifndef WEOF
+#error WEOF not defined
+#endif
+
+#ifdef iswalnum
+#error iswalnum defined
+#endif
+
+#ifdef iswalpha
+#error iswalpha defined
+#endif
+
+#ifdef iswblank
+#error iswblank defined
+#endif
+
+#ifdef iswcntrl
+#error iswcntrl defined
+#endif
+
+#ifdef iswdigit
+#error iswdigit defined
+#endif
+
+#ifdef iswgraph
+#error iswgraph defined
+#endif
+
+#ifdef iswlower
+#error iswlower defined
+#endif
+
+#ifdef iswprint
+#error iswprint defined
+#endif
+
+#ifdef iswpunct
+#error iswpunct defined
+#endif
+
+#ifdef iswspace
+#error iswspace defined
+#endif
+
+#ifdef iswupper
+#error iswupper defined
+#endif
+
+#ifdef iswxdigit
+#error iswxdigit defined
+#endif
+
+#ifdef iswctype
+#error iswctype defined
+#endif
+
+#ifdef wctype
+#error wctype defined
+#endif
+
+#ifdef towlower
+#error towlower defined
+#endif
+
+#ifdef towupper
+#error towupper defined
+#endif
+
+#ifdef towctrans
+#error towctrans defined
+#endif
+
+#ifdef wctrans
+#error wctrans defined
+#endif
+
+wint_t w = 0;
+wctrans_t wctr = 0;
+wctype_t wct = 0;
+ASSERT_SAME_TYPE(int, decltype(iswalnum(w)));
+ASSERT_SAME_TYPE(int, decltype(iswalpha(w)));
+ASSERT_SAME_TYPE(int, decltype(iswblank(w)));
+ASSERT_SAME_TYPE(int, decltype(iswcntrl(w)));
+ASSERT_SAME_TYPE(int, decltype(iswdigit(w)));
+ASSERT_SAME_TYPE(int, decltype(iswgraph(w)));
+ASSERT_SAME_TYPE(int, decltype(iswlower(w)));
+ASSERT_SAME_TYPE(int, decltype(iswprint(w)));
+ASSERT_SAME_TYPE(int, decltype(iswpunct(w)));
+ASSERT_SAME_TYPE(int, decltype(iswspace(w)));
+ASSERT_SAME_TYPE(int, decltype(iswupper(w)));
+ASSERT_SAME_TYPE(int, decltype(iswxdigit(w)));
+ASSERT_SAME_TYPE(int, decltype(iswctype(w, wct)));
+ASSERT_SAME_TYPE(wctype_t, decltype(wctype("")));
+ASSERT_SAME_TYPE(wint_t, decltype(towlower(w)));
+ASSERT_SAME_TYPE(wint_t, decltype(towupper(w)));
+ASSERT_SAME_TYPE(wint_t, decltype(towctrans(w, wctr)));
+ASSERT_SAME_TYPE(wctrans_t, decltype(wctrans("")));
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
deleted file mode 100644
index c40623a..0000000
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// XFAIL: no-wide-characters
-
-// <wctype.h>
-
-#include <wctype.h>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef WEOF
-#error WEOF not defined
-#endif
-
-#ifdef iswalnum
-#error iswalnum defined
-#endif
-
-#ifdef iswalpha
-#error iswalpha defined
-#endif
-
-#ifdef iswblank
-#error iswblank defined
-#endif
-
-#ifdef iswcntrl
-#error iswcntrl defined
-#endif
-
-#ifdef iswdigit
-#error iswdigit defined
-#endif
-
-#ifdef iswgraph
-#error iswgraph defined
-#endif
-
-#ifdef iswlower
-#error iswlower defined
-#endif
-
-#ifdef iswprint
-#error iswprint defined
-#endif
-
-#ifdef iswpunct
-#error iswpunct defined
-#endif
-
-#ifdef iswspace
-#error iswspace defined
-#endif
-
-#ifdef iswupper
-#error iswupper defined
-#endif
-
-#ifdef iswxdigit
-#error iswxdigit defined
-#endif
-
-#ifdef iswctype
-#error iswctype defined
-#endif
-
-#ifdef wctype
-#error wctype defined
-#endif
-
-#ifdef towlower
-#error towlower defined
-#endif
-
-#ifdef towupper
-#error towupper defined
-#endif
-
-#ifdef towctrans
-#error towctrans defined
-#endif
-
-#ifdef wctrans
-#error wctrans defined
-#endif
-
-int main(int, char**)
-{
- wint_t w = 0;
- wctrans_t wctr = 0;
- wctype_t wct = 0;
- static_assert((std::is_same<decltype(iswalnum(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswalpha(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswblank(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswcntrl(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswdigit(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswgraph(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswlower(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswprint(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswpunct(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswspace(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswupper(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswxdigit(w)), int>::value), "");
- static_assert((std::is_same<decltype(iswctype(w, wct)), int>::value), "");
- static_assert((std::is_same<decltype(wctype("")), wctype_t>::value), "");
- static_assert((std::is_same<decltype(towlower(w)), wint_t>::value), "");
- static_assert((std::is_same<decltype(towupper(w)), wint_t>::value), "");
- static_assert((std::is_same<decltype(towctrans(w, wctr)), wint_t>::value), "");
- static_assert((std::is_same<decltype(wctrans("")), wctrans_t>::value), "");
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
index 93cfbb6..00ae309 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
@@ -16,11 +16,7 @@
#include <functional>
#include "../test_func.h"
-#include "test_macros.h"
-int main(int, char**)
-{
+void f() {
std::bind1st(test_func(1), 5); // expected-warning {{'bind1st<test_func, int>' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
index 3e55db6..c1c78ec 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
@@ -16,11 +16,7 @@
#include <functional>
#include "../test_func.h"
-#include "test_macros.h"
-int main(int, char**)
-{
+void f() {
std::bind2nd(test_func(1), 5); // expected-warning {{'bind2nd<test_func, int>' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
index 5048d7b..c1b7c68 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
@@ -16,11 +16,5 @@
#include <functional>
#include "../test_func.h"
-#include "test_macros.h"
-int main(int, char**)
-{
- typedef std::binder1st<test_func> B1ST; // expected-warning {{'binder1st<test_func>' is deprecated}}
-
- return 0;
-}
+typedef std::binder1st<test_func> B1ST; // expected-warning {{'binder1st<test_func>' is deprecated}}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
index 5a883ab..fa25fa0 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
@@ -16,11 +16,5 @@
#include <functional>
#include "../test_func.h"
-#include "test_macros.h"
-int main(int, char**)
-{
- typedef std::binder2nd<test_func> B2ND; // expected-warning {{'binder2nd<test_func>' is deprecated}}
-
- return 0;
-}
+typedef std::binder2nd<test_func> B2ND; // expected-warning {{'binder2nd<test_func>' is deprecated}}
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp b/third_party/llvm-project/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
index 025bc0b..83e3009 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
@@ -34,7 +34,7 @@
struct test
: std::strstreambuf
{
- test(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*))
+ test(void* (*palloc_arg)(std::size_t), void (*pfree_arg)(void*))
: std::strstreambuf(palloc_arg, pfree_arg) {}
virtual int_type overflow(int_type c)
{return std::strstreambuf::overflow(c);}
diff --git a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/errc.pass.cpp b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/errc.pass.cpp
index 6a04a3c..e44cb50 100644
--- a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/errc.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/errc.pass.cpp
@@ -10,6 +10,7 @@
// enum errc {...}
+#include <cerrno>
#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
index 2f766e6..b4a6566 100644
--- a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
@@ -12,6 +12,7 @@
// template <class T> constexpr bool is_error_condition_enum_v;
+#include <string>
#include <system_error>
#include <type_traits>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
index 4570d57..84f209c 100644
--- a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// XFAIL: suse-linux-enterprise-server-11
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// <system_error>
diff --git a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
index 415a900..7b15da3 100644
--- a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -13,7 +13,7 @@
// const error_category& system_category();
// XFAIL: suse-linux-enterprise-server-11
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
#include <system_error>
#include <cassert>
diff --git a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
index bfd6fd6..0559778 100644
--- a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
@@ -14,6 +14,7 @@
#include <system_error>
#include <cassert>
+#include <type_traits>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
index 0f5aa8b..2c98c89 100644
--- a/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
@@ -14,6 +14,7 @@
#include <system_error>
#include <cassert>
+#include <type_traits>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp
deleted file mode 100644
index 8751bc1..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <algorithm>
-
-// template<class ForwardIterator, class Searcher>
-// ForwardIterator search(ForwardIterator first, ForwardIterator last,
-// const Searcher& searcher);
-//
-// returns searcher.operator(first, last).first
-//
-
-#include <experimental/algorithm>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-int searcher_called = 0;
-
-struct MySearcher {
- template <typename Iterator>
- std::pair<Iterator, Iterator>
- operator() (Iterator b, Iterator e) const
- {
- ++searcher_called;
- return std::make_pair(b, e);
- }
-};
-
-
-int main(int, char**) {
- typedef int * RI;
- static_assert((std::is_same<RI, decltype(std::experimental::search(RI(), RI(), MySearcher()))>::value), "" );
-
- RI it(nullptr);
- assert(it == std::experimental::search(it, it, MySearcher()));
- assert(searcher_called == 1);
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp
deleted file mode 100644
index d5acb8f..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_searcher {
-// public:
-// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
- std::experimental::boyer_moore_searcher<Iter2> s{b2, e2};
- assert(result == std::experimental::search(b1, e1, s));
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
- int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sj = sizeof(ij)/sizeof(ij[0]);
- int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sk = sizeof(ik)/sizeof(ik[0]);
- do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
- char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sj = sizeof(ij)/sizeof(ij[0]);
- char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sk = sizeof(ik)/sizeof(ik[0]);
- do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
-}
-
-template <class Iter1, class Iter2>
-void test_large_str() {
- std::vector<signed char> data(257, 'a');
- data[254] = 'b';
- data[255] = 'b';
- data[256] = 'b';
- const signed char find[] = {'b', 'b', 'b'};
- do_search(Iter1(data.data()), Iter1(data.data() + data.size()),
- Iter2(find), Iter2(find + 3),
- Iter1(data.data() + 254));
-}
-
-void test_custom_pred() {
- std::string long_string(1024, '0');
- auto searcher = std::experimental::make_boyer_moore_searcher(std::begin(long_string), std::end(long_string));
- const char str[] = "1234";
- auto ret = searcher(std::begin(str), std::end(str));
- assert(ret.first == std::end(str));
- assert(ret.second == std::end(str));
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
- test_large_str<random_access_iterator<const signed char*>, random_access_iterator<const signed char*>>();
- test_custom_pred();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
deleted file mode 100644
index 5933b61..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_searcher {
-// public:
-// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
-};
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) {
- std::experimental::boyer_moore_searcher<Iter2,
- MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>>
- s{b2, e2};
- assert(result == std::experimental::search(b1, e1, s));
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
deleted file mode 100644
index ef3315f..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_searcher {
-// public:
-// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
-};
-
-struct count_equal
-{
- static unsigned count;
- template <class T>
- bool operator()(const T& x, const T& y) const
- {++count; return x == y;}
-};
-
-unsigned count_equal::count = 0;
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
- std::experimental::boyer_moore_searcher<Iter2,
- MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>,
- count_equal>
- s{b2, e2};
- count_equal::count = 0;
- assert(result == std::experimental::search(b1, e1, s));
- assert(count_equal::count <= max_count);
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
-
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
-
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
-
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
-
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp
deleted file mode 100644
index 86aa18e..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_searcher {
-// public:
-// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-struct count_equal
-{
- static unsigned count;
- template <class T>
- bool operator()(const T& x, const T& y) const
- {++count; return x == y;}
-};
-
-unsigned count_equal::count = 0;
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
- std::experimental::boyer_moore_searcher<Iter2,
- typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2};
- count_equal::count = 0;
- assert(result == std::experimental::search(b1, e1, s));
- assert(count_equal::count <= max_count);
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
-
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
-
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp
deleted file mode 100644
index 440bc05..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore_horspool searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_horspool_searcher {
-// public:
-// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
- std::experimental::boyer_moore_horspool_searcher<Iter2> s{b2, e2};
- assert(result == std::experimental::search(b1, e1, s));
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
- int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sj = sizeof(ij)/sizeof(ij[0]);
- int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sk = sizeof(ik)/sizeof(ik[0]);
- do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
- char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sj = sizeof(ij)/sizeof(ij[0]);
- char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sk = sizeof(ik)/sizeof(ik[0]);
- do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
deleted file mode 100644
index 4677c3a..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore_horspool searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_horspool_searcher {
-// public:
-// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
-};
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) {
- std::experimental::boyer_moore_horspool_searcher<Iter2,
- MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>>
- s{b2, e2};
- assert(result == std::experimental::search(b1, e1, s));
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp
deleted file mode 100644
index 2191ad1..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore_horspool searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_horspool_searcher {
-// public:
-// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
-};
-
-struct count_equal
-{
- static unsigned count;
- template <class T>
- bool operator()(const T& x, const T& y) const
- {++count; return x == y;}
-};
-
-unsigned count_equal::count = 0;
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
- std::experimental::boyer_moore_horspool_searcher<Iter2,
- MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>,
- count_equal>
- s{b2, e2};
- count_equal::count = 0;
- assert(result == std::experimental::search(b1, e1, s));
- assert(count_equal::count <= max_count);
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
deleted file mode 100644
index b97f52b..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// boyer_moore_horspool searcher
-// template<class RandomAccessIterator1,
-// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
-// class BinaryPredicate = equal_to<>>
-// class boyer_moore_horspool_searcher {
-// public:
-// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
-// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
-//
-// template<class RandomAccessIterator2>
-// pair<RandomAccessIterator2, RandomAccessIterator2>
-// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
-//
-// private:
-// RandomAccessIterator1 pat_first_; // exposition only
-// RandomAccessIterator1 pat_last_; // exposition only
-// Hash hash_; // exposition only
-// BinaryPredicate pred_; // exposition only
-// };
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-struct count_equal
-{
- static unsigned count;
- template <class T>
- bool operator()(const T& x, const T& y) const
- {++count; return x == y;}
-};
-
-unsigned count_equal::count = 0;
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
- std::experimental::boyer_moore_horspool_searcher<Iter2,
- typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2};
- count_equal::count = 0;
- assert(result == std::experimental::search(b1, e1, s));
- assert(count_equal::count <= max_count);
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-template <class Iter1, class Iter2>
-void
-test2()
-{
- char ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- char ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- char id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- char ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- char ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- char ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
- test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp
deleted file mode 100644
index 99cc8c3..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// default searcher
-// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-// class default_searcher {
-// public:
-// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
-// _BinaryPredicate __p = _BinaryPredicate())
-// : __first_(__f), __last_(__l), __pred_(__p) {}
-//
-// template <typename _ForwardIterator2>
-// pair<_ForwardIterator2, _ForwardIterator2>
-// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const {
-// return std::search(__f, __l, __first_, __last_, __pred_);
-// }
-//
-// private:
-// _ForwardIterator __first_;
-// _ForwardIterator __last_;
-// _BinaryPredicate __pred_;
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
- std::experimental::default_searcher<Iter2> s{b2, e2};
- assert(result == std::experimental::search(b1, e1, s));
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
- int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sj = sizeof(ij)/sizeof(ij[0]);
- int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sk = sizeof(ik)/sizeof(ik[0]);
- do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
-}
-
-int main(int, char**) {
- test<forward_iterator<const int*>, forward_iterator<const int*> >();
- test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<forward_iterator<const int*>, random_access_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
- test<random_access_iterator<const int*>, forward_iterator<const int*> >();
- test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp
deleted file mode 100644
index 5901dfb..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// UNSUPPORTED: c++03, c++11
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// default searcher
-// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-// class default_searcher {
-// public:
-// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
-// _BinaryPredicate __p = _BinaryPredicate())
-// : __first_(__f), __last_(__l), __pred_(__p) {}
-//
-// template <typename _ForwardIterator2>
-// pair<_ForwardIterator2, _ForwardIterator2>
-// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const {
-// return std::search(__f, __l, __first_, __last_, __pred_);
-// }
-//
-// private:
-// _ForwardIterator __first_;
-// _ForwardIterator __last_;
-// _BinaryPredicate __pred_;
-// };
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-struct count_equal
-{
- static unsigned count;
- template <class T>
- bool operator()(const T& x, const T& y) const
- {++count; return x == y;}
-};
-
-unsigned count_equal::count = 0;
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
- std::experimental::default_searcher<Iter2, count_equal> s{b2, e2};
- count_equal::count = 0;
- assert(result == std::experimental::search(b1, e1, s));
- assert(count_equal::count <= max_count);
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<forward_iterator<const int*>, forward_iterator<const int*> >();
- test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<forward_iterator<const int*>, random_access_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
- test<random_access_iterator<const int*>, forward_iterator<const int*> >();
- test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp
deleted file mode 100644
index f5ec9ff..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// template<class ForwardIterator, class BinaryPredicate = equal_to<>>
-// default_searcher<ForwardIterator, BinaryPredicate>
-// make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
-// BinaryPredicate pred = BinaryPredicate());
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
- assert(result == std::experimental::search(b1, e1,
- std::experimental::make_default_searcher(b2, e2)));
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
- int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sj = sizeof(ij)/sizeof(ij[0]);
- int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
- const unsigned sk = sizeof(ik)/sizeof(ik[0]);
- do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
-}
-
-int main(int, char**) {
- test<forward_iterator<const int*>, forward_iterator<const int*> >();
- test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<forward_iterator<const int*>, random_access_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
- test<random_access_iterator<const int*>, forward_iterator<const int*> >();
- test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp
deleted file mode 100644
index 196d028..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-
-// <functional>
-
-// template<class ForwardIterator, class BinaryPredicate = equal_to<>>
-// default_searcher<ForwardIterator, BinaryPredicate>
-// make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
-// BinaryPredicate pred = BinaryPredicate());
-
-
-#include <experimental/algorithm>
-#include <experimental/functional>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_iterators.h"
-
-struct count_equal
-{
- static unsigned count;
- template <class T>
- bool operator()(const T& x, const T& y)
- {++count; return x == y;}
-};
-
-unsigned count_equal::count = 0;
-
-template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
- count_equal::count = 0;
- assert(result == std::experimental::search(b1, e1,
- std::experimental::make_default_searcher(b2, e2)));
- assert(count_equal::count <= max_count);
-}
-
-template <class Iter1, class Iter2>
-void
-test()
-{
- int ia[] = {0, 1, 2, 3, 4, 5};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
- do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
- do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
- do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
- int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
- int ic[] = {1};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
- int id[] = {1, 2};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
- int ie[] = {1, 2, 3};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
- int ig[] = {1, 2, 3, 4};
- do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
- int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
- const unsigned sh = sizeof(ih)/sizeof(ih[0]);
- int ii[] = {1, 1, 2};
- do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
-}
-
-int main(int, char**) {
- test<forward_iterator<const int*>, forward_iterator<const int*> >();
- test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<forward_iterator<const int*>, random_access_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
- test<random_access_iterator<const int*>, forward_iterator<const int*> >();
- test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
- test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/func/header.functional.synop/includes.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/func/header.functional.synop/includes.pass.cpp
deleted file mode 100644
index 040f2bd..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/func/header.functional.synop/includes.pass.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/functional>
-//
-// has to include <functional>
-
-#include <experimental/functional>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::function<int(int)> x;
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp
deleted file mode 100644
index 94b94d8..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// constexpr explicit operator bool() const noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
- static_assert(std::is_nothrow_constructible<bool, C>::value, "");
- static_assert(!std::is_convertible<C, bool>::value, "");
- {
- constexpr C c; ((void)c);
- static_assert(bool(c) == false, "");
- }
- { // null case
- const C c = {}; ((void)c);
- ASSERT_NOEXCEPT(bool(c));
- if (c)
- assert(false);
- else
- assert(true);
- assert(c.address() == nullptr);
- assert(bool(c) == false);
- }
- { // non-null case
- char dummy = 42;
- C c = C::from_address((void*)&dummy);
- assert(c.address() == &dummy);
- assert(bool(c) == true);
- }
-}
-
-int main(int, char**)
-{
- do_test<coro::coroutine_handle<>>();
- do_test<coro::coroutine_handle<int>>();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp
deleted file mode 100644
index e8757ea..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// bool operator==(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator!=(coroutine_handle<>, coroutine_handle<>) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test(uintptr_t LHSVal, uintptr_t RHSVal) {
- const C LHS = C::from_address(reinterpret_cast<void*>(LHSVal));
- const C RHS = C::from_address(reinterpret_cast<void*>(RHSVal));
- const bool ExpectIsEqual = (LHSVal == RHSVal);
- assert((LHS == RHS) == ExpectIsEqual);
- assert((RHS == LHS) == ExpectIsEqual);
- assert((LHS != RHS) == !ExpectIsEqual);
- assert((RHS != LHS) == !ExpectIsEqual);
- {
- static_assert(noexcept(LHS == RHS), "");
- static_assert(noexcept(LHS != RHS), "");
- ASSERT_SAME_TYPE(decltype(LHS == RHS), bool);
- ASSERT_SAME_TYPE(decltype(LHS != RHS), bool);
- }
-}
-
-int main(int, char**)
-{
- std::pair<uintptr_t, uintptr_t> const TestCases[] = {
- {0, 0},
- {16, 16},
- {0, 16},
- {16, 0}
- };
- for (auto& TC : TestCases) {
- do_test<coro::coroutine_handle<>>(TC.first, TC.second);
- do_test<coro::coroutine_handle<int>>(TC.first, TC.second);
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp
deleted file mode 100644
index ce1d06c..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// bool operator<(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator>(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator>=(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator<=(coroutine_handle<>, coroutine_handle<>) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test(uintptr_t LHSVal, uintptr_t RHSVal) {
- const C LHS = C::from_address(reinterpret_cast<void*>(LHSVal));
- const C RHS = C::from_address(reinterpret_cast<void*>(RHSVal));
- assert((LHS < RHS) == (LHSVal < RHSVal));
- assert((RHS < LHS) == (RHSVal < LHSVal));
- assert((LHS > RHS) == (LHSVal > RHSVal));
- assert((RHS > LHS) == (RHSVal > LHSVal));
- assert((LHS <= RHS) == (LHSVal <= RHSVal));
- assert((RHS <= LHS) == (RHSVal <= LHSVal));
- assert((LHS >= RHS) == (LHSVal >= RHSVal));
- assert((RHS >= LHS) == (RHSVal >= LHSVal));
- {
- static_assert(noexcept(LHS < RHS), "");
- static_assert(noexcept(LHS > RHS), "");
- static_assert(noexcept(LHS <= RHS), "");
- static_assert(noexcept(LHS >= RHS), "");
- ASSERT_SAME_TYPE(decltype(LHS < RHS), bool);
- ASSERT_SAME_TYPE(decltype(LHS > RHS), bool);
- ASSERT_SAME_TYPE(decltype(LHS <= RHS), bool);
- ASSERT_SAME_TYPE(decltype(LHS >= RHS), bool);
- }
-}
-
-int main(int, char**)
-{
- std::pair<uintptr_t, uintptr_t> const TestCases[] = {
- {0, 0},
- {16, 16},
- {0, 16},
- {16, 0}
- };
- for (auto& TC : TestCases) {
- do_test<coro::coroutine_handle<>>(TC.first, TC.second);
- do_test<coro::coroutine_handle<int>>(TC.first, TC.second);
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
deleted file mode 100644
index ecb34ec..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// bool done() const
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise> const& H) {
- // FIXME Add a runtime test
- {
- ASSERT_SAME_TYPE(decltype(H.done()), bool);
- LIBCPP_ASSERT_NOT_NOEXCEPT(H.done());
- }
-}
-
-int main(int, char**)
-{
- do_test(coro::coroutine_handle<>{});
- do_test(coro::coroutine_handle<int>{});
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp
deleted file mode 100644
index c0f5bb5..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// coroutine_handle& operator=(nullptr_t) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
- int dummy = 42;
- void* dummy_h = &dummy;
- {
- C c; ((void)c);
- static_assert(std::is_nothrow_assignable<C&, std::nullptr_t>::value, "");
- static_assert(!std::is_assignable<C&, void*>::value, "");
- }
- {
- C c = C::from_address(dummy_h);
- assert(c.address() == &dummy);
- c = nullptr;
- assert(c.address() == nullptr);
- c = nullptr;
- assert(c.address() == nullptr);
- }
- {
- C c;
- C& cr = (c = nullptr);
- assert(&c == &cr);
- }
-}
-
-int main(int, char**)
-{
- do_test<coro::coroutine_handle<>>();
- do_test<coro::coroutine_handle<int>>();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp
deleted file mode 100644
index b525d79..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// constexpr coroutine_handle() noexcept
-// constexpr coroutine_handle(nullptr_t) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
- {
- constexpr C c;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
- static_assert(c.address() == nullptr, "");
- }
- {
- constexpr C c(nullptr);
- static_assert(std::is_nothrow_constructible<C, std::nullptr_t>::value, "");
- static_assert(c.address() == nullptr, "");
- }
- {
- C c;
- assert(c.address() == nullptr);
- }
- {
- C c(nullptr);
- assert(c.address() == nullptr);
- }
-}
-
-int main(int, char**)
-{
- do_test<coro::coroutine_handle<>>();
- do_test<coro::coroutine_handle<int>>();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp
deleted file mode 100644
index 08dafd4..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// constexpr void* address() const noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
- {
- constexpr C c; ((void)c);
- static_assert(c.address() == nullptr, "");
- }
- {
- const C c = {}; ((void)c);
- ASSERT_NOEXCEPT(c.address());
- ASSERT_SAME_TYPE(decltype(c.address()), void*);
- assert(c.address() == nullptr);
- }
- {
- char dummy = 42;
- C c = C::from_address((void*)&dummy);
- assert(c.address() == &dummy);
- }
-}
-
-int main(int, char**)
-{
- do_test<coro::coroutine_handle<>>();
- do_test<coro::coroutine_handle<int>>();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
deleted file mode 100644
index d02ae2f..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// static coroutine_handle from_address(void*) noexcept
-
-// Test that `from_address` is explicitly ill-formed when called with a typed
-// pointer. The user cannot possibly have a typed pointer to the coroutine.
-// FIXME: This behavior is an extension, and should upstreamed into the TS or
-// the test removed if the TS changes are rejected.
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-namespace coro = std::experimental;
-
-int main(int, char**)
-{
- {
- using H = coro::coroutine_handle<>;
- // expected-error@experimental/coroutine:* 3 {{coroutine_handle<void>::from_address cannot be called with non-void pointers}}
- H::from_address((int*)nullptr); // expected-note {{requested here}}
- H::from_address((const void*)nullptr); // expected-note {{requested here}}
- H::from_address((const char*)nullptr); // expected-note {{requested here}}
- }
- {
- using H = coro::coroutine_handle<int>;
- // expected-error-re@experimental/coroutine:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}coroutine_handle<promise_type>::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead}}
- H::from_address((const char*)nullptr); // expected-note {{requested here}}
- // expected-error@experimental/coroutine:* 1 {{coroutine_handle<promise_type>::from_address cannot be called with non-void pointers}}
- H::from_address((int*)nullptr); // expected-note {{requested here}}
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp
deleted file mode 100644
index 75052af..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// static coroutine_handle from_address(void*) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
- {
- C c = C::from_address(nullptr);
- static_assert(noexcept(C::from_address(nullptr)), "");
- // FIXME: Should the return type not be 'C'?
- static_assert(std::is_same<decltype(C::from_address(nullptr)), C>::value, "");
- assert(c.address() == nullptr);
- }
- {
- char dummy = 42;
- C c = C::from_address((void*)&dummy);
- assert(c.address() == &dummy);
- }
-}
-
-int main(int, char**)
-{
- do_test<coro::coroutine_handle<>>();
- do_test<coro::coroutine_handle<int>>();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
deleted file mode 100644
index 0fd56b3..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// namespace std {
-// template <class P> struct hash<experimental::coroutine_handle<P>>;
-// }
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-#include <functional>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test(uintptr_t LHSVal, uintptr_t RHSVal) {
- const size_t ExpectLHS = std::hash<void*>{}(reinterpret_cast<void*>(LHSVal));
- const size_t ExpectRHS = std::hash<void*>{}(reinterpret_cast<void*>(RHSVal));
- const C LHS = C::from_address(reinterpret_cast<void*>(LHSVal));
- const C RHS = C::from_address(reinterpret_cast<void*>(RHSVal));
- const std::hash<C> h;
- // FIXME: libc++'s implementation hash's the result of LHS.address(), so we
- // expect that value. However this is not required.
- assert(h(LHS) == ExpectLHS);
- assert(h(RHS) == ExpectRHS);
- assert((h(LHS) == h(RHS)) == (LHSVal == RHSVal));
- {
- ASSERT_SAME_TYPE(decltype(h(LHS)), size_t);
- ASSERT_NOEXCEPT(std::hash<C>{}(LHS));
- }
-}
-
-int main(int, char**)
-{
- std::pair<uintptr_t, uintptr_t> const TestCases[] = {
- {0, 0},
- {0, 8},
- {8, 8},
- {8, 16}
- };
- for (auto& TC : TestCases) {
- do_test<coro::coroutine_handle<>>(TC.first, TC.second);
- do_test<coro::coroutine_handle<int>>(TC.first, TC.second);
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp
deleted file mode 100644
index de53b0a..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-// UNSUPPORTED: ubsan
-
-// <experimental/coroutine>
-// struct noop_coroutine_promise;
-// using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
-// noop_coroutine_handle noop_coroutine() noexcept;
-
-#include <experimental/coroutine>
-#include <cassert>
-#include <type_traits>
-
-#include "test_macros.h"
-
-#if TEST_HAS_BUILTIN(__builtin_coro_noop)
-
-namespace coro = std::experimental::coroutines_v1;
-
-
-static_assert(std::is_same<coro::coroutine_handle<coro::noop_coroutine_promise>, coro::noop_coroutine_handle>::value, "");
-static_assert(std::is_same<decltype(coro::noop_coroutine()), coro::noop_coroutine_handle>::value, "");
-
-// template <> struct coroutine_handle<noop_coroutine_promise> : coroutine_handle<>
-// {
-// // 18.11.2.7 noop observers
-// constexpr explicit operator bool() const noexcept;
-// constexpr bool done() const noexcept;
-
-// // 18.11.2.8 noop resumption
-// constexpr void operator()() const noexcept;
-// constexpr void resume() const noexcept;
-// constexpr void destroy() const noexcept;
-
-// // 18.11.2.9 noop promise access
-// noop_coroutine_promise& promise() const noexcept;
-
-// // 18.11.2.10 noop address
-// constexpr void* address() const noexcept;
-
-int main(int, char**)
-{
- auto h = coro::noop_coroutine();
- coro::coroutine_handle<> base = h;
-
- assert(h);
- assert(base);
-
- assert(!h.done());
- assert(!base.done());
-
- h.resume();
- h.destroy();
- h();
- static_assert(h.done() == false, "");
- static_assert(h, "");
-
- h.promise();
- assert(h.address() == base.address());
- assert(h.address() != nullptr);
- assert(coro::coroutine_handle<>::from_address(h.address()) == base);
-
- return 0;
-}
-
-#else
-
-int main(int, char**) { return 0; }
-
-#endif // TEST_HAS_BUILTIN(__builtin_coro_noop)
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp
deleted file mode 100644
index d493e1c..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise>
-// struct coroutine_handle<Promise>;
-
-// Promise& promise() const
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-struct MyCoro {
- struct promise_type {
- void unhandled_exception() {}
- void return_void() {}
- coro::suspend_never initial_suspend() { return {}; }
- coro::suspend_never final_suspend() noexcept { return {}; }
- MyCoro get_return_object() {
- do_runtime_test();
- return {};
- }
- void do_runtime_test() {
- // Test that a coroutine_handle<const T> can be created from a const
- // promise_type and that it represents the same coroutine as
- // coroutine_handle<T>
- using CH = coro::coroutine_handle<promise_type>;
- using CCH = coro::coroutine_handle<const promise_type>;
- const auto &cthis = *this;
- CH h = CH::from_promise(*this);
- CCH h2 = CCH::from_promise(*this);
- CCH h3 = CCH::from_promise(cthis);
- assert(&h.promise() == this);
- assert(&h2.promise() == this);
- assert(&h3.promise() == this);
- assert(h.address() == h2.address());
- assert(h2.address() == h3.address());
- }
- };
-};
-
-MyCoro do_runtime_test() {
- co_await coro::suspend_never{};
-}
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise>&& H) {
-
- // FIXME Add a runtime test
- {
- ASSERT_SAME_TYPE(decltype(H.promise()), Promise&);
- LIBCPP_ASSERT_NOT_NOEXCEPT(H.promise());
- }
- {
- auto const& CH = H;
- ASSERT_SAME_TYPE(decltype(CH.promise()), Promise&);
- LIBCPP_ASSERT_NOT_NOEXCEPT(CH.promise());
- }
-}
-
-int main(int, char**)
-{
- do_test(coro::coroutine_handle<int>{});
- do_test(coro::coroutine_handle<const int>{});
- do_runtime_test();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp
deleted file mode 100644
index 3a27f2a..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// void destroy()
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class H>
-auto has_destroy_imp(H&& h, int) -> decltype(h.destroy(), std::true_type{});
-template <class H>
-auto has_destroy_imp(H&&, long) -> std::false_type;
-
-template <class H>
-constexpr bool has_destroy() {
- return decltype(has_destroy_imp(std::declval<H>(), 0))::value;
-}
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise>&& H) {
- using HType = coro::coroutine_handle<Promise>;
- // FIXME Add a runtime test
- {
- ASSERT_SAME_TYPE(decltype(H.destroy()), void);
- LIBCPP_ASSERT_NOT_NOEXCEPT(H.destroy());
- static_assert(has_destroy<HType&>(), "");
- static_assert(has_destroy<HType&&>(), "");
- }
- {
- static_assert(!has_destroy<HType const&>(), "");
- static_assert(!has_destroy<HType const&&>(), "");
- }
-}
-
-int main(int, char**)
-{
- do_test(coro::coroutine_handle<>{});
- do_test(coro::coroutine_handle<int>{});
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp
deleted file mode 100644
index 77d8d63..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// void operator()()
-// void resume()
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-
-template <class H>
-auto has_resume_imp(H&& h, int) -> decltype(h.resume(), std::true_type{});
-template <class H>
-auto has_resume_imp(H&&, long) -> std::false_type;
-
-template <class H>
-constexpr bool has_resume() {
- return decltype(has_resume_imp(std::declval<H>(), 0))::value;
-}
-
-
-template <class H>
-auto has_call_operator_imp(H&& h, int) -> decltype(h(), std::true_type{});
-template <class H>
-auto has_call_operator_imp(H&&, long) -> std::false_type;
-
-template <class H>
-constexpr bool has_call_operator() {
- return decltype(has_call_operator_imp(std::declval<H>(), 0))::value;
-}
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise>&& H) {
- using HType = coro::coroutine_handle<Promise>;
- // FIXME Add a runtime test
- {
- ASSERT_SAME_TYPE(decltype(H.resume()), void);
- ASSERT_SAME_TYPE(decltype(H()), void);
- LIBCPP_ASSERT_NOT_NOEXCEPT(H.resume());
- LIBCPP_ASSERT_NOT_NOEXCEPT(H());
- static_assert(has_resume<HType&>(), "");
- static_assert(has_resume<HType&&>(), "");
- static_assert(has_call_operator<HType&>(), "");
- static_assert(has_call_operator<HType&&>(), "");
- }
- {
- static_assert(!has_resume<HType const&>(), "");
- static_assert(!has_resume<HType const&&>(), "");
- static_assert(!has_call_operator<HType const&>(), "");
- static_assert(!has_call_operator<HType const&&>(), "");
- }
-}
-
-int main(int, char**)
-{
- do_test(coro::coroutine_handle<>{});
- do_test(coro::coroutine_handle<int>{});
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp
deleted file mode 100644
index 1f48408..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-struct A {
- using promise_type = A*;
-};
-
-struct B {};
-struct C {};
-
-namespace std { namespace experimental {
- template <>
- struct coroutine_traits<::A, int> {
- using promise_type = int*;
- };
- template <class ...Args>
- struct coroutine_traits<::B, Args...> {
- using promise_type = B*;
- };
- template <>
- struct coroutine_traits<::C> {
- using promise_type = void;
- };
-}}
-
-template <class Expect, class T, class ...Args>
-void check_type() {
- using P = typename coro::coroutine_traits<T, Args...>::promise_type ;
- static_assert(std::is_same<P, Expect>::value, "");
-};
-
-int main(int, char**)
-{
- check_type<A*, A>();
- check_type<int*, A, int>();
- check_type<B*, B>();
- check_type<void, C>();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp
deleted file mode 100644
index dd95493..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class T, class = typename T::promise_type>
-constexpr bool has_promise_type(int) { return true; }
-template <class>
-constexpr bool has_promise_type(long) { return false; }
-template <class T>
-constexpr bool has_promise_type() { return has_promise_type<T>(0); }
-
-struct A {
- using promise_type = A*;
-};
-
-struct B {};
-struct C {};
-struct D {
-private:
- using promise_type = void;
-};
-struct E {};
-
-namespace std { namespace experimental {
- template <>
- struct coroutine_traits<::A, int> {
- using promise_type = int*;
- };
- template <class ...Args>
- struct coroutine_traits<::B, Args...> {
- using promise_type = B*;
- };
- template <>
- struct coroutine_traits<::C> {
- using promise_type = void;
- };
-}}
-
-template <class Expect, class T, class ...Args>
-void check_type() {
- using Traits = coro::coroutine_traits<T, Args...>;
- static_assert(has_promise_type<Traits>(), "");
- static_assert(std::is_same<typename Traits::promise_type, Expect>::value, "");
-}
-
-template <class T, class ...Args>
-void check_no_type() {
- using Traits = coro::coroutine_traits<T, Args...>;
- static_assert(!has_promise_type<Traits>(), "");
-}
-
-int main(int, char**)
-{
- {
- check_type<A*, A>();
- check_type<int*, A, int>();
- check_type<B*, B>();
- check_type<void, C>();
- }
- {
- check_no_type<D>();
- check_no_type<E>();
- check_no_type<C, int>();
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
deleted file mode 100644
index dd5673b..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-#include <utility>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-using SuspendT = std::experimental::coroutines_v1::suspend_always;
-
-constexpr bool check_suspend_constexpr() {
- SuspendT s;
- const SuspendT scopy(s); (void)scopy;
- SuspendT smove(std::move(s)); (void)smove;
- s = scopy;
- s = std::move(smove);
- return true;
-}
-
-int main(int, char**)
-{
- using H = coro::coroutine_handle<>;
- using S = SuspendT;
- H h{};
- S s{};
- S const& cs = s;
- {
- LIBCPP_STATIC_ASSERT(noexcept(s.await_ready()), "");
- static_assert(std::is_same<decltype(s.await_ready()), bool>::value, "");
- assert(s.await_ready() == false);
- assert(cs.await_ready() == false);
- }
- {
- LIBCPP_STATIC_ASSERT(noexcept(s.await_suspend(h)), "");
- static_assert(std::is_same<decltype(s.await_suspend(h)), void>::value, "");
- s.await_suspend(h);
- cs.await_suspend(h);
- }
- {
- LIBCPP_STATIC_ASSERT(noexcept(s.await_resume()), "");
- static_assert(std::is_same<decltype(s.await_resume()), void>::value, "");
- s.await_resume();
- cs.await_resume();
- }
- {
- static_assert(std::is_nothrow_default_constructible<S>::value, "");
- static_assert(std::is_nothrow_copy_constructible<S>::value, "");
- static_assert(std::is_nothrow_move_constructible<S>::value, "");
- static_assert(std::is_nothrow_copy_assignable<S>::value, "");
- static_assert(std::is_nothrow_move_assignable<S>::value, "");
- static_assert(std::is_trivially_copyable<S>::value, "");
- static_assert(check_suspend_constexpr(), "");
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
deleted file mode 100644
index 8d59d6a..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-#include <utility>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-using SuspendT = std::experimental::coroutines_v1::suspend_never;
-
-constexpr bool check_suspend_constexpr() {
- SuspendT s;
- const SuspendT scopy(s); (void)scopy;
- SuspendT smove(std::move(s)); (void)smove;
- s = scopy;
- s = std::move(smove);
- return true;
-}
-
-
-int main(int, char**)
-{
- using H = coro::coroutine_handle<>;
- using S = SuspendT;
- H h{};
- S s{};
- S const& cs = s;
- {
- LIBCPP_STATIC_ASSERT(noexcept(s.await_ready()), "");
- static_assert(std::is_same<decltype(s.await_ready()), bool>::value, "");
- assert(s.await_ready() == true);
- assert(cs.await_ready() == true);
- }
- {
- LIBCPP_STATIC_ASSERT(noexcept(s.await_suspend(h)), "");
- static_assert(std::is_same<decltype(s.await_suspend(h)), void>::value, "");
- s.await_suspend(h);
- cs.await_suspend(h);
- }
- {
- LIBCPP_STATIC_ASSERT(noexcept(s.await_resume()), "");
- static_assert(std::is_same<decltype(s.await_resume()), void>::value, "");
- s.await_resume();
- cs.await_resume();
- }
- {
- static_assert(std::is_nothrow_default_constructible<S>::value, "");
- static_assert(std::is_nothrow_copy_constructible<S>::value, "");
- static_assert(std::is_nothrow_move_constructible<S>::value, "");
- static_assert(std::is_nothrow_copy_assignable<S>::value, "");
- static_assert(std::is_nothrow_move_assignable<S>::value, "");
- static_assert(std::is_trivially_copyable<S>::value, "");
- static_assert(check_suspend_constexpr(), "");
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
deleted file mode 100644
index 2b4dac2..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-struct coro_t {
- struct promise_type {
- coro_t get_return_object() {
- coroutine_handle<promise_type>{};
- return {};
- }
- suspend_never initial_suspend() { return {}; }
- suspend_never final_suspend() noexcept { return {}; }
- void return_void() {}
- static void unhandled_exception() {}
- };
-};
-
-struct B {
- ~B() {}
- bool await_ready() { return true; }
- B await_resume() { return {}; }
- template <typename F> void await_suspend(F) {}
-};
-
-
-struct A {
- ~A() {}
- bool await_ready() { return true; }
- int await_resume() { return 42; }
- template <typename F> void await_suspend(F) {}
-};
-
-int last_value = -1;
-void set_value(int x) {
- last_value = x;
-}
-
-coro_t f(int n) {
- if (n == 0) {
- set_value(0);
- co_return;
- }
- int val = co_await A{};
- ((void)val);
- set_value(42);
-}
-
-coro_t g() { B val = co_await B{}; }
-
-int main(int, char**) {
- last_value = -1;
- f(0);
- assert(last_value == 0);
- f(1);
- assert(last_value == 42);
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
deleted file mode 100644
index 611ee25..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// See https://llvm.org/PR33271
-// UNSUPPORTED: ubsan
-
-#include <experimental/coroutine>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-struct coro_t {
- struct promise_type {
- coro_t get_return_object() {
- return coroutine_handle<promise_type>::from_promise(*this);
- }
- suspend_never initial_suspend() { return {}; }
- suspend_never final_suspend() noexcept { return {}; }
- void return_void() {}
- void unhandled_exception() {}
- };
- coro_t(coroutine_handle<promise_type> hh) : h(hh) {}
- coroutine_handle<promise_type> h;
-};
-
-struct NoSuspend {
- bool await_ready() { return false; }
- void await_resume() {}
- template <typename F> bool await_suspend(F) { return false; }
-};
-
-struct DoSuspend {
- bool await_ready() { return false; }
- void await_resume() {}
- template <typename F> bool await_suspend(F) { return true; }
-};
-
-bool f_started, f_resumed = false;
-coro_t f() {
- f_started = true;
- co_await DoSuspend{};
- f_resumed = true;
-}
-
-bool g_started, g_resumed = false;
-coro_t g() {
- g_started = true;
- co_await NoSuspend{};
- g_resumed = true;
-}
-
-int main(int, char**) {
- assert(!f_started && !f_resumed && !g_started && !g_resumed);
- auto fret = f();
- assert(f_started && !f_resumed);
- fret.h.destroy();
- assert(f_started && !f_resumed);
- g();
- assert(g_started && g_resumed);
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
deleted file mode 100644
index 59618e2..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <cassert>
-#include <memory>
-
-#include "test_macros.h"
-using namespace std::experimental;
-
-struct error_tag { };
-
-template <typename T, typename Error = int>
-struct expected {
-
- struct Data {
- Data() : val(), error() { }
- Data(T v, Error e) : val(v), error(e) { }
- T val;
- Error error;
- };
- std::shared_ptr<Data> data;
-
- expected(T val) : data(std::make_shared<Data>(val, Error())) {}
- expected(error_tag, Error error) : data(std::make_shared<Data>(T(), error)) {}
- expected(std::shared_ptr<Data> p) : data(p) {}
-
- struct promise_type {
- std::shared_ptr<Data> data;
- expected get_return_object() { data = std::make_shared<Data>(); return {data}; }
- suspend_never initial_suspend() { return {}; }
- suspend_never final_suspend() noexcept { return {}; }
- void return_value(T v) { data->val = v; data->error = {}; }
- void unhandled_exception() {}
- };
-
- bool await_ready() { return !data->error; }
- T await_resume() { return data->val; }
- void await_suspend(coroutine_handle<promise_type> h) {
- h.promise().data->error = data->error;
- h.destroy();
- }
-
- T const& value() { return data->val; }
- Error const& error() { return data->error; }
-};
-
-expected<int> g() { return {0}; }
-expected<int> h() { return {error_tag{}, 42}; }
-
-extern "C" void print(int);
-
-bool f1_started, f1_resumed = false;
-expected<int> f1() {
- f1_started = true;
- (void)(co_await g());
- f1_resumed = true;
- co_return 100;
-}
-
-bool f2_started, f2_resumed = false;
-expected<int> f2() {
- f2_started = true;
- (void)(co_await h());
- f2_resumed = true;
- co_return 200;
-}
-
-int main(int, char**) {
- auto c1 = f1();
- assert(f1_started && f1_resumed);
- assert(c1.value() == 100);
- assert(c1.error() == 0);
-
- auto c2 = f2();
- assert(f2_started && !f2_resumed);
- assert(c2.value() == 0);
- assert(c2.error() == 42);
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp
deleted file mode 100644
index de1b054..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-int alive = 0;
-int ctor_called = 0;
-int dtor_called = 0;
-void reset() {
- assert(alive == 0);
- alive = 0;
- ctor_called = 0;
- dtor_called = 0;
-}
-struct Noisy {
- Noisy() { ++alive; ++ctor_called; }
- ~Noisy() { --alive; ++dtor_called; }
-#if TEST_STD_VER > 14
- Noisy(Noisy const&) = delete;
-#else
- // FIXME: This test depends on copy elision taking place in C++14
- // (pre-C++17 guaranteed copy elision)
- Noisy(Noisy const&);
-#endif
-};
-
-struct Bug {
- bool await_ready() { return true; }
- void await_suspend(std::experimental::coroutine_handle<>) {}
- Noisy await_resume() { return {}; }
-};
-struct coro2 {
- struct promise_type {
- suspend_never initial_suspend() { return{}; }
- suspend_never final_suspend() noexcept { return {}; }
- coro2 get_return_object() { return{}; }
- void return_void() {}
- Bug yield_value(int) { return {}; }
- void unhandled_exception() {}
- };
-};
-
-// Checks that destructors are correctly invoked for the object returned by
-// coawait.
-coro2 a() {
- reset();
- {
- auto x = co_await Bug{};
- assert(alive == 1);
- assert(ctor_called == 1);
- assert(dtor_called == 0);
- ((void)x);
- }
- assert(alive == 0);
- assert(dtor_called == 1);
-}
-
-coro2 b() {
- reset();
- {
- (void)(co_await Bug{});
- assert(ctor_called == 1);
- assert(dtor_called == 1);
- assert(alive == 0);
- }
- assert(ctor_called == 1);
- assert(dtor_called == 1);
- assert(alive == 0);
-
-}
-
-coro2 c() {
- reset();
- {
- auto x = co_yield 42;
- assert(alive == 1);
- assert(ctor_called == 1);
- assert(dtor_called == 0);
- }
- assert(alive == 0);
- assert(ctor_called == 1);
- assert(dtor_called == 1);
-}
-
-coro2 d() {
- reset();
- {
- (void)(co_yield 42);
- assert(ctor_called == 1);
- assert(dtor_called == 1);
- assert(alive == 0);
- }
- assert(alive == 0);
- assert(ctor_called == 1);
- assert(dtor_called == 1);
-}
-
-int main(int, char**) {
- a();
- b();
- c();
- d();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp
deleted file mode 100644
index 2a05e8e..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// See https://llvm.org/PR33271
-// UNSUPPORTED: ubsan
-
-#include <experimental/coroutine>
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-
-
-template <typename Ty> struct generator {
- struct promise_type {
- Ty current_value;
- std::experimental::suspend_always yield_value(Ty value) {
- this->current_value = value;
- return {};
- }
- std::experimental::suspend_always initial_suspend() { return {}; }
- std::experimental::suspend_always final_suspend() noexcept { return {}; }
- generator get_return_object() { return generator{this}; };
- void return_void() {}
- void unhandled_exception() {}
- };
-
- struct iterator {
- std::experimental::coroutine_handle<promise_type> _Coro;
- bool _Done;
-
- iterator(std::experimental::coroutine_handle<promise_type> Coro, bool Done)
- : _Coro(Coro), _Done(Done) {}
-
- iterator &operator++() {
- _Coro.resume();
- _Done = _Coro.done();
- return *this;
- }
-
- bool operator==(iterator const &_Right) const {
- return _Done == _Right._Done;
- }
-
- bool operator!=(iterator const &_Right) const { return !(*this == _Right); }
-
- Ty const &operator*() const { return _Coro.promise().current_value; }
-
- Ty const *operator->() const { return &(operator*()); }
- };
-
- iterator begin() {
- p.resume();
- return {p, p.done()};
- }
-
- iterator end() { return {p, true}; }
-
- generator(generator &&rhs) : p(rhs.p) { rhs.p = nullptr; }
-
- ~generator() {
- if (p)
- p.destroy();
- }
-
-private:
- explicit generator(promise_type *p)
- : p(std::experimental::coroutine_handle<promise_type>::from_promise(*p)) {}
-
- std::experimental::coroutine_handle<promise_type> p;
-};
-
-struct minig {
- struct promise_type {
- int current_value;
- std::experimental::suspend_always yield_value(int value) {
- this->current_value = value;
- return {};
- }
- std::experimental::suspend_always initial_suspend() { return {}; }
- std::experimental::suspend_always final_suspend() noexcept { return {}; }
- minig get_return_object() { return minig{this}; };
- void return_void() {}
- void unhandled_exception() {}
- };
-
- bool move_next() {
- p.resume();
- return !p.done();
- }
- int current_value() { return p.promise().current_value; }
-
- minig(minig &&rhs) : p(rhs.p) { rhs.p = nullptr; }
-
- ~minig() {
- if (p)
- p.destroy();
- }
-
-private:
- explicit minig(promise_type *p)
- : p(std::experimental::coroutine_handle<promise_type>::from_promise(*p)) {}
-
- std::experimental::coroutine_handle<promise_type> p;
-};
-
-
-minig mini_count(int n) {
- for (int i = 0; i < n; i++) {
- co_yield i;
- }
-}
-
-generator<int> count(int n) {
- for (int i = 0; i < n; ++i)
- co_yield i;
-}
-
-generator<int> range(int from, int n) {
- for (int i = from; i < n; ++i)
- co_yield i;
-}
-
-void test_count() {
- const std::vector<int> expect = {0, 1, 2, 3, 4};
- std::vector<int> got;
- for (auto x : count(5))
- got.push_back(x);
- assert(expect == got);
-}
-
-void test_range() {
- int sum = 0;
- for (auto v: range(1, 20))
- sum += v;
- assert(sum == 190);
-}
-
-void test_mini_generator() {
- int sum = 0;
- auto g = mini_count(5);
- while (g.move_next()) {
- sum += g.current_value();
- }
- assert(sum == 10);
-}
-
-int main(int, char**) {
- test_count();
- test_range();
- test_mini_generator();
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp
deleted file mode 100644
index 3e323ad..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-bool cancel = false;
-
-struct goroutine
-{
- static int const N = 10;
- static int count;
- static coroutine_handle<> stack[N];
-
- static void schedule(coroutine_handle<>& rh)
- {
- assert(count < N);
- stack[count++] = rh;
- rh = nullptr;
- }
-
- ~goroutine() {}
-
- static void go(goroutine) {}
-
- static void run_one()
- {
- assert(count > 0);
- stack[--count]();
- }
-
- struct promise_type
- {
- suspend_never initial_suspend() {
- return {};
- }
- suspend_never final_suspend() noexcept { return {}; }
- void return_void() {}
- goroutine get_return_object() {
- return{};
- }
- void unhandled_exception() {}
- };
-};
-int goroutine::count;
-coroutine_handle<> goroutine::stack[N];
-
-coroutine_handle<goroutine::promise_type> workaround;
-
-class channel;
-
-struct push_awaiter {
- channel* ch;
- bool await_ready() {return false; }
- void await_suspend(coroutine_handle<> rh);
- void await_resume() {}
-};
-
-struct pull_awaiter {
- channel * ch;
-
- bool await_ready();
- void await_suspend(coroutine_handle<> rh);
- int await_resume();
-};
-
-class channel
-{
- using T = int;
-
- friend struct push_awaiter;
- friend struct pull_awaiter;
-
- T const* pvalue = nullptr;
- coroutine_handle<> reader = nullptr;
- coroutine_handle<> writer = nullptr;
-public:
- push_awaiter push(T const& value)
- {
- assert(pvalue == nullptr);
- assert(!writer);
- pvalue = &value;
-
- return { this };
- }
-
- pull_awaiter pull()
- {
- assert(!reader);
-
- return { this };
- }
-
- void sync_push(T const& value)
- {
- assert(!pvalue);
- pvalue = &value;
- assert(reader);
- reader();
- assert(!pvalue);
- reader = nullptr;
- }
-
- auto sync_pull()
- {
- while (!pvalue) goroutine::run_one();
- auto result = *pvalue;
- pvalue = nullptr;
- if (writer)
- {
- auto wr = writer;
- writer = nullptr;
- wr();
- }
- return result;
- }
-};
-
-void push_awaiter::await_suspend(coroutine_handle<> rh)
-{
- ch->writer = rh;
- if (ch->reader) goroutine::schedule(ch->reader);
-}
-
-
-bool pull_awaiter::await_ready() {
- return !!ch->writer;
-}
-void pull_awaiter::await_suspend(coroutine_handle<> rh) {
- ch->reader = rh;
-}
-int pull_awaiter::await_resume() {
- auto result = *ch->pvalue;
- ch->pvalue = nullptr;
- if (ch->writer) {
- //goroutine::schedule(ch->writer);
- auto wr = ch->writer;
- ch->writer = nullptr;
- wr();
- }
- return result;
-}
-
-goroutine pusher(channel& left, channel& right)
-{
- for (;;) {
- auto val = co_await left.pull();
- co_await right.push(val + 1);
- }
-}
-
-const int N = 100;
-channel* c = new channel[N + 1];
-
-int main(int, char**) {
- for (int i = 0; i < N; ++i)
- goroutine::go(pusher(c[i], c[i + 1]));
-
- c[0].sync_push(0);
- int result = c[N].sync_pull();
-
- assert(result == 100);
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp
deleted file mode 100644
index dd8c5ea..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-#include <experimental/coroutine>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-// This file tests, multishot, movable std::function like thing using coroutine
-// for compile-time type erasure and unerasure.
-template <typename R> struct func {
- struct Input {R a, b;};
-
- struct promise_type {
- Input* I;
- R result;
- func get_return_object() { return {this}; }
- suspend_always initial_suspend() { return {}; }
- suspend_never final_suspend() noexcept { return {}; }
- void return_void() {}
- template <typename F>
- suspend_always yield_value(F&& f) {
- result = f(I->a, I->b);
- return {};
- }
- void unhandled_exception() {}
- };
-
- R operator()(Input I) {
- h.promise().I = &I;
- h.resume();
- R result = h.promise().result;
- return result;
- };
-
- func() {}
- func(func &&rhs) : h(rhs.h) { rhs.h = nullptr; }
- func(func const &) = delete;
-
- func &operator=(func &&rhs) {
- if (this != &rhs) {
- if (h)
- h.destroy();
- h = rhs.h;
- rhs.h = nullptr;
- }
- return *this;
- }
-
- template <typename F> static func Create(F f) {
- for (;;) {
- co_yield f;
- }
- }
-
- template <typename F> func(F f) : func(Create(f)) {}
-
- ~func() {
- if (h)
- h.destroy();
- }
-
-private:
- func(promise_type *promise)
- : h(coroutine_handle<promise_type>::from_promise(*promise)) {}
- coroutine_handle<promise_type> h;
-};
-
-int Do(int acc, int n, func<int> f) {
- for (int i = 0; i < n; ++i)
- acc = f({acc, i});
- return acc;
-}
-
-int main(int, char**) {
- int result = Do(1, 10, [](int a, int b) {return a + b;});
- assert(result == 46);
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
deleted file mode 100644
index 105ca8a..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// XFAIL: libcpp-has-debug-mode
-
-#include <experimental/coroutine>
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-// This file tests, one shot, movable std::function like thing using coroutine
-// for compile-time type erasure and unerasure.
-
-template <typename R> struct func {
- struct promise_type {
- R result;
- func get_return_object() { return {this}; }
- suspend_always initial_suspend() { return {}; }
- suspend_always final_suspend() noexcept { return {}; }
- void return_value(R v) { result = v; }
- void unhandled_exception() {}
- };
-
- R operator()() {
- h.resume();
- R result = h.promise().result;
- h.destroy();
- h = nullptr;
- return result;
- };
-
- func() {}
- func(func &&rhs) : h(rhs.h) { rhs.h = nullptr; }
- func(func const &) = delete;
-
- func &operator=(func &&rhs) {
- if (this != &rhs) {
- if (h)
- h.destroy();
- h = rhs.h;
- rhs.h = nullptr;
- }
- return *this;
- }
-
- template <typename F> static func Create(F f) { co_return f(); }
-
- template <typename F> func(F f) : func(Create(f)) {}
-
- ~func() {
- if (h)
- h.destroy();
- }
-
-private:
- func(promise_type *promise)
- : h(coroutine_handle<promise_type>::from_promise(*promise)) {}
- coroutine_handle<promise_type> h;
-};
-
-std::vector<int> yielded_values = {};
-int yield(int x) { yielded_values.push_back(x); return x + 1; }
-float fyield(int x) { yielded_values.push_back(x); return static_cast<float>(x + 2); }
-
-void Do1(func<int> f) { yield(f()); }
-void Do2(func<double> f) { yield(static_cast<int>(f())); }
-
-int main(int, char**) {
- Do1([] { return yield(43); });
- assert((yielded_values == std::vector<int>{43, 44}));
-
- yielded_values = {};
- Do2([] { return fyield(44); });
- assert((yielded_values == std::vector<int>{44, 46}));
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/includes.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/includes.pass.cpp
deleted file mode 100644
index ea39576..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/includes.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-
-// <experimental/coroutine>
-
-// Test that <experimental/coroutine> includes <new>
-
-#include <experimental/coroutine>
-
-int main(int, char**) {
- // std::nothrow is not implicitly defined by the compiler when the include is
- // missing, unlike other parts of <new>. Therefore we use std::nothrow to
- // test for #include <new>
-
- (void)std::nothrow;
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg b/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg
deleted file mode 100644
index 223de62..0000000
--- a/third_party/llvm-project/libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg
+++ /dev/null
@@ -1,8 +0,0 @@
-# If the compiler doesn't support coroutines mark all of the tests under
-# this directory as unsupported. Otherwise add the required `-fcoroutines-ts`
-# flag.
-if 'fcoroutines-ts' not in config.available_features:
- config.unsupported = True
-else:
- config.test_format.addCompileFlags(config, '-fcoroutines-ts')
- config.test_format.addCompileFlags(config, '-Wno-coroutine')
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
index b4faa68..2f5a43d 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
index f198c52..3153c56 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
index 14d53e4..908e32c 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
index 297235e..289d2ee 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
@@ -36,7 +33,7 @@
namespace ex = std::experimental::pmr;
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
void testForSizeAndAlign() {
struct T { alignas(Align) char data[S]; };
TestResource R;
@@ -52,7 +49,7 @@
}
#ifndef TEST_HAS_NO_EXCEPTIONS
-template <size_t S>
+template <std::size_t S>
void testAllocForSizeThrows() {
struct T { char data[S]; };
using Alloc = ex::polymorphic_allocator<T>;
@@ -61,14 +58,14 @@
Alloc a(&R);
// Test that allocating exactly the max size does not throw.
- size_t maxSize = Traits::max_size(a);
+ std::size_t maxSize = Traits::max_size(a);
try {
a.allocate(maxSize);
} catch (...) {
assert(false);
}
- size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
+ std::size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
if (maxSize != sizeTypeMax)
{
// Test that allocating size_t(~0) throws bad_array_new_length.
@@ -79,7 +76,7 @@
}
// Test that allocating even one more than the max size does throw.
- size_t overSize = maxSize + 1;
+ std::size_t overSize = maxSize + 1;
try {
a.allocate(overSize);
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
index 9d653a6..17b9758 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
index dbfddf5..0c09d4c 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
index 0d90844..e442e7e 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
index 6641c93..d203864 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
index 0a5b250..c7f49fd 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
index af30ef0..47fbb99 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
index 08716b3..252044a 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
index 0084d37..bdcc581 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
@@ -34,7 +31,7 @@
namespace ex = std::experimental::pmr;
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
void testForSizeAndAlign() {
struct T { alignas(Align) char data[S]; };
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
index 039a1c7..4075404 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
index 9959573..afe614b 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
index be8673f..d80cb2f 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
index 03fde4d..919c867 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/deque>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
index 614b8c4..0a3c771 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/forward_list>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
index c786a4e..cd9150c 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/list>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
index 0671cc7..b59b7f1 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/map>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
index 397cb26..c650c87 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
@@ -9,10 +9,7 @@
// UNSUPPORTED: c++03
// UNSUPPORTED: no-localization
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/regex>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
index ee75125..dcb8290 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/set>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
index d8acb05..818c669 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/string>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
index c106829..5f55cc8 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
index 7cdf1ea..4c80a0c 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
index 0a503bc..783843b 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/vector>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
index 12d1124..2378d37 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
@@ -11,10 +11,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
index 44b00cb..f308752 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
@@ -32,10 +29,10 @@
struct assert_on_compare : public ex::memory_resource
{
protected:
- void * do_allocate(size_t, size_t) override
+ void * do_allocate(std::size_t, size_t) override
{ assert(false); return nullptr; }
- void do_deallocate(void *, size_t, size_t) override
+ void do_deallocate(void *, std::size_t, size_t) override
{ assert(false); }
bool do_is_equal(ex::memory_resource const &) const noexcept override
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
index 8ac9b8b..e9f57db 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
@@ -8,10 +8,7 @@
// UNSUPPORTED: c++03
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-aligned_allocation-missing
// <experimental/memory_resource>
@@ -32,10 +29,10 @@
struct assert_on_compare : public ex::memory_resource
{
protected:
- void * do_allocate(size_t, size_t) override
+ void * do_allocate(std::size_t, size_t) override
{ assert(false); return nullptr; }
- void do_deallocate(void *, size_t, size_t) override
+ void do_deallocate(void *, std::size_t, size_t) override
{ assert(false); }
bool do_is_equal(ex::memory_resource const &) const noexcept override
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.abi/vector_extension.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.abi/vector_extension.pass.cpp
index 35a45381a..e918276 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.abi/vector_extension.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.abi/vector_extension.pass.cpp
@@ -42,26 +42,26 @@
sizeof(ex::simd<char, ex::__simd_abi<ex::_StorageKind::_VecExt, 12>>) == 16,
"");
static_assert(
- sizeof(ex::simd<int32_t, ex::__simd_abi<ex::_StorageKind::_VecExt, 3>>) ==
+ sizeof(ex::simd<std::int32_t, ex::__simd_abi<ex::_StorageKind::_VecExt, 3>>) ==
16,
"");
static_assert(
- sizeof(ex::simd<int32_t, ex::__simd_abi<ex::_StorageKind::_VecExt, 5>>) ==
+ sizeof(ex::simd<std::int32_t, ex::__simd_abi<ex::_StorageKind::_VecExt, 5>>) ==
32,
"");
static_assert(
- std::is_same<ex::simd_abi::native<int8_t>,
+ std::is_same<ex::simd_abi::native<std::int8_t>,
ex::__simd_abi<ex::_StorageKind::_VecExt, reg_width()>>::value,
"");
#else
static_assert(
- std::is_same<ex::simd_abi::native<int8_t>,
+ std::is_same<ex::simd_abi::native<std::int8_t>,
ex::__simd_abi<ex::_StorageKind::_Array, reg_width()>>::value,
"");
#endif
-static_assert(std::is_same<ex::simd_abi::compatible<int8_t>,
+static_assert(std::is_same<ex::simd_abi::compatible<std::int8_t>,
ex::__simd_abi<ex::_StorageKind::_Array, 16>>::value,
"");
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
index 2ca5ec4..a8ec36c 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
@@ -26,7 +26,7 @@
void test_access() {
{
SimdType a(42), b(4);
- static_assert(std::is_convertible<decltype(a[0]), int8_t>::value, "");
+ static_assert(std::is_convertible<decltype(a[0]), std::int8_t>::value, "");
assert(a[0] == 42);
assert(!a[0] == !42);
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp
index 038af4b..3a58f9f 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp
@@ -22,26 +22,26 @@
namespace ex = std::experimental::parallelism_v2;
static_assert(
- std::is_same<decltype(ex::simd_cast<int32_t>(ex::native_simd<int32_t>())),
- ex::native_simd<int32_t>>::value,
+ std::is_same<decltype(ex::simd_cast<std::int32_t>(ex::native_simd<std::int32_t>())),
+ ex::native_simd<std::int32_t>>::value,
"");
-static_assert(std::is_same<decltype(ex::simd_cast<int64_t>(
- ex::fixed_size_simd<int32_t, 4>())),
- ex::fixed_size_simd<int64_t, 4>>::value,
+static_assert(std::is_same<decltype(ex::simd_cast<std::int64_t>(
+ ex::fixed_size_simd<std::int32_t, 4>())),
+ ex::fixed_size_simd<std::int64_t, 4>>::value,
"");
static_assert(
- std::is_same<decltype(ex::simd_cast<ex::fixed_size_simd<int64_t, 1>>(
- ex::simd<int32_t, ex::simd_abi::scalar>())),
- ex::fixed_size_simd<int64_t, 1>>::value,
+ std::is_same<decltype(ex::simd_cast<ex::fixed_size_simd<std::int64_t, 1>>(
+ ex::simd<std::int32_t, ex::simd_abi::scalar>())),
+ ex::fixed_size_simd<std::int64_t, 1>>::value,
"");
static_assert(
std::is_same<
- decltype(ex::simd_cast<ex::simd<int64_t, ex::simd_abi::scalar>>(
- ex::fixed_size_simd<int32_t, 1>())),
- ex::simd<int64_t, ex::simd_abi::scalar>>::value,
+ decltype(ex::simd_cast<ex::simd<std::int64_t, ex::simd_abi::scalar>>(
+ ex::fixed_size_simd<std::int32_t, 1>())),
+ ex::simd<std::int64_t, ex::simd_abi::scalar>>::value,
"");
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
index 94f9cb7..edf6ba5 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
@@ -37,43 +37,43 @@
void supported_native_simd_ctor(...) = delete;
void compile_narrowing_conversion() {
- supported_native_simd_ctor<int8_t>(3);
- supported_native_simd_ctor<int16_t>(3);
- supported_native_simd_ctor<int32_t>(3);
- supported_native_simd_ctor<int64_t>(3);
- supported_native_simd_ctor<uint8_t>(3);
- supported_native_simd_ctor<uint16_t>(3);
- supported_native_simd_ctor<uint32_t>(3);
- supported_native_simd_ctor<uint64_t>(3);
+ supported_native_simd_ctor<std::int8_t>(3);
+ supported_native_simd_ctor<std::int16_t>(3);
+ supported_native_simd_ctor<std::int32_t>(3);
+ supported_native_simd_ctor<std::int64_t>(3);
+ supported_native_simd_ctor<std::uint8_t>(3);
+ supported_native_simd_ctor<std::uint16_t>(3);
+ supported_native_simd_ctor<std::uint32_t>(3);
+ supported_native_simd_ctor<std::uint64_t>(3);
supported_native_simd_ctor<float>(3.f);
supported_native_simd_ctor<double>(3.);
supported_native_simd_ctor<long double>(3.);
not_supported_native_simd_ctor<float>(3.);
- not_supported_native_simd_ctor<int8_t>(long(3));
+ not_supported_native_simd_ctor<std::int8_t>(long(3));
not_supported_native_simd_ctor<float>(long(3));
not_supported_native_simd_ctor<int>(3.);
}
void compile_convertible() {
struct ConvertibleToInt {
- operator int64_t() const;
+ operator std::int64_t() const;
};
- supported_native_simd_ctor<int64_t>(ConvertibleToInt());
+ supported_native_simd_ctor<std::int64_t>(ConvertibleToInt());
struct NotConvertibleToInt {};
- not_supported_native_simd_ctor<int64_t>(NotConvertibleToInt());
+ not_supported_native_simd_ctor<std::int64_t>(NotConvertibleToInt());
}
void compile_unsigned() {
not_supported_native_simd_ctor<int>(3u);
- supported_native_simd_ctor<uint16_t>(3u);
+ supported_native_simd_ctor<std::uint16_t>(3u);
}
template <typename SimdType>
void test_broadcast() {
SimdType a(3);
- for (size_t i = 0; i < a.size(); i++) {
+ for (std::size_t i = 0; i < a.size(); i++) {
assert(a[i] == 3);
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/default.pass.cpp
index feba23e..753917e 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/default.pass.cpp
@@ -21,10 +21,10 @@
namespace ex = std::experimental::parallelism_v2;
int main(int, char**) {
- static_assert(ex::native_simd<int32_t>().size() > 0, "");
- static_assert(ex::fixed_size_simd<int32_t, 4>().size() == 4, "");
- static_assert(ex::fixed_size_simd<int32_t, 5>().size() == 5, "");
- static_assert(ex::fixed_size_simd<int32_t, 1>().size() == 1, "");
+ static_assert(ex::native_simd<std::int32_t>().size() > 0, "");
+ static_assert(ex::fixed_size_simd<std::int32_t, 4>().size() == 4, "");
+ static_assert(ex::fixed_size_simd<std::int32_t, 5>().size() == 5, "");
+ static_assert(ex::fixed_size_simd<std::int32_t, 1>().size() == 1, "");
static_assert(ex::fixed_size_simd<char, 32>().size() == 32, "");
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
index ace829f..05a1289 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
@@ -38,8 +38,8 @@
void supported_simd128_ctor(...) = delete;
struct identity {
- template <size_t value>
- int operator()(std::integral_constant<size_t, value>) const {
+ template <std::size_t value>
+ int operator()(std::integral_constant<std::size_t, value>) const {
return value;
}
};
@@ -47,21 +47,21 @@
void compile_generator() {
supported_simd128_ctor<int>(identity());
not_supported_simd128_ctor<int>([](int i) { return float(i); });
- not_supported_simd128_ctor<int>([](intptr_t i) { return (int*)(i); });
+ not_supported_simd128_ctor<int>([](std::intptr_t i) { return (int*)(i); });
not_supported_simd128_ctor<int>([](int* i) { return i; });
}
struct limited_identity {
- template <size_t value>
- typename std::conditional<value <= 2, int32_t, int64_t>::type
- operator()(std::integral_constant<size_t, value>) const {
+ template <std::size_t value>
+ typename std::conditional<value <= 2, std::int32_t, std::int64_t>::type
+ operator()(std::integral_constant<std::size_t, value>) const {
return value;
}
};
void compile_limited_identity() {
- supported_simd128_ctor<int64_t>(limited_identity());
- not_supported_simd128_ctor<int32_t>(limited_identity());
+ supported_simd128_ctor<std::int64_t>(limited_identity());
+ not_supported_simd128_ctor<std::int32_t>(limited_identity());
}
template <typename SimdType>
@@ -84,9 +84,9 @@
int main(int, char**) {
// TODO: adjust the tests when this assertion fails.
- assert(ex::native_simd<int32_t>::size() >= 4);
- test_generator<ex::native_simd<int32_t>>();
- test_generator<ex::fixed_size_simd<int32_t, 4>>();
+ assert(ex::native_simd<std::int32_t>::size() >= 4);
+ test_generator<ex::native_simd<std::int32_t>>();
+ test_generator<ex::fixed_size_simd<std::int32_t, 4>>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/load.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/load.pass.cpp
index c4b352a..ff29e71 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/load.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.cons/load.pass.cpp
@@ -38,13 +38,13 @@
void compile_load_ctor() {
supported_native_simd_ctor<int>((int*)nullptr, ex::element_aligned_tag());
- supported_native_simd_ctor<uint32_t>((int*)nullptr,
+ supported_native_simd_ctor<std::uint32_t>((int*)nullptr,
ex::element_aligned_tag());
supported_native_simd_ctor<double>((float*)nullptr,
ex::element_aligned_tag());
- supported_native_simd_ctor<uint16_t>((unsigned int*)nullptr,
+ supported_native_simd_ctor<std::uint16_t>((unsigned int*)nullptr,
ex::element_aligned_tag());
- supported_native_simd_ctor<uint32_t>((float*)nullptr,
+ supported_native_simd_ctor<std::uint32_t>((float*)nullptr,
ex::element_aligned_tag());
not_supported_native_simd_ctor<int>((int*)nullptr, int());
@@ -52,7 +52,7 @@
template <typename SimdType>
void test_load_ctor() {
- alignas(32) int32_t buffer[] = {4, 3, 2, 1};
+ alignas(32) std::int32_t buffer[] = {4, 3, 2, 1};
{
SimdType a(buffer, ex::element_aligned_tag());
assert(a[0] == 4);
@@ -110,11 +110,11 @@
int main(int, char**) {
// TODO: adjust the tests when this assertion fails.
- assert(ex::native_simd<int32_t>::size() >= 4);
- test_load_ctor<ex::native_simd<int32_t>>();
- test_load_ctor<ex::fixed_size_simd<int32_t, 4>>();
- test_converting_load_ctor<ex::native_simd<int32_t>>();
- test_converting_load_ctor<ex::fixed_size_simd<int32_t, 4>>();
+ assert(ex::native_simd<std::int32_t>::size() >= 4);
+ test_load_ctor<ex::native_simd<std::int32_t>>();
+ test_load_ctor<ex::fixed_size_simd<std::int32_t, 4>>();
+ test_converting_load_ctor<ex::native_simd<std::int32_t>>();
+ test_converting_load_ctor<ex::fixed_size_simd<std::int32_t, 4>>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/load.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/load.pass.cpp
index a888117..c036d4f 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/load.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/load.pass.cpp
@@ -39,17 +39,17 @@
void compile_load() {
supported_load<int>((int*)nullptr, ex::element_aligned_tag());
- supported_load<uint32_t>((int*)nullptr, ex::element_aligned_tag());
+ supported_load<std::uint32_t>((int*)nullptr, ex::element_aligned_tag());
supported_load<double>((float*)nullptr, ex::element_aligned_tag());
- supported_load<uint16_t>((unsigned int*)nullptr, ex::element_aligned_tag());
- supported_load<uint32_t>((float*)nullptr, ex::element_aligned_tag());
+ supported_load<std::uint16_t>((unsigned int*)nullptr, ex::element_aligned_tag());
+ supported_load<std::uint32_t>((float*)nullptr, ex::element_aligned_tag());
not_supported_load<int>((int*)nullptr, int());
}
template <typename SimdType>
void test_load() {
- alignas(32) int32_t buffer[] = {4, 3, 2, 1};
+ alignas(32) std::int32_t buffer[] = {4, 3, 2, 1};
{
SimdType a;
a.copy_from(buffer, ex::element_aligned_tag());
@@ -114,11 +114,11 @@
int main(int, char**) {
// TODO: adjust the tests when this assertion fails.
- assert(ex::native_simd<int32_t>::size() >= 4);
- test_load<ex::native_simd<int32_t>>();
- test_load<ex::fixed_size_simd<int32_t, 4>>();
- test_converting_load<ex::native_simd<int32_t>>();
- test_converting_load<ex::fixed_size_simd<int32_t, 4>>();
+ assert(ex::native_simd<std::int32_t>::size() >= 4);
+ test_load<ex::native_simd<std::int32_t>>();
+ test_load<ex::fixed_size_simd<std::int32_t, 4>>();
+ test_converting_load<ex::native_simd<std::int32_t>>();
+ test_converting_load<ex::fixed_size_simd<std::int32_t, 4>>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/store.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/store.pass.cpp
index d3ead60..932ecfc 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/store.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.mem/store.pass.cpp
@@ -25,7 +25,7 @@
void test_store() {
SimdType a([](int i) { return 4 - i; });
{
- alignas(32) int32_t buffer[4] = {0};
+ alignas(32) std::int32_t buffer[4] = {0};
a.copy_to(buffer, ex::element_aligned_tag());
assert(buffer[0] == 4);
assert(buffer[1] == 3);
@@ -33,7 +33,7 @@
assert(buffer[3] == 1);
}
{
- alignas(32) int32_t buffer[4] = {0};
+ alignas(32) std::int32_t buffer[4] = {0};
a.copy_to(buffer, ex::vector_aligned_tag());
assert(buffer[0] == 4);
assert(buffer[1] == 3);
@@ -41,7 +41,7 @@
assert(buffer[3] == 1);
}
{
- alignas(32) int32_t buffer[4] = {0};
+ alignas(32) std::int32_t buffer[4] = {0};
a.copy_to(buffer, ex::overaligned_tag<32>());
assert(buffer[0] == 4);
assert(buffer[1] == 3);
@@ -50,7 +50,7 @@
}
{
- alignas(32) int32_t buffer[4] = {0};
+ alignas(32) std::int32_t buffer[4] = {0};
a.copy_to(buffer, ex::element_aligned);
assert(buffer[0] == 4);
assert(buffer[1] == 3);
@@ -58,7 +58,7 @@
assert(buffer[3] == 1);
}
{
- alignas(32) int32_t buffer[4] = {0};
+ alignas(32) std::int32_t buffer[4] = {0};
a.copy_to(buffer, ex::vector_aligned);
assert(buffer[0] == 4);
assert(buffer[1] == 3);
@@ -66,7 +66,7 @@
assert(buffer[3] == 1);
}
{
- alignas(32) int32_t buffer[4] = {0};
+ alignas(32) std::int32_t buffer[4] = {0};
a.copy_to(buffer, ex::overaligned<32>);
assert(buffer[0] == 4);
assert(buffer[1] == 3);
@@ -88,10 +88,10 @@
int main(int, char**) {
// TODO: adjust the tests when this assertion fails.
- test_store<ex::native_simd<int32_t>>();
- test_store<ex::fixed_size_simd<int32_t, 4>>();
- test_converting_store<ex::native_simd<int32_t>>();
- test_converting_store<ex::fixed_size_simd<int32_t, 4>>();
+ test_store<ex::native_simd<std::int32_t>>();
+ test_store<ex::fixed_size_simd<std::int32_t, 4>>();
+ test_converting_store<ex::native_simd<std::int32_t>>();
+ test_converting_store<ex::fixed_size_simd<std::int32_t, 4>>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp
index cfe8167..4d0883b 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp
@@ -23,25 +23,25 @@
struct UserType {};
-static_assert(ex::is_abi_tag<ex::simd_abi::native<int8_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<int16_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<int32_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<int64_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<uint8_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<uint16_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<uint32_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::native<uint64_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::int8_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::int16_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::int32_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::int64_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::uint8_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::uint16_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::uint32_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::native<std::uint64_t>>::value, "");
static_assert(ex::is_abi_tag<ex::simd_abi::native<float>>::value, "");
static_assert(ex::is_abi_tag<ex::simd_abi::native<double>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int8_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int16_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int32_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int64_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint8_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint16_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint32_t>>::value, "");
-static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint64_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::int8_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::int16_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::int32_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::int64_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::uint8_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::uint16_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::uint32_t>>::value, "");
+static_assert(ex::is_abi_tag<ex::simd_abi::compatible<std::uint64_t>>::value, "");
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<float>>::value, "");
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<double>>::value, "");
@@ -66,25 +66,25 @@
static_assert(!ex::is_abi_tag<ex::simd_mask<int>>::value, "");
static_assert(!ex::is_abi_tag<ex::simd_mask<float>>::value, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int8_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int16_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int32_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int64_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint8_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint16_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint32_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint64_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::int8_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::int16_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::int32_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::int64_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::uint8_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::uint16_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::uint32_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::native<std::uint64_t>>, "");
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<float>>, "");
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<double>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int8_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int16_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int32_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int64_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint8_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint16_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint32_t>>, "");
-static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint64_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::int8_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::int16_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::int32_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::int64_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::uint8_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::uint16_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::uint32_t>>, "");
+static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<std::uint64_t>>, "");
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<float>>, "");
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<double>>, "");
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd.pass.cpp
index 6c7449e..dc20adf 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd.pass.cpp
@@ -23,47 +23,47 @@
struct UserType {};
-static_assert(ex::is_simd<ex::native_simd<int8_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<int16_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<int32_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<int64_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<uint8_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<uint16_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<uint32_t>>::value, "");
-static_assert(ex::is_simd<ex::native_simd<uint64_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::int8_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::int16_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::int32_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::int64_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::uint8_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::uint16_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::uint32_t>>::value, "");
+static_assert(ex::is_simd<ex::native_simd<std::uint64_t>>::value, "");
static_assert(ex::is_simd<ex::native_simd<float>>::value, "");
static_assert(ex::is_simd<ex::native_simd<double>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int8_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int16_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int32_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int64_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint8_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint16_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint32_t, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint64_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int8_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int16_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int32_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int64_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint8_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint16_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint32_t, 1>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint64_t, 1>>::value, "");
static_assert(ex::is_simd<ex::fixed_size_simd<float, 1>>::value, "");
static_assert(ex::is_simd<ex::fixed_size_simd<double, 1>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int8_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int16_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int32_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int64_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint8_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint16_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint32_t, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint64_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int8_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int16_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int32_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int64_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint8_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint16_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint32_t, 3>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint64_t, 3>>::value, "");
static_assert(ex::is_simd<ex::fixed_size_simd<float, 3>>::value, "");
static_assert(ex::is_simd<ex::fixed_size_simd<double, 3>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int8_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int16_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int32_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<int64_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint8_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint16_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint32_t, 32>>::value, "");
-static_assert(ex::is_simd<ex::fixed_size_simd<uint64_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int8_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int16_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int32_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::int64_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint8_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint16_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint32_t, 32>>::value, "");
+static_assert(ex::is_simd<ex::fixed_size_simd<std::uint64_t, 32>>::value, "");
static_assert(ex::is_simd<ex::fixed_size_simd<float, 32>>::value, "");
static_assert(ex::is_simd<ex::fixed_size_simd<double, 32>>::value, "");
@@ -74,47 +74,47 @@
static_assert(!ex::is_simd<ex::simd_mask<float>>::value, "");
static_assert(!ex::is_simd<UserType>::value, "");
-static_assert(ex::is_simd_v<ex::native_simd<int8_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<int16_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<int32_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<int64_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<uint8_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<uint16_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<uint32_t>>, "");
-static_assert(ex::is_simd_v<ex::native_simd<uint64_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::int8_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::int16_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::int32_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::int64_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::uint8_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::uint16_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::uint32_t>>, "");
+static_assert(ex::is_simd_v<ex::native_simd<std::uint64_t>>, "");
static_assert(ex::is_simd_v<ex::native_simd<float>>, "");
static_assert(ex::is_simd_v<ex::native_simd<double>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int8_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int16_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int32_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int64_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint8_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint16_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint32_t, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint64_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int8_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int16_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int32_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int64_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint8_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint16_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint32_t, 1>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint64_t, 1>>, "");
static_assert(ex::is_simd_v<ex::fixed_size_simd<float, 1>>, "");
static_assert(ex::is_simd_v<ex::fixed_size_simd<double, 1>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int8_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int16_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int32_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int64_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint8_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint16_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint32_t, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint64_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int8_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int16_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int32_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int64_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint8_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint16_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint32_t, 3>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint64_t, 3>>, "");
static_assert(ex::is_simd_v<ex::fixed_size_simd<float, 3>>, "");
static_assert(ex::is_simd_v<ex::fixed_size_simd<double, 3>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int8_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int16_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int32_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<int64_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint8_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint16_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint32_t, 32>>, "");
-static_assert(ex::is_simd_v<ex::fixed_size_simd<uint64_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int8_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int16_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int32_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::int64_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint8_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint16_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint32_t, 32>>, "");
+static_assert(ex::is_simd_v<ex::fixed_size_simd<std::uint64_t, 32>>, "");
static_assert(ex::is_simd_v<ex::fixed_size_simd<float, 32>>, "");
static_assert(ex::is_simd_v<ex::fixed_size_simd<double, 32>>, "");
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp
index 1e7b046..e174a7c 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp
@@ -32,8 +32,8 @@
static_assert(!ex::is_simd_flag_type<int>::value, "");
static_assert(!ex::is_simd_flag_type<float>::value, "");
static_assert(!ex::is_simd_flag_type<UserType>::value, "");
-static_assert(!ex::is_simd_flag_type<ex::simd<int8_t>>::value, "");
-static_assert(!ex::is_simd_flag_type<ex::simd_mask<int8_t>>::value, "");
+static_assert(!ex::is_simd_flag_type<ex::simd<std::int8_t>>::value, "");
+static_assert(!ex::is_simd_flag_type<ex::simd_mask<std::int8_t>>::value, "");
static_assert(ex::is_simd_flag_type_v<ex::element_aligned_tag>, "");
static_assert(ex::is_simd_flag_type_v<ex::vector_aligned_tag>, "");
@@ -44,8 +44,8 @@
static_assert(!ex::is_simd_flag_type_v<int>, "");
static_assert(!ex::is_simd_flag_type_v<float>, "");
static_assert(!ex::is_simd_flag_type_v<UserType>, "");
-static_assert(!ex::is_simd_flag_type_v<ex::simd<int8_t>>, "");
-static_assert(!ex::is_simd_flag_type_v<ex::simd_mask<int8_t>>, "");
+static_assert(!ex::is_simd_flag_type_v<ex::simd<std::int8_t>>, "");
+static_assert(!ex::is_simd_flag_type_v<ex::simd_mask<std::int8_t>>, "");
int main(int, char**) {
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp
index a495af4..b9d6cf8 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp
@@ -23,68 +23,68 @@
struct UserType {};
-static_assert(ex::is_simd_mask<ex::native_simd_mask<int8_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<int16_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<int32_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<int64_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<uint8_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<uint16_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<uint32_t>>::value, "");
-static_assert(ex::is_simd_mask<ex::native_simd_mask<uint64_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::int8_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::int16_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::int32_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::int64_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::uint8_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::uint16_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::uint32_t>>::value, "");
+static_assert(ex::is_simd_mask<ex::native_simd_mask<std::uint64_t>>::value, "");
static_assert(ex::is_simd_mask<ex::native_simd_mask<float>>::value, "");
static_assert(ex::is_simd_mask<ex::native_simd_mask<double>>::value, "");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int8_t, 1>>::value, "");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int16_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int8_t, 1>>::value, "");
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int16_t, 1>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int32_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int32_t, 1>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int64_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int64_t, 1>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint8_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint8_t, 1>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint16_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint16_t, 1>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint32_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint32_t, 1>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint64_t, 1>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint64_t, 1>>::value,
"");
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<float, 1>>::value, "");
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<double, 1>>::value, "");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int8_t, 3>>::value, "");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int16_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int8_t, 3>>::value, "");
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int16_t, 3>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int32_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int32_t, 3>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int64_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int64_t, 3>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint8_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint8_t, 3>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint16_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint16_t, 3>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint32_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint32_t, 3>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint64_t, 3>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint64_t, 3>>::value,
"");
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<float, 3>>::value, "");
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<double, 3>>::value, "");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int8_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int8_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int16_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int16_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int32_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int32_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int64_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::int64_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint8_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint8_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint16_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint16_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint32_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint32_t, 32>>::value,
"");
-static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint64_t, 32>>::value,
+static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<std::uint64_t, 32>>::value,
"");
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<float, 32>>::value, "");
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<double, 32>>::value,
@@ -97,47 +97,47 @@
static_assert(!ex::is_simd_mask<ex::simd<float>>::value, "");
static_assert(!ex::is_simd_mask<UserType>::value, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int8_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int16_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int32_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int64_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint8_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint16_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint32_t>>, "");
-static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint64_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::int8_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::int16_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::int32_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::int64_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::uint8_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::uint16_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::uint32_t>>, "");
+static_assert(ex::is_simd_mask_v<ex::native_simd_mask<std::uint64_t>>, "");
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<float>>, "");
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<double>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int8_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int16_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int32_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int64_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint8_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint16_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint32_t, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint64_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int8_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int16_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int32_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int64_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint8_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint16_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint32_t, 1>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint64_t, 1>>, "");
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<float, 1>>, "");
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<double, 1>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int8_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int16_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int32_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int64_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint8_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint16_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint32_t, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint64_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int8_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int16_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int32_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int64_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint8_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint16_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint32_t, 3>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint64_t, 3>>, "");
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<float, 3>>, "");
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<double, 3>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int8_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int16_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int32_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int64_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint8_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint16_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint32_t, 32>>, "");
-static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint64_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int8_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int16_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int32_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::int64_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint8_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint16_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint32_t, 32>>, "");
+static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<std::uint64_t, 32>>, "");
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<float, 32>>, "");
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<double, 32>>, "");
diff --git a/third_party/llvm-project/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
index 01db1a8..65208ff 100644
--- a/third_party/llvm-project/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
@@ -24,7 +24,7 @@
{
typedef X first_argument_type;
- size_t operator()(const first_argument_type&) const
+ std::size_t operator()(const first_argument_type&) const
{
return 99;
}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
index 035dd1f..322787b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <fstream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
index 835cce6..84c4197 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <fstream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
index f75d115..e051099 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <fstream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
index afaaa54..a055c66 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// FILE_DEPENDENCIES: test.dat
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
index 5a53c17..11f84c8 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// FILE_DEPENDENCIES: test.dat
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
index f8a6d28..700247d 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <fstream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
index db7a267..f150cfa 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <fstream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp
index e3c240d..621c445 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp
@@ -19,13 +19,10 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
#include "test_convertible.h"
-TEST_SUITE(directory_entry_path_ctor_suite)
-
-TEST_CASE(copy_ctor) {
+static void copy_ctor() {
using namespace fs;
// Copy
{
@@ -42,7 +39,7 @@
}
}
-TEST_CASE(copy_ctor_copies_cache) {
+static void copy_ctor_copies_cache() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -55,8 +52,8 @@
fs::remove(sym);
directory_entry ent_cp(ent);
- TEST_CHECK(ent_cp.path() == sym);
- TEST_CHECK(ent_cp.is_symlink());
+ assert(ent_cp.path() == sym);
+ assert(ent_cp.is_symlink());
}
{
@@ -65,9 +62,14 @@
fs::remove(file);
directory_entry ent_cp(ent);
- TEST_CHECK(ent_cp.path() == file);
- TEST_CHECK(ent_cp.is_regular_file());
+ assert(ent_cp.path() == file);
+ assert(ent_cp.is_regular_file());
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ copy_ctor();
+ copy_ctor_copies_cache();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp
index 2b3dc83..6c551b5 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp
@@ -22,12 +22,9 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
-TEST_SUITE(directory_entry_ctor_suite)
-
-TEST_CASE(test_copy_assign_operator) {
+static void test_copy_assign_operator() {
using namespace fs;
// Copy
{
@@ -48,7 +45,7 @@
}
}
-TEST_CASE(copy_assign_copies_cache) {
+static void copy_assign_copies_cache() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -62,8 +59,8 @@
directory_entry ent_cp;
ent_cp = ent;
- TEST_CHECK(ent_cp.path() == sym);
- TEST_CHECK(ent_cp.is_symlink());
+ assert(ent_cp.path() == sym);
+ assert(ent_cp.is_symlink());
}
{
@@ -73,9 +70,14 @@
directory_entry ent_cp;
ent_cp = ent;
- TEST_CHECK(ent_cp.path() == file);
- TEST_CHECK(ent_cp.is_regular_file());
+ assert(ent_cp.path() == file);
+ assert(ent_cp.is_regular_file());
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_copy_assign_operator();
+ copy_assign_copies_cache();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp
index 4d59b42..05ebbc7 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp
@@ -19,13 +19,10 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
#include "test_convertible.h"
-TEST_SUITE(directory_entry_path_ctor_suite)
-
-TEST_CASE(move_ctor) {
+static void move_ctor() {
using namespace fs;
// Move
{
@@ -40,7 +37,7 @@
}
}
-TEST_CASE(move_ctor_copies_cache) {
+static void move_ctor_copies_cache() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -53,8 +50,8 @@
fs::remove(sym);
directory_entry ent_cp(std::move(ent));
- TEST_CHECK(ent_cp.path() == sym);
- TEST_CHECK(ent_cp.is_symlink());
+ assert(ent_cp.path() == sym);
+ assert(ent_cp.is_symlink());
}
{
@@ -63,9 +60,14 @@
fs::remove(file);
directory_entry ent_cp(std::move(ent));
- TEST_CHECK(ent_cp.path() == file);
- TEST_CHECK(ent_cp.is_regular_file());
+ assert(ent_cp.path() == file);
+ assert(ent_cp.is_regular_file());
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ move_ctor();
+ move_ctor_copies_cache();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp
index 945b294..6afb041 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp
@@ -22,12 +22,9 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
-TEST_SUITE(directory_entry_ctor_suite)
-
-TEST_CASE(test_move_assign_operator) {
+static void test_move_assign_operator() {
using namespace fs;
// Copy
{
@@ -44,7 +41,7 @@
}
}
-TEST_CASE(move_assign_copies_cache) {
+static void move_assign_copies_cache() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -58,8 +55,8 @@
directory_entry ent_cp;
ent_cp = std::move(ent);
- TEST_CHECK(ent_cp.path() == sym);
- TEST_CHECK(ent_cp.is_symlink());
+ assert(ent_cp.path() == sym);
+ assert(ent_cp.is_symlink());
}
{
@@ -69,9 +66,14 @@
directory_entry ent_cp;
ent_cp = std::move(ent);
- TEST_CHECK(ent_cp.path() == file);
- TEST_CHECK(ent_cp.is_regular_file());
+ assert(ent_cp.path() == file);
+ assert(ent_cp.is_regular_file());
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_move_assign_operator();
+ move_assign_copies_cache();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp
index 19148e7..a075781 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp
@@ -19,14 +19,12 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
#include "test_convertible.h"
-TEST_SUITE(directory_entry_path_ctor_suite)
-
-TEST_CASE(path_ctor) {
+static void path_ctor() {
using namespace fs;
{
static_assert(std::is_constructible<directory_entry, const path&>::value,
@@ -40,11 +38,11 @@
{
const path p("foo/bar/baz");
const directory_entry e(p);
- TEST_CHECK(e.path() == p);
+ assert(e.path() == p);
}
}
-TEST_CASE(path_ec_ctor) {
+static void path_ec_ctor() {
static_test_env static_env;
using namespace fs;
{
@@ -62,19 +60,19 @@
{
std::error_code ec = GetTestEC();
const directory_entry e(static_env.File, ec);
- TEST_CHECK(e.path() == static_env.File);
- TEST_CHECK(!ec);
+ assert(e.path() == static_env.File);
+ assert(!ec);
}
{
const path p("foo/bar/baz");
std::error_code ec = GetTestEC();
const directory_entry e(p, ec);
- TEST_CHECK(e.path() == p);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(e.path() == p);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
}
}
-TEST_CASE(path_ctor_calls_refresh) {
+static void path_ctor_calls_refresh() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -85,15 +83,15 @@
directory_entry ent(file);
std::error_code ec = GetTestEC();
directory_entry ent_ec(file, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
LIBCPP_ONLY(remove(file));
- TEST_CHECK(ent.exists());
- TEST_CHECK(ent_ec.exists());
+ assert(ent.exists());
+ assert(ent_ec.exists());
- TEST_CHECK(ent.file_size() == 42);
- TEST_CHECK(ent_ec.file_size() == 42);
+ assert(ent.file_size() == 42);
+ assert(ent_ec.file_size() == 42);
}
env.create_file("dir/file", 101);
@@ -102,23 +100,23 @@
directory_entry ent(sym);
std::error_code ec = GetTestEC();
directory_entry ent_ec(sym, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
LIBCPP_ONLY(remove(file));
LIBCPP_ONLY(remove(sym));
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent_ec.is_symlink());
+ assert(ent.is_symlink());
+ assert(ent_ec.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent_ec.is_regular_file());
+ assert(ent.is_regular_file());
+ assert(ent_ec.is_regular_file());
- TEST_CHECK(ent.file_size() == 101);
- TEST_CHECK(ent_ec.file_size() == 101);
+ assert(ent.file_size() == 101);
+ assert(ent_ec.file_size() == 101);
}
}
-TEST_CASE(path_ctor_dne) {
+static void path_ctor_dne() {
using namespace fs;
static_test_env static_env;
@@ -126,27 +124,27 @@
{
std::error_code ec = GetTestEC();
directory_entry ent(static_env.DNE, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
- TEST_CHECK(ent.path() == static_env.DNE);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.path() == static_env.DNE);
}
// don't report dead symlinks as an error.
{
std::error_code ec = GetTestEC();
directory_entry ent(static_env.BadSymlink, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ent.path() == static_env.BadSymlink);
+ assert(!ec);
+ assert(ent.path() == static_env.BadSymlink);
}
// DNE does not cause the constructor to throw
{
directory_entry ent(static_env.DNE);
- TEST_CHECK(ent.path() == static_env.DNE);
+ assert(ent.path() == static_env.DNE);
directory_entry ent_two(static_env.BadSymlink);
- TEST_CHECK(ent_two.path() == static_env.BadSymlink);
+ assert(ent_two.path() == static_env.BadSymlink);
}
}
-TEST_CASE(path_ctor_cannot_resolve) {
+static void path_ctor_cannot_resolve() {
using namespace fs;
#ifdef _WIN32
// Windows doesn't support setting perms::none to trigger failures
@@ -154,16 +152,16 @@
// instead.
const path dir = GetWindowsInaccessibleDir();
if (dir.empty())
- TEST_UNSUPPORTED();
+ return;
const path file = dir / "file";
{
std::error_code ec = GetTestEC();
directory_entry ent(file, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
- TEST_CHECK(ent.path() == file);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.path() == file);
}
{
- TEST_CHECK_NO_THROW(directory_entry(file));
+ TEST_DOES_NOT_THROW(directory_entry(file));
}
#else
scoped_test_env env;
@@ -177,27 +175,35 @@
{
std::error_code ec = GetTestEC();
directory_entry ent(file, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
- TEST_CHECK(ent.path() == file);
+ assert(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == file);
}
{
std::error_code ec = GetTestEC();
directory_entry ent(sym_in_dir, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
- TEST_CHECK(ent.path() == sym_in_dir);
+ assert(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == sym_in_dir);
}
{
std::error_code ec = GetTestEC();
directory_entry ent(sym_out_of_dir, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ent.path() == sym_out_of_dir);
+ assert(!ec);
+ assert(ent.path() == sym_out_of_dir);
}
{
- TEST_CHECK_NO_THROW(directory_entry(file));
- TEST_CHECK_NO_THROW(directory_entry(sym_in_dir));
- TEST_CHECK_NO_THROW(directory_entry(sym_out_of_dir));
+ TEST_DOES_NOT_THROW(directory_entry(file));
+ TEST_DOES_NOT_THROW(directory_entry(sym_in_dir));
+ TEST_DOES_NOT_THROW(directory_entry(sym_out_of_dir));
}
#endif
}
-TEST_SUITE_END()
+int main(int, char**) {
+ path_ctor();
+ path_ec_ctor();
+ path_ctor_calls_refresh();
+ path_ctor_dne();
+ path_ctor_cannot_resolve();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp
index 1ab9a91..fe5dd80 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp
@@ -22,12 +22,9 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
-TEST_SUITE(directory_entry_mods_suite)
-
-TEST_CASE(test_path_assign_method) {
+static void test_path_assign_method() {
using namespace fs;
const path p("foo/bar/baz");
const path p2("abc");
@@ -39,15 +36,15 @@
"operation must not be noexcept");
}
{
- TEST_CHECK(e.path() == p);
+ assert(e.path() == p);
e.assign(p2);
- TEST_CHECK(e.path() == p2 && e.path() != p);
+ assert(e.path() == p2 && e.path() != p);
e.assign(p);
- TEST_CHECK(e.path() == p && e.path() != p2);
+ assert(e.path() == p && e.path() != p2);
}
}
-TEST_CASE(test_path_assign_ec_method) {
+static void test_path_assign_ec_method() {
using namespace fs;
const path p("foo/bar/baz");
const path p2("abc");
@@ -63,12 +60,12 @@
directory_entry ent(p);
std::error_code ec = GetTestEC();
ent.assign(p2, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
- TEST_CHECK(ent.path() == p2);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.path() == p2);
}
}
-TEST_CASE(test_assign_calls_refresh) {
+static void test_assign_calls_refresh() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -82,7 +79,7 @@
// removing the file demonstrates that the values where cached previously.
LIBCPP_ONLY(remove(file));
- TEST_CHECK(ent.is_regular_file());
+ assert(ent.is_regular_file());
}
env.create_file("dir/file", 101);
{
@@ -92,12 +89,12 @@
LIBCPP_ONLY(remove(file));
LIBCPP_ONLY(remove(sym));
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
}
}
-TEST_CASE(test_assign_propagates_error) {
+static void test_assign_propagates_error() {
using namespace fs;
scoped_test_env env;
#ifdef _WIN32
@@ -106,7 +103,7 @@
// instead.
const path dir = GetWindowsInaccessibleDir();
if (dir.empty())
- TEST_UNSUPPORTED();
+ return;
const path file = dir / "inaccessible_file";
// We can't create files in the inaccessible directory, so this doesn't
// test exactly the same as the code below.
@@ -115,7 +112,7 @@
directory_entry ent;
std::error_code ec = GetTestEC();
ent.assign(file, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
}
#else
const path dir = env.create_dir("dir");
@@ -130,21 +127,28 @@
directory_entry ent;
std::error_code ec = GetTestEC();
ent.assign(file, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ErrorIs(ec, std::errc::permission_denied));
}
{
directory_entry ent;
std::error_code ec = GetTestEC();
ent.assign(sym_in_dir, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ErrorIs(ec, std::errc::permission_denied));
}
#endif
{
directory_entry ent;
std::error_code ec = GetTestEC();
ent.assign(sym_out_of_dir, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_path_assign_method();
+ test_path_assign_ec_method();
+ test_assign_calls_refresh();
+ test_assign_propagates_error();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp
index 56fda26..9fa44eb 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -25,13 +25,11 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
-TEST_SUITE(directory_entry_mods_suite)
-
-TEST_CASE(test_refresh_method) {
+static void test_refresh_method() {
using namespace fs;
{
directory_entry e;
@@ -43,11 +41,11 @@
{
directory_entry e;
e.refresh();
- TEST_CHECK(!e.exists());
+ assert(!e.exists());
}
}
-TEST_CASE(test_refresh_ec_method) {
+static void test_refresh_ec_method() {
using namespace fs;
{
directory_entry e;
@@ -60,14 +58,14 @@
directory_entry e;
std::error_code ec = GetTestEC();
e.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
}
}
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
-TEST_CASE(refresh_on_file_dne) {
+static void refresh_on_file_dne() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -79,36 +77,36 @@
{
directory_entry ent(file);
remove(file);
- TEST_CHECK(ent.exists());
+ assert(ent.exists());
ent.refresh();
permissions(dir, perms::none);
- TEST_CHECK(!ent.exists());
+ assert(!ent.exists());
}
permissions(dir, old_perms);
env.create_file("dir/file", 101);
{
directory_entry ent(file);
remove(file);
- TEST_CHECK(ent.exists());
+ assert(ent.exists());
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
permissions(dir, perms::none);
- TEST_CHECK(!ent.exists());
+ assert(!ent.exists());
}
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
void remove_if_exists(const fs::path& p) {
std::error_code ec;
remove(p, ec);
}
-TEST_CASE(refresh_on_bad_symlink) {
+static void refresh_on_bad_symlink() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -121,18 +119,18 @@
{
directory_entry ent(sym);
LIBCPP_ONLY(remove(file));
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.exists());
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.exists());
remove_if_exists(file);
ent.refresh();
LIBCPP_ONLY(permissions(dir, perms::none));
- TEST_CHECK(ent.is_symlink());
+ assert(ent.is_symlink());
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
- TEST_CHECK(!ent.is_regular_file());
- TEST_CHECK(!ent.exists());
+ assert(!ent.is_regular_file());
+ assert(!ent.exists());
#endif
}
permissions(dir, old_perms);
@@ -140,19 +138,19 @@
{
directory_entry ent(sym);
LIBCPP_ONLY(remove(file));
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.exists());
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.exists());
remove_if_exists(file);
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(!ec); // we don't report bad symlinks as an error.
+ assert(!ec); // we don't report bad symlinks as an error.
LIBCPP_ONLY(permissions(dir, perms::none));
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
- TEST_CHECK(!ent.exists());
+ assert(!ent.exists());
#endif
}
}
@@ -160,7 +158,7 @@
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
-TEST_CASE(refresh_cannot_resolve) {
+static void refresh_cannot_resolve() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -174,50 +172,50 @@
directory_entry ent(file);
permissions(dir, perms::none);
- TEST_CHECK(ent.is_regular_file());
+ assert(ent.is_regular_file());
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
- TEST_CHECK(ent.path() == file);
+ assert(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == file);
ExceptionChecker Checker(file, std::errc::permission_denied,
"directory_entry::refresh");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.refresh());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.refresh());
}
permissions(dir, old_perms);
{
directory_entry ent(sym_in_dir);
permissions(dir, perms::none);
- TEST_CHECK(ent.is_symlink());
+ assert(ent.is_symlink());
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
- TEST_CHECK(ent.path() == sym_in_dir);
+ assert(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == sym_in_dir);
ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
"directory_entry::refresh");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.refresh());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.refresh());
}
permissions(dir, old_perms);
{
directory_entry ent(sym_out_of_dir);
permissions(dir, perms::none);
- TEST_CHECK(ent.is_symlink());
+ assert(ent.is_symlink());
// Failure to resolve the linked entity due to permissions is not
// reported as an error.
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ent.is_symlink());
+ assert(!ec);
+ assert(ent.is_symlink());
ec = GetTestEC();
- TEST_CHECK(ent.exists(ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
- TEST_CHECK(ent.path() == sym_out_of_dir);
+ assert(ent.exists(ec) == false);
+ assert(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == sym_out_of_dir);
}
permissions(dir, old_perms);
{
@@ -228,14 +226,13 @@
((void)ent_file);
((void)ent_sym);
- TEST_CHECK_THROW(filesystem_error, ent_file.refresh());
- TEST_CHECK_THROW(filesystem_error, ent_sym.refresh());
- TEST_CHECK_NO_THROW(ent_sym2);
+ TEST_THROWS_TYPE(filesystem_error, ent_file.refresh());
+ TEST_THROWS_TYPE(filesystem_error, ent_sym.refresh());
}
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(refresh_doesnt_throw_on_dne_but_reports_it) {
+static void refresh_doesnt_throw_on_dne_but_reports_it() {
using namespace fs;
scoped_test_env env;
@@ -244,47 +241,50 @@
{
directory_entry ent(file);
- TEST_CHECK(ent.file_size() == 42);
+ assert(ent.file_size() == 42);
remove(file);
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
- TEST_CHECK_NO_THROW(ent.refresh());
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ TEST_DOES_NOT_THROW(ent.refresh());
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.file_size(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
// doesn't throw!
- TEST_CHECK_THROW(filesystem_error, ent.file_size());
+ //
+ //
+ //
+ //TEST_THROWS_TYPE(filesystem_error, ent.file_size());
}
env.create_file("file1", 99);
{
directory_entry ent(sym);
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.file_size() == 99);
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.file_size() == 99);
remove(file);
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(!ec);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.file_size(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
- TEST_CHECK_THROW(filesystem_error, ent.file_size());
+ TEST_THROWS_TYPE(filesystem_error, ent.file_size());
}
}
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
-TEST_CASE(access_cache_after_refresh_fails) {
+static void access_cache_after_refresh_fails() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -297,64 +297,79 @@
#define CHECK_ACCESS(func, expect) \
ec = GetTestEC(); \
- TEST_CHECK(ent.func(ec) == expect); \
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied))
+ assert(ent.func(ec) == expect); \
+ assert(ErrorIs(ec, std::errc::permission_denied))
// test file doesn't exist
{
directory_entry ent(file);
- TEST_CHECK(!ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.exists());
+ assert(!ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.exists());
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ErrorIs(ec, std::errc::permission_denied));
CHECK_ACCESS(exists, false);
CHECK_ACCESS(is_symlink, false);
CHECK_ACCESS(last_write_time, file_time_type::min());
- CHECK_ACCESS(hard_link_count, uintmax_t(-1));
+ CHECK_ACCESS(hard_link_count, std::uintmax_t(-1));
}
permissions(dir, old_perms);
{
directory_entry ent(sym_in_dir);
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.exists());
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.exists());
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ErrorIs(ec, std::errc::permission_denied));
CHECK_ACCESS(exists, false);
CHECK_ACCESS(is_symlink, false);
CHECK_ACCESS(last_write_time, file_time_type::min());
- CHECK_ACCESS(hard_link_count, uintmax_t(-1));
+ CHECK_ACCESS(hard_link_count, std::uintmax_t(-1));
}
permissions(dir, old_perms);
{
directory_entry ent(sym);
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.exists());
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.exists());
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.refresh(ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ent.is_symlink());
+ assert(!ec);
+ assert(ent.is_symlink());
CHECK_ACCESS(exists, false);
CHECK_ACCESS(is_regular_file, false);
CHECK_ACCESS(last_write_time, file_time_type::min());
- CHECK_ACCESS(hard_link_count, uintmax_t(-1));
+ CHECK_ACCESS(hard_link_count, std::uintmax_t(-1));
}
#undef CHECK_ACCESS
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_SUITE_END()
+int main(int, char**) {
+ test_refresh_method();
+ test_refresh_ec_method();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ refresh_on_file_dne();
+#endif
+ refresh_on_bad_symlink();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ refresh_cannot_resolve();
+#endif
+ refresh_doesnt_throw_on_dne_but_reports_it();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ access_cache_after_refresh_fails();
+#endif
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp
index 564e0e2..1d0b975 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp
@@ -22,12 +22,9 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
-TEST_SUITE(directory_entry_mods_suite)
-
-TEST_CASE(test_replace_filename_method) {
+static void test_replace_filename_method() {
using namespace fs;
{
@@ -44,13 +41,13 @@
const path replace("bar.out");
const path expect("/path/to/bar.out");
directory_entry e(p);
- TEST_CHECK(e.path() == p);
+ assert(e.path() == p);
e.replace_filename(replace);
- TEST_CHECK(e.path() == expect);
+ assert(e.path() == expect);
}
}
-TEST_CASE(test_replace_filename_ec_method) {
+static void test_replace_filename_ec_method() {
using namespace fs;
static_test_env static_env;
@@ -69,27 +66,27 @@
const path replace("bar.out");
const path expect("/path/to/bar.out");
directory_entry e(p);
- TEST_CHECK(e.path() == p);
+ assert(e.path() == p);
std::error_code ec = GetTestEC();
e.replace_filename(replace, ec);
- TEST_CHECK(e.path() == expect);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(e.path() == expect);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
}
{
const path p = static_env.EmptyFile;
const path expect = static_env.NonEmptyFile;
const path replace = static_env.NonEmptyFile.filename();
- TEST_REQUIRE(expect.parent_path() == p.parent_path());
+ assert(expect.parent_path() == p.parent_path());
directory_entry e(p);
- TEST_CHECK(e.path() == p);
+ assert(e.path() == p);
std::error_code ec = GetTestEC();
e.replace_filename(replace, ec);
- TEST_CHECK(e.path() == expect);
- TEST_CHECK(!ec);
+ assert(e.path() == expect);
+ assert(!ec);
}
}
-TEST_CASE(test_replace_filename_calls_refresh) {
+static void test_replace_filename_calls_refresh() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -101,32 +98,32 @@
{
directory_entry ent(file);
ent.replace_filename(file_two.filename());
- TEST_REQUIRE(ent.path() == file_two);
+ assert(ent.path() == file_two);
// removing the file demonstrates that the values where cached previously.
LIBCPP_ONLY(remove(file_two));
- TEST_CHECK(ent.file_size() == 101);
+ assert(ent.file_size() == 101);
}
env.create_file("dir/file_two", 99);
{
directory_entry ent(sym);
ent.replace_filename(sym_two.filename());
- TEST_REQUIRE(ent.path() == sym_two);
+ assert(ent.path() == sym_two);
LIBCPP_ONLY(remove(file_two));
LIBCPP_ONLY(remove(sym_two));
- TEST_CHECK(ent.is_symlink());
- TEST_CHECK(ent.is_regular_file());
- TEST_CHECK(ent.file_size() == 99);
+ assert(ent.is_symlink());
+ assert(ent.is_regular_file());
+ assert(ent.file_size() == 99);
}
}
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
-TEST_CASE(test_replace_filename_propagates_error) {
+static void test_replace_filename_propagates_error() {
using namespace fs;
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -145,7 +142,7 @@
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.replace_filename(file_two.filename(), ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ErrorIs(ec, std::errc::permission_denied));
}
permissions(dir, old_perms);
{
@@ -153,7 +150,7 @@
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.replace_filename(sym_in_dir_two.filename(), ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ErrorIs(ec, std::errc::permission_denied));
}
permissions(dir, old_perms);
{
@@ -161,13 +158,22 @@
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.replace_filename(sym_out_of_dir_two.filename(), ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ent.is_symlink());
+ assert(!ec);
+ assert(ent.is_symlink());
ec = GetTestEC();
- TEST_CHECK(!ent.exists(ec));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(!ent.exists(ec));
+ assert(ErrorIs(ec, std::errc::permission_denied));
}
}
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+
+int main(int, char**) {
+ test_replace_filename_method();
+ test_replace_filename_ec_method();
+ test_replace_filename_calls_refresh();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ test_replace_filename_propagates_error();
#endif
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
index c1e9130..fa105a7 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -23,27 +23,25 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "filesystem_test_helper.h"
-#include "rapid-cxx-test.h"
#include "test_macros.h"
-TEST_SUITE(directory_entry_obs_testsuite)
-
-TEST_CASE(signatures) {
+static void signatures() {
using namespace fs;
{
const fs::directory_entry e = {};
std::error_code ec;
- static_assert(std::is_same<decltype(e.file_size()), uintmax_t>::value, "");
- static_assert(std::is_same<decltype(e.file_size(ec)), uintmax_t>::value,
+ static_assert(std::is_same<decltype(e.file_size()), std::uintmax_t>::value, "");
+ static_assert(std::is_same<decltype(e.file_size(ec)), std::uintmax_t>::value,
"");
static_assert(noexcept(e.file_size()) == false, "");
static_assert(noexcept(e.file_size(ec)) == true, "");
}
}
-TEST_CASE(basic) {
+static void basic() {
using namespace fs;
scoped_test_env env;
@@ -53,32 +51,32 @@
{
directory_entry ent(file);
- uintmax_t expect = file_size(ent);
- TEST_CHECK(expect == 42);
+ std::uintmax_t expect = file_size(ent);
+ assert(expect == 42);
// Remove the file to show that the results were already in the cache.
LIBCPP_ONLY(remove(file));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == expect);
- TEST_CHECK(!ec);
+ assert(ent.file_size(ec) == expect);
+ assert(!ec);
}
env.create_file("file", 99);
{
directory_entry ent(sym);
- uintmax_t expect = file_size(ent);
- TEST_CHECK(expect == 99);
+ std::uintmax_t expect = file_size(ent);
+ assert(expect == 99);
LIBCPP_ONLY(remove(ent));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == 99);
- TEST_CHECK(!ec);
+ assert(ent.file_size(ec) == 99);
+ assert(!ec);
}
}
-TEST_CASE(not_regular_file) {
+static void not_regular_file() {
using namespace fs;
scoped_test_env env;
@@ -95,24 +93,24 @@
for (auto const& TC : TestCases) {
const path& p = TC.p;
directory_entry ent(p);
- TEST_CHECK(ent.path() == p);
+ assert(ent.path() == p);
std::error_code ec = GetTestEC(0);
std::error_code other_ec = GetTestEC(1);
- uintmax_t expect = file_size(p, other_ec);
+ std::uintmax_t expect = file_size(p, other_ec);
- uintmax_t got = ent.file_size(ec);
- TEST_CHECK(got == expect);
- TEST_CHECK(got == uintmax_t(-1));
- TEST_CHECK(ec == other_ec);
- TEST_CHECK(ErrorIs(ec, TC.expected_err));
+ std::uintmax_t got = ent.file_size(ec);
+ assert(got == expect);
+ assert(got == std::uintmax_t(-1));
+ assert(ec == other_ec);
+ assert(ErrorIs(ec, TC.expected_err));
ExceptionChecker Checker(p, TC.expected_err, "directory_entry::file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.file_size());
}
}
-TEST_CASE(error_reporting) {
+static void error_reporting() {
using namespace fs;
static_test_env static_env;
@@ -134,40 +132,40 @@
std::error_code ec = GetTestEC();
ent.assign(static_env.DNE, ec);
- TEST_REQUIRE(ent.path() == static_env.DNE);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.path() == static_env.DNE);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.file_size(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(static_env.DNE,
std::errc::no_such_file_or_directory,
"directory_entry::file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.file_size());
}
// test a dead symlink
{
directory_entry ent;
std::error_code ec = GetTestEC();
- uintmax_t expect_bad = file_size(static_env.BadSymlink, ec);
- TEST_CHECK(expect_bad == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ std::uintmax_t expect_bad = file_size(static_env.BadSymlink, ec);
+ assert(expect_bad == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ec = GetTestEC();
ent.assign(static_env.BadSymlink, ec);
- TEST_REQUIRE(ent.path() == static_env.BadSymlink);
- TEST_CHECK(!ec);
+ assert(ent.path() == static_env.BadSymlink);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == expect_bad);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.file_size(ec) == expect_bad);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(static_env.BadSymlink,
std::errc::no_such_file_or_directory,
"directory_entry::file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.file_size());
}
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
@@ -175,80 +173,87 @@
// test a file w/o appropriate permissions.
{
directory_entry ent;
- uintmax_t expect_good = file_size(file);
+ std::uintmax_t expect_good = file_size(file);
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.assign(file, ec);
- TEST_REQUIRE(ent.path() == file);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == file);
+ assert(ErrorIs(ec, std::errc::permission_denied));
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.file_size(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(file, std::errc::permission_denied, "file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.file_size());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.file_size());
+ assert(ent.file_size(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.file_size());
}
permissions(dir, old_perms);
// test a symlink w/o appropriate permissions.
{
directory_entry ent;
- uintmax_t expect_good = file_size(sym_in_dir);
+ std::uintmax_t expect_good = file_size(sym_in_dir);
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.assign(sym_in_dir, ec);
- TEST_REQUIRE(ent.path() == sym_in_dir);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == sym_in_dir);
+ assert(ErrorIs(ec, std::errc::permission_denied));
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.file_size(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
"file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.file_size());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.file_size());
+ assert(ent.file_size(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.file_size());
}
permissions(dir, old_perms);
// test a symlink to a file w/o appropriate permissions
{
directory_entry ent;
- uintmax_t expect_good = file_size(sym_out_of_dir);
+ std::uintmax_t expect_good = file_size(sym_out_of_dir);
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.assign(sym_out_of_dir, ec);
- TEST_REQUIRE(ent.path() == sym_out_of_dir);
- TEST_CHECK(!ec);
+ assert(ent.path() == sym_out_of_dir);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.file_size(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied,
"file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.file_size());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.file_size(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.file_size());
+ assert(ent.file_size(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.file_size());
}
#endif
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signatures();
+ basic();
+ not_regular_file();
+ error_reporting();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp
index 541a6d9..6591d51 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp
@@ -20,18 +20,15 @@
#include <cassert>
#include "filesystem_test_helper.h"
-#include "rapid-cxx-test.h"
#include "test_macros.h"
-TEST_SUITE(directory_entry_obs_testsuite)
-
-TEST_CASE(file_dne) {
+static void file_dne() {
using namespace fs;
directory_entry p("dne");
}
-TEST_CASE(signatures) {
+static void signatures() {
using namespace fs;
const directory_entry e = {};
std::error_code ec;
@@ -56,7 +53,7 @@
#undef TEST_FUNC
}
-TEST_CASE(test_without_ec) {
+static void test_without_ec() {
using namespace fs;
using fs::directory_entry;
using fs::file_status;
@@ -71,17 +68,17 @@
file_status st = status(p);
file_status sym_st = symlink_status(p);
fs::remove(p);
- TEST_REQUIRE(e.exists());
- TEST_REQUIRE(!exists(p));
- TEST_CHECK(e.exists() == exists(st));
- TEST_CHECK(e.is_block_file() == is_block_file(st));
- TEST_CHECK(e.is_character_file() == is_character_file(st));
- TEST_CHECK(e.is_directory() == is_directory(st));
- TEST_CHECK(e.is_fifo() == is_fifo(st));
- TEST_CHECK(e.is_other() == is_other(st));
- TEST_CHECK(e.is_regular_file() == is_regular_file(st));
- TEST_CHECK(e.is_socket() == is_socket(st));
- TEST_CHECK(e.is_symlink() == is_symlink(sym_st));
+ assert(e.exists());
+ assert(!exists(p));
+ assert(e.exists() == exists(st));
+ assert(e.is_block_file() == is_block_file(st));
+ assert(e.is_character_file() == is_character_file(st));
+ assert(e.is_directory() == is_directory(st));
+ assert(e.is_fifo() == is_fifo(st));
+ assert(e.is_other() == is_other(st));
+ assert(e.is_regular_file() == is_regular_file(st));
+ assert(e.is_socket() == is_socket(st));
+ assert(e.is_symlink() == is_symlink(sym_st));
};
test_path(f);
test_path(d);
@@ -92,7 +89,7 @@
#endif
}
-TEST_CASE(test_with_ec) {
+static void test_with_ec() {
using namespace fs;
using fs::directory_entry;
using fs::file_status;
@@ -116,36 +113,36 @@
return res;
};
- TEST_REQUIRE(e.exists(ec));
- TEST_CHECK(CheckEC(status_ec));
- TEST_REQUIRE(!exists(p));
+ assert(e.exists(ec));
+ assert(CheckEC(status_ec));
+ assert(!exists(p));
- TEST_CHECK(e.exists(ec) == exists(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.exists(ec) == exists(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_block_file(ec) == is_block_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_block_file(ec) == is_block_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_character_file(ec) == is_character_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_character_file(ec) == is_character_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_directory(ec) == is_directory(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_directory(ec) == is_directory(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_fifo(ec) == is_fifo(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_fifo(ec) == is_fifo(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_other(ec) == is_other(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_other(ec) == is_other(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_regular_file(ec) == is_regular_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_socket(ec) == is_socket(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_socket(ec) == is_socket(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st));
- TEST_CHECK(CheckEC(sym_status_ec));
+ assert(e.is_symlink(ec) == is_symlink(sym_st));
+ assert(CheckEC(sym_status_ec));
};
test_path(f);
test_path(d);
@@ -156,7 +153,7 @@
#endif
}
-TEST_CASE(test_with_ec_dne) {
+static void test_with_ec_dne() {
using namespace fs;
using fs::directory_entry;
using fs::file_status;
@@ -176,39 +173,39 @@
return res;
};
- TEST_CHECK(e.exists(ec) == exists(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.exists(ec) == exists(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_block_file(ec) == is_block_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_block_file(ec) == is_block_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_character_file(ec) == is_character_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_character_file(ec) == is_character_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_directory(ec) == is_directory(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_directory(ec) == is_directory(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_fifo(ec) == is_fifo(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_fifo(ec) == is_fifo(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_other(ec) == is_other(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_other(ec) == is_other(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_regular_file(ec) == is_regular_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_socket(ec) == is_socket(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_socket(ec) == is_socket(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st));
- TEST_CHECK(CheckEC(sym_status_ec));
+ assert(e.is_symlink(ec) == is_symlink(sym_st));
+ assert(CheckEC(sym_status_ec));
}
}
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
-TEST_CASE(test_with_ec_cannot_resolve) {
+static void test_with_ec_cannot_resolve() {
using namespace fs;
using fs::directory_entry;
using fs::file_status;
@@ -229,7 +226,7 @@
permissions(dir, perms::none);
std::error_code dummy_ec;
e.refresh(dummy_ec);
- TEST_REQUIRE(dummy_ec);
+ assert(dummy_ec);
std::error_code status_ec = GetTestEC();
std::error_code sym_status_ec = GetTestEC(1);
@@ -242,34 +239,45 @@
return res;
};
- TEST_CHECK(e.exists(ec) == exists(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.exists(ec) == exists(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_block_file(ec) == is_block_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_block_file(ec) == is_block_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_character_file(ec) == is_character_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_character_file(ec) == is_character_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_directory(ec) == is_directory(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_directory(ec) == is_directory(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_fifo(ec) == is_fifo(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_fifo(ec) == is_fifo(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_other(ec) == is_other(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_other(ec) == is_other(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_regular_file(ec) == is_regular_file(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_socket(ec) == is_socket(st));
- TEST_CHECK(CheckEC(status_ec));
+ assert(e.is_socket(ec) == is_socket(st));
+ assert(CheckEC(status_ec));
- TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st));
- TEST_CHECK(CheckEC(sym_status_ec));
+ assert(e.is_symlink(ec) == is_symlink(sym_st));
+ assert(CheckEC(sym_status_ec));
}
}
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+
+int main(int, char**) {
+ file_dne();
+ signatures();
+ test_without_ec();
+ test_with_ec();
+ test_with_ec_dne();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ test_with_ec_cannot_resolve();
#endif
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
index bd31668..e8c4742 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -23,27 +23,25 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "filesystem_test_helper.h"
-#include "rapid-cxx-test.h"
#include "test_macros.h"
-TEST_SUITE(directory_entry_obs_testsuite)
-
-TEST_CASE(signatures) {
+static void signatures() {
using namespace fs;
{
const directory_entry e = {};
std::error_code ec;
- static_assert(std::is_same<decltype(e.hard_link_count()), uintmax_t>::value, "");
- static_assert(std::is_same<decltype(e.hard_link_count(ec)), uintmax_t>::value,
+ static_assert(std::is_same<decltype(e.hard_link_count()), std::uintmax_t>::value, "");
+ static_assert(std::is_same<decltype(e.hard_link_count(ec)), std::uintmax_t>::value,
"");
static_assert(noexcept(e.hard_link_count()) == false, "");
static_assert(noexcept(e.hard_link_count(ec)) == true, "");
}
}
-TEST_CASE(basic) {
+static void basic() {
using namespace fs;
scoped_test_env env;
@@ -53,36 +51,36 @@
{
directory_entry ent(file);
- uintmax_t expect = hard_link_count(ent);
+ std::uintmax_t expect = hard_link_count(ent);
// Remove the file to show that the results were already in the cache.
LIBCPP_ONLY(remove(file));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect);
- TEST_CHECK(!ec);
+ assert(ent.hard_link_count(ec) == expect);
+ assert(!ec);
}
{
directory_entry ent(dir);
- uintmax_t expect = hard_link_count(ent);
+ std::uintmax_t expect = hard_link_count(ent);
LIBCPP_ONLY(remove(dir));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect);
- TEST_CHECK(!ec);
+ assert(ent.hard_link_count(ec) == expect);
+ assert(!ec);
}
env.create_file("file", 99);
env.create_hardlink("file", "hl");
{
directory_entry ent(sym);
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == 2);
- TEST_CHECK(!ec);
+ assert(ent.hard_link_count(ec) == 2);
+ assert(!ec);
}
}
-TEST_CASE(not_regular_file) {
+static void not_regular_file() {
using namespace fs;
scoped_test_env env;
@@ -94,16 +92,16 @@
auto test_path = [=](const path &p) {
std::error_code dummy_ec = GetTestEC();
directory_entry ent(p, dummy_ec);
- TEST_CHECK(!dummy_ec);
+ assert(!dummy_ec);
- uintmax_t expect = hard_link_count(p);
+ std::uintmax_t expect = hard_link_count(p);
LIBCPP_ONLY(permissions(dir, perms::none));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.hard_link_count());
+ assert(ent.hard_link_count(ec) == expect);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.hard_link_count());
permissions(dir, old_perms);
};
test_path(dir2);
@@ -115,7 +113,7 @@
#endif
}
-TEST_CASE(error_reporting) {
+static void error_reporting() {
using namespace fs;
static_test_env static_env;
@@ -137,41 +135,41 @@
std::error_code ec = GetTestEC();
ent.assign(static_env.DNE, ec);
- TEST_CHECK(ec);
- TEST_REQUIRE(ent.path() == static_env.DNE);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ec);
+ assert(ent.path() == static_env.DNE);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.hard_link_count(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(static_env.DNE,
std::errc::no_such_file_or_directory,
"directory_entry::hard_link_count");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.hard_link_count());
}
// test a dead symlink
{
directory_entry ent;
std::error_code ec = GetTestEC();
- uintmax_t expect_bad = hard_link_count(static_env.BadSymlink, ec);
- TEST_CHECK(expect_bad == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ std::uintmax_t expect_bad = hard_link_count(static_env.BadSymlink, ec);
+ assert(expect_bad == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ec = GetTestEC();
ent.assign(static_env.BadSymlink, ec);
- TEST_REQUIRE(ent.path() == static_env.BadSymlink);
- TEST_CHECK(!ec);
+ assert(ent.path() == static_env.BadSymlink);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect_bad);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.hard_link_count(ec) == expect_bad);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(static_env.BadSymlink,
std::errc::no_such_file_or_directory,
"directory_entry::hard_link_count");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.hard_link_count());
}
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
@@ -179,81 +177,87 @@
// test a file w/o appropriate permissions.
{
directory_entry ent;
- uintmax_t expect_good = hard_link_count(file);
+ std::uintmax_t expect_good = hard_link_count(file);
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.assign(file, ec);
- TEST_REQUIRE(ent.path() == file);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == file);
+ assert(ErrorIs(ec, std::errc::permission_denied));
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.hard_link_count(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(file, std::errc::permission_denied,
"hard_link_count");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.hard_link_count());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.hard_link_count());
+ assert(ent.hard_link_count(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.hard_link_count());
}
permissions(dir, old_perms);
// test a symlink w/o appropriate permissions.
{
directory_entry ent;
- uintmax_t expect_good = hard_link_count(sym_in_dir);
+ std::uintmax_t expect_good = hard_link_count(sym_in_dir);
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.assign(sym_in_dir, ec);
- TEST_REQUIRE(ent.path() == sym_in_dir);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == sym_in_dir);
+ assert(ErrorIs(ec, std::errc::permission_denied));
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.hard_link_count(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
"hard_link_count");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.hard_link_count());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.hard_link_count());
+ assert(ent.hard_link_count(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.hard_link_count());
}
permissions(dir, old_perms);
// test a symlink to a file w/o appropriate permissions
{
directory_entry ent;
- uintmax_t expect_good = hard_link_count(sym_out_of_dir);
+ std::uintmax_t expect_good = hard_link_count(sym_out_of_dir);
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
ent.assign(sym_out_of_dir, ec);
- TEST_REQUIRE(ent.path() == sym_out_of_dir);
- TEST_CHECK(!ec);
+ assert(ent.path() == sym_out_of_dir);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1));
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.hard_link_count(ec) == std::uintmax_t(-1));
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied,
"hard_link_count");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.hard_link_count());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.hard_link_count(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.hard_link_count());
+ assert(ent.hard_link_count(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.hard_link_count());
}
#endif
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signatures();
+ basic();
+ not_regular_file();
+ error_reporting();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp
index dc0a1f7..f5e803f 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -23,14 +23,12 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "filesystem_test_helper.h"
-#include "rapid-cxx-test.h"
#include "test_macros.h"
-TEST_SUITE(directory_entry_obs_testsuite)
-
-TEST_CASE(signatures) {
+static void signatures() {
using namespace fs;
{
const fs::directory_entry e = {};
@@ -44,7 +42,7 @@
}
}
-TEST_CASE(basic) {
+static void basic() {
using namespace fs;
scoped_test_env env;
@@ -60,8 +58,8 @@
LIBCPP_ONLY(remove(file));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect);
- TEST_CHECK(!ec);
+ assert(ent.last_write_time(ec) == expect);
+ assert(!ec);
}
{
directory_entry ent(dir);
@@ -70,8 +68,8 @@
LIBCPP_ONLY(remove(dir));
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect);
- TEST_CHECK(!ec);
+ assert(ent.last_write_time(ec) == expect);
+ assert(!ec);
}
env.create_file("file", 99);
{
@@ -79,12 +77,12 @@
file_time_type expect = last_write_time(sym);
std::error_code ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect);
- TEST_CHECK(!ec);
+ assert(ent.last_write_time(ec) == expect);
+ assert(!ec);
}
}
-TEST_CASE(error_reporting) {
+static void error_reporting() {
using namespace fs;
static_test_env static_env;
@@ -106,17 +104,17 @@
std::error_code ec = GetTestEC();
ent.assign(static_env.DNE, ec);
- TEST_REQUIRE(ent.path() == static_env.DNE);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.path() == static_env.DNE);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.last_write_time(ec) == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(static_env.DNE,
std::errc::no_such_file_or_directory,
"directory_entry::last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.last_write_time());
}
// test a dead symlink
{
@@ -124,22 +122,22 @@
std::error_code ec = GetTestEC();
file_time_type expect_bad = last_write_time(static_env.BadSymlink, ec);
- TEST_CHECK(expect_bad == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(expect_bad == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ec = GetTestEC();
ent.assign(static_env.BadSymlink, ec);
- TEST_REQUIRE(ent.path() == static_env.BadSymlink);
- TEST_CHECK(!ec);
+ assert(ent.path() == static_env.BadSymlink);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect_bad);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(ent.last_write_time(ec) == expect_bad);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(static_env.BadSymlink,
std::errc::no_such_file_or_directory,
"directory_entry::last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.last_write_time());
}
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
@@ -152,22 +150,22 @@
std::error_code ec = GetTestEC();
ent.assign(file, ec);
- TEST_REQUIRE(ent.path() == file);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == file);
+ assert(ErrorIs(ec, std::errc::permission_denied));
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.last_write_time(ec) == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(file, std::errc::permission_denied,
"last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.last_write_time());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.last_write_time());
+ assert(ent.last_write_time(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.last_write_time());
}
permissions(dir, old_perms);
// test a symlink w/o appropriate permissions.
@@ -178,22 +176,22 @@
std::error_code ec = GetTestEC();
ent.assign(sym_in_dir, ec);
- TEST_REQUIRE(ent.path() == sym_in_dir);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.path() == sym_in_dir);
+ assert(ErrorIs(ec, std::errc::permission_denied));
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.last_write_time(ec) == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied,
"last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.last_write_time());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.last_write_time());
+ assert(ent.last_write_time(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.last_write_time());
}
permissions(dir, old_perms);
// test a symlink to a file w/o appropriate permissions
@@ -204,24 +202,30 @@
std::error_code ec = GetTestEC();
ent.assign(sym_out_of_dir, ec);
- TEST_REQUIRE(ent.path() == sym_out_of_dir);
- TEST_CHECK(!ec);
+ assert(ent.path() == sym_out_of_dir);
+ assert(!ec);
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(ent.last_write_time(ec) == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied,
"last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time());
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ent.last_write_time());
permissions(dir, old_perms);
ec = GetTestEC();
- TEST_CHECK(ent.last_write_time(ec) == expect_good);
- TEST_CHECK(!ec);
- TEST_CHECK_NO_THROW(ent.last_write_time());
+ assert(ent.last_write_time(ec) == expect_good);
+ assert(!ec);
+ TEST_DOES_NOT_THROW(ent.last_write_time());
}
#endif
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signatures();
+ basic();
+ error_reporting();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp
index ce4f286..7a45d60 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp
@@ -20,13 +20,10 @@
#include <cassert>
#include "filesystem_test_helper.h"
-#include "rapid-cxx-test.h"
#include "test_macros.h"
-TEST_SUITE(directory_entry_status_testsuite)
-
-TEST_CASE(test_basic) {
+static void test_basic() {
using namespace fs;
static_test_env static_env;
{
@@ -44,17 +41,21 @@
std::error_code pec = GetTestEC(), eec = GetTestEC(1);
file_status ps = fs::status(p, pec);
file_status es = e.status(eec);
- TEST_CHECK(ps.type() == es.type());
- TEST_CHECK(ps.permissions() == es.permissions());
- TEST_CHECK(pec == eec);
+ assert(ps.type() == es.type());
+ assert(ps.permissions() == es.permissions());
+ assert(pec == eec);
}
for (const auto& p : TestCases) {
const directory_entry e(p);
file_status ps = fs::status(p);
file_status es = e.status();
- TEST_CHECK(ps.type() == es.type());
- TEST_CHECK(ps.permissions() == es.permissions());
+ assert(ps.type() == es.type());
+ assert(ps.permissions() == es.permissions());
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_basic();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp
index 364b832..7fc5d3c 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp
@@ -20,13 +20,10 @@
#include <cassert>
#include "filesystem_test_helper.h"
-#include "rapid-cxx-test.h"
#include "test_macros.h"
-TEST_SUITE(directory_entry_obs_suite)
-
-TEST_CASE(test_signature) {
+static void test_signature() {
using namespace fs;
static_test_env static_env;
{
@@ -44,17 +41,20 @@
std::error_code pec = GetTestEC(), eec = GetTestEC(1);
file_status ps = fs::symlink_status(p, pec);
file_status es = e.symlink_status(eec);
- TEST_CHECK(ps.type() == es.type());
- TEST_CHECK(ps.permissions() == es.permissions());
- TEST_CHECK(pec == eec);
+ assert(ps.type() == es.type());
+ assert(ps.permissions() == es.permissions());
+ assert(pec == eec);
}
for (const auto& p : TestCases) {
const directory_entry e(p);
file_status ps = fs::symlink_status(p);
file_status es = e.symlink_status();
- TEST_CHECK(ps.type() == es.type());
- TEST_CHECK(ps.permissions() == es.permissions());
+ assert(ps.type() == es.type());
+ assert(ps.permissions() == es.permissions());
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signature();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp
index 47041cb..d37053a 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp
@@ -20,40 +20,43 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(directory_iterator_copy_construct_tests)
-
-TEST_CASE(test_constructor_signature)
+static void test_constructor_signature()
{
using D = directory_iterator;
static_assert(std::is_copy_constructible<D>::value, "");
}
-TEST_CASE(test_copy_end_iterator)
+static void test_copy_end_iterator()
{
const directory_iterator endIt;
directory_iterator it(endIt);
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_copy_valid_iterator)
+static void test_copy_valid_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
const directory_iterator endIt{};
const directory_iterator it(testDir);
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
const directory_iterator it2(it);
- TEST_REQUIRE(it2 == it);
- TEST_CHECK(*it2 == entry);
- TEST_CHECK(*it == entry);
+ assert(it2 == it);
+ assert(*it2 == entry);
+ assert(*it == entry);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_constructor_signature();
+ test_copy_end_iterator();
+ test_copy_valid_iterator();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp
index e6f6d16..c1f96e1 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp
@@ -20,37 +20,34 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(directory_iterator_copy_assign_tests)
-
-TEST_CASE(test_assignment_signature)
+static void test_assignment_signature()
{
using D = directory_iterator;
static_assert(std::is_copy_assignable<D>::value, "");
}
-TEST_CASE(test_copy_to_end_iterator)
+static void test_copy_to_end_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
const directory_iterator from(testDir);
- TEST_REQUIRE(from != directory_iterator{});
+ assert(from != directory_iterator{});
const path entry = *from;
directory_iterator to{};
to = from;
- TEST_REQUIRE(to == from);
- TEST_CHECK(*to == entry);
- TEST_CHECK(*from == entry);
+ assert(to == from);
+ assert(*to == entry);
+ assert(*from == entry);
}
-TEST_CASE(test_copy_from_end_iterator)
+static void test_copy_from_end_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -58,14 +55,14 @@
const directory_iterator from{};
directory_iterator to(testDir);
- TEST_REQUIRE(to != directory_iterator{});
+ assert(to != directory_iterator{});
to = from;
- TEST_REQUIRE(to == from);
- TEST_CHECK(to == directory_iterator{});
+ assert(to == from);
+ assert(to == directory_iterator{});
}
-TEST_CASE(test_copy_valid_iterator)
+static void test_copy_valid_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -73,28 +70,35 @@
directory_iterator it_obj(testDir);
const directory_iterator& it = it_obj;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
++it_obj;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
directory_iterator it2(testDir);
- TEST_REQUIRE(it2 != it);
+ assert(it2 != it);
const path entry2 = *it2;
- TEST_CHECK(entry2 != entry);
+ assert(entry2 != entry);
it2 = it;
- TEST_REQUIRE(it2 == it);
- TEST_CHECK(*it2 == entry);
+ assert(it2 == it);
+ assert(*it2 == entry);
}
-TEST_CASE(test_returns_reference_to_self)
+static void test_returns_reference_to_self()
{
const directory_iterator it;
directory_iterator it2;
directory_iterator& ref = (it2 = it);
- TEST_CHECK(&ref == &it2);
+ assert(&ref == &it2);
}
+int main(int, char**) {
+ test_assignment_signature();
+ test_copy_to_end_iterator();
+ test_copy_from_end_iterator();
+ test_copy_valid_iterator();
+ test_returns_reference_to_self();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
index 4ab9a2d..67a0703 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
@@ -22,15 +22,13 @@
#include <set>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(directory_iterator_constructor_tests)
-
-TEST_CASE(test_constructor_signatures)
+static void test_constructor_signatures()
{
using D = directory_iterator;
@@ -57,7 +55,7 @@
}
-TEST_CASE(test_construction_from_bad_path)
+static void test_construction_from_bad_path()
{
static_test_env static_env;
std::error_code ec;
@@ -69,22 +67,22 @@
{
{
directory_iterator it(testPath, ec);
- TEST_CHECK(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
{
directory_iterator it(testPath, opts, ec);
- TEST_CHECK(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
{
- TEST_CHECK_THROW(filesystem_error, directory_iterator(testPath));
- TEST_CHECK_THROW(filesystem_error, directory_iterator(testPath, opts));
+ TEST_THROWS_TYPE(filesystem_error, directory_iterator(testPath));
+ TEST_THROWS_TYPE(filesystem_error, directory_iterator(testPath, opts));
}
}
}
-TEST_CASE(access_denied_test_case)
+static void access_denied_test_case()
{
using namespace fs;
#ifdef _WIN32
@@ -93,7 +91,7 @@
// instead.
const path testDir = GetWindowsInaccessibleDir();
if (testDir.empty())
- TEST_UNSUPPORTED();
+ return;
#else
scoped_test_env env;
path const testDir = env.make_env_path("dir1");
@@ -104,7 +102,7 @@
// Test that we can iterator over the directory before changing the perms
{
directory_iterator it(testDir);
- TEST_REQUIRE(it != directory_iterator{});
+ assert(it != directory_iterator{});
}
// Change the permissions so we can no longer iterate
permissions(testDir, perms::none);
@@ -115,21 +113,21 @@
{
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == directory_iterator{});
+ assert(ec);
+ assert(it == directory_iterator{});
}
// Check that construction does not report an error when
// 'skip_permissions_denied' is given.
{
std::error_code ec;
directory_iterator it(testDir, directory_options::skip_permission_denied, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it == directory_iterator{});
+ assert(!ec);
+ assert(it == directory_iterator{});
}
}
-TEST_CASE(access_denied_to_file_test_case)
+static void access_denied_to_file_test_case()
{
using namespace fs;
scoped_test_env env;
@@ -144,20 +142,20 @@
{
std::error_code ec;
directory_iterator it(testFile, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == directory_iterator{});
+ assert(ec);
+ assert(it == directory_iterator{});
}
// Check that construction still fails when 'skip_permissions_denied' is given
// because we tried to open a file and not a directory.
{
std::error_code ec;
directory_iterator it(testFile, directory_options::skip_permission_denied, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == directory_iterator{});
+ assert(ec);
+ assert(it == directory_iterator{});
}
}
-TEST_CASE(test_open_on_empty_directory_equals_end)
+static void test_open_on_empty_directory_equals_end()
{
scoped_test_env env;
const path testDir = env.make_env_path("dir1");
@@ -167,16 +165,16 @@
{
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(it == endIt);
+ assert(!ec);
+ assert(it == endIt);
}
{
directory_iterator it(testDir);
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
}
-TEST_CASE(test_open_on_directory_succeeds)
+static void test_open_on_directory_succeeds()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -187,18 +185,18 @@
{
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it != endIt);
- TEST_CHECK(dir_contents.count(*it));
+ assert(!ec);
+ assert(it != endIt);
+ assert(dir_contents.count(*it));
}
{
directory_iterator it(testDir);
- TEST_CHECK(it != endIt);
- TEST_CHECK(dir_contents.count(*it));
+ assert(it != endIt);
+ assert(dir_contents.count(*it));
}
}
-TEST_CASE(test_open_on_file_fails)
+static void test_open_on_file_fails()
{
static_test_env static_env;
const path testFile = static_env.File;
@@ -206,35 +204,35 @@
{
std::error_code ec;
directory_iterator it(testFile, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
{
- TEST_CHECK_THROW(filesystem_error, directory_iterator(testFile));
+ TEST_THROWS_TYPE(filesystem_error, directory_iterator(testFile));
}
}
-TEST_CASE(test_open_on_empty_string)
+static void test_open_on_empty_string()
{
const path testPath = "";
const directory_iterator endIt{};
std::error_code ec;
directory_iterator it(testPath, ec);
- TEST_CHECK(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
-TEST_CASE(test_open_on_dot_dir)
+static void test_open_on_dot_dir()
{
const path testPath = ".";
std::error_code ec;
directory_iterator it(testPath, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
}
-TEST_CASE(test_open_on_symlink)
+static void test_open_on_symlink()
{
static_test_env static_env;
const path symlinkToDir = static_env.SymlinkToDir;
@@ -247,20 +245,33 @@
{
std::error_code ec;
directory_iterator it(symlinkToDir, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it != endIt);
+ assert(!ec);
+ assert(it != endIt);
path const& entry = *it;
- TEST_CHECK(dir_contents.count(entry.filename()));
+ assert(dir_contents.count(entry.filename()));
}
{
std::error_code ec;
directory_iterator it(symlinkToDir,
directory_options::follow_directory_symlink, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it != endIt);
+ assert(!ec);
+ assert(it != endIt);
path const& entry = *it;
- TEST_CHECK(dir_contents.count(entry.filename()));
+ assert(dir_contents.count(entry.filename()));
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_constructor_signatures();
+ test_construction_from_bad_path();
+ access_denied_test_case();
+ access_denied_to_file_test_case();
+ test_open_on_empty_directory_equals_end();
+ test_open_on_directory_succeeds();
+ test_open_on_file_fails();
+ test_open_on_empty_string();
+ test_open_on_dot_dir();
+ test_open_on_symlink();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp
index 09b5139..ca83031 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp
@@ -21,14 +21,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(directory_iterator_increment_tests)
-
-TEST_CASE(test_increment_signatures)
+static void test_increment_signatures()
{
directory_iterator d; ((void)d);
std::error_code ec; ((void)ec);
@@ -40,7 +37,7 @@
ASSERT_NOT_NOEXCEPT(d.increment(ec));
}
-TEST_CASE(test_prefix_increment)
+static void test_prefix_increment()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -50,21 +47,21 @@
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
directory_iterator& it_ref = ++it;
- TEST_CHECK(&it_ref == &it);
+ assert(&it_ref == &it);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_postfix_increment)
+static void test_postfix_increment()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -74,22 +71,22 @@
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
const path entry2 = *it++;
- TEST_CHECK(entry2 == entry);
+ assert(entry2 == entry);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_increment_method)
+static void test_increment_method()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -99,19 +96,26 @@
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
directory_iterator& it_ref = it.increment(ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(&it_ref == &it);
+ assert(!ec);
+ assert(&it_ref == &it);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_increment_signatures();
+ test_prefix_increment();
+ test_postfix_increment();
+ test_increment_method();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp
index 6ae6eed..a1f730e 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp
@@ -20,43 +20,46 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(directory_iterator_move_construct_tests)
-
-TEST_CASE(test_constructor_signature)
+static void test_constructor_signature()
{
using D = directory_iterator;
static_assert(std::is_nothrow_move_constructible<D>::value, "");
}
-TEST_CASE(test_move_end_iterator)
+static void test_move_end_iterator()
{
const directory_iterator endIt;
directory_iterator endIt2{};
directory_iterator it(std::move(endIt2));
- TEST_CHECK(it == endIt);
- TEST_CHECK(endIt2 == endIt);
+ assert(it == endIt);
+ assert(endIt2 == endIt);
}
-TEST_CASE(test_move_valid_iterator)
+static void test_move_valid_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
const directory_iterator endIt{};
directory_iterator it(testDir);
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
const directory_iterator it2(std::move(it));
- TEST_CHECK(*it2 == entry);
+ assert(*it2 == entry);
- TEST_CHECK(it == it2 || it == endIt);
+ assert(it == it2 || it == endIt);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_constructor_signature();
+ test_move_end_iterator();
+ test_move_valid_iterator();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp
index d0beee1..636c54b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp
@@ -20,7 +20,6 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
// The filesystem specification explicitly allows for self-move on
@@ -29,31 +28,29 @@
using namespace fs;
-TEST_SUITE(directory_iterator_move_assign_tests)
-
-TEST_CASE(test_assignment_signature)
+static void test_assignment_signature()
{
using D = directory_iterator;
static_assert(std::is_nothrow_move_assignable<D>::value, "");
}
-TEST_CASE(test_move_to_end_iterator)
+static void test_move_to_end_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
directory_iterator from(testDir);
- TEST_REQUIRE(from != directory_iterator{});
+ assert(from != directory_iterator{});
const path entry = *from;
directory_iterator to{};
to = std::move(from);
- TEST_REQUIRE(to != directory_iterator{});
- TEST_CHECK(*to == entry);
+ assert(to != directory_iterator{});
+ assert(*to == entry);
}
-TEST_CASE(test_move_from_end_iterator)
+static void test_move_from_end_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -61,57 +58,65 @@
directory_iterator from{};
directory_iterator to(testDir);
- TEST_REQUIRE(to != from);
+ assert(to != from);
to = std::move(from);
- TEST_REQUIRE(to == directory_iterator{});
- TEST_REQUIRE(from == directory_iterator{});
+ assert(to == directory_iterator{});
+ assert(from == directory_iterator{});
}
-TEST_CASE(test_move_valid_iterator)
+static void test_move_valid_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
const directory_iterator endIt{};
directory_iterator it(testDir);
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
++it;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
directory_iterator it2(testDir);
- TEST_REQUIRE(it2 != it);
+ assert(it2 != it);
const path entry2 = *it2;
- TEST_CHECK(entry2 != entry);
+ assert(entry2 != entry);
it2 = std::move(it);
- TEST_REQUIRE(it2 != directory_iterator{});
- TEST_CHECK(*it2 == entry);
+ assert(it2 != directory_iterator{});
+ assert(*it2 == entry);
}
-TEST_CASE(test_returns_reference_to_self)
+static void test_returns_reference_to_self()
{
directory_iterator it;
directory_iterator it2;
directory_iterator& ref = (it2 = it);
- TEST_CHECK(&ref == &it2);
+ assert(&ref == &it2);
}
-TEST_CASE(test_self_move)
+static void test_self_move()
{
static_test_env static_env;
// Create two non-equal iterators that have exactly the same state.
directory_iterator it(static_env.Dir);
directory_iterator it2(static_env.Dir);
++it; ++it2;
- TEST_CHECK(it != it2);
- TEST_CHECK(*it2 == *it);
+ assert(it != it2);
+ assert(*it2 == *it);
it = std::move(it);
- TEST_CHECK(*it2 == *it);
+ assert(*it2 == *it);
}
+int main(int, char**) {
+ test_assignment_signature();
+ test_move_to_end_iterator();
+ test_move_from_end_iterator();
+ test_move_valid_iterator();
+ test_returns_reference_to_self();
+ test_self_move();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp
index f6f0bbe..44cde7e 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp
@@ -21,14 +21,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(directory_iterator_begin_end_tests)
-
-TEST_CASE(test_function_signatures)
+static void test_function_signatures()
{
directory_iterator d;
@@ -43,7 +40,7 @@
ASSERT_NOEXCEPT(end(std::move(d)));
}
-TEST_CASE(test_ranged_for_loop)
+static void test_ranged_for_loop()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -52,12 +49,17 @@
std::error_code ec;
directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
for (auto& elem : it) {
- TEST_CHECK(dir_contents.erase(elem) == 1);
+ assert(dir_contents.erase(elem) == 1);
}
- TEST_CHECK(dir_contents.empty());
+ assert(dir_contents.empty());
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_function_signatures();
+ test_ranged_for_loop();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
index 3e194a7..504616c 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
@@ -131,9 +131,17 @@
auto h2 = hash_value(p2);
assert((h1 == h2) == (p1 == p2));
// check signature
- ASSERT_SAME_TYPE(size_t, decltype(hash_value(p1)));
+ ASSERT_SAME_TYPE(std::size_t, decltype(hash_value(p1)));
ASSERT_NOEXCEPT(hash_value(p1));
}
+ { // check std::hash
+ auto h1 = std::hash<fs::path>()(p1);
+ auto h2 = std::hash<fs::path>()(p2);
+ assert((h1 == h2) == (p1 == p2));
+ // check signature
+ ASSERT_SAME_TYPE(std::size_t, decltype(std::hash<fs::path>()(p1)));
+ ASSERT_NOEXCEPT(std::hash<fs::path>()(p1));
+ }
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
index 75e88e0..32bbc4c 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
@@ -16,12 +16,7 @@
#include "filesystem_include.h"
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
fs::path c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp
index 0d17436..c6574d0 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp
@@ -19,6 +19,7 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
#include "filesystem_test_helper.h"
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash.tested_elswhere.compile.pass.cpp
similarity index 69%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
copy to third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash.tested_elswhere.compile.pass.cpp
index 92dc58c..b69e224 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash.tested_elswhere.compile.pass.cpp
@@ -6,16 +6,5 @@
//
//===----------------------------------------------------------------------===//
-// <complex.h>
-
-#include <complex.h>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
-
- return 0;
-}
+// The std::hash specialization is tested as part of [path.compare]
+// in libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value.tested_elswhere.compile.pass.cpp
similarity index 69%
copy from third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
copy to third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value.tested_elswhere.compile.pass.cpp
index 92dc58c..9d7260d 100644
--- a/third_party/llvm-project/libcxx/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/hash_value.tested_elswhere.compile.pass.cpp
@@ -6,16 +6,5 @@
//
//===----------------------------------------------------------------------===//
-// <complex.h>
-
-#include <complex.h>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::complex<double> d;
- (void)d;
-
- return 0;
-}
+// The `hash_value` function is tested as part of [path.compare]
+// in libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp
index aacf160..3e007dd 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp
@@ -20,28 +20,25 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_copy_construct_tests)
-
-TEST_CASE(test_constructor_signature)
+static void test_constructor_signature()
{
using D = recursive_directory_iterator;
static_assert(std::is_copy_constructible<D>::value, "");
//static_assert(!std::is_nothrow_copy_constructible<D>::value, "");
}
-TEST_CASE(test_copy_end_iterator)
+static void test_copy_end_iterator()
{
const recursive_directory_iterator endIt;
recursive_directory_iterator it(endIt);
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_copy_valid_iterator)
+static void test_copy_valid_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -54,26 +51,32 @@
// it.recursion_pending() != true
const directory_options opts = directory_options::skip_permission_denied;
recursive_directory_iterator it(testDir, opts);
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
while (it.depth() == 0) {
++it;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
}
it.disable_recursion_pending();
- TEST_CHECK(it.options() == opts);
- TEST_CHECK(it.depth() == 1);
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.options() == opts);
+ assert(it.depth() == 1);
+ assert(it.recursion_pending() == false);
const path entry = *it;
// OPERATION UNDER TEST //
const recursive_directory_iterator it2(it);
// ------------------- //
- TEST_REQUIRE(it2 == it);
- TEST_CHECK(*it2 == entry);
- TEST_CHECK(it2.depth() == 1);
- TEST_CHECK(it2.recursion_pending() == false);
- TEST_CHECK(it != endIt);
+ assert(it2 == it);
+ assert(*it2 == entry);
+ assert(it2.depth() == 1);
+ assert(it2.recursion_pending() == false);
+ assert(it != endIt);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_constructor_signature();
+ test_copy_end_iterator();
+ test_copy_valid_iterator();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
index dc689ad..95a7762 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
@@ -20,13 +20,10 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_copy_assign_tests)
-
recursive_directory_iterator createInterestingIterator(const static_test_env &static_env)
// Create an "interesting" iterator where all fields are
// in a non-default state. The returned 'it' is in a
@@ -39,12 +36,12 @@
const recursive_directory_iterator endIt;
recursive_directory_iterator it(testDir,
directory_options::skip_permission_denied);
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
while (it.depth() != 1) {
++it;
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
}
- TEST_ASSERT(it.depth() == 1);
+ assert(it.depth() == 1);
it.disable_recursion_pending();
return it;
}
@@ -62,21 +59,21 @@
const recursive_directory_iterator endIt;
recursive_directory_iterator it(testDir,
directory_options::follow_directory_symlink);
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
while (it.depth() != 2) {
++it;
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
}
- TEST_ASSERT(it.depth() == 2);
+ assert(it.depth() == 2);
return it;
}
-TEST_CASE(test_assignment_signature) {
+static void test_assignment_signature() {
using D = recursive_directory_iterator;
static_assert(std::is_copy_assignable<D>::value, "");
}
-TEST_CASE(test_copy_to_end_iterator)
+static void test_copy_to_end_iterator()
{
static_test_env static_env;
const recursive_directory_iterator endIt;
@@ -86,26 +83,26 @@
recursive_directory_iterator to;
to = from;
- TEST_REQUIRE(to == from);
- TEST_CHECK(*to == entry);
- TEST_CHECK(to.options() == from.options());
- TEST_CHECK(to.depth() == from.depth());
- TEST_CHECK(to.recursion_pending() == from.recursion_pending());
+ assert(to == from);
+ assert(*to == entry);
+ assert(to.options() == from.options());
+ assert(to.depth() == from.depth());
+ assert(to.recursion_pending() == from.recursion_pending());
}
-TEST_CASE(test_copy_from_end_iterator)
+static void test_copy_from_end_iterator()
{
static_test_env static_env;
const recursive_directory_iterator from;
recursive_directory_iterator to = createInterestingIterator(static_env);
to = from;
- TEST_REQUIRE(to == from);
- TEST_CHECK(to == recursive_directory_iterator{});
+ assert(to == from);
+ assert(to == recursive_directory_iterator{});
}
-TEST_CASE(test_copy_valid_iterator)
+static void test_copy_valid_iterator()
{
static_test_env static_env;
const recursive_directory_iterator endIt;
@@ -114,48 +111,57 @@
const path entry = *it;
recursive_directory_iterator it2 = createDifferentInterestingIterator(static_env);
- TEST_REQUIRE(it2 != it);
- TEST_CHECK(it2.options() != it.options());
- TEST_CHECK(it2.depth() != it.depth());
- TEST_CHECK(it2.recursion_pending() != it.recursion_pending());
- TEST_CHECK(*it2 != entry);
+ assert(it2 != it);
+ assert(it2.options() != it.options());
+ assert(it2.depth() != it.depth());
+ assert(it2.recursion_pending() != it.recursion_pending());
+ assert(*it2 != entry);
it2 = it;
- TEST_REQUIRE(it2 == it);
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == entry);
+ assert(it2 == it);
+ assert(it2.options() == it.options());
+ assert(it2.depth() == it.depth());
+ assert(it2.recursion_pending() == it.recursion_pending());
+ assert(*it2 == entry);
}
-TEST_CASE(test_returns_reference_to_self)
+static void test_returns_reference_to_self()
{
const recursive_directory_iterator it;
recursive_directory_iterator it2;
recursive_directory_iterator& ref = (it2 = it);
- TEST_CHECK(&ref == &it2);
+ assert(&ref == &it2);
}
-TEST_CASE(test_self_copy)
+static void test_self_copy()
{
static_test_env static_env;
// Create two non-equal iterators that have exactly the same state.
recursive_directory_iterator it = createInterestingIterator(static_env);
recursive_directory_iterator it2 = createInterestingIterator(static_env);
- TEST_CHECK(it != it2);
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == *it);
+ assert(it != it2);
+ assert(it2.options() == it.options());
+ assert(it2.depth() == it.depth());
+ assert(it2.recursion_pending() == it.recursion_pending());
+ assert(*it2 == *it);
// perform a self-copy and check that the state still matches the
// other unmodified iterator.
recursive_directory_iterator const& cit = it;
it = cit;
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == *it);
+ assert(it2.options() == it.options());
+ assert(it2.depth() == it.depth());
+ assert(it2.recursion_pending() == it.recursion_pending());
+ assert(*it2 == *it);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_assignment_signature();
+ test_copy_to_end_iterator();
+ test_copy_from_end_iterator();
+ test_copy_valid_iterator();
+ test_returns_reference_to_self();
+ test_self_copy();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
index 5a18c46..ced81b9 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
@@ -24,17 +24,15 @@
#include <set>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
using RDI = recursive_directory_iterator;
-TEST_SUITE(recursive_directory_iterator_constructor_tests)
-
-TEST_CASE(test_constructor_signatures)
+static void test_constructor_signatures()
{
using D = recursive_directory_iterator;
@@ -58,7 +56,7 @@
static_assert(!std::is_nothrow_constructible<D, path, directory_options, std::error_code&>::value, "");
}
-TEST_CASE(test_construction_from_bad_path)
+static void test_construction_from_bad_path()
{
static_test_env static_env;
std::error_code ec;
@@ -70,22 +68,22 @@
{
{
RDI it(testPath, ec);
- TEST_CHECK(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
{
RDI it(testPath, opts, ec);
- TEST_CHECK(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
{
- TEST_CHECK_THROW(filesystem_error, RDI(testPath));
- TEST_CHECK_THROW(filesystem_error, RDI(testPath, opts));
+ TEST_THROWS_TYPE(filesystem_error, RDI(testPath));
+ TEST_THROWS_TYPE(filesystem_error, RDI(testPath, opts));
}
}
}
-TEST_CASE(access_denied_test_case)
+static void access_denied_test_case()
{
using namespace fs;
#ifdef _WIN32
@@ -94,7 +92,7 @@
// instead.
const path testDir = GetWindowsInaccessibleDir();
if (testDir.empty())
- TEST_UNSUPPORTED();
+ return;
#else
scoped_test_env env;
path const testDir = env.make_env_path("dir1");
@@ -105,7 +103,7 @@
// Test that we can iterator over the directory before changing the perms
{
RDI it(testDir);
- TEST_REQUIRE(it != RDI{});
+ assert(it != RDI{});
}
// Change the permissions so we can no longer iterate
@@ -117,21 +115,21 @@
{
std::error_code ec;
RDI it(testDir, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == RDI{});
+ assert(ec);
+ assert(it == RDI{});
}
// Check that construction does not report an error when
// 'skip_permissions_denied' is given.
{
std::error_code ec;
RDI it(testDir, directory_options::skip_permission_denied, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it == RDI{});
+ assert(!ec);
+ assert(it == RDI{});
}
}
-TEST_CASE(access_denied_to_file_test_case)
+static void access_denied_to_file_test_case()
{
using namespace fs;
#ifdef _WIN32
@@ -140,7 +138,7 @@
// instead.
const path testDir = GetWindowsInaccessibleDir();
if (testDir.empty())
- TEST_UNSUPPORTED();
+ return;
path const testFile = testDir / "inaccessible_file";
#else
scoped_test_env env;
@@ -156,20 +154,20 @@
{
std::error_code ec;
RDI it(testFile, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == RDI{});
+ assert(ec);
+ assert(it == RDI{});
}
// Check that construction still fails when 'skip_permissions_denied' is given
// because we tried to open a file and not a directory.
{
std::error_code ec;
RDI it(testFile, directory_options::skip_permission_denied, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == RDI{});
+ assert(ec);
+ assert(it == RDI{});
}
}
-TEST_CASE(test_open_on_empty_directory_equals_end)
+static void test_open_on_empty_directory_equals_end()
{
scoped_test_env env;
const path testDir = env.make_env_path("dir1");
@@ -179,16 +177,16 @@
{
std::error_code ec;
RDI it(testDir, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(it == endIt);
+ assert(!ec);
+ assert(it == endIt);
}
{
RDI it(testDir);
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
}
-TEST_CASE(test_open_on_directory_succeeds)
+static void test_open_on_directory_succeeds()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -199,18 +197,18 @@
{
std::error_code ec;
RDI it(testDir, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it != endIt);
- TEST_CHECK(dir_contents.count(*it));
+ assert(!ec);
+ assert(it != endIt);
+ assert(dir_contents.count(*it));
}
{
RDI it(testDir);
- TEST_CHECK(it != endIt);
- TEST_CHECK(dir_contents.count(*it));
+ assert(it != endIt);
+ assert(dir_contents.count(*it));
}
}
-TEST_CASE(test_open_on_file_fails)
+static void test_open_on_file_fails()
{
static_test_env static_env;
const path testFile = static_env.File;
@@ -218,15 +216,15 @@
{
std::error_code ec;
RDI it(testFile, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
{
- TEST_CHECK_THROW(filesystem_error, RDI(testFile));
+ TEST_THROWS_TYPE(filesystem_error, RDI(testFile));
}
}
-TEST_CASE(test_options_post_conditions)
+static void test_options_post_conditions()
{
static_test_env static_env;
const path goodDir = static_env.Dir;
@@ -236,33 +234,45 @@
std::error_code ec;
RDI it1(goodDir, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it1.options() == directory_options::none);
+ assert(!ec);
+ assert(it1.options() == directory_options::none);
RDI it2(badDir, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(it2 == RDI{});
+ assert(ec);
+ assert(it2 == RDI{});
}
{
std::error_code ec;
const directory_options opts = directory_options::skip_permission_denied;
RDI it1(goodDir, opts, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it1.options() == opts);
+ assert(!ec);
+ assert(it1.options() == opts);
RDI it2(badDir, opts, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(it2 == RDI{});
+ assert(ec);
+ assert(it2 == RDI{});
}
{
RDI it(goodDir);
- TEST_CHECK(it.options() == directory_options::none);
+ assert(it.options() == directory_options::none);
}
{
const directory_options opts = directory_options::follow_directory_symlink;
RDI it(goodDir, opts);
- TEST_CHECK(it.options() == opts);
+ assert(it.options() == opts);
}
}
-TEST_SUITE_END()
+
+int main(int, char**) {
+ test_constructor_signatures();
+ test_construction_from_bad_path();
+ access_denied_test_case();
+ access_denied_to_file_test_case();
+ test_open_on_empty_directory_equals_end();
+ test_open_on_directory_succeeds();
+ test_open_on_file_fails();
+ test_options_post_conditions();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp
index 4983665..32bd074 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp
@@ -19,15 +19,13 @@
#include <set>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_depth_tests)
-
-TEST_CASE(test_depth)
+static void test_depth()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -37,8 +35,8 @@
std::error_code ec;
recursive_directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(it.depth() == 0);
+ assert(!ec);
+ assert(it.depth() == 0);
bool seen_d1, seen_d2;
seen_d1 = seen_d2 = false;
@@ -47,20 +45,24 @@
const path entry = *it;
const path parent = entry.parent_path();
if (parent == testDir) {
- TEST_CHECK(it.depth() == 0);
+ assert(it.depth() == 0);
} else if (parent == DirDepth1) {
- TEST_CHECK(it.depth() == 1);
+ assert(it.depth() == 1);
seen_d1 = true;
} else if (parent == DirDepth2) {
- TEST_CHECK(it.depth() == 2);
+ assert(it.depth() == 2);
seen_d2 = true;
} else {
- TEST_CHECK(!"Unexpected depth while iterating over static env");
+ assert(!"Unexpected depth while iterating over static env");
}
++it;
}
- TEST_REQUIRE(seen_d1 && seen_d2);
- TEST_CHECK(it == endIt);
+ assert(seen_d1 && seen_d2);
+ assert(it == endIt);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_depth();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp
index e9dc964..061046e 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp
@@ -20,24 +20,26 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_disable_recursion_pending_tests)
// NOTE: The main semantics of disable_recursion_pending are tested
// in the 'recursion_pending()' tests.
-TEST_CASE(basic_test)
+static void basic_test()
{
static_test_env static_env;
recursive_directory_iterator it(static_env.Dir);
- TEST_REQUIRE(it.recursion_pending() == true);
+ assert(it.recursion_pending() == true);
it.disable_recursion_pending();
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.recursion_pending() == false);
it.disable_recursion_pending();
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.recursion_pending() == false);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ basic_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
index 4b8390e..9a157ad 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
@@ -20,15 +20,13 @@
#include <set>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_increment_tests)
-
-TEST_CASE(test_increment_signatures)
+static void test_increment_signatures()
{
recursive_directory_iterator d; ((void)d);
std::error_code ec; ((void)ec);
@@ -40,7 +38,7 @@
ASSERT_NOT_NOEXCEPT(d.increment(ec));
}
-TEST_CASE(test_prefix_increment)
+static void test_prefix_increment()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -50,21 +48,21 @@
std::error_code ec;
recursive_directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
recursive_directory_iterator& it_ref = ++it;
- TEST_CHECK(&it_ref == &it);
+ assert(&it_ref == &it);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_postfix_increment)
+static void test_postfix_increment()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -74,21 +72,21 @@
std::error_code ec;
recursive_directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
const path entry2 = *it++;
- TEST_CHECK(entry2 == entry);
+ assert(entry2 == entry);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_increment_method)
+static void test_increment_method()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -98,22 +96,22 @@
std::error_code ec;
recursive_directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
recursive_directory_iterator& it_ref = it.increment(ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(&it_ref == &it);
+ assert(!ec);
+ assert(&it_ref == &it);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
-TEST_CASE(test_follow_symlinks)
+static void test_follow_symlinks()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -125,25 +123,25 @@
std::error_code ec;
recursive_directory_iterator it(testDir,
directory_options::follow_directory_symlink, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
std::set<path> unseen_entries = dir_contents;
while (!unseen_entries.empty()) {
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
const path entry = *it;
- TEST_REQUIRE(unseen_entries.erase(entry) == 1);
+ assert(unseen_entries.erase(entry) == 1);
recursive_directory_iterator& it_ref = it.increment(ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(&it_ref == &it);
+ assert(!ec);
+ assert(&it_ref == &it);
}
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
}
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(access_denied_on_recursion_test_case)
+static void access_denied_on_recursion_test_case()
{
using namespace fs;
scoped_test_env env;
@@ -168,54 +166,54 @@
{
std::error_code ec = GetTestEC();
recursive_directory_iterator it(startDir, ec);
- TEST_REQUIRE(ec != GetTestEC());
- TEST_REQUIRE(!ec);
+ assert(ec != GetTestEC());
+ assert(!ec);
while (it != endIt && it->path() != permDeniedDir)
++it;
- TEST_REQUIRE(it != endIt);
- TEST_REQUIRE(*it == permDeniedDir);
+ assert(it != endIt);
+ assert(*it == permDeniedDir);
it.increment(ec);
- TEST_CHECK(ec);
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
// Same as above but test operator++().
{
std::error_code ec = GetTestEC();
recursive_directory_iterator it(startDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
while (it != endIt && it->path() != permDeniedDir)
++it;
- TEST_REQUIRE(it != endIt);
- TEST_REQUIRE(*it == permDeniedDir);
+ assert(it != endIt);
+ assert(*it == permDeniedDir);
- TEST_REQUIRE_THROW(filesystem_error, ++it);
+ TEST_THROWS_TYPE(filesystem_error, ++it);
}
// Test that recursion resulting in a "EACCESS" error is ignored when the
// correct options are given to the constructor.
{
std::error_code ec = GetTestEC();
recursive_directory_iterator it(startDir, SkipEPerm, ec);
- TEST_REQUIRE(!ec);
- TEST_REQUIRE(it != endIt);
+ assert(!ec);
+ assert(it != endIt);
bool seenOtherFile = false;
if (*it == otherFile) {
++it;
seenOtherFile = true;
- TEST_REQUIRE (it != endIt);
+ assert (it != endIt);
}
- TEST_REQUIRE(*it == permDeniedDir);
+ assert(*it == permDeniedDir);
ec = GetTestEC();
it.increment(ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
if (seenOtherFile) {
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
} else {
- TEST_CHECK(it != endIt);
- TEST_CHECK(*it == otherFile);
+ assert(it != endIt);
+ assert(*it == otherFile);
}
}
// Test that construction resulting in a "EACCESS" error is not ignored
@@ -223,12 +221,12 @@
{
std::error_code ec;
recursive_directory_iterator it(permDeniedDir, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(it == endIt);
+ assert(ec);
+ assert(it == endIt);
}
// Same as above but testing the throwing constructors
{
- TEST_REQUIRE_THROW(filesystem_error,
+ TEST_THROWS_TYPE(filesystem_error,
recursive_directory_iterator(permDeniedDir));
}
// Test that construction resulting in a "EACCESS" error constructs the
@@ -236,13 +234,13 @@
{
std::error_code ec = GetTestEC();
recursive_directory_iterator it(permDeniedDir, SkipEPerm, ec);
- TEST_REQUIRE(!ec);
- TEST_REQUIRE(it == endIt);
+ assert(!ec);
+ assert(it == endIt);
}
}
// See llvm.org/PR35078
-TEST_CASE(test_PR35078)
+static void test_PR35078()
{
using namespace fs;
scoped_test_env env;
@@ -284,46 +282,46 @@
{
bool SeenNestedFile = false;
recursive_directory_iterator it = SetupState(false, SeenNestedFile);
- TEST_REQUIRE(it != endIt);
- TEST_REQUIRE(*it == nestedDir);
+ assert(it != endIt);
+ assert(*it == nestedDir);
ec = GetTestEC();
it.increment(ec);
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, eacess));
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(ErrorIs(ec, eacess));
+ assert(it == endIt);
}
{
bool SeenNestedFile = false;
recursive_directory_iterator it = SetupState(true, SeenNestedFile);
- TEST_REQUIRE(it != endIt);
- TEST_REQUIRE(*it == nestedDir);
+ assert(it != endIt);
+ assert(*it == nestedDir);
ec = GetTestEC();
it.increment(ec);
- TEST_CHECK(!ec);
+ assert(!ec);
if (SeenNestedFile) {
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
} else {
- TEST_REQUIRE(it != endIt);
- TEST_CHECK(*it == nestedFile);
+ assert(it != endIt);
+ assert(*it == nestedFile);
}
}
{
bool SeenNestedFile = false;
recursive_directory_iterator it = SetupState(false, SeenNestedFile);
- TEST_REQUIRE(it != endIt);
- TEST_REQUIRE(*it == nestedDir);
+ assert(it != endIt);
+ assert(*it == nestedDir);
ExceptionChecker Checker(std::errc::permission_denied,
"recursive_directory_iterator::operator++()",
format_string("attempting recursion into \"%s\"",
nestedDir.string().c_str()));
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ++it);
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, ++it);
}
}
// See llvm.org/PR35078
-TEST_CASE(test_PR35078_with_symlink)
+static void test_PR35078_with_symlink()
{
using namespace fs;
scoped_test_env env;
@@ -383,30 +381,30 @@
recursive_directory_iterator it = SetupState(TC.SkipPermDenied,
TC.FollowSymlinks,
SeenNestedFile);
- TEST_REQUIRE(!ec);
- TEST_REQUIRE(it != endIt);
- TEST_REQUIRE(*it == symDir);
+ assert(!ec);
+ assert(it != endIt);
+ assert(*it == symDir);
ec = GetTestEC();
it.increment(ec);
if (TC.ExpectSuccess) {
- TEST_CHECK(!ec);
+ assert(!ec);
if (SeenNestedFile) {
- TEST_CHECK(it == endIt);
+ assert(it == endIt);
} else {
- TEST_REQUIRE(it != endIt);
- TEST_CHECK(*it == nestedFile);
+ assert(it != endIt);
+ assert(*it == nestedFile);
}
} else {
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, eacess));
- TEST_CHECK(it == endIt);
+ assert(ec);
+ assert(ErrorIs(ec, eacess));
+ assert(it == endIt);
}
}
}
// See llvm.org/PR35078
-TEST_CASE(test_PR35078_with_symlink_file)
+static void test_PR35078_with_symlink_file()
{
using namespace fs;
scoped_test_env env;
@@ -466,34 +464,47 @@
recursive_directory_iterator it = SetupState(TC.SkipPermDenied,
TC.FollowSymlinks,
SeenNestedFile);
- TEST_REQUIRE(!ec);
- TEST_REQUIRE(it != EndIt);
- TEST_REQUIRE(*it == nestedDir);
+ assert(!ec);
+ assert(it != EndIt);
+ assert(*it == nestedDir);
ec = GetTestEC();
it.increment(ec);
- TEST_REQUIRE(it != EndIt);
- TEST_CHECK(!ec);
- TEST_CHECK(*it == symFile);
+ assert(it != EndIt);
+ assert(!ec);
+ assert(*it == symFile);
ec = GetTestEC();
it.increment(ec);
if (TC.ExpectSuccess) {
if (!SeenNestedFile) {
- TEST_CHECK(!ec);
- TEST_REQUIRE(it != EndIt);
- TEST_CHECK(*it == nestedFile);
+ assert(!ec);
+ assert(it != EndIt);
+ assert(*it == nestedFile);
ec = GetTestEC();
it.increment(ec);
}
- TEST_CHECK(!ec);
- TEST_CHECK(it == EndIt);
+ assert(!ec);
+ assert(it == EndIt);
} else {
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, eacess));
- TEST_CHECK(it == EndIt);
+ assert(ec);
+ assert(ErrorIs(ec, eacess));
+ assert(it == EndIt);
}
}
}
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+
+int main(int, char**) {
+ test_increment_signatures();
+ test_prefix_increment();
+ test_postfix_increment();
+ test_increment_method();
+ test_follow_symlinks();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ access_denied_on_recursion_test_case();
+ test_PR35078();
+ test_PR35078_with_symlink();
+ test_PR35078_with_symlink_file();
#endif
-
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp
index 7dcc47d..be32042 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp
@@ -20,30 +20,27 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_move_construct_tests)
-
-TEST_CASE(test_constructor_signature)
+static void test_constructor_signature()
{
using D = recursive_directory_iterator;
static_assert(std::is_nothrow_move_constructible<D>::value, "");
}
-TEST_CASE(test_move_end_iterator)
+static void test_move_end_iterator()
{
const recursive_directory_iterator endIt;
recursive_directory_iterator endIt2{};
recursive_directory_iterator it(std::move(endIt2));
- TEST_CHECK(it == endIt);
- TEST_CHECK(endIt2 == endIt);
+ assert(it == endIt);
+ assert(endIt2 == endIt);
}
-TEST_CASE(test_move_valid_iterator)
+static void test_move_valid_iterator()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -56,25 +53,31 @@
// it.recursion_pending() != true
const directory_options opts = directory_options::skip_permission_denied;
recursive_directory_iterator it(testDir, opts);
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
while (it.depth() == 0) {
++it;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
}
it.disable_recursion_pending();
- TEST_CHECK(it.options() == opts);
- TEST_CHECK(it.depth() == 1);
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.options() == opts);
+ assert(it.depth() == 1);
+ assert(it.recursion_pending() == false);
const path entry = *it;
// OPERATION UNDER TEST //
const recursive_directory_iterator it2(std::move(it));
// ------------------- //
- TEST_REQUIRE(it2 != endIt);
- TEST_CHECK(*it2 == entry);
- TEST_CHECK(it2.depth() == 1);
- TEST_CHECK(it2.recursion_pending() == false);
+ assert(it2 != endIt);
+ assert(*it2 == entry);
+ assert(it2.depth() == 1);
+ assert(it2.recursion_pending() == false);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_constructor_signature();
+ test_move_end_iterator();
+ test_move_valid_iterator();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp
index abe5dd7..65c3042 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp
@@ -20,7 +20,6 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
// The filesystem specification explicitly allows for self-move on
@@ -29,8 +28,6 @@
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_move_assign_tests)
-
recursive_directory_iterator createInterestingIterator(const static_test_env &static_env)
// Create an "interesting" iterator where all fields are
// in a non-default state. The returned 'it' is in a
@@ -43,12 +40,12 @@
const recursive_directory_iterator endIt;
recursive_directory_iterator it(testDir,
directory_options::skip_permission_denied);
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
while (it.depth() != 1) {
++it;
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
}
- TEST_ASSERT(it.depth() == 1);
+ assert(it.depth() == 1);
it.disable_recursion_pending();
return it;
}
@@ -65,24 +62,24 @@
const recursive_directory_iterator endIt;
recursive_directory_iterator it(testDir,
directory_options::follow_directory_symlink);
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
while (it.depth() != 2) {
++it;
- TEST_ASSERT(it != endIt);
+ assert(it != endIt);
}
- TEST_ASSERT(it.depth() == 2);
+ assert(it.depth() == 2);
return it;
}
-TEST_CASE(test_assignment_signature)
+static void test_assignment_signature()
{
using D = recursive_directory_iterator;
static_assert(std::is_nothrow_move_assignable<D>::value, "");
}
-TEST_CASE(test_move_to_end_iterator)
+static void test_move_to_end_iterator()
{
static_test_env static_env;
const recursive_directory_iterator endIt;
@@ -93,27 +90,27 @@
recursive_directory_iterator to;
to = std::move(from);
- TEST_REQUIRE(to != endIt);
- TEST_CHECK(*to == entry);
- TEST_CHECK(to.options() == from_copy.options());
- TEST_CHECK(to.depth() == from_copy.depth());
- TEST_CHECK(to.recursion_pending() == from_copy.recursion_pending());
- TEST_CHECK(from == endIt || from == to);
+ assert(to != endIt);
+ assert(*to == entry);
+ assert(to.options() == from_copy.options());
+ assert(to.depth() == from_copy.depth());
+ assert(to.recursion_pending() == from_copy.recursion_pending());
+ assert(from == endIt || from == to);
}
-TEST_CASE(test_move_from_end_iterator)
+static void test_move_from_end_iterator()
{
static_test_env static_env;
recursive_directory_iterator from;
recursive_directory_iterator to = createInterestingIterator(static_env);
to = std::move(from);
- TEST_REQUIRE(to == from);
- TEST_CHECK(to == recursive_directory_iterator{});
+ assert(to == from);
+ assert(to == recursive_directory_iterator{});
}
-TEST_CASE(test_move_valid_iterator)
+static void test_move_valid_iterator()
{
static_test_env static_env;
const recursive_directory_iterator endIt;
@@ -124,47 +121,55 @@
recursive_directory_iterator it2 = createDifferentInterestingIterator(static_env);
const recursive_directory_iterator it2_copy(it2);
- TEST_REQUIRE(it2 != it);
- TEST_CHECK(it2.options() != it.options());
- TEST_CHECK(it2.depth() != it.depth());
- TEST_CHECK(it2.recursion_pending() != it.recursion_pending());
- TEST_CHECK(*it2 != entry);
+ assert(it2 != it);
+ assert(it2.options() != it.options());
+ assert(it2.depth() != it.depth());
+ assert(it2.recursion_pending() != it.recursion_pending());
+ assert(*it2 != entry);
it2 = std::move(it);
- TEST_REQUIRE(it2 != it2_copy && it2 != endIt);
- TEST_CHECK(it2.options() == it_copy.options());
- TEST_CHECK(it2.depth() == it_copy.depth());
- TEST_CHECK(it2.recursion_pending() == it_copy.recursion_pending());
- TEST_CHECK(*it2 == entry);
- TEST_CHECK(it == endIt || it == it2);
+ assert(it2 != it2_copy && it2 != endIt);
+ assert(it2.options() == it_copy.options());
+ assert(it2.depth() == it_copy.depth());
+ assert(it2.recursion_pending() == it_copy.recursion_pending());
+ assert(*it2 == entry);
+ assert(it == endIt || it == it2);
}
-TEST_CASE(test_returns_reference_to_self)
+static void test_returns_reference_to_self()
{
recursive_directory_iterator it;
recursive_directory_iterator it2;
recursive_directory_iterator& ref = (it2 = std::move(it));
- TEST_CHECK(&ref == &it2);
+ assert(&ref == &it2);
}
-TEST_CASE(test_self_move)
+static void test_self_move()
{
static_test_env static_env;
// Create two non-equal iterators that have exactly the same state.
recursive_directory_iterator it = createInterestingIterator(static_env);
recursive_directory_iterator it2 = createInterestingIterator(static_env);
- TEST_CHECK(it != it2);
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == *it);
+ assert(it != it2);
+ assert(it2.options() == it.options());
+ assert(it2.depth() == it.depth());
+ assert(it2.recursion_pending() == it.recursion_pending());
+ assert(*it2 == *it);
it = std::move(it);
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == *it);
+ assert(it2.options() == it.options());
+ assert(it2.depth() == it.depth());
+ assert(it2.recursion_pending() == it.recursion_pending());
+ assert(*it2 == *it);
}
+int main(int, char**) {
+ test_assignment_signature();
+ test_move_to_end_iterator();
+ test_move_from_end_iterator();
+ test_move_valid_iterator();
+ test_returns_reference_to_self();
+ test_self_move();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp
index 40b09f1..0a80fe1 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp
@@ -20,14 +20,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_pop_tests)
-
-TEST_CASE(signature_tests)
+static void signature_tests()
{
recursive_directory_iterator it{}; ((void)it);
std::error_code ec; ((void)ec);
@@ -37,7 +34,7 @@
// NOTE: Since the order of iteration is unspecified we use a list of
// seen files at each depth to determine the new depth after a 'pop()' operation.
-TEST_CASE(test_depth)
+static void test_depth()
{
static_test_env static_env;
const recursive_directory_iterator endIt{};
@@ -50,8 +47,8 @@
std::error_code ec;
recursive_directory_iterator it(static_env.Dir, ec);
- TEST_REQUIRE(it != endIt);
- TEST_CHECK(it.depth() == 0);
+ assert(it != endIt);
+ assert(it.depth() == 0);
while (it.depth() != 2) {
if (it.depth() == 0)
@@ -59,35 +56,40 @@
else
notSeenDepth1.erase(it->path());
++it;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
}
while (true) {
auto set_ec = std::make_error_code(std::errc::address_in_use);
it.pop(set_ec);
- TEST_REQUIRE(!set_ec);
+ assert(!set_ec);
if (it == endIt) {
// We must have seen every entry at depth 0 and 1.
- TEST_REQUIRE(notSeenDepth0.empty() && notSeenDepth1.empty());
+ assert(notSeenDepth0.empty() && notSeenDepth1.empty());
break;
}
else if (it.depth() == 1) {
// If we popped to depth 1 then there must be unseen entries
// at this level.
- TEST_REQUIRE(!notSeenDepth1.empty());
- TEST_CHECK(notSeenDepth1.count(it->path()));
+ assert(!notSeenDepth1.empty());
+ assert(notSeenDepth1.count(it->path()));
notSeenDepth1.clear();
}
else if (it.depth() == 0) {
// If we popped to depth 0 there must be unseen entries at this
// level. There should also be no unseen entries at depth 1.
- TEST_REQUIRE(!notSeenDepth0.empty());
- TEST_REQUIRE(notSeenDepth1.empty());
- TEST_CHECK(notSeenDepth0.count(it->path()));
+ assert(!notSeenDepth0.empty());
+ assert(notSeenDepth1.empty());
+ assert(notSeenDepth0.count(it->path()));
notSeenDepth0.clear();
}
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_tests();
+ test_depth();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
index 82c82c7..721ed7b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
@@ -20,21 +20,18 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_recursion_pending_tests)
-
-TEST_CASE(initial_value_test)
+static void initial_value_test()
{
static_test_env static_env;
recursive_directory_iterator it(static_env.Dir);
- TEST_REQUIRE(it.recursion_pending() == true);
+ assert(it.recursion_pending() == true);
}
-TEST_CASE(value_after_copy_construction_and_assignment_test)
+static void value_after_copy_construction_and_assignment_test()
{
static_test_env static_env;
recursive_directory_iterator rec_pending_it(static_env.Dir);
@@ -43,31 +40,31 @@
{ // copy construction
recursive_directory_iterator it(rec_pending_it);
- TEST_CHECK(it.recursion_pending() == true);
+ assert(it.recursion_pending() == true);
it.disable_recursion_pending();
- TEST_REQUIRE(rec_pending_it.recursion_pending() == true);
+ assert(rec_pending_it.recursion_pending() == true);
recursive_directory_iterator it2(no_rec_pending_it);
- TEST_CHECK(it2.recursion_pending() == false);
+ assert(it2.recursion_pending() == false);
}
{ // copy assignment
recursive_directory_iterator it(static_env.Dir);
it.disable_recursion_pending();
it = rec_pending_it;
- TEST_CHECK(it.recursion_pending() == true);
+ assert(it.recursion_pending() == true);
it.disable_recursion_pending();
- TEST_REQUIRE(rec_pending_it.recursion_pending() == true);
+ assert(rec_pending_it.recursion_pending() == true);
recursive_directory_iterator it2(static_env.Dir);
it2 = no_rec_pending_it;
- TEST_CHECK(it2.recursion_pending() == false);
+ assert(it2.recursion_pending() == false);
}
- TEST_CHECK(rec_pending_it.recursion_pending() == true);
- TEST_CHECK(no_rec_pending_it.recursion_pending() == false);
+ assert(rec_pending_it.recursion_pending() == true);
+ assert(no_rec_pending_it.recursion_pending() == false);
}
-TEST_CASE(value_after_move_construction_and_assignment_test)
+static void value_after_move_construction_and_assignment_test()
{
static_test_env static_env;
recursive_directory_iterator rec_pending_it(static_env.Dir);
@@ -77,60 +74,60 @@
{ // move construction
recursive_directory_iterator it_cp(rec_pending_it);
recursive_directory_iterator it(std::move(it_cp));
- TEST_CHECK(it.recursion_pending() == true);
+ assert(it.recursion_pending() == true);
recursive_directory_iterator it_cp2(no_rec_pending_it);
recursive_directory_iterator it2(std::move(it_cp2));
- TEST_CHECK(it2.recursion_pending() == false);
+ assert(it2.recursion_pending() == false);
}
{ // copy assignment
recursive_directory_iterator it(static_env.Dir);
it.disable_recursion_pending();
recursive_directory_iterator it_cp(rec_pending_it);
it = std::move(it_cp);
- TEST_CHECK(it.recursion_pending() == true);
+ assert(it.recursion_pending() == true);
recursive_directory_iterator it2(static_env.Dir);
recursive_directory_iterator it_cp2(no_rec_pending_it);
it2 = std::move(it_cp2);
- TEST_CHECK(it2.recursion_pending() == false);
+ assert(it2.recursion_pending() == false);
}
- TEST_CHECK(rec_pending_it.recursion_pending() == true);
- TEST_CHECK(no_rec_pending_it.recursion_pending() == false);
+ assert(rec_pending_it.recursion_pending() == true);
+ assert(no_rec_pending_it.recursion_pending() == false);
}
-TEST_CASE(increment_resets_value)
+static void increment_resets_value()
{
static_test_env static_env;
const recursive_directory_iterator endIt;
{
recursive_directory_iterator it(static_env.Dir);
it.disable_recursion_pending();
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.recursion_pending() == false);
++it;
- TEST_CHECK(it.recursion_pending() == true);
- TEST_CHECK(it.depth() == 0);
+ assert(it.recursion_pending() == true);
+ assert(it.depth() == 0);
}
{
recursive_directory_iterator it(static_env.Dir);
it.disable_recursion_pending();
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.recursion_pending() == false);
it++;
- TEST_CHECK(it.recursion_pending() == true);
- TEST_CHECK(it.depth() == 0);
+ assert(it.recursion_pending() == true);
+ assert(it.depth() == 0);
}
{
recursive_directory_iterator it(static_env.Dir);
it.disable_recursion_pending();
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.recursion_pending() == false);
std::error_code ec;
it.increment(ec);
- TEST_CHECK(it.recursion_pending() == true);
- TEST_CHECK(it.depth() == 0);
+ assert(it.recursion_pending() == true);
+ assert(it.depth() == 0);
}
}
-TEST_CASE(pop_does_not_reset_value)
+static void pop_does_not_reset_value()
{
static_test_env static_env;
const recursive_directory_iterator endIt;
@@ -139,28 +136,36 @@
std::set<path> notSeenDepth0(DE0.begin(), DE0.end());
recursive_directory_iterator it(static_env.Dir);
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
while (it.depth() == 0) {
notSeenDepth0.erase(it->path());
++it;
- TEST_REQUIRE(it != endIt);
+ assert(it != endIt);
}
- TEST_REQUIRE(it.depth() == 1);
+ assert(it.depth() == 1);
it.disable_recursion_pending();
it.pop();
// Since the order of iteration is unspecified the pop() could result
// in the end iterator. When this is the case it is undefined behavior
// to call recursion_pending().
if (it == endIt) {
- TEST_CHECK(notSeenDepth0.empty());
+ assert(notSeenDepth0.empty());
#if defined(_LIBCPP_VERSION)
- TEST_CHECK(it.recursion_pending() == false);
+ assert(it.recursion_pending() == false);
#endif
} else {
- TEST_CHECK(! notSeenDepth0.empty());
- TEST_CHECK(it.recursion_pending() == false);
+ assert(! notSeenDepth0.empty());
+ assert(it.recursion_pending() == false);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ initial_value_test();
+ value_after_copy_construction_and_assignment_test();
+ value_after_move_construction_and_assignment_test();
+ increment_resets_value();
+ pop_does_not_reset_value();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp
index 104e419..f0b6804 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp
@@ -21,14 +21,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(recursive_directory_iterator_begin_end_tests)
-
-TEST_CASE(test_function_signatures)
+static void test_function_signatures()
{
recursive_directory_iterator d;
@@ -43,7 +40,7 @@
ASSERT_NOEXCEPT(end(std::move(d)));
}
-TEST_CASE(test_ranged_for_loop)
+static void test_ranged_for_loop()
{
static_test_env static_env;
const path testDir = static_env.Dir;
@@ -52,12 +49,17 @@
std::error_code ec;
recursive_directory_iterator it(testDir, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
for (auto& elem : it) {
- TEST_CHECK(dir_contents.erase(elem) == 1);
+ assert(dir_contents.erase(elem) == 1);
}
- TEST_CHECK(dir_contents.empty());
+ assert(dir_contents.empty());
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_function_signatures();
+ test_ranged_for_loop();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
index 4b597fc..2a05056 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
@@ -17,14 +17,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_absolute_path_test_suite)
-
-TEST_CASE(absolute_signature_test)
+static void absolute_signature_test()
{
const path p; ((void)p);
std::error_code ec;
@@ -33,7 +30,7 @@
}
-TEST_CASE(basic_test)
+static void basic_test()
{
const fs::path cwd = fs::current_path();
const struct {
@@ -48,11 +45,16 @@
for (auto& TC : TestCases) {
std::error_code ec = GetTestEC();
const path ret = absolute(TC.input, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ret.is_absolute());
- TEST_CHECK(PathEqIgnoreSep(ret, TC.expect));
- LIBCPP_ONLY(TEST_CHECK(PathEq(ret, TC.expect)));
+ assert(!ec);
+ assert(ret.is_absolute());
+ assert(PathEqIgnoreSep(ret, TC.expect));
+ LIBCPP_ONLY(assert(PathEq(ret, TC.expect)));
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ absolute_signature_test();
+ basic_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
index 707b646..fb88b4a 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
@@ -17,15 +17,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_canonical_path_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -35,7 +33,7 @@
// There are 4 cases is the proposal for absolute path.
// Each scope tests one of the cases.
-TEST_CASE(test_canonical)
+static void test_canonical()
{
static_test_env static_env;
CWDGuard guard;
@@ -68,30 +66,30 @@
std::error_code ec = GetTestEC();
fs::current_path(TC.base);
const path ret = canonical(TC.p, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
const path ret2 = canonical(TC.p);
- TEST_CHECK(PathEq(ret, TC.expect));
- TEST_CHECK(PathEq(ret, ret2));
- TEST_CHECK(ret.is_absolute());
+ assert(PathEq(ret, TC.expect));
+ assert(PathEq(ret, ret2));
+ assert(ret.is_absolute());
}
}
-TEST_CASE(test_dne_path)
+static void test_dne_path()
{
static_test_env static_env;
std::error_code ec = GetTestEC();
{
const path ret = canonical(static_env.DNE, ec);
- TEST_CHECK(ec != GetTestEC());
- TEST_REQUIRE(ec);
- TEST_CHECK(ret == path{});
+ assert(ec != GetTestEC());
+ assert(ec);
+ assert(ret == path{});
}
{
- TEST_CHECK_THROW(filesystem_error, canonical(static_env.DNE));
+ TEST_THROWS_TYPE(filesystem_error, canonical(static_env.DNE));
}
}
-TEST_CASE(test_exception_contains_paths)
+static void test_exception_contains_paths()
{
#ifndef TEST_HAS_NO_EXCEPTIONS
static_test_env static_env;
@@ -99,21 +97,28 @@
const path p = "blabla/dne";
try {
(void)canonical(p);
- TEST_REQUIRE(false);
+ assert(false);
} catch (filesystem_error const& err) {
- TEST_CHECK(err.path1() == p);
+ assert(err.path1() == p);
// libc++ provides the current path as the second path in the exception
- LIBCPP_ONLY(TEST_CHECK(err.path2() == current_path()));
+ LIBCPP_ONLY(assert(err.path2() == current_path()));
}
fs::current_path(static_env.Dir);
try {
(void)canonical(p);
- TEST_REQUIRE(false);
+ assert(false);
} catch (filesystem_error const& err) {
- TEST_CHECK(err.path1() == p);
- LIBCPP_ONLY(TEST_CHECK(err.path2() == static_env.Dir));
+ assert(err.path1() == p);
+ LIBCPP_ONLY(assert(err.path2() == static_env.Dir));
}
#endif
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ test_canonical();
+ test_dne_path();
+ test_exception_contains_paths();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
index 3f9574d..2d7acf3 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
@@ -22,16 +22,13 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
using CO = fs::copy_options;
-TEST_SUITE(filesystem_copy_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -44,7 +41,7 @@
// There are 4 cases is the proposal for absolute path.
// Each scope tests one of the cases.
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
{
@@ -69,7 +66,7 @@
const path dir = env.create_dir("dir");
#ifndef _WIN32
const path fifo = env.create_fifo("fifo");
- TEST_REQUIRE(is_other(fifo));
+ assert(is_other(fifo));
#endif
const auto test_ec = GetTestEC();
@@ -80,43 +77,43 @@
const path f = static_env.DNE;
const path t = env.test_root;
fs::copy(f, t, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(ec != test_ec);
- TEST_CHECK(checkThrow(f, t, ec));
+ assert(ec);
+ assert(ec != test_ec);
+ assert(checkThrow(f, t, ec));
}
{ // equivalent(f, t) == true
std::error_code ec = test_ec;
fs::copy(file, file, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(ec != test_ec);
- TEST_CHECK(checkThrow(file, file, ec));
+ assert(ec);
+ assert(ec != test_ec);
+ assert(checkThrow(file, file, ec));
}
{ // is_directory(from) && is_file(to)
std::error_code ec = test_ec;
fs::copy(dir, file, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(ec != test_ec);
- TEST_CHECK(checkThrow(dir, file, ec));
+ assert(ec);
+ assert(ec != test_ec);
+ assert(checkThrow(dir, file, ec));
}
#ifndef _WIN32
{ // is_other(from)
std::error_code ec = test_ec;
fs::copy(fifo, dir, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(ec != test_ec);
- TEST_CHECK(checkThrow(fifo, dir, ec));
+ assert(ec);
+ assert(ec != test_ec);
+ assert(checkThrow(fifo, dir, ec));
}
{ // is_other(to)
std::error_code ec = test_ec;
fs::copy(file, fifo, ec);
- TEST_REQUIRE(ec);
- TEST_REQUIRE(ec != test_ec);
- TEST_CHECK(checkThrow(file, fifo, ec));
+ assert(ec);
+ assert(ec != test_ec);
+ assert(checkThrow(file, fifo, ec));
}
#endif
}
-TEST_CASE(from_is_symlink)
+static void from_is_symlink()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
@@ -126,32 +123,32 @@
{ // skip symlinks
std::error_code ec = GetTestEC();
fs::copy(symlink, dne, copy_options::skip_symlinks, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(dne));
+ assert(!ec);
+ assert(!exists(dne));
}
{
const path dest = env.make_env_path("dest");
std::error_code ec = GetTestEC();
fs::copy(symlink, dest, copy_options::copy_symlinks, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(exists(dest));
- TEST_CHECK(is_symlink(dest));
+ assert(!ec);
+ assert(exists(dest));
+ assert(is_symlink(dest));
}
{ // copy symlink but target exists
std::error_code ec = GetTestEC();
fs::copy(symlink, file, copy_options::copy_symlinks, ec);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(ec);
+ assert(ec != GetTestEC());
}
{ // create symlinks but target exists
std::error_code ec = GetTestEC();
fs::copy(symlink, file, copy_options::create_symlinks, ec);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(ec);
+ assert(ec != GetTestEC());
}
}
-TEST_CASE(from_is_regular_file)
+static void from_is_regular_file()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
@@ -160,44 +157,44 @@
const path dest = env.make_env_path("dest1");
std::error_code ec = GetTestEC();
fs::copy(file, dest, CO::directories_only, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(dest));
+ assert(!ec);
+ assert(!exists(dest));
}
{ // create symlink to file
const path dest = env.make_env_path("sym");
std::error_code ec = GetTestEC();
fs::copy(file, dest, CO::create_symlinks, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(is_symlink(dest));
- TEST_CHECK(equivalent(file, canonical(dest)));
+ assert(!ec);
+ assert(is_symlink(dest));
+ assert(equivalent(file, canonical(dest)));
}
{ // create hard link to file
const path dest = env.make_env_path("hardlink");
- TEST_CHECK(hard_link_count(file) == 1);
+ assert(hard_link_count(file) == 1);
std::error_code ec = GetTestEC();
fs::copy(file, dest, CO::create_hard_links, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(exists(dest));
- TEST_CHECK(hard_link_count(file) == 2);
+ assert(!ec);
+ assert(exists(dest));
+ assert(hard_link_count(file) == 2);
}
{ // is_directory(t)
const path dest_dir = env.create_dir("dest_dir");
const path expect_dest = dest_dir / file.filename();
std::error_code ec = GetTestEC();
fs::copy(file, dest_dir, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(is_regular_file(expect_dest));
+ assert(!ec);
+ assert(is_regular_file(expect_dest));
}
{ // otherwise copy_file(from, to, ...)
const path dest = env.make_env_path("file_copy");
std::error_code ec = GetTestEC();
fs::copy(file, dest, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(is_regular_file(dest));
+ assert(!ec);
+ assert(is_regular_file(dest));
}
}
-TEST_CASE(from_is_directory)
+static void from_is_directory()
{
struct FileInfo {
path filename;
@@ -221,48 +218,48 @@
const path dest = env.make_env_path("dest_dir1");
std::error_code ec = GetTestEC();
fs::copy(dir, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_directory(dest));
+ assert(!ec);
+ assert(is_directory(dest));
for (auto& FI : files) {
path created = dest / FI.filename;
- TEST_CHECK(is_regular_file(created));
- TEST_CHECK(file_size(created) == FI.size);
+ assert(is_regular_file(created));
+ assert(file_size(created) == FI.size);
}
- TEST_CHECK(!is_directory(dest / nested_dir_name));
+ assert(!is_directory(dest / nested_dir_name));
}
{ // test for existing directory
const path dest = env.create_dir("dest_dir2");
std::error_code ec = GetTestEC();
fs::copy(dir, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_directory(dest));
+ assert(!ec);
+ assert(is_directory(dest));
for (auto& FI : files) {
path created = dest / FI.filename;
- TEST_CHECK(is_regular_file(created));
- TEST_CHECK(file_size(created) == FI.size);
+ assert(is_regular_file(created));
+ assert(file_size(created) == FI.size);
}
- TEST_CHECK(!is_directory(dest / nested_dir_name));
+ assert(!is_directory(dest / nested_dir_name));
}
{ // test recursive copy
const path dest = env.make_env_path("dest_dir3");
std::error_code ec = GetTestEC();
fs::copy(dir, dest, CO::recursive, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_directory(dest));
+ assert(!ec);
+ assert(is_directory(dest));
const path nested_dest = dest / nested_dir_name;
- TEST_REQUIRE(is_directory(nested_dest));
+ assert(is_directory(nested_dest));
for (auto& FI : files) {
path created = dest / FI.filename;
path nested_created = nested_dest / FI.filename;
- TEST_CHECK(is_regular_file(created));
- TEST_CHECK(file_size(created) == FI.size);
- TEST_CHECK(is_regular_file(nested_created));
- TEST_CHECK(file_size(nested_created) == FI.size);
+ assert(is_regular_file(created));
+ assert(file_size(created) == FI.size);
+ assert(is_regular_file(nested_created));
+ assert(file_size(nested_created) == FI.size);
}
}
}
-TEST_CASE(test_copy_symlinks_to_symlink_dir)
+static void test_copy_symlinks_to_symlink_dir()
{
scoped_test_env env;
const path file1 = env.create_file("file1", 42);
@@ -273,16 +270,16 @@
{
std::error_code ec = GetTestEC();
fs::copy(file1, dir_sym, copy_options::copy_symlinks, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
const path dest = env.make_env_path("dir/file1");
- TEST_CHECK(exists(dest));
- TEST_CHECK(!is_symlink(dest));
- TEST_CHECK(file_size(dest) == 42);
+ assert(exists(dest));
+ assert(!is_symlink(dest));
+ assert(file_size(dest) == 42);
}
}
-TEST_CASE(test_dir_create_symlink)
+static void test_dir_create_symlink()
{
scoped_test_env env;
const path dir = env.create_dir("dir1");
@@ -290,20 +287,20 @@
{
std::error_code ec = GetTestEC();
fs::copy(dir, dest, copy_options::create_symlinks, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::is_a_directory));
- TEST_CHECK(!exists(dest));
- TEST_CHECK(!is_symlink(dest));
+ assert(ErrorIs(ec, std::errc::is_a_directory));
+ assert(!exists(dest));
+ assert(!is_symlink(dest));
}
{
std::error_code ec = GetTestEC();
fs::copy(dir, dest, copy_options::create_symlinks|copy_options::recursive, ec);
- TEST_CHECK(ErrorIs(ec, std::errc::is_a_directory));
- TEST_CHECK(!exists(dest));
- TEST_CHECK(!is_symlink(dest));
+ assert(ErrorIs(ec, std::errc::is_a_directory));
+ assert(!exists(dest));
+ assert(!is_symlink(dest));
}
}
-TEST_CASE(test_otherwise_no_effects_clause)
+static void test_otherwise_no_effects_clause()
{
scoped_test_env env;
const path dir = env.create_dir("dir1");
@@ -311,9 +308,20 @@
const path dest = env.make_env_path("dest1");
std::error_code ec;
fs::copy(dir, dest, CO::directories_only, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(dest));
+ assert(!ec);
+ assert(!exists(dest));
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ test_error_reporting();
+ from_is_symlink();
+ from_is_regular_file();
+ from_is_directory();
+ test_copy_symlinks_to_symlink_dir();
+ test_dir_create_symlink();
+ test_otherwise_no_effects_clause();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
index 85e8416..06d2c0b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -25,17 +25,15 @@
#include <chrono>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
using CO = fs::copy_options;
-TEST_SUITE(filesystem_copy_file_test_suite)
-
-TEST_CASE(test_signatures) {
+static void test_signatures() {
const path p;
((void)p);
const copy_options opts{};
@@ -52,7 +50,7 @@
ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts, ec));
}
-TEST_CASE(test_error_reporting) {
+static void test_error_reporting() {
scoped_test_env env;
const path file = env.create_file("file1", 42);
@@ -60,25 +58,25 @@
{ // exists(to) && equivalent(to, from)
std::error_code ec;
- TEST_CHECK(fs::copy_file(file, file, copy_options::overwrite_existing,
+ assert(fs::copy_file(file, file, copy_options::overwrite_existing,
ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
+ assert(ErrorIs(ec, std::errc::file_exists));
ExceptionChecker Checker(file, file, std::errc::file_exists, "copy_file");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing));
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing));
}
{ // exists(to) && !(skip_existing | overwrite_existing | update_existing)
std::error_code ec;
- TEST_CHECK(fs::copy_file(file, file2, ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
+ assert(fs::copy_file(file, file2, ec) == false);
+ assert(ErrorIs(ec, std::errc::file_exists));
ExceptionChecker Checker(file, file, std::errc::file_exists, "copy_file");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing));
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing));
}
}
#ifndef _WIN32
-TEST_CASE(non_regular_file_test) {
+static void non_regular_file_test() {
scoped_test_env env;
const path fifo = env.create_fifo("fifo");
const path dest = env.make_env_path("dest");
@@ -86,22 +84,22 @@
{
std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::not_supported));
- TEST_CHECK(!exists(dest));
+ assert(fs::copy_file(fifo, dest, ec) == false);
+ assert(ErrorIs(ec, std::errc::not_supported));
+ assert(!exists(dest));
}
{
std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing,
+ assert(fs::copy_file(file, fifo, copy_options::overwrite_existing,
ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::not_supported));
- TEST_CHECK(is_fifo(fifo));
+ assert(ErrorIs(ec, std::errc::not_supported));
+ assert(is_fifo(fifo));
}
}
-#endif
+#endif // _WIN32
-TEST_CASE(test_attributes_get_copied) {
+static void test_attributes_get_copied() {
scoped_test_env env;
const path file = env.create_file("file1", 42);
const path dest = env.make_env_path("file2");
@@ -109,27 +107,27 @@
perms new_perms = perms::owner_read;
permissions(file, new_perms);
std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(file, dest, ec) == true);
- TEST_CHECK(!ec);
+ assert(fs::copy_file(file, dest, ec) == true);
+ assert(!ec);
auto new_st = status(dest);
- TEST_CHECK(new_st.permissions() == NormalizeExpectedPerms(new_perms));
+ assert(new_st.permissions() == NormalizeExpectedPerms(new_perms));
}
-TEST_CASE(copy_dir_test) {
+static void copy_dir_test() {
scoped_test_env env;
const path file = env.create_file("file1", 42);
const path dest = env.create_dir("dir1");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::copy_file(file, dest, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(fs::copy_file(file, dest, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
ec = GetTestEC();
- TEST_CHECK(fs::copy_file(dest, file, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(fs::copy_file(dest, file, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
}
-TEST_CASE(copy_file) {
+static void copy_file() {
scoped_test_env env;
const path file = env.create_file("file1", 42);
@@ -137,9 +135,9 @@
const path dest = env.make_env_path("dest1");
std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(file, dest, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(dest) == 42);
+ assert(fs::copy_file(file, dest, ec) == true);
+ assert(!ec);
+ assert(file_size(dest) == 42);
}
{ // exists(to) && overwrite_existing
const path dest = env.create_file("dest2", 55);
@@ -149,11 +147,11 @@
perm_options::remove);
std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(file, dest, copy_options::overwrite_existing,
+ assert(fs::copy_file(file, dest, copy_options::overwrite_existing,
ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(dest) == 42);
- TEST_CHECK(status(dest).permissions() == status(file).permissions());
+ assert(!ec);
+ assert(file_size(dest) == 42);
+ assert(status(dest).permissions() == status(file).permissions());
}
{ // exists(to) && update_existing
using Sec = std::chrono::seconds;
@@ -166,25 +164,35 @@
const path newer = env.create_file("newer_file", 2);
std::error_code ec = GetTestEC();
- TEST_REQUIRE(
+ assert(
fs::copy_file(from, older, copy_options::update_existing, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(older) == 55);
+ assert(!ec);
+ assert(file_size(older) == 55);
- TEST_REQUIRE(
+ assert(
fs::copy_file(from, newer, copy_options::update_existing, ec) == false);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(newer) == 2);
+ assert(!ec);
+ assert(file_size(newer) == 2);
}
{ // skip_existing
const path file2 = env.create_file("file2", 55);
std::error_code ec = GetTestEC();
- TEST_REQUIRE(fs::copy_file(file, file2, copy_options::skip_existing, ec) ==
+ assert(fs::copy_file(file, file2, copy_options::skip_existing, ec) ==
false);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(file2) == 55);
+ assert(!ec);
+ assert(file_size(file2) == 55);
}
}
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+#ifndef _WIN32
+ non_regular_file_test();
+#endif
+ test_attributes_get_copied();
+ copy_dir_test();
+ copy_file();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
index dd38b1e..31d43eb 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
@@ -23,22 +23,19 @@
#include <string>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_copy_file_test_suite)
-
// This test is intended to test 'sendfile's 2gb limit for a single call, and
// to ensure that libc++ correctly copies files larger than that limit.
// However it requires allocating ~5GB of filesystem space. This might not
// be acceptable on all systems.
-TEST_CASE(large_file) {
+static void large_file() {
using namespace fs;
- constexpr uintmax_t sendfile_size_limit = 2147479552ull;
- constexpr uintmax_t additional_size = 1024;
- constexpr uintmax_t test_file_size = sendfile_size_limit + additional_size;
+ constexpr std::uintmax_t sendfile_size_limit = 2147479552ull;
+ constexpr std::uintmax_t additional_size = 1024;
+ constexpr std::uintmax_t test_file_size = sendfile_size_limit + additional_size;
static_assert(test_file_size > sendfile_size_limit, "");
scoped_test_env env;
@@ -46,7 +43,7 @@
// Check that we have more than sufficient room to create the files needed
// to perform the test.
if (space(env.test_root).available < 3 * test_file_size) {
- TEST_UNSUPPORTED();
+ return;
}
// Create a file right at the size limit. The file is full of '\0's.
@@ -55,32 +52,36 @@
// Append known data to the end of the source file.
{
std::FILE* outf = std::fopen(source.string().c_str(), "a");
- TEST_REQUIRE(outf != nullptr);
+ assert(outf != nullptr);
std::fputs(additional_data.c_str(), outf);
std::fclose(outf);
}
- TEST_REQUIRE(file_size(source) == test_file_size);
+ assert(file_size(source) == test_file_size);
const path dest = env.make_env_path("dest");
std::error_code ec = GetTestEC();
- TEST_CHECK(copy_file(source, dest, ec));
- TEST_CHECK(!ec);
+ assert(copy_file(source, dest, ec));
+ assert(!ec);
- TEST_REQUIRE(is_regular_file(dest));
- TEST_CHECK(file_size(dest) == test_file_size);
+ assert(is_regular_file(dest));
+ assert(file_size(dest) == test_file_size);
// Read the data from the end of the destination file, and ensure it matches
// the data at the end of the source file.
std::string out_data(additional_size, 'z');
{
std::FILE* dest_file = std::fopen(dest.string().c_str(), "rb");
- TEST_REQUIRE(dest_file != nullptr);
- TEST_REQUIRE(std::fseek(dest_file, sendfile_size_limit, SEEK_SET) == 0);
- TEST_REQUIRE(std::fread(&out_data[0], sizeof(out_data[0]), additional_size, dest_file) == additional_size);
+ assert(dest_file != nullptr);
+ assert(std::fseek(dest_file, sendfile_size_limit, SEEK_SET) == 0);
+ assert(std::fread(&out_data[0], sizeof(out_data[0]), additional_size, dest_file) == additional_size);
std::fclose(dest_file);
}
- TEST_CHECK(out_data.size() == additional_data.size());
- TEST_CHECK(out_data == additional_data);
+ assert(out_data.size() == additional_data.size());
+ assert(out_data == additional_data);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ large_file();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
index fff62c3..c618acf 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
@@ -19,14 +19,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_copy_symlink_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -35,7 +32,7 @@
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
{
@@ -62,23 +59,23 @@
{ // from is a file, not a symlink
std::error_code ec;
fs::copy_symlink(file, dne, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(checkThrow(file, dne, ec));
+ assert(ec);
+ assert(checkThrow(file, dne, ec));
}
{ // from is a file, not a symlink
std::error_code ec;
fs::copy_symlink(dir, dne, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(checkThrow(dir, dne, ec));
+ assert(ec);
+ assert(checkThrow(dir, dne, ec));
}
{ // destination exists
std::error_code ec;
fs::copy_symlink(sym, file2, ec);
- TEST_REQUIRE(ec);
+ assert(ec);
}
}
-TEST_CASE(copy_symlink_basic)
+static void copy_symlink_basic()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -89,19 +86,24 @@
const path dest = env.make_env_path("dest1");
std::error_code ec;
fs::copy_symlink(dir_sym, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_symlink(dest));
- TEST_CHECK(equivalent(dest, dir));
+ assert(!ec);
+ assert(is_symlink(dest));
+ assert(equivalent(dest, dir));
}
{ // test for file symlinks
const path dest = env.make_env_path("dest2");
std::error_code ec;
fs::copy_symlink(file_sym, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_symlink(dest));
- TEST_CHECK(equivalent(dest, file));
+ assert(!ec);
+ assert(is_symlink(dest));
+ assert(equivalent(dest, file));
}
}
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ copy_symlink_basic();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
index f3c22c8..ecc68e8 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03
// This test requires the dylib support introduced in D92769.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -20,15 +20,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_create_directories_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -38,37 +36,37 @@
ASSERT_NOT_NOEXCEPT(fs::create_directories(p, ec));
}
-TEST_CASE(create_existing_directory)
+static void create_existing_directory()
{
scoped_test_env env;
const path dir = env.create_dir("dir1");
std::error_code ec;
- TEST_CHECK(fs::create_directories(dir, ec) == false);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(dir));
+ assert(fs::create_directories(dir, ec) == false);
+ assert(!ec);
+ assert(is_directory(dir));
}
-TEST_CASE(create_directory_one_level)
+static void create_directory_one_level()
{
scoped_test_env env;
const path dir = env.make_env_path("dir1");
std::error_code ec;
- TEST_CHECK(fs::create_directories(dir, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(dir));
+ assert(fs::create_directories(dir, ec) == true);
+ assert(!ec);
+ assert(is_directory(dir));
}
-TEST_CASE(create_directories_multi_level)
+static void create_directories_multi_level()
{
scoped_test_env env;
const path dir = env.make_env_path("dir1/dir2/dir3");
std::error_code ec;
- TEST_CHECK(fs::create_directories(dir, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(dir));
+ assert(fs::create_directories(dir, ec) == true);
+ assert(!ec);
+ assert(is_directory(dir));
}
-TEST_CASE(create_directory_symlinks) {
+static void create_directory_symlinks() {
scoped_test_env env;
const path root = env.create_dir("dir");
const path sym_dest_dead = env.make_env_path("dead");
@@ -76,82 +74,82 @@
const path target = env.make_env_path("dir/sym_dir/foo");
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directories(target, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
- TEST_CHECK(!exists(sym_dest_dead));
- TEST_CHECK(!exists(dead_sym));
+ assert(create_directories(target, ec) == false);
+ assert(ec);
+ assert(ErrorIs(ec, std::errc::file_exists));
+ assert(!exists(sym_dest_dead));
+ assert(!exists(dead_sym));
}
}
-TEST_CASE(create_directory_through_symlinks) {
+static void create_directory_through_symlinks() {
scoped_test_env env;
const path root = env.create_dir("dir");
const path sym_dir = env.create_directory_symlink(root, "sym_dir");
const path target = env.make_env_path("sym_dir/foo");
const path resolved_target = env.make_env_path("dir/foo");
- TEST_REQUIRE(is_directory(sym_dir));
+ assert(is_directory(sym_dir));
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directories(target, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(target));
- TEST_CHECK(is_directory(resolved_target));
+ assert(create_directories(target, ec) == true);
+ assert(!ec);
+ assert(is_directory(target));
+ assert(is_directory(resolved_target));
}
}
-TEST_CASE(dest_is_file)
+static void dest_is_file()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directories(file, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
- TEST_CHECK(is_regular_file(file));
+ assert(fs::create_directories(file, ec) == false);
+ assert(ec);
+ assert(ErrorIs(ec, std::errc::file_exists));
+ assert(is_regular_file(file));
}
-TEST_CASE(dest_part_is_file)
+static void dest_part_is_file()
{
scoped_test_env env;
const path file = env.create_file("file");
const path dir = env.make_env_path("file/dir1");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directories(dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
- TEST_CHECK(is_regular_file(file));
- TEST_CHECK(!exists(dir));
+ assert(fs::create_directories(dir, ec) == false);
+ assert(ec);
+ assert(ErrorIs(ec, std::errc::not_a_directory));
+ assert(is_regular_file(file));
+ assert(!exists(dir));
}
-TEST_CASE(dest_final_part_is_file)
+static void dest_final_part_is_file()
{
scoped_test_env env;
env.create_dir("dir");
const path file = env.create_file("dir/file");
const path dir = env.make_env_path("dir/file/dir1");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directories(dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
- TEST_CHECK(is_regular_file(file));
- TEST_CHECK(!exists(dir));
+ assert(fs::create_directories(dir, ec) == false);
+ assert(ec);
+ assert(ErrorIs(ec, std::errc::not_a_directory));
+ assert(is_regular_file(file));
+ assert(!exists(dir));
}
-TEST_CASE(dest_is_empty_path)
+static void dest_is_empty_path()
{
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directories(fs::path{}, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(fs::create_directories(fs::path{}, ec) == false);
+ assert(ec);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
ExceptionChecker Checker(path{}, std::errc::no_such_file_or_directory,
"create_directories");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker,
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker,
fs::create_directories(path{}));
}
#ifdef _WIN32
-TEST_CASE(nonexistent_root)
+static void nonexistent_root()
{
std::error_code ec = GetTestEC();
// If Q:\ doesn't exist, create_directories would try to recurse upwards
@@ -159,9 +157,25 @@
// whole path is the root name, parent_path() returns itself, and it
// would recurse indefinitely, unless the recursion is broken.
if (!exists("Q:\\"))
- TEST_CHECK(fs::create_directories("Q:\\", ec) == false);
- TEST_CHECK(fs::create_directories("\\\\nonexistentserver", ec) == false);
+ assert(fs::create_directories("Q:\\", ec) == false);
+ assert(fs::create_directories("\\\\nonexistentserver", ec) == false);
}
+#endif // _WIN32
+
+int main(int, char**) {
+ test_signatures();
+ create_existing_directory();
+ create_directory_one_level();
+ create_directories_multi_level();
+ create_directory_symlinks();
+ create_directory_through_symlinks();
+ dest_is_file();
+ dest_part_is_file();
+ dest_final_part_is_file();
+ dest_is_empty_path();
+#ifdef _WIN32
+ nonexistent_root();
#endif
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
index cf7e64c..daa160b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03
// This test requires the dylib support introduced in http://llvm.org/D92769.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -23,7 +23,6 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
#include <sys/types.h>
@@ -37,9 +36,7 @@
return static_cast<fs::perms>(old_mask);
}
-TEST_SUITE(filesystem_create_directory_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -54,84 +51,95 @@
}
-TEST_CASE(create_existing_directory)
+static void create_existing_directory()
{
scoped_test_env env;
const path dir = env.create_dir("dir1");
std::error_code ec;
- TEST_CHECK(fs::create_directory(dir, ec) == false);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(dir));
+ assert(fs::create_directory(dir, ec) == false);
+ assert(!ec);
+ assert(is_directory(dir));
// Test throwing version
- TEST_CHECK(fs::create_directory(dir) == false);
+ assert(fs::create_directory(dir) == false);
}
-TEST_CASE(create_directory_one_level)
+static void create_directory_one_level()
{
scoped_test_env env;
const path dir = env.make_env_path("dir1");
std::error_code ec;
- TEST_CHECK(fs::create_directory(dir, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(dir));
+ assert(fs::create_directory(dir, ec) == true);
+ assert(!ec);
+ assert(is_directory(dir));
auto st = status(dir);
const perms expect_perms = perms::all & ~(read_umask());
- TEST_CHECK((st.permissions() & perms::all) == expect_perms);
+ assert((st.permissions() & perms::all) == expect_perms);
}
-TEST_CASE(create_directory_multi_level)
+static void create_directory_multi_level()
{
scoped_test_env env;
const path dir = env.make_env_path("dir1/dir2");
const path dir1 = env.make_env_path("dir1");
std::error_code ec;
- TEST_CHECK(fs::create_directory(dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(!is_directory(dir));
- TEST_CHECK(!is_directory(dir1));
+ assert(fs::create_directory(dir, ec) == false);
+ assert(ec);
+ assert(!is_directory(dir));
+ assert(!is_directory(dir1));
}
-TEST_CASE(dest_is_file)
+static void dest_is_file()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directory(file, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(is_regular_file(file));
+ assert(fs::create_directory(file, ec) == false);
+ assert(ec);
+ assert(is_regular_file(file));
}
-TEST_CASE(dest_part_is_file)
+static void dest_part_is_file()
{
scoped_test_env env;
const path file = env.create_file("file");
const path dir = env.make_env_path("file/dir1");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directory(dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(is_regular_file(file));
- TEST_CHECK(!exists(dir));
+ assert(fs::create_directory(dir, ec) == false);
+ assert(ec);
+ assert(is_regular_file(file));
+ assert(!exists(dir));
}
-TEST_CASE(dest_is_symlink_to_dir)
+static void dest_is_symlink_to_dir()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
const path sym = env.create_directory_symlink(dir, "sym_name");
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(sym, ec) == false);
- TEST_CHECK(!ec);
+ assert(create_directory(sym, ec) == false);
+ assert(!ec);
}
-TEST_CASE(dest_is_symlink_to_file)
+static void dest_is_symlink_to_file()
{
scoped_test_env env;
const path file = env.create_file("file");
const path sym = env.create_symlink(file, "sym_name");
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(sym, ec) == false);
- TEST_CHECK(ec);
+ assert(create_directory(sym, ec) == false);
+ assert(ec);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ create_existing_directory();
+ create_directory_one_level();
+ create_directory_multi_level();
+ dest_is_file();
+ dest_part_is_file();
+ dest_is_symlink_to_dir();
+ dest_is_symlink_to_file();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
index c3ca9dd..8fbfdcf 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03
// This test requires the dylib support introduced in http://llvm.org/D92769.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -21,14 +21,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_create_directory_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -38,7 +35,7 @@
ASSERT_NOEXCEPT(fs::create_directory(p, p, ec));
}
-TEST_CASE(create_existing_directory)
+static void create_existing_directory()
{
scoped_test_env env;
const path dir = env.create_dir("dir1");
@@ -48,19 +45,19 @@
permissions(dir2, perms::none);
std::error_code ec;
- TEST_CHECK(fs::create_directory(dir, dir2, ec) == false);
- TEST_CHECK(!ec);
+ assert(fs::create_directory(dir, dir2, ec) == false);
+ assert(!ec);
// Check that the permissions were unchanged
- TEST_CHECK(orig_p == status(dir).permissions());
+ assert(orig_p == status(dir).permissions());
// Test throwing version
- TEST_CHECK(fs::create_directory(dir, dir2) == false);
+ assert(fs::create_directory(dir, dir2) == false);
}
// Windows doesn't have the concept of perms::none on directories.
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(create_directory_one_level)
+static void create_directory_one_level()
{
scoped_test_env env;
// Remove setgid which mkdir would inherit
@@ -71,104 +68,119 @@
permissions(attr_dir, perms::none);
std::error_code ec;
- TEST_CHECK(fs::create_directory(dir, attr_dir, ec) == true);
- TEST_CHECK(!ec);
- TEST_CHECK(is_directory(dir));
+ assert(fs::create_directory(dir, attr_dir, ec) == true);
+ assert(!ec);
+ assert(is_directory(dir));
// Check that the new directory has the same permissions as attr_dir
auto st = status(dir);
- TEST_CHECK(st.permissions() == perms::none);
+ assert(st.permissions() == perms::none);
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(create_directory_multi_level)
+static void create_directory_multi_level()
{
scoped_test_env env;
const path dir = env.make_env_path("dir1/dir2");
const path dir1 = env.make_env_path("dir1");
const path attr_dir = env.create_dir("attr_dir");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directory(dir, attr_dir, ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
- TEST_CHECK(!is_directory(dir));
- TEST_CHECK(!is_directory(dir1));
+ assert(fs::create_directory(dir, attr_dir, ec) == false);
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(!is_directory(dir));
+ assert(!is_directory(dir1));
}
-TEST_CASE(dest_is_file)
+static void dest_is_file()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
const path attr_dir = env.create_dir("attr_dir");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directory(file, attr_dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(is_regular_file(file));
+ assert(fs::create_directory(file, attr_dir, ec) == false);
+ assert(ec);
+ assert(is_regular_file(file));
}
-TEST_CASE(dest_part_is_file)
+static void dest_part_is_file()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
const path dir = env.make_env_path("file/dir1");
const path attr_dir = env.create_dir("attr_dir");
std::error_code ec = GetTestEC();
- TEST_CHECK(fs::create_directory(dir, attr_dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(is_regular_file(file));
- TEST_CHECK(!exists(dir));
+ assert(fs::create_directory(dir, attr_dir, ec) == false);
+ assert(ec);
+ assert(is_regular_file(file));
+ assert(!exists(dir));
}
-TEST_CASE(attr_dir_is_invalid) {
+static void attr_dir_is_invalid() {
scoped_test_env env;
const path file = env.create_file("file", 42);
const path dest = env.make_env_path("dir");
const path dne = env.make_env_path("dne");
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(dest, file, ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
+ assert(create_directory(dest, file, ec) == false);
+ assert(ErrorIs(ec, std::errc::not_a_directory));
}
- TEST_REQUIRE(!exists(dest));
+ assert(!exists(dest));
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(dest, dne, ec) == false);
- TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
+ assert(create_directory(dest, dne, ec) == false);
+ assert(ErrorIs(ec, std::errc::not_a_directory));
}
}
-TEST_CASE(dest_is_symlink_to_unexisting) {
+static void dest_is_symlink_to_unexisting() {
scoped_test_env env;
const path attr_dir = env.create_dir("attr_dir");
const path sym = env.create_symlink("dne_sym", "dne_sym_name");
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(sym, attr_dir, ec) == false);
- TEST_CHECK(ec);
+ assert(create_directory(sym, attr_dir, ec) == false);
+ assert(ec);
}
}
-TEST_CASE(dest_is_symlink_to_dir) {
+static void dest_is_symlink_to_dir() {
scoped_test_env env;
const path dir = env.create_dir("dir");
const path sym = env.create_directory_symlink(dir, "sym_name");
const path attr_dir = env.create_dir("attr_dir");
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(sym, attr_dir, ec) == false);
- TEST_CHECK(!ec);
+ assert(create_directory(sym, attr_dir, ec) == false);
+ assert(!ec);
}
}
-TEST_CASE(dest_is_symlink_to_file) {
+static void dest_is_symlink_to_file() {
scoped_test_env env;
const path file = env.create_file("file");
const path sym = env.create_symlink(file, "sym_name");
const path attr_dir = env.create_dir("attr_dir");
{
std::error_code ec = GetTestEC();
- TEST_CHECK(create_directory(sym, attr_dir, ec) == false);
- TEST_CHECK(ec);
+ assert(create_directory(sym, attr_dir, ec) == false);
+ assert(ec);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ create_existing_directory();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ create_directory_one_level();
+#endif
+ create_directory_multi_level();
+ dest_is_file();
+ dest_part_is_file();
+ attr_dir_is_invalid();
+ dest_is_symlink_to_unexisting();
+ dest_is_symlink_to_dir();
+ dest_is_symlink_to_file();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
index 2b6467b..cd8d053 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
@@ -18,14 +18,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_create_directory_symlink_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -33,7 +30,7 @@
ASSERT_NOEXCEPT(fs::create_directory_symlink(p, p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
scoped_test_env env;
const path file = env.create_file("file1", 42);
@@ -42,11 +39,11 @@
{ // destination exists
std::error_code ec;
fs::create_directory_symlink(sym, file2, ec);
- TEST_REQUIRE(ec);
+ assert(ec);
}
}
-TEST_CASE(create_directory_symlink_basic)
+static void create_directory_symlink_basic()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -55,10 +52,15 @@
const path dest = env.make_env_path("dest1");
std::error_code ec;
fs::create_directory_symlink(dir_sym, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_symlink(dest));
- TEST_CHECK(equivalent(dest, dir));
+ assert(!ec);
+ assert(is_symlink(dest));
+ assert(equivalent(dest, dir));
}
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ create_directory_symlink_basic();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
index c6785e6..5145cd4 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
@@ -17,14 +17,11 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_create_hard_link_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -32,7 +29,7 @@
ASSERT_NOEXCEPT(fs::create_hard_link(p, p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
scoped_test_env env;
const path file = env.create_file("file1", 42);
@@ -41,25 +38,25 @@
{ // destination exists
std::error_code ec;
fs::create_hard_link(sym, file2, ec);
- TEST_REQUIRE(ec);
+ assert(ec);
}
}
-TEST_CASE(create_file_hard_link)
+static void create_file_hard_link()
{
scoped_test_env env;
const path file = env.create_file("file");
const path dest = env.make_env_path("dest1");
std::error_code ec;
- TEST_CHECK(hard_link_count(file) == 1);
+ assert(hard_link_count(file) == 1);
fs::create_hard_link(file, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(exists(dest));
- TEST_CHECK(equivalent(dest, file));
- TEST_CHECK(hard_link_count(file) == 2);
+ assert(!ec);
+ assert(exists(dest));
+ assert(equivalent(dest, file));
+ assert(hard_link_count(file) == 2);
}
-TEST_CASE(create_directory_hard_link_fails)
+static void create_directory_hard_link_fails()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -67,7 +64,14 @@
std::error_code ec;
fs::create_hard_link(dir, dest, ec);
- TEST_REQUIRE(ec);
+ assert(ec);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ create_file_hard_link();
+ create_directory_hard_link_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
index 3b54cff..28d7f4a 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
@@ -18,14 +18,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_create_symlink_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -33,7 +30,7 @@
ASSERT_NOEXCEPT(fs::create_symlink(p, p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
scoped_test_env env;
const path file = env.create_file("file1", 42);
@@ -42,11 +39,11 @@
{ // destination exists
std::error_code ec;
fs::create_symlink(sym, file2, ec);
- TEST_REQUIRE(ec);
+ assert(ec);
}
}
-TEST_CASE(create_symlink_basic)
+static void create_symlink_basic()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
@@ -57,21 +54,21 @@
const path dest = env.make_env_path("dest1");
std::error_code ec;
fs::create_symlink(file_sym, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_symlink(dest));
- TEST_CHECK(equivalent(dest, file));
+ assert(!ec);
+ assert(is_symlink(dest));
+ assert(equivalent(dest, file));
}
{
const path dest = env.make_env_path("dest2");
std::error_code ec;
fs::create_directory_symlink(dir_sym, dest, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(is_symlink(dest));
- TEST_CHECK(equivalent(dest, dir));
+ assert(!ec);
+ assert(is_symlink(dest));
+ assert(equivalent(dest, dir));
}
}
-TEST_CASE(create_symlink_dest_cleanup)
+static void create_symlink_dest_cleanup()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -84,12 +81,18 @@
sym_target_normalized.make_preferred();
std::error_code ec;
fs::create_symlink(sym_target, sym, ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(equivalent(sym, file, ec));
+ assert(!ec);
+ assert(equivalent(sym, file, ec));
const path ret = fs::read_symlink(sym, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ret.native() == sym_target_normalized.native());
+ assert(!ec);
+ assert(ret.native() == sym_target_normalized.native());
}
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ create_symlink_basic();
+ create_symlink_dest_cleanup();
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
index 5e90c44..981c549 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
@@ -20,14 +20,11 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_current_path_path_test_suite)
-
-TEST_CASE(current_path_signature_test)
+static void current_path_signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -37,28 +34,28 @@
ASSERT_NOEXCEPT(current_path(p, ec));
}
-TEST_CASE(current_path_test)
+static void current_path_test()
{
std::error_code ec;
const path p = current_path(ec);
- TEST_REQUIRE(!ec);
- TEST_CHECK(p.is_absolute());
- TEST_CHECK(is_directory(p));
+ assert(!ec);
+ assert(p.is_absolute());
+ assert(is_directory(p));
const path p2 = current_path();
- TEST_CHECK(p2 == p);
+ assert(p2 == p);
}
-TEST_CASE(current_path_after_change_test)
+static void current_path_after_change_test()
{
static_test_env static_env;
CWDGuard guard;
const path new_path = static_env.Dir;
current_path(new_path);
- TEST_CHECK(current_path() == new_path);
+ assert(current_path() == new_path);
}
-TEST_CASE(current_path_is_file_test)
+static void current_path_is_file_test()
{
static_test_env static_env;
CWDGuard guard;
@@ -66,11 +63,11 @@
std::error_code ec;
const path old_p = current_path();
current_path(p, ec);
- TEST_CHECK(ec);
- TEST_CHECK(old_p == current_path());
+ assert(ec);
+ assert(old_p == current_path());
}
-TEST_CASE(set_to_non_absolute_path)
+static void set_to_non_absolute_path()
{
static_test_env static_env;
CWDGuard guard;
@@ -79,20 +76,29 @@
const path p = static_env.Dir2.filename();
std::error_code ec;
current_path(p, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
const path new_cwd = current_path();
- TEST_CHECK(new_cwd == static_env.Dir2);
- TEST_CHECK(new_cwd.is_absolute());
+ assert(new_cwd == static_env.Dir2);
+ assert(new_cwd.is_absolute());
}
-TEST_CASE(set_to_empty)
+static void set_to_empty()
{
const path p = "";
std::error_code ec;
const path old_p = current_path();
current_path(p, ec);
- TEST_CHECK(ec);
- TEST_CHECK(old_p == current_path());
+ assert(ec);
+ assert(old_p == current_path());
}
-TEST_SUITE_END()
+int main(int, char**) {
+ current_path_signature_test();
+ current_path_test();
+ current_path_after_change_test();
+ current_path_is_file_test();
+ set_to_non_absolute_path();
+ set_to_empty();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
index 5fe8886..e9c8935 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
@@ -17,15 +17,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(equivalent_test_suite)
-
-TEST_CASE(signature_test) {
+static void signature_test() {
const path p;
((void)p);
std::error_code ec;
@@ -34,7 +32,7 @@
ASSERT_NOT_NOEXCEPT(equivalent(p, p));
}
-TEST_CASE(equivalent_test) {
+static void equivalent_test() {
static_test_env static_env;
struct TestCase {
path lhs;
@@ -51,65 +49,75 @@
};
for (auto& TC : testCases) {
std::error_code ec;
- TEST_CHECK(equivalent(TC.lhs, TC.rhs, ec) == TC.expect);
- TEST_CHECK(!ec);
+ assert(equivalent(TC.lhs, TC.rhs, ec) == TC.expect);
+ assert(!ec);
}
}
-TEST_CASE(equivalent_reports_error_if_input_dne) {
+static void equivalent_reports_error_if_input_dne() {
static_test_env static_env;
const path E = static_env.File;
const path DNE = static_env.DNE;
{ // Test that an error is reported when either of the paths don't exist
std::error_code ec = GetTestEC();
- TEST_CHECK(equivalent(E, DNE, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(equivalent(E, DNE, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
}
{
std::error_code ec = GetTestEC();
- TEST_CHECK(equivalent(DNE, E, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(equivalent(DNE, E, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
}
{
- TEST_CHECK_THROW(filesystem_error, equivalent(DNE, E));
- TEST_CHECK_THROW(filesystem_error, equivalent(E, DNE));
+ TEST_THROWS_TYPE(filesystem_error, equivalent(DNE, E));
+ TEST_THROWS_TYPE(filesystem_error, equivalent(E, DNE));
}
{ // Test that an exception is thrown if both paths do not exist.
- TEST_CHECK_THROW(filesystem_error, equivalent(DNE, DNE));
+ TEST_THROWS_TYPE(filesystem_error, equivalent(DNE, DNE));
}
{
std::error_code ec = GetTestEC();
- TEST_CHECK(equivalent(DNE, DNE, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(equivalent(DNE, DNE, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
}
}
-TEST_CASE(equivalent_hardlink_succeeds) {
+static void equivalent_hardlink_succeeds() {
scoped_test_env env;
path const file = env.create_file("file", 42);
const path hl1 = env.create_hardlink(file, "hl1");
const path hl2 = env.create_hardlink(file, "hl2");
- TEST_CHECK(equivalent(file, hl1));
- TEST_CHECK(equivalent(file, hl2));
- TEST_CHECK(equivalent(hl1, hl2));
+ assert(equivalent(file, hl1));
+ assert(equivalent(file, hl2));
+ assert(equivalent(hl1, hl2));
}
#ifndef _WIN32
-TEST_CASE(equivalent_is_other_succeeds) {
+static void equivalent_is_other_succeeds() {
scoped_test_env env;
path const file = env.create_file("file", 42);
const path fifo1 = env.create_fifo("fifo1");
const path fifo2 = env.create_fifo("fifo2");
// Required to test behavior for inputs where is_other(p) is true.
- TEST_REQUIRE(is_other(fifo1));
- TEST_CHECK(!equivalent(file, fifo1));
- TEST_CHECK(!equivalent(fifo2, file));
- TEST_CHECK(!equivalent(fifo1, fifo2));
- TEST_CHECK(equivalent(fifo1, fifo1));
+ assert(is_other(fifo1));
+ assert(!equivalent(file, fifo1));
+ assert(!equivalent(fifo2, file));
+ assert(!equivalent(fifo1, fifo2));
+ assert(equivalent(fifo1, fifo1));
}
+#endif // _WIN32
+
+int main(int, char**) {
+ signature_test();
+ equivalent_test();
+ equivalent_reports_error_if_input_dne();
+ equivalent_hardlink_succeeds();
+#ifndef _WIN32
+ equivalent_is_other_succeeds();
#endif
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp
index 13e8b95..c16a592 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(exists_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(exists(p));
}
-TEST_CASE(exists_status_test)
+static void exists_status_test()
{
struct TestCase {
file_type type;
@@ -56,33 +54,33 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(exists(s) == TC.expect);
+ assert(exists(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(exists(p) == false);
+ assert(exists(p) == false);
- TEST_CHECK(exists(static_env.Dir) == true);
- TEST_CHECK(exists(static_env.Dir / "dne") == false);
+ assert(exists(static_env.Dir) == true);
+ assert(exists(static_env.Dir / "dne") == false);
// Whether <dir>/dne/.. is considered to exist or not is not necessarily
// something we need to define, but the platform specific behaviour
// does affect a few other tests, so clarify the root cause here.
#ifdef _WIN32
- TEST_CHECK(exists(static_env.Dir / "dne" / "..") == true);
+ assert(exists(static_env.Dir / "dne" / "..") == true);
#else
- TEST_CHECK(exists(static_env.Dir / "dne" / "..") == false);
+ assert(exists(static_env.Dir / "dne" / "..") == false);
#endif
std::error_code ec = GetTestEC();
- TEST_CHECK(exists(p, ec) == false);
- TEST_CHECK(!ec);
+ assert(exists(p, ec) == false);
+ assert(!ec);
}
-TEST_CASE(test_exists_fails)
+static void test_exists_fails()
{
#ifdef _WIN32
// Windows doesn't support setting perms::none to trigger failures
@@ -90,7 +88,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -99,23 +97,33 @@
#endif
std::error_code ec;
- TEST_CHECK(exists(p, ec) == false);
- TEST_CHECK(ec);
+ assert(exists(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, exists(p));
+ TEST_THROWS_TYPE(filesystem_error, exists(p));
}
#ifndef _WIN32
// Checking for the existence of an invalid long path name doesn't
// trigger errors on windows.
-TEST_CASE(test_name_too_long) {
+static void test_name_too_long() {
std::string long_name(2500, 'a');
const path file(long_name);
std::error_code ec;
- TEST_CHECK(exists(file, ec) == false);
- TEST_CHECK(ec);
+ assert(exists(file, ec) == false);
+ assert(ec);
}
+#endif // _WIN32
+
+int main(int, char**) {
+ signature_test();
+ exists_status_test();
+ test_exist_not_found();
+ test_exists_fails();
+#ifndef _WIN32
+ test_name_too_long();
#endif
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp
index 2b1cb07..8e532fd 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -21,51 +21,49 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(file_size_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
- ASSERT_SAME_TYPE(decltype(file_size(p)), uintmax_t);
- ASSERT_SAME_TYPE(decltype(file_size(p, ec)), uintmax_t);
+ ASSERT_SAME_TYPE(decltype(file_size(p)), std::uintmax_t);
+ ASSERT_SAME_TYPE(decltype(file_size(p, ec)), std::uintmax_t);
ASSERT_NOT_NOEXCEPT(file_size(p));
ASSERT_NOEXCEPT(file_size(p, ec));
}
-TEST_CASE(file_size_empty_test)
+static void file_size_empty_test()
{
static_test_env static_env;
const path p = static_env.EmptyFile;
- TEST_CHECK(file_size(p) == 0);
+ assert(file_size(p) == 0);
std::error_code ec;
- TEST_CHECK(file_size(p, ec) == 0);
+ assert(file_size(p, ec) == 0);
}
-TEST_CASE(file_size_non_empty)
+static void file_size_non_empty()
{
scoped_test_env env;
const path p = env.create_file("file", 42);
- TEST_CHECK(file_size(p) == 42);
+ assert(file_size(p) == 42);
std::error_code ec;
- TEST_CHECK(file_size(p, ec) == 42);
+ assert(file_size(p, ec) == 42);
}
-TEST_CASE(symlink_test_case)
+static void symlink_test_case()
{
static_test_env static_env;
const path p = static_env.File;
const path p2 = static_env.SymlinkToFile;
- TEST_CHECK(file_size(p) == file_size(p2));
+ assert(file_size(p) == file_size(p2));
}
-TEST_CASE(file_size_error_cases)
+static void file_size_error_cases()
{
static_test_env static_env;
struct {
@@ -77,15 +75,22 @@
{static_env.BadSymlink, std::errc::no_such_file_or_directory},
{static_env.DNE, std::errc::no_such_file_or_directory},
{"", std::errc::no_such_file_or_directory}};
- const uintmax_t expect = static_cast<uintmax_t>(-1);
+ const std::uintmax_t expect = static_cast<std::uintmax_t>(-1);
for (auto& TC : TestCases) {
std::error_code ec = GetTestEC();
- TEST_CHECK(file_size(TC.p, ec) == expect);
- TEST_CHECK(ErrorIs(ec, TC.expected_err));
+ assert(file_size(TC.p, ec) == expect);
+ assert(ErrorIs(ec, TC.expected_err));
ExceptionChecker Checker(TC.p, TC.expected_err, "file_size");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, file_size(TC.p));
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, file_size(TC.p));
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ file_size_empty_test();
+ file_size_non_empty();
+ symlink_test_case();
+ file_size_error_cases();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
index 38b2671..b646b46 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
@@ -18,38 +18,35 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(hard_link_count_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
- ASSERT_SAME_TYPE(decltype(hard_link_count(p)), uintmax_t);
- ASSERT_SAME_TYPE(decltype(hard_link_count(p, ec)), uintmax_t);
+ ASSERT_SAME_TYPE(decltype(hard_link_count(p)), std::uintmax_t);
+ ASSERT_SAME_TYPE(decltype(hard_link_count(p, ec)), std::uintmax_t);
ASSERT_NOT_NOEXCEPT(hard_link_count(p));
ASSERT_NOEXCEPT(hard_link_count(p, ec));
}
-TEST_CASE(hard_link_count_for_file)
+static void hard_link_count_for_file()
{
static_test_env static_env;
- TEST_CHECK(hard_link_count(static_env.File) == 1);
+ assert(hard_link_count(static_env.File) == 1);
std::error_code ec;
- TEST_CHECK(hard_link_count(static_env.File, ec) == 1);
+ assert(hard_link_count(static_env.File, ec) == 1);
}
-TEST_CASE(hard_link_count_for_directory)
+static void hard_link_count_for_directory()
{
static_test_env static_env;
- uintmax_t DirExpect = 3; // hard link from . .. and Dir2
- uintmax_t Dir3Expect = 2; // hard link from . ..
- uintmax_t DirExpectAlt = DirExpect;
- uintmax_t Dir3ExpectAlt = Dir3Expect;
+ std::uintmax_t DirExpect = 3; // hard link from . .. and Dir2
+ std::uintmax_t Dir3Expect = 2; // hard link from . ..
+ std::uintmax_t DirExpectAlt = DirExpect;
+ std::uintmax_t Dir3ExpectAlt = Dir3Expect;
#if defined(__APPLE__)
// Filesystems formatted with case sensitive hfs+ behave unixish as
// expected. Normal hfs+ filesystems report the number of directory
@@ -57,45 +54,54 @@
DirExpectAlt = 5; // . .. Dir2 file1 file2
Dir3Expect = 3; // . .. file5
#endif
- TEST_CHECK(hard_link_count(static_env.Dir) == DirExpect ||
+ assert(hard_link_count(static_env.Dir) == DirExpect ||
hard_link_count(static_env.Dir) == DirExpectAlt ||
hard_link_count(static_env.Dir) == 1);
- TEST_CHECK(hard_link_count(static_env.Dir3) == Dir3Expect ||
+ assert(hard_link_count(static_env.Dir3) == Dir3Expect ||
hard_link_count(static_env.Dir3) == Dir3ExpectAlt ||
hard_link_count(static_env.Dir3) == 1);
std::error_code ec;
- TEST_CHECK(hard_link_count(static_env.Dir, ec) == DirExpect ||
+ assert(hard_link_count(static_env.Dir, ec) == DirExpect ||
hard_link_count(static_env.Dir, ec) == DirExpectAlt ||
hard_link_count(static_env.Dir) == 1);
- TEST_CHECK(hard_link_count(static_env.Dir3, ec) == Dir3Expect ||
+ assert(hard_link_count(static_env.Dir3, ec) == Dir3Expect ||
hard_link_count(static_env.Dir3, ec) == Dir3ExpectAlt ||
hard_link_count(static_env.Dir3) == 1);
}
-TEST_CASE(hard_link_count_increments_test)
+
+static void hard_link_count_increments_test()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
- TEST_CHECK(hard_link_count(file) == 1);
+ assert(hard_link_count(file) == 1);
env.create_hardlink(file, "file_hl");
- TEST_CHECK(hard_link_count(file) == 2);
+ assert(hard_link_count(file) == 2);
}
-TEST_CASE(hard_link_count_error_cases)
+static void hard_link_count_error_cases()
{
static_test_env static_env;
const path testCases[] = {
static_env.BadSymlink,
static_env.DNE
};
- const uintmax_t expect = static_cast<uintmax_t>(-1);
+ const std::uintmax_t expect = static_cast<std::uintmax_t>(-1);
for (auto& TC : testCases) {
std::error_code ec;
- TEST_CHECK(hard_link_count(TC, ec) == expect);
- TEST_CHECK(ec);
+ assert(hard_link_count(TC, ec) == expect);
+ assert(ec);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ hard_link_count_for_file();
+ hard_link_count_for_directory();
+ hard_link_count_increments_test();
+ hard_link_count_error_cases();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp
index d288984..3986b18 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_block_file_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_block_file(p));
}
-TEST_CASE(is_block_file_status_test)
+static void is_block_file_status_test()
{
struct TestCase {
file_type type;
@@ -56,18 +54,18 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_block_file(s) == TC.expect);
+ assert(is_block_file(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_block_file(p) == false);
+ assert(is_block_file(p) == false);
}
-TEST_CASE(test_is_block_file_fails)
+static void test_is_block_file_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -76,7 +74,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -84,10 +82,17 @@
#endif
std::error_code ec;
- TEST_CHECK(is_block_file(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_block_file(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_block_file(p));
+ TEST_THROWS_TYPE(filesystem_error, is_block_file(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_block_file_status_test();
+ test_exist_not_found();
+ test_is_block_file_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp
index 738e06c..610d97b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_character_file_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_character_file(p));
}
-TEST_CASE(is_character_file_status_test)
+static void is_character_file_status_test()
{
struct TestCase {
file_type type;
@@ -56,18 +54,18 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_character_file(s) == TC.expect);
+ assert(is_character_file(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_character_file(p) == false);
+ assert(is_character_file(p) == false);
}
-TEST_CASE(test_is_character_file_fails)
+static void test_is_character_file_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -76,7 +74,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -84,10 +82,17 @@
#endif
std::error_code ec;
- TEST_CHECK(is_character_file(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_character_file(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_character_file(p));
+ TEST_THROWS_TYPE(filesystem_error, is_character_file(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_character_file_status_test();
+ test_exist_not_found();
+ test_is_character_file_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp
index 8b1e41e..7cb297b 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_directory_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_directory(p));
}
-TEST_CASE(is_directory_status_test)
+static void is_directory_status_test()
{
struct TestCase {
file_type type;
@@ -56,26 +54,26 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_directory(s) == TC.expect);
+ assert(is_directory(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_directory(p) == false);
+ assert(is_directory(p) == false);
}
-TEST_CASE(static_env_test)
+static void static_env_test()
{
static_test_env static_env;
- TEST_CHECK(is_directory(static_env.Dir));
- TEST_CHECK(is_directory(static_env.SymlinkToDir));
- TEST_CHECK(!is_directory(static_env.File));
+ assert(is_directory(static_env.Dir));
+ assert(is_directory(static_env.SymlinkToDir));
+ assert(!is_directory(static_env.File));
}
-TEST_CASE(test_is_directory_fails)
+static void test_is_directory_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -84,7 +82,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_dir("dir/dir2");
@@ -92,10 +90,18 @@
#endif
std::error_code ec;
- TEST_CHECK(is_directory(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_directory(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_directory(p));
+ TEST_THROWS_TYPE(filesystem_error, is_directory(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_directory_status_test();
+ test_exist_not_found();
+ static_env_test();
+ test_is_directory_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
index 8478037..752e682 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
@@ -17,15 +17,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_empty_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -33,39 +31,39 @@
ASSERT_NOT_NOEXCEPT(is_empty(p));
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
std::error_code ec;
- TEST_CHECK(is_empty(p, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK_THROW(filesystem_error, is_empty(p));
+ assert(is_empty(p, ec) == false);
+ assert(ec);
+ TEST_THROWS_TYPE(filesystem_error, is_empty(p));
}
-TEST_CASE(test_is_empty_directory)
+static void test_is_empty_directory()
{
static_test_env static_env;
- TEST_CHECK(!is_empty(static_env.Dir));
- TEST_CHECK(!is_empty(static_env.SymlinkToDir));
+ assert(!is_empty(static_env.Dir));
+ assert(!is_empty(static_env.SymlinkToDir));
}
-TEST_CASE(test_is_empty_directory_dynamic)
+static void test_is_empty_directory_dynamic()
{
scoped_test_env env;
- TEST_CHECK(is_empty(env.test_root));
+ assert(is_empty(env.test_root));
env.create_file("foo", 42);
- TEST_CHECK(!is_empty(env.test_root));
+ assert(!is_empty(env.test_root));
}
-TEST_CASE(test_is_empty_file)
+static void test_is_empty_file()
{
static_test_env static_env;
- TEST_CHECK(is_empty(static_env.EmptyFile));
- TEST_CHECK(!is_empty(static_env.NonEmptyFile));
+ assert(is_empty(static_env.EmptyFile));
+ assert(!is_empty(static_env.NonEmptyFile));
}
-TEST_CASE(test_is_empty_fails)
+static void test_is_empty_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -74,7 +72,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_dir("dir/dir2");
@@ -82,13 +80,13 @@
#endif
std::error_code ec;
- TEST_CHECK(is_empty(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_empty(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_empty(p));
+ TEST_THROWS_TYPE(filesystem_error, is_empty(p));
}
-TEST_CASE(test_directory_access_denied)
+static void test_directory_access_denied()
{
scoped_test_env env;
#ifdef _WIN32
@@ -97,7 +95,7 @@
// instead.
const path dir = GetWindowsInaccessibleDir();
if (dir.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path file1 = env.create_file("dir/file", 42);
@@ -105,27 +103,40 @@
#endif
std::error_code ec = GetTestEC();
- TEST_CHECK(is_empty(dir, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(is_empty(dir, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
- TEST_CHECK_THROW(filesystem_error, is_empty(dir));
+ TEST_THROWS_TYPE(filesystem_error, is_empty(dir));
}
#ifndef _WIN32
-TEST_CASE(test_fifo_fails)
+static void test_fifo_fails()
{
scoped_test_env env;
const path fifo = env.create_fifo("fifo");
std::error_code ec = GetTestEC();
- TEST_CHECK(is_empty(fifo, ec) == false);
- TEST_CHECK(ec);
- TEST_CHECK(ec != GetTestEC());
+ assert(is_empty(fifo, ec) == false);
+ assert(ec);
+ assert(ec != GetTestEC());
- TEST_CHECK_THROW(filesystem_error, is_empty(fifo));
+ TEST_THROWS_TYPE(filesystem_error, is_empty(fifo));
}
+#endif // _WIN32
+
+int main(int, char**) {
+ signature_test();
+ test_exist_not_found();
+ test_is_empty_directory();
+ test_is_empty_directory_dynamic();
+ test_is_empty_file();
+ test_is_empty_fails();
+ test_directory_access_denied();
+#ifndef _WIN32
+ test_fifo_fails();
#endif
-TEST_SUITE_END()
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp
index 0169fed..b0ef430 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_fifo_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_fifo(p));
}
-TEST_CASE(is_fifo_status_test)
+static void is_fifo_status_test()
{
struct TestCase {
file_type type;
@@ -56,18 +54,18 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_fifo(s) == TC.expect);
+ assert(is_fifo(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_fifo(p) == false);
+ assert(is_fifo(p) == false);
}
-TEST_CASE(test_is_fifo_fails)
+static void test_is_fifo_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -76,7 +74,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -84,10 +82,17 @@
#endif
std::error_code ec;
- TEST_CHECK(is_fifo(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_fifo(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_fifo(p));
+ TEST_THROWS_TYPE(filesystem_error, is_fifo(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_fifo_status_test();
+ test_exist_not_found();
+ test_is_fifo_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp
index f84eb7d..8b37190 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_other_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_other(p));
}
-TEST_CASE(is_other_status_test)
+static void is_other_status_test()
{
struct TestCase {
file_type type;
@@ -56,18 +54,18 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_other(s) == TC.expect);
+ assert(is_other(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_other(p) == false);
+ assert(is_other(p) == false);
}
-TEST_CASE(test_is_other_fails)
+static void test_is_other_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -76,7 +74,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -84,10 +82,17 @@
#endif
std::error_code ec;
- TEST_CHECK(is_other(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_other(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_other(p));
+ TEST_THROWS_TYPE(filesystem_error, is_other(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_other_status_test();
+ test_exist_not_found();
+ test_is_other_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp
index 441f15a..b32ce64 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_regular_file_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_regular_file(p));
}
-TEST_CASE(is_regular_file_status_test)
+static void is_regular_file_status_test()
{
struct TestCase {
file_type type;
@@ -56,21 +54,21 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_regular_file(s) == TC.expect);
+ assert(is_regular_file(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_regular_file(p) == false);
+ assert(is_regular_file(p) == false);
std::error_code ec;
- TEST_CHECK(is_regular_file(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_regular_file(p, ec) == false);
+ assert(ec);
}
-TEST_CASE(test_is_regular_file_fails)
+static void test_is_regular_file_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -79,7 +77,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -87,10 +85,17 @@
#endif
std::error_code ec;
- TEST_CHECK(is_regular_file(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_regular_file(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_regular_file(p));
+ TEST_THROWS_TYPE(filesystem_error, is_regular_file(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_regular_file_status_test();
+ test_exist_not_found();
+ test_is_regular_file_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp
index 21aa537..da5169f 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_socket_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_socket(p));
}
-TEST_CASE(is_socket_status_test)
+static void is_socket_status_test()
{
struct TestCase {
file_type type;
@@ -56,18 +54,18 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_socket(s) == TC.expect);
+ assert(is_socket(s) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_socket(p) == false);
+ assert(is_socket(p) == false);
}
-TEST_CASE(test_is_socket_fails)
+static void test_is_socket_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -76,7 +74,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -84,10 +82,17 @@
#endif
std::error_code ec;
- TEST_CHECK(is_socket(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_socket(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_socket(p));
+ TEST_THROWS_TYPE(filesystem_error, is_socket(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_socket_status_test();
+ test_exist_not_found();
+ test_is_socket_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp
index d8ec533..e8ee7f4 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp
@@ -18,15 +18,13 @@
#include <type_traits>
#include <cassert>
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(is_symlink_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
const path p; ((void)p);
@@ -36,7 +34,7 @@
ASSERT_NOT_NOEXCEPT(is_symlink(p));
}
-TEST_CASE(is_symlink_status_test)
+static void is_symlink_status_test()
{
struct TestCase {
file_type type;
@@ -56,11 +54,11 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(is_symlink(s) == TC.expect);
+ assert(is_symlink(s) == TC.expect);
}
}
-TEST_CASE(static_env_test)
+static void static_env_test()
{
static_test_env static_env;
struct TestCase {
@@ -75,21 +73,21 @@
{static_env.BadSymlink, true}
};
for (auto& TC : testCases) {
- TEST_CHECK(is_symlink(TC.p) == TC.expect);
+ assert(is_symlink(TC.p) == TC.expect);
}
}
-TEST_CASE(test_exist_not_found)
+static void test_exist_not_found()
{
static_test_env static_env;
const path p = static_env.DNE;
- TEST_CHECK(is_symlink(p) == false);
+ assert(is_symlink(p) == false);
std::error_code ec;
- TEST_CHECK(is_symlink(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_symlink(p, ec) == false);
+ assert(ec);
}
-TEST_CASE(test_is_symlink_fails)
+static void test_is_symlink_fails()
{
scoped_test_env env;
#ifdef _WIN32
@@ -98,7 +96,7 @@
// instead.
const path p = GetWindowsInaccessibleDir();
if (p.empty())
- TEST_UNSUPPORTED();
+ return;
#else
const path dir = env.create_dir("dir");
const path p = env.create_file("dir/file", 42);
@@ -106,10 +104,18 @@
#endif
std::error_code ec;
- TEST_CHECK(is_symlink(p, ec) == false);
- TEST_CHECK(ec);
+ assert(is_symlink(p, ec) == false);
+ assert(ec);
- TEST_CHECK_THROW(filesystem_error, is_symlink(p));
+ TEST_THROWS_TYPE(filesystem_error, is_symlink(p));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ is_symlink_status_test();
+ static_env_test();
+ test_exist_not_found();
+ test_is_symlink_fails();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
index cfff7c2..7b6bf45 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
@@ -10,7 +10,7 @@
// The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
// <filesystem>
@@ -29,7 +29,6 @@
#include <type_traits>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
#include <fcntl.h>
@@ -52,8 +51,8 @@
#ifdef _WIN32
struct TimeSpec {
- int64_t tv_sec;
- int64_t tv_nsec;
+ std::int64_t tv_sec;
+ std::int64_t tv_nsec;
};
struct StatT {
TimeSpec st_atim;
@@ -61,7 +60,7 @@
};
// There were 369 years and 89 leap days from the Windows epoch
// (1601) to the Unix epoch (1970).
-#define FILE_TIME_OFFSET_SECS (uint64_t(369 * 365 + 89) * (24 * 60 * 60))
+#define FILE_TIME_OFFSET_SECS (std::uint64_t(369 * 365 + 89) * (24 * 60 * 60))
static TimeSpec filetime_to_timespec(LARGE_INTEGER li) {
TimeSpec ret;
ret.tv_sec = li.QuadPart / 10000000 - FILE_TIME_OFFSET_SECS;
@@ -376,9 +375,7 @@
}
}
-TEST_SUITE(last_write_time_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const file_time_type t;
const path p; ((void)p);
@@ -393,7 +390,7 @@
ASSERT_NOEXCEPT(last_write_time(p, t, ec));
}
-TEST_CASE(read_last_write_time_static_env_test)
+static void read_last_write_time_static_env_test()
{
static_test_env static_env;
using C = file_time_type::clock;
@@ -405,29 +402,28 @@
SleepFor(MilliSec(30));
{
file_time_type ret = last_write_time(static_env.File);
- TEST_CHECK(ret != min);
- TEST_CHECK(ret < C::now());
- TEST_CHECK(CompareTime(ret, LastWriteTime(static_env.File)));
+ assert(ret != min);
+ assert(ret < C::now());
+ assert(CompareTime(ret, LastWriteTime(static_env.File)));
file_time_type ret2 = last_write_time(static_env.SymlinkToFile);
- TEST_CHECK(CompareTime(ret, ret2));
- TEST_CHECK(CompareTime(ret2, LastWriteTime(static_env.SymlinkToFile)));
+ assert(CompareTime(ret, ret2));
+ assert(CompareTime(ret2, LastWriteTime(static_env.SymlinkToFile)));
}
{
file_time_type ret = last_write_time(static_env.Dir);
- TEST_CHECK(ret != min);
- TEST_CHECK(ret < C::now());
- TEST_CHECK(CompareTime(ret, LastWriteTime(static_env.Dir)));
+ assert(ret != min);
+ assert(ret < C::now());
+ assert(CompareTime(ret, LastWriteTime(static_env.Dir)));
file_time_type ret2 = last_write_time(static_env.SymlinkToDir);
- TEST_CHECK(CompareTime(ret, ret2));
- TEST_CHECK(CompareTime(ret2, LastWriteTime(static_env.SymlinkToDir)));
+ assert(CompareTime(ret, ret2));
+ assert(CompareTime(ret2, LastWriteTime(static_env.SymlinkToDir)));
}
}
-TEST_CASE(get_last_write_time_dynamic_env_test)
+static void get_last_write_time_dynamic_env_test()
{
- using Sec = std::chrono::seconds;
scoped_test_env env;
const path file = env.create_file("file", 42);
@@ -439,12 +435,12 @@
const TimeSpec dir_write_time = dir_times.write;
file_time_type ftime = last_write_time(file);
- TEST_CHECK(CompareTime(ftime, file_write_time));
+ assert(CompareTime(ftime, file_write_time));
file_time_type dtime = last_write_time(dir);
- TEST_CHECK(CompareTime(dtime, dir_write_time));
+ assert(CompareTime(dtime, dir_write_time));
- SleepFor(Sec(2));
+ SleepFor(std::chrono::seconds(2));
// update file and add a file to the directory. Make sure the times increase.
std::FILE* of = std::fopen(file.string().c_str(), "a");
@@ -455,14 +451,14 @@
file_time_type ftime2 = last_write_time(file);
file_time_type dtime2 = last_write_time(dir);
- TEST_CHECK(ftime2 > ftime);
- TEST_CHECK(dtime2 > dtime);
- TEST_CHECK(CompareTime(LastWriteTime(file), ftime2));
- TEST_CHECK(CompareTime(LastWriteTime(dir), dtime2));
+ assert(ftime2 > ftime);
+ assert(dtime2 > dtime);
+ assert(CompareTime(LastWriteTime(file), ftime2));
+ assert(CompareTime(LastWriteTime(dir), dtime2));
}
-TEST_CASE(set_last_write_time_dynamic_env_test)
+static void set_last_write_time_dynamic_env_test()
{
using Clock = file_time_type::clock;
scoped_test_env env;
@@ -513,25 +509,25 @@
for (const auto& TC : cases) {
const auto old_times = GetTimes(TC.p);
file_time_type old_time;
- TEST_REQUIRE(ConvertFromTimeSpec(old_time, old_times.write));
+ assert(ConvertFromTimeSpec(old_time, old_times.write));
std::error_code ec = GetTestEC();
last_write_time(TC.p, TC.new_time, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
ec = GetTestEC();
file_time_type got_time = last_write_time(TC.p, ec);
- TEST_REQUIRE(!ec);
+ assert(!ec);
if (TimeIsRepresentableByFilesystem(TC.new_time)) {
- TEST_CHECK(got_time != old_time);
- TEST_CHECK(CompareTime(got_time, TC.new_time));
- TEST_CHECK(CompareTime(LastAccessTime(TC.p), old_times.access));
+ assert(got_time != old_time);
+ assert(CompareTime(got_time, TC.new_time));
+ assert(CompareTime(LastAccessTime(TC.p), old_times.access));
}
}
}
-TEST_CASE(last_write_time_symlink_test)
+static void last_write_time_symlink_test()
{
using Clock = file_time_type::clock;
@@ -547,24 +543,24 @@
std::error_code ec = GetTestEC();
last_write_time(sym, new_time, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
file_time_type got_time = last_write_time(sym);
- TEST_CHECK(!CompareTime(got_time, old_times.write));
+ assert(!CompareTime(got_time, old_times.write));
if (!WorkaroundStatTruncatesToSeconds) {
- TEST_CHECK(got_time == new_time);
+ assert(got_time == new_time);
} else {
- TEST_CHECK(CompareTime(got_time, new_time));
+ assert(CompareTime(got_time, new_time));
}
- TEST_CHECK(CompareTime(LastWriteTime(file), new_time));
- TEST_CHECK(CompareTime(LastAccessTime(sym), old_times.access));
+ assert(CompareTime(LastWriteTime(file), new_time));
+ assert(CompareTime(LastAccessTime(sym), old_times.access));
Times sym_times = GetSymlinkTimes(sym);
- TEST_CHECK(CompareTime(sym_times.write, old_sym_times.write));
+ assert(CompareTime(sym_times.write, old_sym_times.write));
}
-TEST_CASE(test_write_min_time)
+static void test_write_min_time()
{
scoped_test_env env;
const path p = env.create_file("file", 42);
@@ -576,8 +572,8 @@
file_time_type tt = last_write_time(p);
if (TimeIsRepresentableByFilesystem(new_time)) {
- TEST_CHECK(!ec);
- TEST_CHECK(CompareTime(tt, new_time));
+ assert(!ec);
+ assert(CompareTime(tt, new_time));
last_write_time(p, old_time);
new_time = file_time_type::min() + SubSec(1);
@@ -587,19 +583,19 @@
tt = last_write_time(p);
if (TimeIsRepresentableByFilesystem(new_time)) {
- TEST_CHECK(!ec);
- TEST_CHECK(CompareTime(tt, new_time));
+ assert(!ec);
+ assert(CompareTime(tt, new_time));
} else {
- TEST_CHECK(ErrorIs(ec, std::errc::value_too_large));
- TEST_CHECK(tt == old_time);
+ assert(ErrorIs(ec, std::errc::value_too_large));
+ assert(tt == old_time);
}
} else {
- TEST_CHECK(ErrorIs(ec, std::errc::value_too_large));
- TEST_CHECK(tt == old_time);
+ assert(ErrorIs(ec, std::errc::value_too_large));
+ assert(tt == old_time);
}
}
-TEST_CASE(test_write_max_time) {
+static void test_write_max_time() {
scoped_test_env env;
const path p = env.create_file("file", 42);
const file_time_type old_time = last_write_time(p);
@@ -610,27 +606,27 @@
file_time_type tt = last_write_time(p);
if (TimeIsRepresentableByFilesystem(new_time)) {
- TEST_CHECK(!ec);
- TEST_CHECK(CompareTime(tt, new_time));
+ assert(!ec);
+ assert(CompareTime(tt, new_time));
} else {
- TEST_CHECK(ErrorIs(ec, std::errc::value_too_large));
- TEST_CHECK(tt == old_time);
+ assert(ErrorIs(ec, std::errc::value_too_large));
+ assert(tt == old_time);
}
}
-TEST_CASE(test_value_on_failure)
+static void test_value_on_failure()
{
static_test_env static_env;
const path p = static_env.DNE;
std::error_code ec = GetTestEC();
- TEST_CHECK(last_write_time(p, ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory));
+ assert(last_write_time(p, ec) == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::no_such_file_or_directory));
}
// Windows doesn't support setting perms::none to trigger failures
// reading directories.
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(test_exists_fails)
+static void test_exists_fails()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -638,13 +634,26 @@
permissions(dir, perms::none);
std::error_code ec = GetTestEC();
- TEST_CHECK(last_write_time(file, ec) == file_time_type::min());
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
+ assert(last_write_time(file, ec) == file_time_type::min());
+ assert(ErrorIs(ec, std::errc::permission_denied));
ExceptionChecker Checker(file, std::errc::permission_denied,
"last_write_time");
- TEST_CHECK_THROW_RESULT(filesystem_error, Checker, last_write_time(file));
+ TEST_VALIDATE_EXCEPTION(filesystem_error, Checker, last_write_time(file));
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ read_last_write_time_static_env_test();
+ get_last_write_time_dynamic_env_test();
+ set_last_write_time_dynamic_env_test();
+ last_write_time_symlink_test();
+ test_write_min_time();
+ test_write_max_time();
+ test_value_on_failure();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ test_exists_fails();
+#endif
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
index 7cf1c72..dc5ff11 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
@@ -20,16 +20,13 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
using PR = fs::perms;
-TEST_SUITE(filesystem_permissions_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
const perms pr{}; ((void)pr);
@@ -41,7 +38,7 @@
LIBCPP_ONLY(ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec)));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, fs::perms opts,
const std::error_code& ec)
@@ -67,20 +64,20 @@
{ // !exists
std::error_code ec = GetTestEC();
fs::permissions(dne, fs::perms{}, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(checkThrow(dne, fs::perms{}, ec));
+ assert(ec);
+ assert(ec != GetTestEC());
+ assert(checkThrow(dne, fs::perms{}, ec));
}
{
std::error_code ec = GetTestEC();
fs::permissions(dne_sym, fs::perms{}, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(checkThrow(dne_sym, fs::perms{}, ec));
+ assert(ec);
+ assert(ec != GetTestEC());
+ assert(checkThrow(dne_sym, fs::perms{}, ec));
}
}
-TEST_CASE(basic_permissions_test)
+static void basic_permissions_test()
{
scoped_test_env env;
const path file = env.create_file("file1", 42);
@@ -120,20 +117,20 @@
{dir, perms::group_all, perms::owner_all | perms::group_all, AP | NF}
};
for (auto const& TC : cases) {
- TEST_CHECK(status(TC.p).permissions() != TC.expected);
+ assert(status(TC.p).permissions() != TC.expected);
{
std::error_code ec = GetTestEC();
permissions(TC.p, TC.set_perms, TC.opts, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
auto pp = status(TC.p).permissions();
- TEST_CHECK(pp == NormalizeExpectedPerms(TC.expected));
+ assert(pp == NormalizeExpectedPerms(TC.expected));
}
if (TC.opts == perm_options::replace) {
std::error_code ec = GetTestEC();
permissions(TC.p, TC.set_perms, ec);
- TEST_CHECK(!ec);
+ assert(!ec);
auto pp = status(TC.p).permissions();
- TEST_CHECK(pp == NormalizeExpectedPerms(TC.expected));
+ assert(pp == NormalizeExpectedPerms(TC.expected));
}
}
}
@@ -142,7 +139,7 @@
// This test isn't currently meaningful on Windows; the Windows file
// permissions visible via std::filesystem doesn't show any difference
// between owner/group/others.
-TEST_CASE(test_no_resolve_symlink_on_symlink)
+static void test_no_resolve_symlink_on_symlink()
{
scoped_test_env env;
const path file = env.create_file("file", 42);
@@ -177,13 +174,21 @@
std::error_code ec = GetTestEC();
permissions(sym, TC.set_perms, TC.opts | perm_options::nofollow, ec);
if (expected_ec)
- TEST_CHECK(ErrorIs(ec, static_cast<std::errc>(expected_ec.value())));
+ assert(ErrorIs(ec, static_cast<std::errc>(expected_ec.value())));
else
- TEST_CHECK(!ec);
- TEST_CHECK(status(file).permissions() == file_perms);
- TEST_CHECK(symlink_status(sym).permissions() == expected_link_perms);
+ assert(!ec);
+ assert(status(file).permissions() == file_perms);
+ assert(symlink_status(sym).permissions() == expected_link_perms);
}
}
-#endif
+#endif // _WIN32
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ basic_permissions_test();
+#ifndef _WIN32
+ test_no_resolve_symlink_on_symlink();
+#endif
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
index b1341ee..2970d9f 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
@@ -20,7 +20,6 @@
#include "test_macros.h"
#include "count_new.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
@@ -33,10 +32,8 @@
return count;
}
-TEST_SUITE(filesystem_proximate_path_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
using fs::path;
const path p; ((void)p);
@@ -47,12 +44,12 @@
ASSERT_NOT_NOEXCEPT(proximate(p, p, ec));
}
-TEST_CASE(basic_test) {
+static void basic_test() {
using fs::path;
const path cwd = fs::current_path();
const path parent_cwd = cwd.parent_path();
const path curdir = cwd.filename();
- TEST_REQUIRE(!cwd.native().empty());
+ assert(!cwd.native().empty());
int cwd_depth = count_path_elems(cwd);
path dot_dot_to_root;
for (int i=0; i < cwd_depth; ++i)
@@ -141,7 +138,7 @@
fs::path expect = TC.expect;
expect.make_preferred();
if (ec) {
- TEST_CHECK(!ec);
+ assert(!ec);
std::fprintf(stderr, "TEST CASE #%d FAILED:\n"
" Input: '%s'\n"
" Base: '%s'\n"
@@ -149,7 +146,7 @@
ID, TC.input.string().c_str(), TC.base.string().c_str(),
expect.string().c_str());
} else if (!PathEq(output, expect)) {
- TEST_CHECK(PathEq(output, expect));
+ assert(PathEq(output, expect));
const path canon_input = fs::weakly_canonical(TC.input);
const path canon_base = fs::weakly_canonical(TC.base);
@@ -170,4 +167,9 @@
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ basic_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
index ae94253..fa0bf95 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
@@ -16,14 +16,11 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_read_symlink_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -35,7 +32,7 @@
ASSERT_NOT_NOEXCEPT(fs::read_symlink(p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, const std::error_code& ec)
{
@@ -63,14 +60,14 @@
for (path const& p : cases) {
std::error_code ec;
const path ret = fs::read_symlink(p, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(ret == path{});
- TEST_CHECK(checkThrow(p, ec));
+ assert(ec);
+ assert(ret == path{});
+ assert(checkThrow(p, ec));
}
}
-TEST_CASE(basic_symlink_test)
+static void basic_symlink_test()
{
scoped_test_env env;
const path dne = env.make_env_path("dne");
@@ -91,9 +88,15 @@
for (auto& TC : testCases) {
std::error_code ec = std::make_error_code(std::errc::address_in_use);
const path ret = read_symlink(TC.symlink, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ret == TC.expected);
+ assert(!ec);
+ assert(ret == TC.expected);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ basic_symlink_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
index 0c05605..820162f 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
@@ -22,76 +22,73 @@
#include "test_macros.h"
#include "test_iterators.h"
#include "count_new.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
-TEST_SUITE(filesystem_proximate_path_test_suite)
-
-TEST_CASE(test_signature_0) {
+static void test_signature_0() {
fs::path p("");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(fs::current_path()));
+ assert(output == fs::path::string_type(fs::current_path()));
}
-TEST_CASE(test_signature_1) {
+static void test_signature_1() {
fs::path p(".");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(fs::current_path()));
+ assert(output == fs::path::string_type(fs::current_path()));
}
-TEST_CASE(test_signature_2) {
+static void test_signature_2() {
static_test_env static_env;
fs::path p(static_env.File);
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.File));
+ assert(output == fs::path::string_type(static_env.File));
}
-TEST_CASE(test_signature_3) {
+static void test_signature_3() {
static_test_env static_env;
fs::path p(static_env.Dir);
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir));
+ assert(output == fs::path::string_type(static_env.Dir));
}
-TEST_CASE(test_signature_4) {
+static void test_signature_4() {
static_test_env static_env;
fs::path p(static_env.SymlinkToDir);
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir));
+ assert(output == fs::path::string_type(static_env.Dir));
}
-TEST_CASE(test_signature_5) {
+static void test_signature_5() {
static_test_env static_env;
fs::path p(static_env.SymlinkToDir / "dir2/.");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir / "dir2"));
+ assert(output == fs::path::string_type(static_env.Dir / "dir2"));
}
-TEST_CASE(test_signature_6) {
+static void test_signature_6() {
static_test_env static_env;
// FIXME? If the trailing separator occurs in a part of the path that exists,
// it is omitted. Otherwise it is added to the end of the result.
fs::path p(static_env.SymlinkToDir / "dir2/./");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir / "dir2"));
+ assert(output == fs::path::string_type(static_env.Dir / "dir2"));
}
-TEST_CASE(test_signature_7) {
+static void test_signature_7() {
static_test_env static_env;
fs::path p(static_env.SymlinkToDir / "dir2/DNE/./");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir / "dir2/DNE/"));
+ assert(output == fs::path::string_type(static_env.Dir / "dir2/DNE/"));
}
-TEST_CASE(test_signature_8) {
+static void test_signature_8() {
static_test_env static_env;
fs::path p(static_env.SymlinkToDir / "dir2");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir2));
+ assert(output == fs::path::string_type(static_env.Dir2));
}
-TEST_CASE(test_signature_9) {
+static void test_signature_9() {
static_test_env static_env;
fs::path p(static_env.SymlinkToDir / "dir2/../dir2/DNE/..");
const fs::path output = fs::weakly_canonical(p);
@@ -102,38 +99,55 @@
// to exist, on posix it's considered to not exist. Therefore, the
// result here differs in the trailing slash.
#ifdef _WIN32
- TEST_CHECK(output == fs::path::string_type(static_env.Dir2));
+ assert(output == fs::path::string_type(static_env.Dir2));
#else
- TEST_CHECK(output == fs::path::string_type(static_env.Dir2 / ""));
+ assert(output == fs::path::string_type(static_env.Dir2 / ""));
#endif
}
-TEST_CASE(test_signature_10) {
+static void test_signature_10() {
static_test_env static_env;
fs::path p(static_env.SymlinkToDir / "dir2/dir3/../DNE/DNE2");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir2 / "DNE/DNE2"));
+ assert(output == fs::path::string_type(static_env.Dir2 / "DNE/DNE2"));
}
-TEST_CASE(test_signature_11) {
+static void test_signature_11() {
static_test_env static_env;
fs::path p(static_env.Dir / "../dir1");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir));
+ assert(output == fs::path::string_type(static_env.Dir));
}
-TEST_CASE(test_signature_12) {
+static void test_signature_12() {
static_test_env static_env;
fs::path p(static_env.Dir / "./.");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir));
+ assert(output == fs::path::string_type(static_env.Dir));
}
-TEST_CASE(test_signature_13) {
+static void test_signature_13() {
static_test_env static_env;
fs::path p(static_env.Dir / "DNE/../foo");
const fs::path output = fs::weakly_canonical(p);
- TEST_CHECK(output == fs::path::string_type(static_env.Dir / "foo"));
+ assert(output == fs::path::string_type(static_env.Dir / "foo"));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signature_0();
+ test_signature_1();
+ test_signature_2();
+ test_signature_3();
+ test_signature_4();
+ test_signature_5();
+ test_signature_6();
+ test_signature_7();
+ test_signature_8();
+ test_signature_9();
+ test_signature_10();
+ test_signature_11();
+ test_signature_12();
+ test_signature_13();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp
index 950ed73..f82a583 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp
@@ -16,14 +16,11 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_remove_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -34,7 +31,7 @@
ASSERT_NOEXCEPT(fs::remove(p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, const std::error_code& ec)
{
@@ -71,9 +68,9 @@
for (auto& p : testCases) {
std::error_code ec;
- TEST_CHECK(!fs::remove(p, ec));
- TEST_CHECK(ec);
- TEST_CHECK(checkThrow(p, ec));
+ assert(!fs::remove(p, ec));
+ assert(ec);
+ assert(checkThrow(p, ec));
}
// PR#35780
@@ -85,12 +82,12 @@
for (auto& p : testCasesNonexistant) {
std::error_code ec;
- TEST_CHECK(!fs::remove(p, ec));
- TEST_CHECK(!ec);
+ assert(!fs::remove(p, ec));
+ assert(!ec);
}
}
-TEST_CASE(basic_remove_test)
+static void basic_remove_test()
{
scoped_test_env env;
const path dne = env.make_env_path("dne");
@@ -105,10 +102,15 @@
};
for (auto& p : testCases) {
std::error_code ec = std::make_error_code(std::errc::address_in_use);
- TEST_CHECK(remove(p, ec));
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(symlink_status(p)));
+ assert(remove(p, ec));
+ assert(!ec);
+ assert(!exists(symlink_status(p)));
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ basic_remove_test();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
index 7ac9ddc..a6842b2 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
@@ -18,14 +18,11 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_remove_all_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -36,7 +33,7 @@
ASSERT_NOT_NOEXCEPT(fs::remove_all(p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
scoped_test_env env;
// Windows doesn't support setting perms::none to trigger failures
@@ -73,9 +70,9 @@
for (auto& p : testCases) {
std::error_code ec;
- TEST_CHECK(fs::remove_all(p, ec) == BadRet);
- TEST_CHECK(ec);
- TEST_CHECK(checkThrow(p, ec));
+ assert(fs::remove_all(p, ec) == BadRet);
+ assert(ec);
+ assert(checkThrow(p, ec));
}
#endif
@@ -87,12 +84,12 @@
for (auto &p : testCasesNonexistant) {
std::error_code ec;
- TEST_CHECK(fs::remove_all(p, ec) == 0);
- TEST_CHECK(!ec);
+ assert(fs::remove_all(p, ec) == 0);
+ assert(!ec);
}
}
-TEST_CASE(basic_remove_all_test)
+static void basic_remove_all_test()
{
scoped_test_env env;
const path dne = env.make_env_path("dne");
@@ -107,13 +104,13 @@
};
for (auto& p : testCases) {
std::error_code ec = std::make_error_code(std::errc::address_in_use);
- TEST_CHECK(remove(p, ec));
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(symlink_status(p)));
+ assert(remove(p, ec));
+ assert(!ec);
+ assert(!exists(symlink_status(p)));
}
}
-TEST_CASE(symlink_to_dir)
+static void symlink_to_dir()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -122,16 +119,16 @@
{
std::error_code ec = std::make_error_code(std::errc::address_in_use);
- TEST_CHECK(remove_all(link, ec) == 1);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(symlink_status(link)));
- TEST_CHECK(exists(dir));
- TEST_CHECK(exists(file));
+ assert(remove_all(link, ec) == 1);
+ assert(!ec);
+ assert(!exists(symlink_status(link)));
+ assert(exists(dir));
+ assert(exists(file));
}
}
-TEST_CASE(nested_dir)
+static void nested_dir()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -147,12 +144,20 @@
const std::size_t expected_count = sizeof(all_files) / sizeof(all_files[0]);
std::error_code ec = std::make_error_code(std::errc::address_in_use);
- TEST_CHECK(remove_all(dir, ec) == expected_count);
- TEST_CHECK(!ec);
+ assert(remove_all(dir, ec) == expected_count);
+ assert(!ec);
for (auto const& p : all_files) {
- TEST_CHECK(!exists(symlink_status(p)));
+ assert(!exists(symlink_status(p)));
}
- TEST_CHECK(exists(out_of_dir_file));
+ assert(exists(out_of_dir_file));
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ basic_remove_all_test();
+ symlink_to_dir();
+ nested_dir();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/toctou.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/toctou.pass.cpp
index 8831912..e327e72 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/toctou.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/toctou.pass.cpp
@@ -29,9 +29,9 @@
// This test requires a dylib containing the fix shipped in https://reviews.llvm.org/D118134.
// We use UNSUPPORTED instead of XFAIL because the test might not fail reliably.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx11.0
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx12.{{0|1|2}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx11.0
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx12.{{0|1|2}}
// Windows doesn't support the necessary APIs to mitigate this issue.
// UNSUPPORTED: target={{.+}}-windows-{{.+}}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
index c651bf1..b1ac260 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
@@ -16,14 +16,11 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_rename_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -34,7 +31,7 @@
ASSERT_NOEXCEPT(fs::rename(p, p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
{
@@ -75,14 +72,14 @@
auto to_before = status(TC.to);
std::error_code ec;
rename(TC.from, TC.to, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(from_before.type() == status(TC.from).type());
- TEST_CHECK(to_before.type() == status(TC.to).type());
- TEST_CHECK(checkThrow(TC.from, TC.to, ec));
+ assert(ec);
+ assert(from_before.type() == status(TC.from).type());
+ assert(to_before.type() == status(TC.to).type());
+ assert(checkThrow(TC.from, TC.to, ec));
}
}
-TEST_CASE(basic_rename_test)
+static void basic_rename_test()
{
scoped_test_env env;
@@ -91,28 +88,28 @@
{ // same file
std::error_code ec = set_ec;
rename(file, file, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(is_regular_file(file));
- TEST_CHECK(file_size(file) == 42);
+ assert(!ec);
+ assert(is_regular_file(file));
+ assert(file_size(file) == 42);
}
const path sym = env.create_symlink(file, "sym");
{ // file -> symlink
std::error_code ec = set_ec;
rename(file, sym, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(file));
- TEST_CHECK(is_regular_file(symlink_status(sym)));
- TEST_CHECK(file_size(sym) == 42);
+ assert(!ec);
+ assert(!exists(file));
+ assert(is_regular_file(symlink_status(sym)));
+ assert(file_size(sym) == 42);
}
const path file2 = env.create_file("file2", 42);
const path file3 = env.create_file("file3", 100);
{ // file -> file
std::error_code ec = set_ec;
rename(file2, file3, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(file2));
- TEST_CHECK(is_regular_file(file3));
- TEST_CHECK(file_size(file3) == 42);
+ assert(!ec);
+ assert(!exists(file2));
+ assert(is_regular_file(file3));
+ assert(file_size(file3) == 42);
}
const path dne = env.make_env_path("dne");
const path bad_sym = env.create_symlink(dne, "bad_sym");
@@ -120,14 +117,14 @@
{ // bad-symlink
std::error_code ec = set_ec;
rename(bad_sym, bad_sym_dest, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(symlink_status(bad_sym)));
- TEST_CHECK(is_symlink(bad_sym_dest));
- TEST_CHECK(read_symlink(bad_sym_dest) == dne);
+ assert(!ec);
+ assert(!exists(symlink_status(bad_sym)));
+ assert(is_symlink(bad_sym_dest));
+ assert(read_symlink(bad_sym_dest) == dne);
}
}
-TEST_CASE(basic_rename_dir_test)
+static void basic_rename_dir_test()
{
static_test_env env;
const std::error_code set_ec = std::make_error_code(std::errc::address_in_use);
@@ -135,10 +132,10 @@
{ // dir -> dir (with contents)
std::error_code ec = set_ec;
rename(env.Dir, new_dir, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(env.Dir));
- TEST_CHECK(is_directory(new_dir));
- TEST_CHECK(exists(new_dir / "file1"));
+ assert(!ec);
+ assert(!exists(env.Dir));
+ assert(is_directory(new_dir));
+ assert(exists(new_dir / "file1"));
}
#ifdef _WIN32
// On Windows, renaming a directory over a file isn't an error (this
@@ -146,12 +143,19 @@
{ // dir -> file
std::error_code ec = set_ec;
rename(new_dir, env.NonEmptyFile, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(!exists(new_dir));
- TEST_CHECK(is_directory(env.NonEmptyFile));
- TEST_CHECK(exists(env.NonEmptyFile / "file1"));
+ assert(!ec);
+ assert(!exists(new_dir));
+ assert(is_directory(env.NonEmptyFile));
+ assert(exists(env.NonEmptyFile / "file1"));
}
#endif
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ basic_rename_test();
+ basic_rename_dir_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
index 5045617..0b03bb8 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
@@ -16,14 +16,11 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_resize_file_test_suite)
-
-TEST_CASE(test_signatures)
+static void test_signatures()
{
const path p; ((void)p);
std::uintmax_t i; ((void)i);
@@ -36,7 +33,7 @@
ASSERT_NOEXCEPT(fs::resize_file(p, i, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
auto checkThrow = [](path const& f, std::uintmax_t s, const std::error_code& ec)
{
@@ -64,12 +61,12 @@
for (auto& p : cases) {
std::error_code ec;
resize_file(p, 42, ec);
- TEST_REQUIRE(ec);
- TEST_CHECK(checkThrow(p, 42, ec));
+ assert(ec);
+ assert(checkThrow(p, 42, ec));
}
}
-TEST_CASE(basic_resize_file_test)
+static void basic_resize_file_test()
{
scoped_test_env env;
const path file1 = env.create_file("file1", 42);
@@ -78,31 +75,36 @@
const std::uintmax_t new_s = 100;
std::error_code ec = set_ec;
resize_file(file1, new_s, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(file1) == new_s);
+ assert(!ec);
+ assert(file_size(file1) == new_s);
}
{ // shrink file
const std::uintmax_t new_s = 1;
std::error_code ec = set_ec;
resize_file(file1, new_s, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(file1) == new_s);
+ assert(!ec);
+ assert(file_size(file1) == new_s);
}
{ // shrink file to zero
const std::uintmax_t new_s = 0;
std::error_code ec = set_ec;
resize_file(file1, new_s, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(file1) == new_s);
+ assert(!ec);
+ assert(file_size(file1) == new_s);
}
const path sym = env.create_symlink(file1, "sym");
{ // grow file via symlink
const std::uintmax_t new_s = 1024;
std::error_code ec = set_ec;
resize_file(sym, new_s, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(file_size(file1) == new_s);
+ assert(!ec);
+ assert(file_size(file1) == new_s);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ test_signatures();
+ test_error_reporting();
+ basic_resize_file_test();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
index c031796..7659cde 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
@@ -16,7 +16,6 @@
#include "filesystem_include.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
@@ -29,9 +28,7 @@
}
}
-TEST_SUITE(filesystem_space_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -41,7 +38,7 @@
ASSERT_NOEXCEPT(space(p, ec));
}
-TEST_CASE(test_error_reporting)
+static void test_error_reporting()
{
static_test_env static_env;
auto checkThrow = [](path const& f, const std::error_code& ec)
@@ -69,15 +66,15 @@
const auto expect = static_cast<std::uintmax_t>(-1);
std::error_code ec;
space_info info = space(p, ec);
- TEST_CHECK(ec);
- TEST_CHECK(info.capacity == expect);
- TEST_CHECK(info.free == expect);
- TEST_CHECK(info.available == expect);
- TEST_CHECK(checkThrow(p, ec));
+ assert(ec);
+ assert(info.capacity == expect);
+ assert(info.free == expect);
+ assert(info.available == expect);
+ assert(checkThrow(p, ec));
}
}
-TEST_CASE(basic_space_test)
+static void basic_space_test()
{
static_test_env static_env;
@@ -88,7 +85,7 @@
std::uintmax_t expect_capacity;
std::uintmax_t expect_free;
std::uintmax_t expect_avail;
- TEST_REQUIRE(utils::space(static_env.Dir.string(), expect_capacity,
+ assert(utils::space(static_env.Dir.string(), expect_capacity,
expect_free, expect_avail));
// Other processes running on the operating system may have changed
@@ -105,14 +102,20 @@
for (auto& p : cases) {
std::error_code ec = GetTestEC();
space_info info = space(p, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(info.capacity != bad_value);
- TEST_CHECK(expect_capacity == info.capacity);
- TEST_CHECK(info.free != bad_value);
- TEST_CHECK(EqualDelta(expect_free, info.free, delta));
- TEST_CHECK(info.available != bad_value);
- TEST_CHECK(EqualDelta(expect_avail, info.available, delta));
+ assert(!ec);
+ assert(info.capacity != bad_value);
+ assert(expect_capacity == info.capacity);
+ assert(info.free != bad_value);
+ assert(EqualDelta(expect_free, info.free, delta));
+ assert(info.available != bad_value);
+ assert(EqualDelta(expect_avail, info.available, delta));
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ test_error_reporting();
+ basic_space_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
index 3fa9f58..17abaf7 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
@@ -15,15 +15,13 @@
#include "filesystem_include.h"
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_status_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -31,7 +29,7 @@
ASSERT_NOEXCEPT(status(p, ec));
}
-TEST_CASE(test_status_not_found)
+static void test_status_not_found()
{
static_test_env static_env;
const std::errc expect_errc = std::errc::no_such_file_or_directory;
@@ -43,14 +41,14 @@
std::error_code ec = std::make_error_code(std::errc::address_in_use);
// test non-throwing overload.
file_status st = status(p, ec);
- TEST_CHECK(ErrorIs(ec, expect_errc));
- TEST_CHECK(st.type() == file_type::not_found);
- TEST_CHECK(st.permissions() == perms::unknown);
+ assert(ErrorIs(ec, expect_errc));
+ assert(st.type() == file_type::not_found);
+ assert(st.permissions() == perms::unknown);
// test throwing overload. It should not throw even though it reports
// that the file was not found.
- TEST_CHECK_NO_THROW(st = status(p));
- TEST_CHECK(st.type() == file_type::not_found);
- TEST_CHECK(st.permissions() == perms::unknown);
+ TEST_DOES_NOT_THROW(st = status(p));
+ assert(st.type() == file_type::not_found);
+ assert(st.permissions() == perms::unknown);
}
}
@@ -60,7 +58,7 @@
// for. Finally, status() for a too long file name doesn't return errors
// on windows.
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(test_status_cannot_resolve)
+static void test_status_cannot_resolve()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -85,26 +83,26 @@
{ // test non-throwing case
std::error_code ec = std::make_error_code(set_errc);
file_status st = status(TC.p, ec);
- TEST_CHECK(ErrorIs(ec, TC.expect_errc));
- TEST_CHECK(st.type() == file_type::none);
- TEST_CHECK(st.permissions() == perms::unknown);
+ assert(ErrorIs(ec, TC.expect_errc));
+ assert(st.type() == file_type::none);
+ assert(st.permissions() == perms::unknown);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{ // test throwing case
try {
status(TC.p);
} catch (filesystem_error const& err) {
- TEST_CHECK(err.path1() == TC.p);
- TEST_CHECK(err.path2() == "");
- TEST_CHECK(ErrorIs(err.code(), TC.expect_errc));
+ assert(err.path1() == TC.p);
+ assert(err.path2() == "");
+ assert(ErrorIs(err.code(), TC.expect_errc));
}
}
#endif
}
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(status_file_types_test)
+static void status_file_types_test()
{
static_test_env static_env;
scoped_test_env env;
@@ -131,17 +129,17 @@
// test non-throwing case
std::error_code ec = std::make_error_code(std::errc::address_in_use);
file_status st = status(TC.p, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(st.type() == TC.expect_type);
- TEST_CHECK(st.permissions() != perms::unknown);
+ assert(!ec);
+ assert(st.type() == TC.expect_type);
+ assert(st.permissions() != perms::unknown);
// test throwing case
- TEST_REQUIRE_NO_THROW(st = status(TC.p));
- TEST_CHECK(st.type() == TC.expect_type);
- TEST_CHECK(st.permissions() != perms::unknown);
+ TEST_DOES_NOT_THROW(st = status(TC.p));
+ assert(st.type() == TC.expect_type);
+ assert(st.permissions() != perms::unknown);
}
}
-TEST_CASE(test_block_file)
+static void test_block_file()
{
const path possible_paths[] = {
"/dev/drive0", // Apple
@@ -157,18 +155,29 @@
}
}
if (p == path{}) {
- TEST_UNSUPPORTED();
+ // No possible path found.
+ return;
}
// test non-throwing case
std::error_code ec = std::make_error_code(std::errc::address_in_use);
file_status st = status(p, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(st.type() == file_type::block);
- TEST_CHECK(st.permissions() != perms::unknown);
+ assert(!ec);
+ assert(st.type() == file_type::block);
+ assert(st.permissions() != perms::unknown);
// test throwing case
- TEST_REQUIRE_NO_THROW(st = status(p));
- TEST_CHECK(st.type() == file_type::block);
- TEST_CHECK(st.permissions() != perms::unknown);
+ TEST_DOES_NOT_THROW(st = status(p));
+ assert(st.type() == file_type::block);
+ assert(st.permissions() != perms::unknown);
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ test_status_not_found();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ test_status_cannot_resolve();
+#endif
+ status_file_types_test();
+ test_block_file();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp
index e3763bb..1394c08 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp
@@ -17,21 +17,18 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(status_known_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
file_status s; ((void)s);
ASSERT_SAME_TYPE(decltype(status_known(s)), bool);
ASSERT_NOEXCEPT(status_known(s));
}
-TEST_CASE(status_known_test)
+static void status_known_test()
{
struct TestCase {
file_type type;
@@ -51,8 +48,13 @@
};
for (auto& TC : testCases) {
file_status s(TC.type);
- TEST_CHECK(status_known(s) == TC.expect);
+ assert(status_known(s) == TC.expect);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ status_known_test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
index a1d8ba6..3ab50c3 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
@@ -15,15 +15,13 @@
#include "filesystem_include.h"
+#include "assert_macros.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
-TEST_SUITE(filesystem_symlink_status_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
const path p; ((void)p);
std::error_code ec; ((void)ec);
@@ -31,7 +29,7 @@
ASSERT_NOEXCEPT(symlink_status(p, ec));
}
-TEST_CASE(test_symlink_status_not_found)
+static void test_symlink_status_not_found()
{
static_test_env static_env;
const std::errc expect_errc = std::errc::no_such_file_or_directory;
@@ -42,14 +40,14 @@
std::error_code ec = std::make_error_code(std::errc::address_in_use);
// test non-throwing overload.
file_status st = symlink_status(p, ec);
- TEST_CHECK(ErrorIs(ec, expect_errc));
- TEST_CHECK(st.type() == file_type::not_found);
- TEST_CHECK(st.permissions() == perms::unknown);
+ assert(ErrorIs(ec, expect_errc));
+ assert(st.type() == file_type::not_found);
+ assert(st.permissions() == perms::unknown);
// test throwing overload. It should not throw even though it reports
// that the file was not found.
- TEST_CHECK_NO_THROW(st = status(p));
- TEST_CHECK(st.type() == file_type::not_found);
- TEST_CHECK(st.permissions() == perms::unknown);
+ TEST_DOES_NOT_THROW(st = status(p));
+ assert(st.type() == file_type::not_found);
+ assert(st.permissions() == perms::unknown);
}
}
@@ -59,7 +57,7 @@
// for. Finally, status() for a too long file name doesn't return errors
// on windows.
#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(test_symlink_status_cannot_resolve)
+static void test_symlink_status_cannot_resolve()
{
scoped_test_env env;
const path dir = env.create_dir("dir");
@@ -79,18 +77,18 @@
{ // test non-throwing case
std::error_code ec = std::make_error_code(set_errc);
file_status st = symlink_status(p, ec);
- TEST_CHECK(ErrorIs(ec, expect_errc));
- TEST_CHECK(st.type() == file_type::none);
- TEST_CHECK(st.permissions() == perms::unknown);
+ assert(ErrorIs(ec, expect_errc));
+ assert(st.type() == file_type::none);
+ assert(st.permissions() == perms::unknown);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{ // test throwing case
try {
(void)symlink_status(p);
} catch (filesystem_error const& err) {
- TEST_CHECK(err.path1() == p);
- TEST_CHECK(err.path2() == "");
- TEST_CHECK(ErrorIs(err.code(), expect_errc));
+ assert(err.path1() == p);
+ assert(err.path2() == "");
+ assert(ErrorIs(err.code(), expect_errc));
}
}
#endif
@@ -100,19 +98,19 @@
{
std::error_code ec = std::make_error_code(set_errc);
file_status st = symlink_status(sym_points_in_dir, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(st.type() == file_type::symlink);
- TEST_CHECK(st.permissions() != perms::unknown);
+ assert(!ec);
+ assert(st.type() == file_type::symlink);
+ assert(st.permissions() != perms::unknown);
// test non-throwing version
- TEST_REQUIRE_NO_THROW(st = symlink_status(sym_points_in_dir));
- TEST_CHECK(st.type() == file_type::symlink);
- TEST_CHECK(st.permissions() != perms::unknown);
+ TEST_DOES_NOT_THROW(st = symlink_status(sym_points_in_dir));
+ assert(st.type() == file_type::symlink);
+ assert(st.permissions() != perms::unknown);
}
}
-#endif
+#endif // TEST_WIN_NO_FILESYSTEM_PERMS_NONE
-TEST_CASE(symlink_status_file_types_test)
+static void symlink_status_file_types_test()
{
static_test_env static_env;
scoped_test_env env;
@@ -140,17 +138,17 @@
// test non-throwing case
std::error_code ec = std::make_error_code(std::errc::address_in_use);
file_status st = symlink_status(TC.p, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(st.type() == TC.expect_type);
- TEST_CHECK(st.permissions() != perms::unknown);
+ assert(!ec);
+ assert(st.type() == TC.expect_type);
+ assert(st.permissions() != perms::unknown);
// test throwing case
- TEST_REQUIRE_NO_THROW(st = symlink_status(TC.p));
- TEST_CHECK(st.type() == TC.expect_type);
- TEST_CHECK(st.permissions() != perms::unknown);
+ TEST_DOES_NOT_THROW(st = symlink_status(TC.p));
+ assert(st.type() == TC.expect_type);
+ assert(st.permissions() != perms::unknown);
}
}
-TEST_CASE(test_block_file)
+static void test_block_file()
{
const path possible_paths[] = {
"/dev/drive0", // Apple
@@ -167,20 +165,21 @@
}
}
if (p == path{}) {
- TEST_UNSUPPORTED();
+ // No possible path found.
+ return;
}
scoped_test_env env;
{ // test block file
// test non-throwing case
std::error_code ec = std::make_error_code(std::errc::address_in_use);
file_status st = symlink_status(p, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(st.type() == file_type::block);
- TEST_CHECK(st.permissions() != perms::unknown);
+ assert(!ec);
+ assert(st.type() == file_type::block);
+ assert(st.permissions() != perms::unknown);
// test throwing case
- TEST_REQUIRE_NO_THROW(st = symlink_status(p));
- TEST_CHECK(st.type() == file_type::block);
- TEST_CHECK(st.permissions() != perms::unknown);
+ TEST_DOES_NOT_THROW(st = symlink_status(p));
+ assert(st.type() == file_type::block);
+ assert(st.permissions() != perms::unknown);
}
const path sym = env.make_env_path("sym");
create_symlink(p, sym);
@@ -188,14 +187,23 @@
// test non-throwing case
std::error_code ec = std::make_error_code(std::errc::address_in_use);
file_status st = symlink_status(sym, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(st.type() == file_type::symlink);
- TEST_CHECK(st.permissions() != perms::unknown);
+ assert(!ec);
+ assert(st.type() == file_type::symlink);
+ assert(st.permissions() != perms::unknown);
// test throwing case
- TEST_REQUIRE_NO_THROW(st = symlink_status(sym));
- TEST_CHECK(st.type() == file_type::symlink);
- TEST_CHECK(st.permissions() != perms::unknown);
+ TEST_DOES_NOT_THROW(st = symlink_status(sym));
+ assert(st.type() == file_type::symlink);
+ assert(st.permissions() != perms::unknown);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ test_symlink_status_not_found();
+#ifndef TEST_WIN_NO_FILESYSTEM_PERMS_NONE
+ test_symlink_status_cannot_resolve();
+#endif
+ symlink_status_file_types_test();
+ test_block_file();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
index 0b5018d..4bc4099 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
@@ -20,7 +20,6 @@
#include <cassert>
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "filesystem_test_helper.h"
using namespace fs;
@@ -33,16 +32,14 @@
assert(utils::unsetenv(var.c_str()) == 0);
}
-TEST_SUITE(filesystem_temp_directory_path_test_suite)
-
-TEST_CASE(signature_test)
+static void signature_test()
{
std::error_code ec; ((void)ec);
ASSERT_NOT_NOEXCEPT(temp_directory_path());
ASSERT_NOT_NOEXCEPT(temp_directory_path(ec));
}
-TEST_CASE(basic_tests)
+static void basic_tests()
{
scoped_test_env env;
const path dne = env.make_env_path("dne");
@@ -87,45 +84,45 @@
for (auto& TC : cases) {
std::error_code ec = GetTestEC();
path ret = temp_directory_path(ec);
- TEST_CHECK(!ec);
- TEST_CHECK(ret == TC.p);
- TEST_CHECK(is_directory(ret));
+ assert(!ec);
+ assert(ret == TC.p);
+ assert(is_directory(ret));
// Set the env variable to a path that does not exist and check
// that it fails.
PutEnv(TC.name, dne);
ec = GetTestEC();
ret = temp_directory_path(ec);
- LIBCPP_ONLY(TEST_CHECK(ErrorIs(ec, expect_errc)));
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(ec);
- TEST_CHECK(ret == "");
+ LIBCPP_ONLY(assert(ErrorIs(ec, expect_errc)));
+ assert(ec != GetTestEC());
+ assert(ec);
+ assert(ret == "");
// Set the env variable to point to a file and check that it fails.
PutEnv(TC.name, file);
ec = GetTestEC();
ret = temp_directory_path(ec);
- LIBCPP_ONLY(TEST_CHECK(ErrorIs(ec, expect_errc)));
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(ec);
- TEST_CHECK(ret == "");
+ LIBCPP_ONLY(assert(ErrorIs(ec, expect_errc)));
+ assert(ec != GetTestEC());
+ assert(ec);
+ assert(ret == "");
if (!inaccessible_dir.empty()) {
// Set the env variable to point to a dir we can't access
PutEnv(TC.name, inaccessible_dir);
ec = GetTestEC();
ret = temp_directory_path(ec);
- TEST_CHECK(ErrorIs(ec, std::errc::permission_denied));
- TEST_CHECK(ret == "");
+ assert(ErrorIs(ec, std::errc::permission_denied));
+ assert(ret == "");
}
// Set the env variable to point to a non-existent dir
PutEnv(TC.name, TC.p / "does_not_exist");
ec = GetTestEC();
ret = temp_directory_path(ec);
- TEST_CHECK(ec != GetTestEC());
- TEST_CHECK(ec);
- TEST_CHECK(ret == "");
+ assert(ec != GetTestEC());
+ assert(ec);
+ assert(ret == "");
// Finally erase this env variable
UnsetEnv(TC.name);
@@ -135,12 +132,12 @@
{
std::error_code ec = GetTestEC();
path ret = temp_directory_path(ec);
- TEST_CHECK(!ec);
+ assert(!ec);
#ifndef _WIN32
// On Windows, the function falls back to the Windows folder.
- TEST_CHECK(ret == "/tmp");
+ assert(ret == "/tmp");
#endif
- TEST_CHECK(is_directory(ret));
+ assert(is_directory(ret));
fallback = ret;
}
for (auto& TC : ignored_cases) {
@@ -148,14 +145,18 @@
PutEnv(TC.name, TC.p);
std::error_code ec = GetTestEC();
path ret = temp_directory_path(ec);
- TEST_CHECK(!ec);
+ assert(!ec);
// Check that we return the same as above when no vars were defined.
- TEST_CHECK(ret == fallback);
+ assert(ret == fallback);
// Finally erase this env variable
UnsetEnv(TC.name);
}
}
-TEST_SUITE_END()
+int main(int, char**) {
+ signature_test();
+ basic_tests();
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/lit.local.cfg b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/lit.local.cfg
index b22876f..c219596 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/filesystems/lit.local.cfg
+++ b/third_party/llvm-project/libcxx/test/std/input.output/filesystems/lit.local.cfg
@@ -1,10 +1,5 @@
-# Filesystem is supported on Apple platforms starting with macosx10.15.
-# Automatically disable the <filesystem> tests when we're running the test
-# suite against an older macOS.
-too_old = {'10.9', '10.10', '10.11', '10.12', '10.13', '10.14'}
-if 'use_system_cxx_lib' in config.available_features:
- if any('target=x86_64-apple-macosx{}'.format(v) in config.available_features for v in too_old):
- config.unsupported = True
+if 'availability-filesystem-missing' in config.available_features:
+ config.unsupported = True
if 'no-filesystem' in config.available_features:
config.unsupported = True
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
index fa14790..c7d7a4e 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
index 85d13b3..7bb7930 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
index 44ba89a..cf4070a 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
index 5ab4515..6bfd64a 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
index 4af8578..8eca4d4 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
index e7d7074..f290efe 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
index e13237c..04fa1ea 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
index f3b5bba..ee388e9 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
index 4f9c1a1..965e029 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
index 64bafa1..f15a352 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
index 764ca34..7c26e47 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
index 25dface..d9af921 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
index e01cd3d..de5a989 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
index ff96d12..35cb70e 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
index 18a29da..13ac402 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
index 7dd808e..fe15b36 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
index 76e860f..8ae08ba 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
@@ -8,7 +8,7 @@
// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
// have a bug in how they handle null-termination in case of errors (see D40677).
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
index 38b5163..f310172 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
@@ -8,7 +8,7 @@
// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
// have a bug in how they handle null-termination in case of errors (see D40677).
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
index a6c6687..331e38c 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
index 27d9ed8..50ec7ea 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
index 6e0d8b0..8d131da 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
@@ -8,7 +8,7 @@
// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
// have a bug in how they handle null-termination in case of errors (see D40677).
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
index d07e74c..b85478d 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
@@ -8,7 +8,7 @@
// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
// have a bug in how they handle null-termination in case of errors (see D40677).
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
index 0f1edcd..e313ddc 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
index 2ca7016..29ccb2c 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
index 5f8c455..a00842d 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
index a5aaf21..8b43c31 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// <istream>
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp
index 1261512..a5b19c4 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp
@@ -25,7 +25,7 @@
// This test exposes a regression that was not fixed yet in the libc++
// shipped with macOS 10.12, 10.13 and 10.14. See D32670 for details.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{12|13|14}}
#include <cassert>
#include <cstdint>
@@ -67,9 +67,9 @@
test<unsigned int>(d, "4294967295");
test<unsigned int>(x, "0xffffffff");
- const bool long_is_32 = std::integral_constant<bool, sizeof(long) == sizeof(int32_t)>::value; // avoid compiler warnings
- const bool long_is_64 = std::integral_constant<bool, sizeof(long) == sizeof(int64_t)>::value; // avoid compiler warnings
- const bool long_long_is_64 = std::integral_constant<bool, sizeof(long long) == sizeof(int64_t)>::value; // avoid compiler warnings
+ const bool long_is_32 = std::integral_constant<bool, sizeof(long) == sizeof(std::int32_t)>::value; // avoid compiler warnings
+ const bool long_is_64 = std::integral_constant<bool, sizeof(long) == sizeof(std::int64_t)>::value; // avoid compiler warnings
+ const bool long_long_is_64 = std::integral_constant<bool, sizeof(long long) == sizeof(std::int64_t)>::value; // avoid compiler warnings
if (long_is_32) {
test<long>(o, "020000000000");
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
index 8e3b77c..207fc42 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.12
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.12
// <ostream>
@@ -54,7 +54,7 @@
ss << std::hex << static_cast<T>(-1);
std::string str = ss.str();
- for (size_t i = 0; i < str.size(); ++i )
+ for (std::size_t i = 0; i < str.size(); ++i )
str[i] = static_cast<char>(std::toupper(str[i]));
assert(str == expected);
@@ -63,16 +63,16 @@
int main(int, char**)
{
- test_octal<uint16_t>( "177777");
- test_octal< int16_t>( "177777");
- test_octal<uint32_t>( "37777777777");
- test_octal< int32_t>( "37777777777");
- test_octal<uint64_t>("1777777777777777777777");
- test_octal< int64_t>("1777777777777777777777");
- test_octal<uint64_t>("1777777777777777777777");
+ test_octal<std::uint16_t>( "177777");
+ test_octal< std::int16_t>( "177777");
+ test_octal<std::uint32_t>( "37777777777");
+ test_octal< std::int32_t>( "37777777777");
+ test_octal<std::uint64_t>("1777777777777777777777");
+ test_octal< std::int64_t>("1777777777777777777777");
+ test_octal<std::uint64_t>("1777777777777777777777");
- const bool long_is_64 = std::integral_constant<bool, sizeof(long) == sizeof(int64_t)>::value; // avoid compiler warnings
- const bool long_long_is_64 = std::integral_constant<bool, sizeof(long long) == sizeof(int64_t)>::value; // avoid compiler warnings
+ const bool long_is_64 = std::integral_constant<bool, sizeof(long) == sizeof(std::int64_t)>::value; // avoid compiler warnings
+ const bool long_long_is_64 = std::integral_constant<bool, sizeof(long long) == sizeof(std::int64_t)>::value; // avoid compiler warnings
if (long_is_64) {
test_octal< unsigned long>("1777777777777777777777");
@@ -83,12 +83,12 @@
test_octal< long long>("1777777777777777777777");
}
- test_dec<uint16_t>( "65535");
- test_dec< int16_t>( "-1");
- test_dec<uint32_t>( "4294967295");
- test_dec< int32_t>( "-1");
- test_dec<uint64_t>("18446744073709551615");
- test_dec< int64_t>( "-1");
+ test_dec<std::uint16_t>( "65535");
+ test_dec< std::int16_t>( "-1");
+ test_dec<std::uint32_t>( "4294967295");
+ test_dec< std::int32_t>( "-1");
+ test_dec<std::uint64_t>("18446744073709551615");
+ test_dec< std::int64_t>( "-1");
if (long_is_64) {
test_dec<unsigned long>("18446744073709551615");
test_dec< long>( "-1");
@@ -98,12 +98,12 @@
test_dec< long long>( "-1");
}
- test_hex<uint16_t>( "FFFF");
- test_hex< int16_t>( "FFFF");
- test_hex<uint32_t>( "FFFFFFFF");
- test_hex< int32_t>( "FFFFFFFF");
- test_hex<uint64_t>("FFFFFFFFFFFFFFFF");
- test_hex< int64_t>("FFFFFFFFFFFFFFFF");
+ test_hex<std::uint16_t>( "FFFF");
+ test_hex< std::int16_t>( "FFFF");
+ test_hex<std::uint32_t>( "FFFFFFFF");
+ test_hex< std::int32_t>( "FFFFFFFF");
+ test_hex<std::uint64_t>("FFFFFFFFFFFFFFFF");
+ test_hex< std::int64_t>("FFFFFFFFFFFFFFFF");
if (long_is_64) {
test_hex<unsigned long>("FFFFFFFFFFFFFFFF");
test_hex< long>("FFFFFFFFFFFFFFFF");
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
index 4d96351..22013cd 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
@@ -16,9 +16,6 @@
#include <iomanip>
#include <sstream>
#include <string>
-#include <cassert>
-
-#include "test_macros.h"
// Test that mismatches between strings and wide streams are diagnosed
@@ -29,6 +26,6 @@
ss >> std::quoted(s); // expected-error {{invalid operands to binary expression}}
}
-int main(int, char**) {
+void f() {
round_trip("Hi Mom");
}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
index 5a92485..e457adb 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
@@ -15,9 +15,6 @@
#include <iomanip>
#include <sstream>
#include <string>
-#include <cassert>
-
-#include "test_macros.h"
// Test that mismatches in the traits between the quoted object and the dest string are diagnosed.
@@ -33,6 +30,6 @@
ss >> std::quoted(s); // expected-error {{invalid operands to binary expression}}
}
-int main(int, char**) {
+void f() {
round_trip("Hi Mom");
}
diff --git a/third_party/llvm-project/libcxx/test/std/input.output/iostreams.base/ios.base/ios.types/ios_Init/ios_Init.multiple.pass.cpp b/third_party/llvm-project/libcxx/test/std/input.output/iostreams.base/ios.base/ios.types/ios_Init/ios_Init.multiple.pass.cpp
index 1a9aaa9..f842f28 100644
--- a/third_party/llvm-project/libcxx/test/std/input.output/iostreams.base/ios.base/ios.types/ios_Init/ios_Init.multiple.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/input.output/iostreams.base/ios.base/ios.types/ios_Init/ios_Init.multiple.pass.cpp
@@ -16,7 +16,7 @@
// The dylibs shipped on macOS so far do not contain the fix for PR43300, so
// this test fails.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/data.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/data.pass.cpp
index 72c4b65..1a6af4a 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/data.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/data.pass.cpp
@@ -54,7 +54,7 @@
assert ( std::data(c) == c.begin());
}
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
void test_const_array( const T (&array)[Sz] )
{
ASSERT_NOEXCEPT(std::data(array));
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
index e67d864..c60c752 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
@@ -13,15 +13,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-#include <vector>
#include <iterator>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
int c[5];
std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
index 44b102e..6fbaa05 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
@@ -16,12 +16,7 @@
#include <vector>
#include <iterator>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::vector<int> c;
std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
index f97534d..416931f 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
@@ -16,12 +16,7 @@
#include <initializer_list>
#include <iterator>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::initializer_list<int> c = { 4 };
std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.pass.cpp
index 1e1c0e4..1a00e88 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/empty.pass.cpp
@@ -53,7 +53,7 @@
assert ( std::empty(c) == (c.size() == 0));
}
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
void test_const_array( const T (&array)[Sz] )
{
ASSERT_NOEXCEPT(std::empty(array));
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/size.pass.cpp
index 697119a..975d3e8 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/size.pass.cpp
@@ -54,7 +54,7 @@
assert ( std::size(c) == c.size());
}
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
void test_const_array( const T (&array)[Sz] )
{
ASSERT_NOEXCEPT(std::size(array));
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
index 9f384c6..e7531ae 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
@@ -13,14 +13,16 @@
// -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>; // C++20
// template <class T, ptrdiff_t> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // C++20
-#include <iterator>
-#include <cassert>
-#include <vector>
#include <array>
-#include <list>
+#include <cassert>
+#include <cstdint>
#include <initializer_list>
-#include <string_view>
+#include <iterator>
#include <limits>
+#include <list>
+#include <string_view>
+#include <type_traits>
+#include <vector>
#include "test_macros.h"
@@ -28,7 +30,7 @@
TEST_GCC_DIAGNOSTIC_IGNORED("-Wtype-limits")
struct short_container {
- uint16_t size() const { return 60000; } // not noexcept
+ std::uint16_t size() const { return 60000; } // not noexcept
};
template<typename C>
@@ -63,7 +65,7 @@
assert ( std::ssize(c) == static_cast<decltype(std::ssize(c))>(c.size()));
}
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
void test_const_array(const T (&array)[Sz])
{
ASSERT_NOEXCEPT(std::ssize(array));
@@ -98,7 +100,7 @@
test_const_container ( sv );
static constexpr int arrA [] { 1, 2, 3 };
- ASSERT_SAME_TYPE(ptrdiff_t, decltype(std::ssize(arrA)));
+ ASSERT_SAME_TYPE(std::ptrdiff_t, decltype(std::ssize(arrA)));
static_assert( std::is_signed_v<decltype(std::ssize(arrA))>, "");
test_const_array ( arrA );
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp
index 9a0f6be..18fc2fb 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp
@@ -8,8 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// This test uses iterator types from std::filesystem
+// XFAIL: availability-filesystem-missing
// template<class T>
// struct iterator_traits;
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
index f531b3a..ed4061f 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
@@ -24,12 +24,10 @@
friend constexpr auto iter_move(WithADL&) { return 0; }
};
-int main(int, char**) {
+void f() {
int* noADL = nullptr;
std::ranges::iter_move(noADL); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
WithADL adl;
std::ranges::iter_move(adl); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp
index 31ec010..5666382 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp
@@ -11,11 +11,11 @@
// template<class I>
// unspecified iter_move;
-#include <iterator>
-
-#include <array>
#include <algorithm>
+#include <array>
#include <cassert>
+#include <iterator>
+#include <type_traits>
#include <utility>
#include "../unqualified_lookup_wrapper.h"
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_move.pass.cpp
index a9e6d17..e0f63ac 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_move.pass.cpp
@@ -28,7 +28,7 @@
struct MaybeNoexceptMove {
int x;
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
constexpr friend value_type&& iter_move(MaybeNoexceptMove) noexcept(IsNoexcept) {
return std::move(global);
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_swap.pass.cpp
index 075930d..aa08153 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/iter_swap.pass.cpp
@@ -26,7 +26,7 @@
template <bool IsNoexcept>
struct MaybeNoexceptSwap {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
constexpr friend void iter_swap(MaybeNoexceptSwap, MaybeNoexceptSwap) noexcept(IsNoexcept) {
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
index b141115..5b609f8 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
@@ -16,8 +16,7 @@
#include <iterator>
-int main(int, char**) {
+void f() {
char const* it = "";
std::move_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::move_iterator<const char *>'}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
index 8c1684f..e4e22cb 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
@@ -12,9 +12,6 @@
#include <iterator>
-int main(int, char**) {
- (void)std::move_iterator<int*>().operator->();
- // expected-warning@-1{{'operator->' is deprecated}}
-
- return 0;
+void f() {
+ (void)std::move_iterator<int*>().operator->(); // expected-warning {{'operator->' is deprecated}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
index 844da40..1b21fd7 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
@@ -56,8 +56,8 @@
static_assert( std::default_initializable<iterator>);
static_assert( std::copyable<iterator>);
- static_assert( std::input_iterator<iterator>);
- static_assert(!std::forward_iterator<iterator>);
+ static_assert( std::forward_iterator<iterator>);
+ static_assert(!std::bidirectional_iterator<iterator>);
static_assert( std::sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::indirectly_movable<int*, iterator>);
@@ -73,8 +73,8 @@
static_assert( std::default_initializable<iterator>);
static_assert( std::copyable<iterator>);
- static_assert( std::input_iterator<iterator>);
- static_assert(!std::forward_iterator<iterator>);
+ static_assert( std::bidirectional_iterator<iterator>);
+ static_assert(!std::random_access_iterator<iterator>);
static_assert( std::sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::indirectly_movable<int*, iterator>);
@@ -90,8 +90,8 @@
static_assert( std::default_initializable<iterator>);
static_assert( std::copyable<iterator>);
- static_assert( std::input_iterator<iterator>);
- static_assert(!std::forward_iterator<iterator>);
+ static_assert( std::random_access_iterator<iterator>);
+ static_assert(!std::contiguous_iterator<iterator>);
static_assert( std::sentinel_for<iterator, iterator>);
static_assert( std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::indirectly_movable<int*, iterator>);
@@ -107,8 +107,8 @@
static_assert( std::default_initializable<iterator>);
static_assert( std::copyable<iterator>);
- static_assert( std::input_iterator<iterator>);
- static_assert(!std::forward_iterator<iterator>);
+ static_assert( std::random_access_iterator<iterator>);
+ static_assert(!std::contiguous_iterator<iterator>);
static_assert( std::sentinel_for<iterator, iterator>);
static_assert( std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::indirectly_movable<int*, iterator>);
@@ -124,8 +124,8 @@
static_assert( std::default_initializable<iterator>);
static_assert( std::copyable<iterator>);
- static_assert( std::input_iterator<iterator>);
- static_assert(!std::forward_iterator<iterator>);
+ static_assert( std::random_access_iterator<iterator>);
+ static_assert(!std::contiguous_iterator<iterator>);
static_assert( std::sentinel_for<iterator, iterator>);
static_assert( std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::indirectly_movable<int*, iterator>);
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp
index 5676564..8b92eb2 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp
@@ -16,7 +16,7 @@
// class move_iterator {
// public:
// using iterator_type = Iterator;
-// using iterator_concept = input_iterator_tag; // From C++20
+// using iterator_concept = see below; // From C++20
// using iterator_category = see below; // not always present starting from C++20
// using value_type = iter_value_t<Iterator>; // Until C++20, iterator_traits<Iterator>::value_type
// using difference_type = iter_difference_t<Iterator>; // Until C++20, iterator_traits<Iterator>::difference_type;
@@ -99,7 +99,11 @@
#endif
#if TEST_STD_VER > 17
- static_assert(std::is_same_v<typename R::iterator_concept, std::input_iterator_tag>);
+ static_assert(
+ std::is_same_v<typename R::iterator_concept,
+ std::conditional_t<std::is_same_v<typename R::iterator_concept, std::contiguous_iterator_tag>,
+ std::random_access_iterator_tag,
+ typename R::iterator_concept>>);
#endif
}
@@ -142,11 +146,11 @@
#if TEST_STD_VER > 17
test<contiguous_iterator<char*>>();
- static_assert(std::is_same_v<typename std::move_iterator<forward_iterator<char*>>::iterator_concept, std::input_iterator_tag>);
- static_assert(std::is_same_v<typename std::move_iterator<bidirectional_iterator<char*>>::iterator_concept, std::input_iterator_tag>);
- static_assert(std::is_same_v<typename std::move_iterator<random_access_iterator<char*>>::iterator_concept, std::input_iterator_tag>);
- static_assert(std::is_same_v<typename std::move_iterator<contiguous_iterator<char*>>::iterator_concept, std::input_iterator_tag>);
- static_assert(std::is_same_v<typename std::move_iterator<char*>::iterator_concept, std::input_iterator_tag>);
+ static_assert(std::is_same_v<typename std::move_iterator<forward_iterator<char*>>::iterator_concept, std::forward_iterator_tag>);
+ static_assert(std::is_same_v<typename std::move_iterator<bidirectional_iterator<char*>>::iterator_concept, std::bidirectional_iterator_tag>);
+ static_assert(std::is_same_v<typename std::move_iterator<random_access_iterator<char*>>::iterator_concept, std::random_access_iterator_tag>);
+ static_assert(std::is_same_v<typename std::move_iterator<contiguous_iterator<char*>>::iterator_concept, std::random_access_iterator_tag>);
+ static_assert(std::is_same_v<typename std::move_iterator<char*>::iterator_concept, std::random_access_iterator_tag>);
#endif
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/sfinae.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/sfinae.compile.pass.cpp
index 92e0e5c..8ead392 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/sfinae.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/sfinae.compile.pass.cpp
@@ -49,7 +49,7 @@
struct IterBase {
using iterator_category = std::bidirectional_iterator_tag;
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
using pointer = int*;
using reference = int&;
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
index 940848b..d69799d 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
@@ -16,8 +16,7 @@
#include <iterator>
-int main(int, char**) {
+void f() {
char const* it = "";
std::reverse_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::reverse_iterator<const char *>'}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_move.pass.cpp
index 712425a..5e35f5c 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_move.pass.cpp
@@ -55,7 +55,7 @@
{
struct ThrowingCopyNoexceptDecrement {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
ThrowingCopyNoexceptDecrement();
ThrowingCopyNoexceptDecrement(const ThrowingCopyNoexceptDecrement&);
@@ -80,7 +80,7 @@
{
struct NoexceptCopyThrowingDecrement {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
NoexceptCopyThrowingDecrement();
NoexceptCopyThrowingDecrement(const NoexceptCopyThrowingDecrement&) noexcept;
@@ -105,7 +105,7 @@
{
struct NoexceptCopyAndDecrement {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
NoexceptCopyAndDecrement();
NoexceptCopyAndDecrement(const NoexceptCopyAndDecrement&) noexcept;
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_swap.pass.cpp
index d01ee2a..7b6fb43 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_swap.pass.cpp
@@ -61,7 +61,7 @@
{
struct ThrowingCopyNoexceptDecrement {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
ThrowingCopyNoexceptDecrement();
ThrowingCopyNoexceptDecrement(const ThrowingCopyNoexceptDecrement&);
@@ -89,7 +89,7 @@
{
struct NoexceptCopyThrowingDecrement {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
NoexceptCopyThrowingDecrement();
NoexceptCopyThrowingDecrement(const NoexceptCopyThrowingDecrement&) noexcept;
@@ -117,7 +117,7 @@
{
struct NoexceptCopyAndDecrement {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
NoexceptCopyAndDecrement();
NoexceptCopyAndDecrement(const NoexceptCopyAndDecrement&) noexcept;
diff --git a/third_party/llvm-project/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp
index 7273223..d8377f0 100644
--- a/third_party/llvm-project/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp
@@ -14,9 +14,10 @@
// C++17 says: If is_trivially_default_constructible_v<T> is true, then this
// constructor is a constexpr constructor.
-#include <iterator>
#include <cassert>
+#include <iterator>
#include <string>
+#include <type_traits>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
index 6d2687f..8e3c793 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
@@ -50,9 +50,8 @@
TEST_PASS(v, <=>);
}
-int main(int, char**) {
+void f() {
test_category(std::strong_ordering::equivalent);
test_category(std::weak_ordering::equivalent);
test_category(std::partial_ordering::equivalent);
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
index 6d5b9e9..1e3aed2 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
@@ -30,8 +30,8 @@
template <class C>
void do_test(int *LHSVal, int *RHSVal) {
- [[maybe_unused]] const size_t ExpectLHS = std::hash<void*>{}(LHSVal);
- [[maybe_unused]] const size_t ExpectRHS = std::hash<void*>{}(RHSVal);
+ [[maybe_unused]] const std::size_t ExpectLHS = std::hash<void*>{}(LHSVal);
+ [[maybe_unused]] const std::size_t ExpectRHS = std::hash<void*>{}(RHSVal);
const C LHS = C::from_address(LHSVal);
const C RHS = C::from_address(RHSVal);
const std::hash<C> h;
@@ -40,7 +40,7 @@
LIBCPP_ASSERT(h(RHS) == ExpectRHS);
assert((h(LHS) == h(RHS)) == (LHSVal == RHSVal));
{
- ASSERT_SAME_TYPE(decltype(h(LHS)), size_t);
+ ASSERT_SAME_TYPE(decltype(h(LHS)), std::size_t);
ASSERT_NOEXCEPT(std::hash<C>{}(LHS));
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
index 5281484..868abe5 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
@@ -11,9 +11,8 @@
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
-// Aligned allocation was not provided before macosx10.13 and as a result we
-// get availability errors when the deployment target is older than macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// We get availability markup errors when aligned allocation is missing
+// XFAIL: availability-aligned_allocation-missing
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
index 22f67eb..7aa31a9 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
@@ -11,9 +11,8 @@
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
-// Aligned allocation was not provided before macosx10.13 and as a result we
-// get availability errors when the deployment target is older than macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// We get availability markup errors when aligned allocation is missing
+// XFAIL: availability-aligned_allocation-missing
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
index 40d4a86..a0845eb 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
@@ -11,9 +11,8 @@
// XFAIL: LIBCXX-AIX-FIXME
-// Aligned allocation was not provided before macosx10.13 and as a result we
-// get availability errors when the deployment target is older than macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// We get availability markup errors when aligned allocation is missing
+// XFAIL: availability-aligned_allocation-missing
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
index efd84bb..8e97916 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
@@ -17,7 +17,6 @@
#include <new>
-int main(int, char**) {
+void f() {
::operator new[](4); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
index 1551a05..530e152 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
@@ -21,7 +21,6 @@
#include <new>
-int main(int, char**) {
+void f() {
::operator new[](4, std::align_val_t{4}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
index ec819627..3310073 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
@@ -21,7 +21,6 @@
#include <new>
-int main(int, char**) {
+void f() {
::operator new[](4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
index 066ca1a..fd954d4 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
@@ -17,7 +17,6 @@
#include <new>
-int main(int, char**) {
+void f() {
::operator new[](4, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
index 2a5bb21..7fb9293 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
@@ -12,7 +12,7 @@
// when sized deallocation is not supported, e.g., prior to C++14.
// UNSUPPORTED: sanitizer-new-delete
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// REQUIRES: -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
index b5ec824..b1b2f0f 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
@@ -14,12 +14,7 @@
#include <new>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
char buffer[100];
::operator new[](4, buffer); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
index 5029864..e98144e 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
@@ -14,12 +14,7 @@
#include <new>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
char buffer[100];
::operator new(4, buffer); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
index d662e08..bd3c737 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Aligned allocation was not provided before macosx10.13 and as a result we
-// get availability errors when the deployment target is older than macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// We get availability markup errors when aligned allocation is missing
+// XFAIL: availability-aligned_allocation-missing
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
index cd1b3f8..de48167 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Aligned allocation was not provided before macosx10.13 and as a result we
-// get availability errors when the deployment target is older than macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// We get availability markup errors when aligned allocation is missing
+// XFAIL: availability-aligned_allocation-missing
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
index 13e6c52..285c88f 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
@@ -11,9 +11,8 @@
// XFAIL: LIBCXX-AIX-FIXME
-// Aligned allocation was not provided before macosx10.13 and as a result we
-// get availability errors when the deployment target is older than macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// We get availability markup errors when aligned allocation is missing
+// XFAIL: availability-aligned_allocation-missing
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
index ed66078..d3ed46e 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
@@ -14,11 +14,6 @@
#include <new>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
::operator new(4); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
index 2a30e15..42a8861 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
@@ -21,7 +21,6 @@
#include <new>
-int main(int, char**) {
+void f() {
::operator new(4, std::align_val_t{4}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
index 047e81d..8dcdbe3 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
@@ -21,7 +21,6 @@
#include <new>
-int main(int, char**) {
+void f() {
::operator new(4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
index 4826cb4..081769b 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
@@ -14,11 +14,6 @@
#include <new>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
::operator new(4, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
index 826b2a3..d990777 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
@@ -12,7 +12,7 @@
// when sized deallocation is not supported, e.g., prior to C++14.
// UNSUPPORTED: sanitizer-new-delete
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// REQUIRES: -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation, -O3
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
index 632ca0e..f8e6cb2 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
@@ -11,17 +11,11 @@
// template <class T> constexpr T* launder(T* p) noexcept;
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORETD: c++17 && !stdlib=libc++
+// UNSUPPORTED: c++17 && !stdlib=libc++
#include <new>
-#include <cassert>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
int *p = nullptr;
std::launder(p); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
index 658c0a8..1d8b6b1 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
@@ -9,11 +9,11 @@
// UNSUPPORTED: no-exceptions
// std::uncaught_exceptions() was introduced in the dylib on Mac OS 10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// However, std::uncaught_exceptions() gives the wrong answer in Mac OS 10.12
// and 10.13, where it only gives 0 or 1. This was fixed later.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{12|13}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{12|13}}
// test uncaught_exceptions
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/limits/is_specialized.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/limits/is_specialized.pass.cpp
index 0c39f9f..f27c73157 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/limits/is_specialized.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/limits/is_specialized.pass.cpp
@@ -44,7 +44,7 @@
int main(int, char**)
{
- meta::for_each(meta::arithmetic_types(), Test());
+ types::for_each(types::arithmetic_types(), Test());
static_assert(!std::numeric_limits<std::complex<double> >::is_specialized,
"!std::numeric_limits<std::complex<double> >::is_specialized");
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
index 198fe9d..eeafd01 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
@@ -216,7 +216,7 @@
# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_atomic_wait
# error "__cpp_lib_atomic_wait should be defined in c++20"
# endif
@@ -225,7 +225,7 @@
# endif
# else
# ifdef __cpp_lib_atomic_wait
-# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)' is not met!"
+# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
@@ -311,7 +311,7 @@
# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++2b"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_atomic_wait
# error "__cpp_lib_atomic_wait should be defined in c++2b"
# endif
@@ -320,7 +320,7 @@
# endif
# else
# ifdef __cpp_lib_atomic_wait
-# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)' is not met!"
+# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
index 109c955..adf2dee 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
@@ -44,7 +44,7 @@
#elif TEST_STD_VER == 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_barrier
# error "__cpp_lib_barrier should be defined in c++20"
# endif
@@ -53,13 +53,13 @@
# endif
# else
# ifdef __cpp_lib_barrier
-# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)' is not met!"
+# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
#elif TEST_STD_VER > 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_barrier
# error "__cpp_lib_barrier should be defined in c++2b"
# endif
@@ -68,7 +68,7 @@
# endif
# else
# ifdef __cpp_lib_barrier
-# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)' is not met!"
+# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
index 4530898..692c7fa 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
@@ -51,7 +51,7 @@
# error "__cpp_lib_char8_t should not be defined before c++20"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# ifndef __cpp_lib_filesystem
# error "__cpp_lib_filesystem should be defined in c++17"
# endif
@@ -60,7 +60,7 @@
# endif
# else
# ifdef __cpp_lib_filesystem
-# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)' is not met!"
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)' is not met!"
# endif
# endif
@@ -79,7 +79,7 @@
# endif
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# ifndef __cpp_lib_filesystem
# error "__cpp_lib_filesystem should be defined in c++20"
# endif
@@ -88,7 +88,7 @@
# endif
# else
# ifdef __cpp_lib_filesystem
-# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)' is not met!"
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)' is not met!"
# endif
# endif
@@ -107,7 +107,7 @@
# endif
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# ifndef __cpp_lib_filesystem
# error "__cpp_lib_filesystem should be defined in c++2b"
# endif
@@ -116,7 +116,7 @@
# endif
# else
# ifdef __cpp_lib_filesystem
-# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)' is not met!"
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
index 7e18331..279361b 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
@@ -17,8 +17,9 @@
// Test the feature test macros defined by <format>
-/* Constant Value
- __cpp_lib_format 202106L [C++20]
+/* Constant Value
+ __cpp_lib_format 202106L [C++20]
+ __cpp_lib_format_ranges 202207L [C++2b]
*/
#include <format>
@@ -30,18 +31,30 @@
# error "__cpp_lib_format should not be defined before c++20"
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
#elif TEST_STD_VER == 14
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined before c++20"
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
#elif TEST_STD_VER == 17
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined before c++20"
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
#elif TEST_STD_VER == 20
# if !defined(_LIBCPP_VERSION)
@@ -57,6 +70,10 @@
# endif
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
#elif TEST_STD_VER > 20
# if !defined(_LIBCPP_VERSION)
@@ -72,5 +89,18 @@
# endif
# endif
+# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+# ifndef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should be defined in c++2b"
+# endif
+# if __cpp_lib_format_ranges != 202207L
+# error "__cpp_lib_format_ranges should have the value 202207L in c++2b"
+# endif
+# else
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)' is not met!"
+# endif
+# endif
+
#endif // TEST_STD_VER > 20
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
index 15c0920..d484504 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
@@ -325,17 +325,11 @@
# error "__cpp_lib_invoke should have the value 201411L in c++2b"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_invoke_r
-# error "__cpp_lib_invoke_r should be defined in c++2b"
-# endif
-# if __cpp_lib_invoke_r != 202106L
-# error "__cpp_lib_invoke_r should have the value 202106L in c++2b"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_invoke_r
-# error "__cpp_lib_invoke_r should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_invoke_r
+# error "__cpp_lib_invoke_r should be defined in c++2b"
+# endif
+# if __cpp_lib_invoke_r != 202106L
+# error "__cpp_lib_invoke_r should have the value 202106L in c++2b"
# endif
# if !defined(_LIBCPP_VERSION)
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
index bf7d03b..a490a8a 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
@@ -20,6 +20,7 @@
201811L [C++20]
__cpp_lib_constexpr_iterator 201811L [C++20]
__cpp_lib_make_reverse_iterator 201402L [C++14]
+ __cpp_lib_move_iterator_concept 202207L [C++20]
__cpp_lib_nonmember_container_access 201411L [C++17]
__cpp_lib_null_iterators 201304L [C++14]
__cpp_lib_ranges 202106L [C++20]
@@ -43,6 +44,10 @@
# error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
# endif
+# ifdef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+# endif
+
# ifdef __cpp_lib_nonmember_container_access
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
# endif
@@ -76,6 +81,10 @@
# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
# endif
+# ifdef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+# endif
+
# ifdef __cpp_lib_nonmember_container_access
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
# endif
@@ -115,6 +124,10 @@
# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
# endif
+# ifdef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+# endif
+
# ifndef __cpp_lib_nonmember_container_access
# error "__cpp_lib_nonmember_container_access should be defined in c++17"
# endif
@@ -160,6 +173,13 @@
# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20"
# endif
+# ifndef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should be defined in c++20"
+# endif
+# if __cpp_lib_move_iterator_concept != 202207L
+# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20"
+# endif
+
# ifndef __cpp_lib_nonmember_container_access
# error "__cpp_lib_nonmember_container_access should be defined in c++20"
# endif
@@ -211,6 +231,13 @@
# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++2b"
# endif
+# ifndef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should be defined in c++2b"
+# endif
+# if __cpp_lib_move_iterator_concept != 202207L
+# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++2b"
+# endif
+
# ifndef __cpp_lib_nonmember_container_access
# error "__cpp_lib_nonmember_container_access should be defined in c++2b"
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
index 3d40930..310827d 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
@@ -44,7 +44,7 @@
#elif TEST_STD_VER == 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_latch
# error "__cpp_lib_latch should be defined in c++20"
# endif
@@ -53,13 +53,13 @@
# endif
# else
# ifdef __cpp_lib_latch
-# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)' is not met!"
+# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
#elif TEST_STD_VER > 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_latch
# error "__cpp_lib_latch should be defined in c++2b"
# endif
@@ -68,7 +68,7 @@
# endif
# else
# ifdef __cpp_lib_latch
-# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)' is not met!"
+# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
deleted file mode 100644
index 68c47df..0000000
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-//
-// WARNING: This test was generated by generate_feature_test_macro_components.py
-// and should not be edited manually.
-//
-// clang-format off
-
-// <memory_resource>
-
-// Test the feature test macros defined by <memory_resource>
-
-/* Constant Value
- __cpp_lib_memory_resource 201603L [C++17]
-*/
-
-#include <memory_resource>
-#include "test_macros.h"
-
-#if TEST_STD_VER < 14
-
-# ifdef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should not be defined before c++17"
-# endif
-
-#elif TEST_STD_VER == 14
-
-# ifdef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should not be defined before c++17"
-# endif
-
-#elif TEST_STD_VER == 17
-
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++17"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++17"
-# endif
-
-#elif TEST_STD_VER == 20
-
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++20"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++20"
-# endif
-
-#elif TEST_STD_VER > 20
-
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++2b"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++2b"
-# endif
-
-#endif // TEST_STD_VER > 20
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
index be51d6d..581875d 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
@@ -17,6 +17,7 @@
/* Constant Value
__cpp_lib_ranges 202106L [C++20]
+ __cpp_lib_ranges_as_rvalue 202207L [C++2b]
__cpp_lib_ranges_chunk 202202L [C++2b]
__cpp_lib_ranges_chunk_by 202202L [C++2b]
__cpp_lib_ranges_join_with 202202L [C++2b]
@@ -33,6 +34,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -59,6 +64,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -85,6 +94,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -114,6 +127,10 @@
# error "__cpp_lib_ranges should have the value 202106L in c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -143,6 +160,13 @@
# error "__cpp_lib_ranges should have the value 202106L in c++2b"
# endif
+# ifndef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should be defined in c++2b"
+# endif
+# if __cpp_lib_ranges_as_rvalue != 202207L
+# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++2b"
+# endif
+
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should be defined in c++2b"
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
index f20e9e0..93240e1 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
@@ -44,7 +44,7 @@
#elif TEST_STD_VER == 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_semaphore
# error "__cpp_lib_semaphore should be defined in c++20"
# endif
@@ -53,13 +53,13 @@
# endif
# else
# ifdef __cpp_lib_semaphore
-# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)' is not met!"
+# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
#elif TEST_STD_VER > 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_semaphore
# error "__cpp_lib_semaphore should be defined in c++2b"
# endif
@@ -68,7 +68,7 @@
# endif
# else
# ifdef __cpp_lib_semaphore
-# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)' is not met!"
+# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
index fdd9b01..a36f4b0 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
@@ -41,7 +41,7 @@
# error "__cpp_lib_shared_mutex should not be defined before c++17"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++14"
# endif
@@ -50,13 +50,13 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
#elif TEST_STD_VER == 17
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_mutex
# error "__cpp_lib_shared_mutex should be defined in c++17"
# endif
@@ -65,11 +65,11 @@
# endif
# else
# ifdef __cpp_lib_shared_mutex
-# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)' is not met!"
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++17"
# endif
@@ -78,13 +78,13 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
#elif TEST_STD_VER == 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_mutex
# error "__cpp_lib_shared_mutex should be defined in c++20"
# endif
@@ -93,11 +93,11 @@
# endif
# else
# ifdef __cpp_lib_shared_mutex
-# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)' is not met!"
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++20"
# endif
@@ -106,13 +106,13 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
#elif TEST_STD_VER > 20
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_mutex
# error "__cpp_lib_shared_mutex should be defined in c++2b"
# endif
@@ -121,11 +121,11 @@
# endif
# else
# ifdef __cpp_lib_shared_mutex
-# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)' is not met!"
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++2b"
# endif
@@ -134,7 +134,7 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
index 0b3bad5..5b3d4b4 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
@@ -42,7 +42,7 @@
#elif TEST_STD_VER == 20
-# if __has_builtin(__builtin_source_location)
+# if __has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)
# ifndef __cpp_lib_source_location
# error "__cpp_lib_source_location should be defined in c++20"
# endif
@@ -51,13 +51,13 @@
# endif
# else
# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location)' is not met!"
+# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)' is not met!"
# endif
# endif
#elif TEST_STD_VER > 20
-# if __has_builtin(__builtin_source_location)
+# if __has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)
# ifndef __cpp_lib_source_location
# error "__cpp_lib_source_location should be defined in c++2b"
# endif
@@ -66,7 +66,7 @@
# endif
# else
# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location)' is not met!"
+# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.pass.cpp
deleted file mode 100644
index c3ed983..0000000
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.pass.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-//
-// WARNING: This test was generated by generate_feature_test_macro_components.py
-// and should not be edited manually.
-//
-// clang-format off
-
-// <source_location>
-
-// Test the feature test macros defined by <source_location>
-
-/* Constant Value
- __cpp_lib_source_location 201907L [C++20]
-*/
-
-#include <source_location>
-#include "test_macros.h"
-
-#if TEST_STD_VER < 14
-
-# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined before c++20"
-# endif
-
-#elif TEST_STD_VER == 14
-
-# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined before c++20"
-# endif
-
-#elif TEST_STD_VER == 17
-
-# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined before c++20"
-# endif
-
-#elif TEST_STD_VER == 20
-
-# if __has_builtin(__builtin_source_location)
-# ifndef __cpp_lib_source_location
-# error "__cpp_lib_source_location should be defined in c++20"
-# endif
-# if __cpp_lib_source_location != 201907L
-# error "__cpp_lib_source_location should have the value 201907L in c++20"
-# endif
-# else
-# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined when __has_builtin(__builtin_source_location) is not defined!"
-# endif
-# endif
-
-#elif TEST_STD_VER > 20
-
-# if __has_builtin(__builtin_source_location)
-# ifndef __cpp_lib_source_location
-# error "__cpp_lib_source_location should be defined in c++2b"
-# endif
-# if __cpp_lib_source_location != 201907L
-# error "__cpp_lib_source_location should have the value 201907L in c++2b"
-# endif
-# else
-# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined when __has_builtin(__builtin_source_location) is not defined!"
-# endif
-# endif
-
-#endif // TEST_STD_VER > 20
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
index 0f5c066..47f6c61 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
@@ -17,8 +17,9 @@
// Test the feature test macros defined by <thread>
-/* Constant Value
- __cpp_lib_jthread 201911L [C++20]
+/* Constant Value
+ __cpp_lib_formatters 202302L [C++2b]
+ __cpp_lib_jthread 201911L [C++20]
*/
#include <thread>
@@ -26,24 +27,40 @@
#if TEST_STD_VER < 14
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_jthread
# error "__cpp_lib_jthread should not be defined before c++20"
# endif
#elif TEST_STD_VER == 14
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_jthread
# error "__cpp_lib_jthread should not be defined before c++20"
# endif
#elif TEST_STD_VER == 17
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_jthread
# error "__cpp_lib_jthread should not be defined before c++20"
# endif
#elif TEST_STD_VER == 20
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_jthread
# error "__cpp_lib_jthread should be defined in c++20"
@@ -60,6 +77,19 @@
#elif TEST_STD_VER > 20
# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_formatters
+# error "__cpp_lib_formatters should be defined in c++2b"
+# endif
+# if __cpp_lib_formatters != 202302L
+# error "__cpp_lib_formatters should have the value 202302L in c++2b"
+# endif
+# else // _LIBCPP_VERSION
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_jthread
# error "__cpp_lib_jthread should be defined in c++2b"
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
index 75abf3e..3cb2502 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
@@ -48,17 +48,11 @@
#elif TEST_STD_VER > 20
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_constexpr_typeinfo
-# error "__cpp_lib_constexpr_typeinfo should be defined in c++2b"
-# endif
-# if __cpp_lib_constexpr_typeinfo != 202106L
-# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++2b"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_constexpr_typeinfo
-# error "__cpp_lib_constexpr_typeinfo should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_constexpr_typeinfo
+# error "__cpp_lib_constexpr_typeinfo should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_typeinfo != 202106L
+# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++2b"
# endif
#endif // TEST_STD_VER > 20
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 9c1816b..a289eeb 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -79,6 +79,8 @@
__cpp_lib_expected 202202L [C++2b]
__cpp_lib_filesystem 201703L [C++17]
__cpp_lib_format 202106L [C++20]
+ __cpp_lib_format_ranges 202207L [C++2b]
+ __cpp_lib_formatters 202302L [C++2b]
__cpp_lib_forward_like 202207L [C++2b]
__cpp_lib_gcd_lcm 201606L [C++17]
__cpp_lib_generic_associative_lookup 201304L [C++14]
@@ -116,6 +118,7 @@
__cpp_lib_math_constants 201907L [C++20]
__cpp_lib_math_special_functions 201603L [C++17]
__cpp_lib_memory_resource 201603L [C++17]
+ __cpp_lib_move_iterator_concept 202207L [C++20]
__cpp_lib_move_only_function 202110L [C++2b]
__cpp_lib_node_extract 201606L [C++17]
__cpp_lib_nonmember_container_access 201411L [C++17]
@@ -128,6 +131,7 @@
__cpp_lib_polymorphic_allocator 201902L [C++20]
__cpp_lib_quoted_string_io 201304L [C++14]
__cpp_lib_ranges 202106L [C++20]
+ __cpp_lib_ranges_as_rvalue 202207L [C++2b]
__cpp_lib_ranges_chunk 202202L [C++2b]
__cpp_lib_ranges_chunk_by 202202L [C++2b]
__cpp_lib_ranges_iota 202202L [C++2b]
@@ -429,6 +433,14 @@
# error "__cpp_lib_format should not be defined before c++20"
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_forward_like
# error "__cpp_lib_forward_like should not be defined before c++2b"
# endif
@@ -577,6 +589,10 @@
# error "__cpp_lib_memory_resource should not be defined before c++17"
# endif
+# ifdef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+# endif
+
# ifdef __cpp_lib_move_only_function
# error "__cpp_lib_move_only_function should not be defined before c++2b"
# endif
@@ -621,6 +637,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -1076,6 +1096,14 @@
# error "__cpp_lib_format should not be defined before c++20"
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_forward_like
# error "__cpp_lib_forward_like should not be defined before c++2b"
# endif
@@ -1245,6 +1273,10 @@
# error "__cpp_lib_memory_resource should not be defined before c++17"
# endif
+# ifdef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+# endif
+
# ifdef __cpp_lib_move_only_function
# error "__cpp_lib_move_only_function should not be defined before c++2b"
# endif
@@ -1295,6 +1327,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -1377,7 +1413,7 @@
# error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++14"
# endif
@@ -1386,7 +1422,7 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -1820,7 +1856,7 @@
# error "__cpp_lib_expected should not be defined before c++2b"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# ifndef __cpp_lib_filesystem
# error "__cpp_lib_filesystem should be defined in c++17"
# endif
@@ -1829,7 +1865,7 @@
# endif
# else
# ifdef __cpp_lib_filesystem
-# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)' is not met!"
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)' is not met!"
# endif
# endif
@@ -1837,6 +1873,14 @@
# error "__cpp_lib_format should not be defined before c++20"
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_forward_like
# error "__cpp_lib_forward_like should not be defined before c++2b"
# endif
@@ -2063,6 +2107,10 @@
# error "__cpp_lib_memory_resource should have the value 201603L in c++17"
# endif
+# ifdef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+# endif
+
# ifdef __cpp_lib_move_only_function
# error "__cpp_lib_move_only_function should not be defined before c++2b"
# endif
@@ -2134,6 +2182,10 @@
# error "__cpp_lib_ranges should not be defined before c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -2213,7 +2265,7 @@
# error "__cpp_lib_semaphore should not be defined before c++20"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_mutex
# error "__cpp_lib_shared_mutex should be defined in c++17"
# endif
@@ -2222,7 +2274,7 @@
# endif
# else
# ifdef __cpp_lib_shared_mutex
-# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)' is not met!"
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -2240,7 +2292,7 @@
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++17"
# endif
@@ -2249,7 +2301,7 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -2549,7 +2601,7 @@
# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_atomic_wait
# error "__cpp_lib_atomic_wait should be defined in c++20"
# endif
@@ -2558,11 +2610,11 @@
# endif
# else
# ifdef __cpp_lib_atomic_wait
-# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)' is not met!"
+# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_barrier
# error "__cpp_lib_barrier should be defined in c++20"
# endif
@@ -2571,7 +2623,7 @@
# endif
# else
# ifdef __cpp_lib_barrier
-# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)' is not met!"
+# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
@@ -2851,7 +2903,7 @@
# error "__cpp_lib_expected should not be defined before c++2b"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# ifndef __cpp_lib_filesystem
# error "__cpp_lib_filesystem should be defined in c++20"
# endif
@@ -2860,7 +2912,7 @@
# endif
# else
# ifdef __cpp_lib_filesystem
-# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)' is not met!"
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)' is not met!"
# endif
# endif
@@ -2877,6 +2929,14 @@
# endif
# endif
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined before c++2b"
+# endif
+
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_forward_like
# error "__cpp_lib_forward_like should not be defined before c++2b"
# endif
@@ -3074,7 +3134,7 @@
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_latch
# error "__cpp_lib_latch should be defined in c++20"
# endif
@@ -3083,7 +3143,7 @@
# endif
# else
# ifdef __cpp_lib_latch
-# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)' is not met!"
+# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
@@ -3163,6 +3223,13 @@
# error "__cpp_lib_memory_resource should have the value 201603L in c++20"
# endif
+# ifndef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should be defined in c++20"
+# endif
+# if __cpp_lib_move_iterator_concept != 202207L
+# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20"
+# endif
+
# ifdef __cpp_lib_move_only_function
# error "__cpp_lib_move_only_function should not be defined before c++2b"
# endif
@@ -3240,6 +3307,10 @@
# error "__cpp_lib_ranges should have the value 202106L in c++20"
# endif
+# ifdef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should not be defined before c++2b"
+# endif
+
# ifdef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should not be defined before c++2b"
# endif
@@ -3318,7 +3389,7 @@
# error "__cpp_lib_scoped_lock should have the value 201703L in c++20"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_semaphore
# error "__cpp_lib_semaphore should be defined in c++20"
# endif
@@ -3327,11 +3398,11 @@
# endif
# else
# ifdef __cpp_lib_semaphore
-# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)' is not met!"
+# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_mutex
# error "__cpp_lib_shared_mutex should be defined in c++20"
# endif
@@ -3340,7 +3411,7 @@
# endif
# else
# ifdef __cpp_lib_shared_mutex
-# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)' is not met!"
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -3358,7 +3429,7 @@
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++20"
# endif
@@ -3367,7 +3438,7 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -3391,7 +3462,7 @@
# endif
# endif
-# if __has_builtin(__builtin_source_location)
+# if __has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)
# ifndef __cpp_lib_source_location
# error "__cpp_lib_source_location should be defined in c++20"
# endif
@@ -3400,7 +3471,7 @@
# endif
# else
# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location)' is not met!"
+# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)' is not met!"
# endif
# endif
@@ -3742,7 +3813,7 @@
# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++2b"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_atomic_wait
# error "__cpp_lib_atomic_wait should be defined in c++2b"
# endif
@@ -3751,11 +3822,11 @@
# endif
# else
# ifdef __cpp_lib_atomic_wait
-# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)' is not met!"
+# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_barrier
# error "__cpp_lib_barrier should be defined in c++2b"
# endif
@@ -3764,7 +3835,7 @@
# endif
# else
# ifdef __cpp_lib_barrier
-# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)' is not met!"
+# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
@@ -3988,17 +4059,11 @@
# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++2b"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_constexpr_typeinfo
-# error "__cpp_lib_constexpr_typeinfo should be defined in c++2b"
-# endif
-# if __cpp_lib_constexpr_typeinfo != 202106L
-# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++2b"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_constexpr_typeinfo
-# error "__cpp_lib_constexpr_typeinfo should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_constexpr_typeinfo
+# error "__cpp_lib_constexpr_typeinfo should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_typeinfo != 202106L
+# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++2b"
# endif
# ifndef __cpp_lib_constexpr_utility
@@ -4083,7 +4148,7 @@
# error "__cpp_lib_expected should have the value 202202L in c++2b"
# endif
-# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)
# ifndef __cpp_lib_filesystem
# error "__cpp_lib_filesystem should be defined in c++2b"
# endif
@@ -4092,7 +4157,7 @@
# endif
# else
# ifdef __cpp_lib_filesystem
-# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)' is not met!"
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)' is not met!"
# endif
# endif
@@ -4109,6 +4174,32 @@
# endif
# endif
+# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+# ifndef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should be defined in c++2b"
+# endif
+# if __cpp_lib_format_ranges != 202207L
+# error "__cpp_lib_format_ranges should have the value 202207L in c++2b"
+# endif
+# else
+# ifdef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_formatters
+# error "__cpp_lib_formatters should be defined in c++2b"
+# endif
+# if __cpp_lib_formatters != 202302L
+# error "__cpp_lib_formatters should have the value 202302L in c++2b"
+# endif
+# else // _LIBCPP_VERSION
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
# ifndef __cpp_lib_forward_like
# error "__cpp_lib_forward_like should be defined in c++2b"
# endif
@@ -4213,17 +4304,11 @@
# error "__cpp_lib_invoke should have the value 201411L in c++2b"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_invoke_r
-# error "__cpp_lib_invoke_r should be defined in c++2b"
-# endif
-# if __cpp_lib_invoke_r != 202106L
-# error "__cpp_lib_invoke_r should have the value 202106L in c++2b"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_invoke_r
-# error "__cpp_lib_invoke_r should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_invoke_r
+# error "__cpp_lib_invoke_r should be defined in c++2b"
+# endif
+# if __cpp_lib_invoke_r != 202106L
+# error "__cpp_lib_invoke_r should have the value 202106L in c++2b"
# endif
# ifndef __cpp_lib_is_aggregate
@@ -4321,7 +4406,7 @@
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_latch
# error "__cpp_lib_latch should be defined in c++2b"
# endif
@@ -4330,7 +4415,7 @@
# endif
# else
# ifdef __cpp_lib_latch
-# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)' is not met!"
+# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
@@ -4410,6 +4495,13 @@
# error "__cpp_lib_memory_resource should have the value 201603L in c++2b"
# endif
+# ifndef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should be defined in c++2b"
+# endif
+# if __cpp_lib_move_iterator_concept != 202207L
+# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++2b"
+# endif
+
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_move_only_function
# error "__cpp_lib_move_only_function should be defined in c++2b"
@@ -4505,6 +4597,13 @@
# error "__cpp_lib_ranges should have the value 202106L in c++2b"
# endif
+# ifndef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should be defined in c++2b"
+# endif
+# if __cpp_lib_ranges_as_rvalue != 202207L
+# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++2b"
+# endif
+
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_ranges_chunk
# error "__cpp_lib_ranges_chunk should be defined in c++2b"
@@ -4664,7 +4763,7 @@
# error "__cpp_lib_scoped_lock should have the value 201703L in c++2b"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
# ifndef __cpp_lib_semaphore
# error "__cpp_lib_semaphore should be defined in c++2b"
# endif
@@ -4673,11 +4772,11 @@
# endif
# else
# ifdef __cpp_lib_semaphore
-# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)' is not met!"
+# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)' is not met!"
# endif
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_mutex
# error "__cpp_lib_shared_mutex should be defined in c++2b"
# endif
@@ -4686,7 +4785,7 @@
# endif
# else
# ifdef __cpp_lib_shared_mutex
-# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)' is not met!"
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -4704,7 +4803,7 @@
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++2b"
# endif
-# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)
+# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)
# ifndef __cpp_lib_shared_timed_mutex
# error "__cpp_lib_shared_timed_mutex should be defined in c++2b"
# endif
@@ -4713,7 +4812,7 @@
# endif
# else
# ifdef __cpp_lib_shared_timed_mutex
-# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)' is not met!"
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)' is not met!"
# endif
# endif
@@ -4737,7 +4836,7 @@
# endif
# endif
-# if __has_builtin(__builtin_source_location)
+# if __has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)
# ifndef __cpp_lib_source_location
# error "__cpp_lib_source_location should be defined in c++2b"
# endif
@@ -4746,7 +4845,7 @@
# endif
# else
# ifdef __cpp_lib_source_location
-# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location)' is not met!"
+# error "__cpp_lib_source_location should not be defined when the requirement '__has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)' is not met!"
# endif
# endif
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.rtti/type.info/type_info.equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.rtti/type.info/type_info.equal.pass.cpp
new file mode 100644
index 0000000..3f5dd96
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.rtti/type.info/type_info.equal.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// class type_info
+//
+// bool operator==(const type_info& rhs) const noexcept; // constexpr since C++23
+
+// UNSUPPORTED: no-rtti
+
+// When we build for Windows on top of the VC runtime, `typeinfo::operator==` may not
+// be `constexpr` (depending on the version of the VC runtime). So this test can fail.
+// UNSUPPORTED: target={{.+}}-windows-msvc && !libcpp-no-vcruntime
+
+#include <typeinfo>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct Base {
+ virtual void func() {}
+};
+struct Derived : Base {
+ virtual void func() {}
+};
+
+TEST_CONSTEXPR_CXX23 bool test() {
+ // Test when storing typeid() in a const ref
+ {
+ std::type_info const& t1 = typeid(int);
+ std::type_info const& t2 = typeid(long);
+ assert(t1 == t1);
+ assert(t2 == t2);
+ assert(t1 != t2);
+ }
+
+ // Test when using `typeid()` directly
+ {
+ struct Foo { };
+ struct Bar { };
+ assert(typeid(Foo) == typeid(Foo));
+ assert(typeid(Foo) != typeid(Bar));
+ }
+
+ // Test when using typeid(object) instead of typeid(type)
+ {
+ int x = 0, y = 0;
+ long z = 0;
+ assert(typeid(x) == typeid(y));
+ assert(typeid(x) != typeid(z));
+ }
+
+ // Check with derived/base types
+ {
+ Derived derived;
+ Base const& as_base = derived;
+ assert(typeid(as_base) == typeid(Derived));
+ }
+
+ // Check noexcept-ness
+ {
+ std::type_info const& t1 = typeid(int); (void)t1;
+ std::type_info const& t2 = typeid(long); (void)t2;
+ ASSERT_NOEXCEPT(t1 == t2);
+ }
+ return true;
+}
+
+int main(int, char**) {
+ test();
+#if TEST_STD_VER >= 23
+ static_assert(test());
+#endif
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.aligned_alloc.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.aligned_alloc.compile.pass.cpp
index f6681db..1c3c546 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.aligned_alloc.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.aligned_alloc.compile.pass.cpp
@@ -13,7 +13,7 @@
// ::aligned_alloc is provided by the C library, but it's marked as unavailable
// until macOS 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// ::aligned_alloc is not implemented on Windows
// XFAIL: target={{.+}}-windows-{{.+}}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
index c4c8ddd..823417f 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
@@ -78,7 +78,7 @@
static_assert(!has_abs<unsigned>::value, "");
static_assert(!has_abs<unsigned long>::value, "");
static_assert(!has_abs<unsigned long long>::value, "");
- static_assert(!has_abs<size_t>::value, "");
+ static_assert(!has_abs<std::size_t>::value, "");
TEST_DIAGNOSTIC_POP
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp
index 37c7b67..9a512f6 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp
@@ -15,7 +15,7 @@
// ::timespec_get is provided by the C library, but it's marked as
// unavailable until macOS 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// ::timespec_get is available starting with Android Q (API 29)
// XFAIL: target={{.+}}-android{{(eabi)?(21|22|23|24|25|26|27|28)}}
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.srcloc/general.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.srcloc/general.pass.cpp
index 39ad936..70861ee 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.srcloc/general.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.srcloc/general.pass.cpp
@@ -43,8 +43,8 @@
ASSERT_NOEXCEPT(empty.column());
ASSERT_NOEXCEPT(empty.file_name());
ASSERT_NOEXCEPT(empty.function_name());
-std::same_as<uint_least32_t> auto line = empty.line();
-std::same_as<uint_least32_t> auto column = empty.column();
+std::same_as<std::uint_least32_t> auto line = empty.line();
+std::same_as<std::uint_least32_t> auto column = empty.column();
std::same_as<const char*> auto file = empty.file_name();
std::same_as<const char*> auto function = empty.function_name();
diff --git a/third_party/llvm-project/libcxx/test/std/language.support/support.types/max_align_t.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/language.support/support.types/max_align_t.compile.pass.cpp
index aef00bb..5e33584 100644
--- a/third_party/llvm-project/libcxx/test/std/language.support/support.types/max_align_t.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/language.support/support.types/max_align_t.compile.pass.cpp
@@ -26,5 +26,5 @@
static_assert(alignof(std::max_align_t) >= alignof(void*), "");
#if TEST_STD_VER > 14
static_assert(alignof(std::max_align_t) <= __STDCPP_DEFAULT_NEW_ALIGNMENT__,
- "max_align_t alignment should be no larger than operator new's alignment");
+ "std::max_align_t alignment should be no larger than operator new's alignment");
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/library/description/conventions/customization.point.object/cpo.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/library/description/conventions/customization.point.object/cpo.compile.pass.cpp
index 060f179..e6c0e09 100644
--- a/third_party/llvm-project/libcxx/test/std/library/description/conventions/customization.point.object/cpo.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/library/description/conventions/customization.point.object/cpo.compile.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// TODO: make `join_view` non-experimental once D2770 is implemented.
+// UNSUPPORTED: !c++experimental
// [customization.point.object]
// [range.adaptor.object] "A range adaptor object is a customization point object..."
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
index 7f85dee..8fe8080 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
@@ -26,7 +26,7 @@
typedef F::mask mask;
const mask *p = F::classic_table();
- for ( size_t i = 0; i < 128; ++i ) // values above 128 are not consistent
+ for ( std::size_t i = 0; i < 128; ++i ) // values above 128 are not consistent
{
bool expect_cntrl = (i < 32 || 126 < i);
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
index 4017b94..bbfbe5d 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
@@ -14,8 +14,8 @@
// Before https://llvm.org/D110647, the shared library did not contain
// std::ctype<char>::table_size, so this test fails with a link error.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0|13.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{11.0|12.0|13.0}}
#include <locale>
#include <cassert>
@@ -24,7 +24,7 @@
int main(int, char**) {
typedef std::ctype<char> F;
- const size_t* G = &F::table_size;
+ const std::size_t* G = &F::table_size;
assert(*G >= 256);
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
index c430321..5beeed9 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
#include <locale>
#include "../with_public_dtor.hpp"
-#include "test_macros.h"
-int main(int, char **)
-{
+void f() {
// Don't test for the exact type since the underlying type of
// std::mbstate_t depends on implementation details.
with_public_dtor<std::codecvt_byname<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt_byname<char16_t, char, {{.*}}>' is deprecated}}
(void)cvt;
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
index ebace3a..1cf0ae3 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
#include <locale>
#include "../with_public_dtor.hpp"
-#include "test_macros.h"
-int main(int, char **)
-{
+void f() {
// Don't test for the exact type since the underlying type of
// std::mbstate_t depends on implementation details.
with_public_dtor<std::codecvt_byname<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt_byname<char32_t, char, {{.*}}>' is deprecated}}
(void)cvt;
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp
index a910eb4..209d9a9 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp
index d0b74a0..7d2eb4c 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
index 54f57c6..cc9c355 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
#include <locale>
#include "../with_public_dtor.hpp"
-#include "test_macros.h"
-int main(int, char **)
-{
+void f() {
// Don't test for the exact type since the underlying type of
// std::mbstate_t depends on implementation details.
with_public_dtor<std::codecvt<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt<char16_t, char, {{.*}}>' is deprecated}}
(void)cvt;
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
index 9b7fdc5..7cbfbd3 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
#include <locale>
#include "../with_public_dtor.hpp"
-#include "test_macros.h"
-int main(int, char **)
-{
+void f() {
// Don't test for the exact type since the underlying type of
// std::mbstate_t depends on implementation details.
with_public_dtor<std::codecvt<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt<char32_t, char, {{.*}}>' is deprecated}}
(void)cvt;
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp
index 54a5846..734c3e9 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp
index 0599e05..b4a93fe 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp
index 382c184..cb2c0bc 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp
index 3db1619..b008ecf 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp
index 5639305..c34e864 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp
index 24b0c4a..d72a154 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp
index 519446d..c16c15d 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp
index 3ae5b8b..c39e64d 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp
index d27c1d2..bf18de2 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp
index eb208b0..25d1ffe 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp
index 8aeec78..8ac8ccd 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp
index cb05562..e848f8a 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp
index 57b76c4..725b2da 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp
index 9d3adca..beb6195 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp
index 28f0309..7a31c9e 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp
index 4eacd50..eaa6373 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
index 03185d3..07789ca 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
@@ -6,9 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp
index 82d7e68..31f28b5 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp
index 233a2c3..7224260 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp
@@ -8,9 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// <locale>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
index 45270d1..a180848 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
@@ -15,7 +15,7 @@
// This test exercises the fix for PR28704, which isn't in the dylib for
// some systems.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
#include <locale>
#include <ios>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
index 5aa2fe6..5eb7c92 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -84,7 +84,7 @@
++value;
std::string std_str = make_neg_string(value);
const char* str = std_str.data();
- size_t size = std_str.size();
+ std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
@@ -102,7 +102,7 @@
++value;
std::string std_str = make_neg_string(value);
const char* str = std_str.data();
- size_t size = std_str.size();
+ std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
@@ -118,7 +118,7 @@
T value = std::numeric_limits<T>::max();
std::string std_str = make_neg_string(value);
const char* str = std_str.data();
- size_t size = std_str.size();
+ std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
@@ -134,7 +134,7 @@
std::string std_str = make_neg_string(std::numeric_limits<T>::max());
std_str.back()++;
const char* str = std_str.data();
- size_t size = std_str.size();
+ std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
index 53172e7..bf2f8af 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
@@ -26,7 +26,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
index ac3daf4..e9c19e5 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
@@ -25,7 +25,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
index 2a6936a..24b1d22 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
@@ -28,7 +28,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
index 37cc10a..0d52894 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
@@ -26,7 +26,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
index 6279dce..32fdde3 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
@@ -25,7 +25,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
index 7d124c9..22636ca 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
@@ -28,7 +28,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
index d7776b3..24eb2df 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
@@ -28,7 +28,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
index c208dc3..b9eeb6a 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
@@ -28,7 +28,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/classification/isblank.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/classification/isblank.pass.cpp
new file mode 100644
index 0000000..2a5cc19
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/classification/isblank.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isblank (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ std::locale l;
+ assert(std::isblank(' ', l));
+ assert(!std::isblank('<', l));
+ assert(!std::isblank('\x8', l));
+ assert(!std::isblank('A', l));
+ assert(!std::isblank('a', l));
+ assert(!std::isblank('z', l));
+ assert(!std::isblank('3', l));
+ assert(!std::isblank('.', l));
+ assert(!std::isblank('f', l));
+ assert(!std::isblank('9', l));
+ assert(!std::isblank('+', l));
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
index e1b1f69..2861e4a 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
@@ -22,7 +22,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
index 157b745..ac614b0 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
@@ -25,7 +25,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
index 52c5897..4f3b931 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
@@ -25,7 +25,7 @@
#include "test_macros.h"
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
index 87c7ec2..1dea0b0 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
@@ -8,9 +8,7 @@
// REQUIRES: locale.ru_RU.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
index 7c29d9c..99131dd 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
@@ -12,9 +12,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
index 09e4e45..04d72f6 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
@@ -8,9 +8,7 @@
// REQUIRES: locale.fr_FR.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
index 2035f5d..f0086ad 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
@@ -8,9 +8,7 @@
// REQUIRES: locale.en_US.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
index 3a4bc23..0581dcf 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
@@ -10,9 +10,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// UNSUPPORTED: sanitizer-new-delete
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
index 8482f49..beeba43 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
@@ -8,9 +8,7 @@
// REQUIRES: locale.ru_RU.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
index 4337362..bfd38d7 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
@@ -10,9 +10,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// UNSUPPORTED: sanitizer-new-delete
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
index ee39910..8e433cb 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
@@ -10,9 +10,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// UNSUPPORTED: sanitizer-new-delete
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
index 1296b74..4de61f4 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
@@ -9,9 +9,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
index 811c47c..4463dad 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
@@ -6,9 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
index 72801e3..dcf4bc6 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
@@ -6,9 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
index b8bfa69..1ac36ef 100644
--- a/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
@@ -8,9 +8,7 @@
// REQUIRES: locale.en_US.UTF-8
-// This test relies on https://wg21.link/P0482 being implemented, which isn't in
-// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.endian/endian.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.endian/endian.pass.cpp
index ecba960..fa02afe 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.endian/endian.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.endian/endian.pass.cpp
@@ -12,9 +12,9 @@
// <bit>
#include <bit>
-#include <cstring>
#include <cassert>
#include <cstdint>
+#include <cstring>
#include <type_traits>
#include "test_macros.h"
@@ -38,7 +38,7 @@
// Try to check at runtime
{
- uint32_t i = 0x01020304;
+ std::uint32_t i = 0x01020304;
char c[4];
static_assert(sizeof(i) == sizeof(c));
std::memcpy(c, &i, sizeof(c));
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
index fab7d78..71902b7 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
@@ -39,13 +39,13 @@
static_assert(toobig<unsigned long>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<unsigned long long>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<uint8_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<uint16_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<uint32_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<uint64_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<size_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<uintmax_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- static_assert(toobig<uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::uint8_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::uint16_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::uint32_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::uint64_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::size_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::uintmax_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<std::uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
index f18d52a..4e794f1 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
@@ -84,13 +84,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -115,13 +115,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -131,13 +131,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
index f843fff..06ee38c 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
@@ -81,13 +81,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -113,13 +113,13 @@
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -130,13 +130,13 @@
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
index 23aad27..cfb9a16 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
@@ -86,13 +86,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -117,13 +117,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -133,13 +133,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
index 1a20a4c..7b23627 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
@@ -84,13 +84,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -115,13 +115,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -131,13 +131,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
index ab82d03..bbce57b 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
@@ -81,13 +81,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -112,13 +112,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -128,13 +128,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
index 2a23e9b..f103450 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
@@ -80,13 +80,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -111,13 +111,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -127,13 +127,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
index 467d034..8e8ef1d 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
@@ -85,13 +85,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -116,13 +116,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -132,13 +132,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
index 149ca27..d0fdf92 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
@@ -82,13 +82,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -113,13 +113,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -129,13 +129,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
index 96c5fd4..b8759c4 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
@@ -92,13 +92,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -123,13 +123,13 @@
#ifndef TEST_HAS_NO_INT128
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -139,13 +139,13 @@
#ifndef TEST_HAS_NO_INT128
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
index e82388d..9592db6 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
@@ -80,13 +80,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -112,13 +112,13 @@
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -129,13 +129,13 @@
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
index 0545874..9575254 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
@@ -81,13 +81,13 @@
static_assert(!std::is_invocable_v<L, __int128_t>);
#endif
- static_assert(!std::is_invocable_v<L, int8_t>);
- static_assert(!std::is_invocable_v<L, int16_t>);
- static_assert(!std::is_invocable_v<L, int32_t>);
- static_assert(!std::is_invocable_v<L, int64_t>);
- static_assert(!std::is_invocable_v<L, intmax_t>);
- static_assert(!std::is_invocable_v<L, intptr_t>);
- static_assert(!std::is_invocable_v<L, ptrdiff_t>);
+ static_assert(!std::is_invocable_v<L, std::int8_t>);
+ static_assert(!std::is_invocable_v<L, std::int16_t>);
+ static_assert(!std::is_invocable_v<L, std::int32_t>);
+ static_assert(!std::is_invocable_v<L, std::int64_t>);
+ static_assert(!std::is_invocable_v<L, std::intmax_t>);
+ static_assert(!std::is_invocable_v<L, std::intptr_t>);
+ static_assert(!std::is_invocable_v<L, std::ptrdiff_t>);
static_assert(!std::is_invocable_v<L, bool>);
static_assert(!std::is_invocable_v<L, char>);
@@ -113,13 +113,13 @@
static_assert(test<__uint128_t>());
#endif
- static_assert(test<uint8_t>());
- static_assert(test<uint16_t>());
- static_assert(test<uint32_t>());
- static_assert(test<uint64_t>());
- static_assert(test<uintmax_t>());
- static_assert(test<uintptr_t>());
- static_assert(test<size_t>());
+ static_assert(test<std::uint8_t>());
+ static_assert(test<std::uint16_t>());
+ static_assert(test<std::uint32_t>());
+ static_assert(test<std::uint64_t>());
+ static_assert(test<std::uintmax_t>());
+ static_assert(test<std::uintptr_t>());
+ static_assert(test<std::size_t>());
test<unsigned char>();
test<unsigned short>();
@@ -130,13 +130,13 @@
test<__uint128_t>();
#endif
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
- test<size_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
+ test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/bit/byteswap.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/bit/byteswap.pass.cpp
index bd73515..b87faf1 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/bit/byteswap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/bit/byteswap.pass.cpp
@@ -54,15 +54,15 @@
}
constexpr bool test() {
- test_num<uint8_t>(0xAB, 0xAB);
- test_num<uint16_t>(0xCDEF, 0xEFCD);
- test_num<uint32_t>(0x01234567, 0x67452301);
- test_num<uint64_t>(0x0123456789ABCDEF, 0xEFCDAB8967452301);
+ test_num<std::uint8_t>(0xAB, 0xAB);
+ test_num<std::uint16_t>(0xCDEF, 0xEFCD);
+ test_num<std::uint32_t>(0x01234567, 0x67452301);
+ test_num<std::uint64_t>(0x0123456789ABCDEF, 0xEFCDAB8967452301);
- test_num<int8_t>(static_cast<int8_t>(0xAB), static_cast<int8_t>(0xAB));
- test_num<int16_t>(static_cast<int16_t>(0xCDEF), static_cast<int16_t>(0xEFCD));
- test_num<int32_t>(0x01234567, 0x67452301);
- test_num<int64_t>(0x0123456789ABCDEF, 0xEFCDAB8967452301);
+ test_num<std::int8_t>(static_cast<std::int8_t>(0xAB), static_cast<std::int8_t>(0xAB));
+ test_num<std::int16_t>(static_cast<std::int16_t>(0xCDEF), static_cast<std::int16_t>(0xEFCD));
+ test_num<std::int32_t>(0x01234567, 0x67452301);
+ test_num<std::int64_t>(0x0123456789ABCDEF, 0xEFCDAB8967452301);
#ifndef TEST_HAS_NO_INT128
const auto in = static_cast<__uint128_t>(0x0123456789ABCDEF) << 64 | 0x13579BDF02468ACE;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/c.math/cmath.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/c.math/cmath.pass.cpp
index c867472..e2062cc 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/c.math/cmath.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/c.math/cmath.pass.cpp
@@ -133,7 +133,7 @@
static_assert(!has_abs<unsigned>::value, "");
static_assert(!has_abs<unsigned long>::value, "");
static_assert(!has_abs<unsigned long long>::value, "");
- static_assert(!has_abs<size_t>::value, "");
+ static_assert(!has_abs<std::size_t>::value, "");
TEST_DIAGNOSTIC_POP
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isfinite.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isfinite.pass.cpp
index fd2ad11..6bbc3aa 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isfinite.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isfinite.pass.cpp
@@ -63,8 +63,8 @@
};
int main(int, char**) {
- meta::for_each(meta::floating_point_types(), TestFloat());
- meta::for_each(meta::integral_types(), TestInt());
+ types::for_each(types::floating_point_types(), TestFloat());
+ types::for_each(types::integral_types(), TestInt());
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isinf.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isinf.pass.cpp
index 3b1e54f..e935b53 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isinf.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isinf.pass.cpp
@@ -63,8 +63,8 @@
};
int main(int, char**) {
- meta::for_each(meta::floating_point_types(), TestFloat());
- meta::for_each(meta::integral_types(), TestInt());
+ types::for_each(types::floating_point_types(), TestFloat());
+ types::for_each(types::integral_types(), TestInt());
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnan.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnan.pass.cpp
index c8ac055..fffb124 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnan.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnan.pass.cpp
@@ -63,8 +63,8 @@
};
int main(int, char**) {
- meta::for_each(meta::floating_point_types(), TestFloat());
- meta::for_each(meta::integral_types(), TestInt());
+ types::for_each(types::floating_point_types(), TestFloat());
+ types::for_each(types::integral_types(), TestInt());
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnormal.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnormal.pass.cpp
index 681438e..c3b8f31 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnormal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/c.math/isnormal.pass.cpp
@@ -63,8 +63,8 @@
};
int main(int, char**) {
- meta::for_each(meta::floating_point_types(), TestFloat());
- meta::for_each(meta::integral_types(), TestInt());
+ types::for_each(types::floating_point_types(), TestFloat());
+ types::for_each(types::integral_types(), TestInt());
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
index 80ac2ae..e664b6a 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
@@ -64,7 +64,7 @@
{
// From (indirect_array<T>)
std::valarray<long> v = {1, 2, 3, 4, 5};
- std::valarray<size_t> i = {1, 2, 3};
+ std::valarray<std::size_t> i = {1, 2, 3};
std::valarray v2 = v[i];
static_assert(std::is_same_v<decltype(v2), std::valarray<long>>);
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
index 4c87bd4..21d4ee1 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
@@ -21,7 +21,7 @@
S() : x(1) {}
~S() { ++cnt_dtor; }
int x;
- static size_t cnt_dtor;
+ static std::size_t cnt_dtor;
};
size_t S::cnt_dtor = 0;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numbers/illformed.verify.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numbers/illformed.verify.cpp
index 213f98c..8f19718 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numbers/illformed.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numbers/illformed.verify.cpp
@@ -11,8 +11,7 @@
#include <numbers>
// Initializing the primary template is ill-formed.
-int log2e{std::numbers::log2e_v<
- int>}; // expected-error-re@numbers:* {{{{(static_assert|static assertion)}} failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}}
+int log2e{std::numbers::log2e_v<int>}; // expected-error-re@numbers:* {{{{(static_assert|static assertion)}} failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}}
int log10e{std::numbers::log10e_v<int>};
int pi{std::numbers::pi_v<int>};
int inv_pi{std::numbers::inv_pi_v<int>};
@@ -24,5 +23,3 @@
int inv_sqrt3{std::numbers::inv_sqrt3_v<int>};
int egamma{std::numbers::egamma_v<int>};
int phi{std::numbers::phi_v<int>};
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
index 69f25fc..bef2dd7 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
@@ -57,33 +57,33 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
- std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50});
- for (size_t i = 0; i < v.size(); ++i)
+ std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{50});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + i * 3);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
- std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30});
- for (size_t i = 0; i < v.size(); ++i)
+ std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{30});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i-1));
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
- std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40});
- for (size_t i = 0; i < v.size(); ++i)
+ std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{40});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i));
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
index 53698b1..ca2de4a 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
@@ -77,13 +77,13 @@
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
- std::array<size_t, 10> res;
+ std::array<std::size_t, 10> res;
std::exclusive_scan(v.begin(), v.end(), res.begin(), 1, std::multiplies<>());
assert(res.size() == 10);
- size_t j = 1;
+ std::size_t j = 1;
assert(res[0] == 1);
- for (size_t i = 1; i < v.size(); ++i)
+ for (std::size_t i = 1; i < v.size(); ++i)
{
j *= i;
assert(res[i] == j);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
index 6e00506..299d085 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
@@ -58,38 +58,38 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin());
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == (i+1) * 3);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin());
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i));
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin());
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i + 1));
}
{
- std::array<size_t, 0> v, res;
+ std::array<std::size_t, 0> v, res;
std::inclusive_scan(v.begin(), v.end(), res.begin());
assert(res.empty());
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
index 5e33394..87bea92 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
@@ -62,38 +62,38 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == (i+1) * 3);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i));
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i + 1));
}
{
- std::array<size_t, 0> v, res;
+ std::array<std::size_t, 0> v, res;
std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>());
assert(res.empty());
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
index f7c2be2..2e21d38 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
@@ -62,39 +62,39 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
- std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{50});
- for (size_t i = 0; i < v.size(); ++i)
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{50});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + (i+1) * 3);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
- std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{40});
- for (size_t i = 0; i < v.size(); ++i)
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{40});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i));
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
- std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{30});
- for (size_t i = 0; i < v.size(); ++i)
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{30});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i + 1));
}
{
- std::array<size_t, 0> v, res;
- std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), size_t{40});
+ std::array<std::size_t, 0> v, res;
+ std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), std::size_t{40});
assert(res.empty());
}
@@ -102,13 +102,13 @@
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
- std::array<size_t, 10> res;
- std::inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), size_t{1});
+ std::array<std::size_t, 10> res;
+ std::inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), std::size_t{1});
assert(res.size() == 10);
- size_t j = 1;
+ std::size_t j = 1;
assert(res[0] == 1);
- for (size_t i = 1; i < v.size(); ++i)
+ for (std::size_t i = 1; i < v.size(); ++i)
{
j *= i + 1;
assert(res[i] == j);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
index 599b328..c506d07 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
@@ -18,6 +18,7 @@
#include <numeric>
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include "test_macros.h"
template <typename T>
@@ -114,10 +115,10 @@
signed_test<long>();
signed_test<long long>();
- signed_test<int8_t>();
- signed_test<int16_t>();
- signed_test<int32_t>();
- signed_test<int64_t>();
+ signed_test<std::int8_t>();
+ signed_test<std::int16_t>();
+ signed_test<std::int32_t>();
+ signed_test<std::int64_t>();
unsigned_test<unsigned char>();
unsigned_test<unsigned short>();
@@ -125,10 +126,10 @@
unsigned_test<unsigned long>();
unsigned_test<unsigned long long>();
- unsigned_test<uint8_t>();
- unsigned_test<uint16_t>();
- unsigned_test<uint32_t>();
- unsigned_test<uint64_t>();
+ unsigned_test<std::uint8_t>();
+ unsigned_test<std::uint16_t>();
+ unsigned_test<std::uint32_t>();
+ unsigned_test<std::uint64_t>();
#ifndef TEST_HAS_NO_INT128
unsigned_test<__uint128_t>();
@@ -136,8 +137,8 @@
#endif
// int_test<char>();
- signed_test<ptrdiff_t>();
- unsigned_test<size_t>();
+ signed_test<std::ptrdiff_t>();
+ unsigned_test<std::size_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
index 9ab546a..5227220 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
@@ -88,39 +88,39 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
- std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50}, std::plus<>(), add_one{});
- for (size_t i = 0; i < v.size(); ++i)
+ std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{50}, std::plus<>(), add_one{});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + i * 4);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
- std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30}, std::plus<>(), add_one{});
- for (size_t i = 0; i < v.size(); ++i)
+ std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{30}, std::plus<>(), add_one{});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i - 1) + i);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
- std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40}, std::plus<>(), add_one{});
- for (size_t i = 0; i < v.size(); ++i)
+ std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{40}, std::plus<>(), add_one{});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i) + i);
}
{
- std::array<size_t, 0> v, res;
- std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), size_t{40}, std::plus<>(), add_one{});
+ std::array<std::size_t, 0> v, res;
+ std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), std::size_t{40}, std::plus<>(), add_one{});
assert(res.empty());
}
@@ -128,13 +128,13 @@
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
- std::array<size_t, 10> res;
- std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), size_t{1}, std::multiplies<>(), add_one{});
+ std::array<std::size_t, 10> res;
+ std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), std::size_t{1}, std::multiplies<>(), add_one{});
assert(res.size() == 10);
- size_t j = 1;
+ std::size_t j = 1;
assert(res[0] == 1);
- for (size_t i = 1; i < res.size(); ++i)
+ for (std::size_t i = 1; i < res.size(); ++i)
{
j *= i + 1;
assert(res[i] == j);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
index d4a95bf..80ead01 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
@@ -77,38 +77,38 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == (i+1) * 4);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i) + i + 1);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
- for (size_t i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i + 1) + i + 1);
}
{
- std::array<size_t, 0> v, res;
+ std::array<std::size_t, 0> v, res;
std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{});
assert(res.empty());
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
index 7d89c5b..18be676 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
@@ -90,39 +90,39 @@
}
}
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{50});
- for (size_t i = 0; i < v.size(); ++i)
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{50});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + (i + 1) * 4);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{30});
- for (size_t i = 0; i < v.size(); ++i)
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{30});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i) + i + 1);
}
{
- std::array<size_t, 10> v;
+ std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
- std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{40});
- for (size_t i = 0; i < v.size(); ++i)
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{40});
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i + 1) + i + 1);
}
{
- std::array<size_t, 0> v, res;
- std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{}, size_t{1});
+ std::array<std::size_t, 0> v, res;
+ std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{}, std::size_t{1});
assert(res.empty());
}
@@ -130,13 +130,13 @@
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
- std::array<size_t, 10> res;
- std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), add_one{}, size_t{1});
+ std::array<std::size_t, 10> res;
+ std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), add_one{}, std::size_t{1});
assert(res.size() == 10);
- size_t j = 2;
+ std::size_t j = 2;
assert(res[0] == 2);
- for (size_t i = 1; i < res.size(); ++i)
+ for (std::size_t i = 1; i < res.size(); ++i)
{
j *= i + 2;
assert(res[i] == j);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp
index b92a583..a2d46ab 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp
@@ -7,12 +7,11 @@
//===----------------------------------------------------------------------===//
// See https://llvm.org/PR20183
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// The behavior of std::random_device changed on Apple platforms with
// https://llvm.org/D116045.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
// UNSUPPORTED: no-random-device
@@ -30,6 +29,7 @@
// throw.
#include <random>
+#include <string>
#include <system_error>
#include <cassert>
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp
index 3339a54..9c385b3 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -16,6 +16,7 @@
#include <random>
#include <cassert>
+#include <string>
#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
index 2e8bfae..dbdd097 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
@@ -15,10 +15,12 @@
// template<class _URNG> result_type operator()(_URNG& g);
-#include <random>
-#include <numeric>
-#include <vector>
#include <cassert>
+#include <cstdint>
+#include <numeric>
+#include <random>
+#include <type_traits>
+#include <vector>
#include "test_macros.h"
@@ -527,8 +529,8 @@
tests<unsigned long long>();
#if defined(_LIBCPP_VERSION) // extension
- tests<int8_t>();
- tests<uint8_t>();
+ tests<std::int8_t>();
+ tests<std::uint8_t>();
#if !defined(TEST_HAS_NO_INT128)
tests<__int128_t>();
tests<__uint128_t>();
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
index deccad1..440334e 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
@@ -15,10 +15,11 @@
// template<class _URNG> result_type operator()(_URNG& g);
-#include <random>
-#include <numeric>
-#include <vector>
#include <cassert>
+#include <cstdint>
+#include <numeric>
+#include <random>
+#include <vector>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
index 6aef9b4..5feb2e5 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
@@ -15,13 +15,13 @@
// template<class _URNG> result_type operator()(_URNG& g);
-#include <random>
-
#include <cassert>
#include <cmath>
+#include <cstdint>
#include <limits>
-#include <vector>
#include <numeric>
+#include <random>
+#include <vector>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
index d52e23e..762acd4 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
@@ -15,9 +15,11 @@
// template<class _URNG> result_type operator()(_URNG& g);
+#include <cassert>
+#include <cstdint>
+#include <cstdlib>
#include <random>
#include <vector>
-#include <cassert>
#include "test_macros.h"
@@ -305,8 +307,8 @@
tests<unsigned long long>();
#if defined(_LIBCPP_VERSION) // extension
- tests<int8_t>();
- tests<uint8_t>();
+ tests<std::int8_t>();
+ tests<std::uint8_t>();
#if !defined(TEST_HAS_NO_INT128)
tests<__int128_t>();
tests<__uint128_t>();
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval_param.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval_param.pass.cpp
index f058e68..cee3dbf 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval_param.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval_param.pass.cpp
@@ -15,11 +15,10 @@
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
+#include <cassert>
+#include <cstdlib>
#include <random>
#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
int main(int, char**)
{
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
index c24d1a4..e11b235 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
@@ -40,7 +40,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
@@ -60,7 +60,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -103,7 +103,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
@@ -123,7 +123,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -166,7 +166,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 0, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
@@ -186,7 +186,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -229,7 +229,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
@@ -249,7 +249,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -292,7 +292,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 0, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -312,7 +312,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -355,7 +355,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 25, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -375,7 +375,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -418,7 +418,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 0, 1};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -438,7 +438,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -481,7 +481,7 @@
G g;
double b[] = {10, 14, 16};
double p[] = {75, 25};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -501,7 +501,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -544,7 +544,7 @@
G g;
double b[] = {10, 14, 16};
double p[] = {0, 25};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -564,7 +564,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -607,7 +607,7 @@
G g;
double b[] = {10, 14, 16};
double p[] = {1, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -627,7 +627,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
@@ -670,7 +670,7 @@
G g;
double b[] = {10, 14};
double p[] = {1};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
@@ -690,7 +690,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
index d9f2628..d3964ce 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
@@ -42,7 +42,7 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d;
P pa(b, b+Np+1, p);
const int N = 1000000;
@@ -63,7 +63,7 @@
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
- const size_t Ni = ub - lb;
+ const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
index db7c0d6..e3458fe 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
@@ -25,7 +25,7 @@
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
P pa(b, b+Np+1, p);
D d(pa);
assert(d.param() == pa);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
index 72a66c7..f173d6b 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
@@ -35,7 +35,7 @@
typedef std::piecewise_constant_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d1(b, b+Np+1, p);
std::ostringstream os;
os << d1;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
index fe0c23f..f0bca2a 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
@@ -24,7 +24,7 @@
typedef std::piecewise_constant_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
assert(d.max() == 17);
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
index 533f3e2..060c4ee 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
@@ -24,7 +24,7 @@
typedef std::piecewise_constant_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
assert(d.min() == 10);
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
index a97708d..a7074a8 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
@@ -26,7 +26,7 @@
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np+1, p);
P p1;
p1 = p0;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
index 80b442a..1d44416 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
@@ -26,7 +26,7 @@
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np+1, p);
P p1 = p0;
assert(p1 == p0);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
index ea8924e..e551c8c 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
@@ -47,11 +47,11 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 1, 1, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -65,16 +65,16 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -99,11 +99,11 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 0, 1, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -117,16 +117,16 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -151,11 +151,11 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {1, 0, 0, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
- const size_t N = 1000000;
+ const std::size_t N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -169,16 +169,16 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -203,11 +203,11 @@
G g;
double b[] = {10, 14, 16};
double p[] = {0, 1, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -221,16 +221,16 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -256,11 +256,11 @@
G g;
double b[] = {10, 14};
double p[] = {1, 1};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -274,17 +274,17 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
assert(i < Np);
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -310,11 +310,11 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -328,16 +328,16 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
index 9c9365f..605b119 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
@@ -48,12 +48,12 @@
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+ const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d;
P pa(b, b+Np+1, p);
- const size_t N = 1000000;
+ const std::size_t N = 1000000;
std::vector<D::result_type> u;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g, pa);
assert(10 <= v && v < 17);
@@ -67,16 +67,16 @@
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (size_t i = 0; i < areas.size(); ++i)
+ for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (size_t i = 0; i < Np+1; ++i)
+ for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (size_t i = 0; i < N; ++i)
+ for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
index b9450c0..5c36008 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
@@ -25,7 +25,7 @@
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 10};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
P pa(b, b+Np, p);
D d(pa);
assert(d.param() == pa);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
index e3983b9..8a0a8ff 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
@@ -35,7 +35,7 @@
typedef std::piecewise_linear_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 25};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d1(b, b+Np, p);
std::ostringstream os;
os << d1;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
index e0c6857..b37ab29 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
@@ -24,7 +24,7 @@
typedef std::piecewise_linear_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np, p);
assert(d.max() == 17);
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
index a0ec322..51b555e 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
@@ -24,7 +24,7 @@
typedef std::piecewise_linear_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 0};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np, p);
assert(d.min() == 10);
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
index 47b5c28..ff9e317 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
@@ -26,7 +26,7 @@
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 2};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np, p);
P p1;
p1 = p0;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
index b88d9c2..15a8466 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
@@ -26,7 +26,7 @@
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 5};
- const size_t Np = sizeof(p) / sizeof(p[0]);
+ const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np, p);
P p1 = p0;
assert(p1 == p0);
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
index d636c4c..669f90d 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
@@ -15,12 +15,13 @@
// template<class _URNG> result_type operator()(_URNG& g);
-#include <random>
#include <cassert>
#include <climits>
#include <cstddef>
+#include <cstdint>
#include <limits>
#include <numeric>
+#include <random>
#include <vector>
#include "test_macros.h"
@@ -123,8 +124,8 @@
test_statistics<short, std::minstd_rand0>(SHRT_MIN, SHRT_MAX);
#if defined(_LIBCPP_VERSION) // extension
- test_statistics<int8_t, std::minstd_rand0>();
- test_statistics<uint8_t, std::minstd_rand0>();
+ test_statistics<std::int8_t, std::minstd_rand0>();
+ test_statistics<std::uint8_t, std::minstd_rand0>();
#if !defined(TEST_HAS_NO_INT128) && !defined(TEST_BUGGY_I128_FP)
test_statistics<__int128_t, std::minstd_rand0>();
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/int128.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/int128.pass.cpp
index 9b52205..9d499db 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/int128.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/int128.pass.cpp
@@ -15,10 +15,11 @@
// template<class _URNG> result_type operator()(_URNG& g);
-#include <random>
#include <cassert>
+#include <cstdint>
#include <limits>
+#include <random>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp
index a814056..02df034 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp
@@ -267,8 +267,8 @@
test1();
test2();
- test_implicit<std::mt19937, uint_fast32_t>();
- test_implicit<std::mt19937_64, uint_fast64_t>();
+ test_implicit<std::mt19937, std::uint_fast32_t>();
+ test_implicit<std::mt19937_64, std::uint_fast64_t>();
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/ctor_result_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/ctor_result_type.pass.cpp
index 291dbf7..3c7ab48 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/ctor_result_type.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/ctor_result_type.pass.cpp
@@ -76,8 +76,8 @@
static_assert(test_convertible<std::ranlux48_base>(), "");
test_implicit_ctor<std::ranlux24_base>();
test_implicit_ctor<std::ranlux48_base>();
- static_assert(!test_convertible<std::ranlux24_base, uint_fast32_t>(), "");
- static_assert(!test_convertible<std::ranlux48_base, uint_fast64_t>(), "");
+ static_assert(!test_convertible<std::ranlux24_base, std::uint_fast32_t>(), "");
+ static_assert(!test_convertible<std::ranlux48_base, std::uint_fast64_t>(), "");
#endif
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
index bfda9b7..9f2fe28 100644
--- a/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
@@ -140,5 +140,3 @@
static constexpr unsigned char max() { return 1; }
};
static_assert(std::uniform_random_bit_generator<Works>);
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/iterator_robust_against_adl.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/iterator_robust_against_adl.compile.pass.cpp
new file mode 100644
index 0000000..09b77c0
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/ranges/iterator_robust_against_adl.compile.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+// UNSUPPORTED: !c++experimental
+
+// ADL call with nested iterators of views should not look up base's view's
+// namespace
+
+#include <ranges>
+#include <tuple>
+
+#include "test_macros.h"
+
+#ifndef TEST_HAS_NO_LOCALIZATION
+#include <istream>
+#endif
+namespace adl {
+
+struct BaseView : std::ranges::view_base {
+ int* begin() const;
+ int* end() const;
+};
+
+struct TupleView : std::ranges::view_base {
+ std::tuple<int>* begin() const;
+ std::tuple<int>* end() const;
+};
+
+struct NestedView : std::ranges::view_base {
+ BaseView* begin() const;
+ BaseView* end() const;
+};
+
+struct Pred {
+ bool operator()(const auto&...) const;
+};
+
+struct Sentinel {
+ bool operator==(const auto&) const;
+};
+
+struct Value {
+ friend std::istream& operator>>(std::istream&, Value);
+};
+
+void adl_func(const auto&);
+
+} // namespace adl
+
+template <class View>
+concept CanFindADLFunc = requires(std::ranges::iterator_t<View> it) { adl_func(it); };
+
+static_assert(!CanFindADLFunc<std::ranges::elements_view<adl::TupleView, 0>>);
+static_assert(!CanFindADLFunc<std::ranges::filter_view<adl::BaseView, adl::Pred>>);
+static_assert(!CanFindADLFunc<std::ranges::iota_view<int, adl::Sentinel>>);
+
+#ifndef TEST_HAS_NO_LOCALIZATION
+static_assert(!CanFindADLFunc<std::ranges::istream_view<adl::Value>>);
+#endif
+
+static_assert(!CanFindADLFunc<std::ranges::join_view<adl::NestedView>>);
+
+static_assert(!CanFindADLFunc<std::ranges::lazy_split_view<adl::BaseView, adl::BaseView>>);
+using InnerRange =
+ typename std::ranges::iterator_t<std::ranges::lazy_split_view<adl::BaseView, adl::BaseView>>::value_type;
+static_assert(!CanFindADLFunc<InnerRange >);
+
+static_assert(!CanFindADLFunc<std::ranges::split_view<adl::BaseView, adl::BaseView>>);
+static_assert(!CanFindADLFunc<std::ranges::transform_view<adl::BaseView, adl::Pred>>);
+
+#if TEST_STD_VER >= 23
+static_assert(!CanFindADLFunc<std::ranges::zip_view<adl::BaseView>>);
+#endif
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.access/empty.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.access/empty.pass.cpp
index 4ff1f3b..990b75b 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.access/empty.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.access/empty.pass.cpp
@@ -87,13 +87,13 @@
}
struct SizeMember {
- size_t size_;
- constexpr size_t size() const { return size_; }
+ std::size_t size_;
+ constexpr std::size_t size() const { return size_; }
};
struct SizeFunction {
- size_t size_;
- friend constexpr size_t size(SizeFunction sf) { return sf.size_; }
+ std::size_t size_;
+ friend constexpr std::size_t size(SizeFunction sf) { return sf.size_; }
};
struct BeginEndSizedSentinel {
@@ -131,7 +131,7 @@
struct DisabledSizeRangeWithBeginEnd {
constexpr int *begin() const { return nullptr; }
constexpr auto end() const { return sentinel_wrapper<int*>(nullptr); }
- size_t size() const;
+ std::size_t size() const;
};
template<>
inline constexpr bool std::ranges::disable_sized_range<DisabledSizeRangeWithBeginEnd> = true;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.access/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.access/size.pass.cpp
index 0568173..fd7d0a8 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.access/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.access/size.pass.cpp
@@ -35,23 +35,23 @@
static_assert(std::ranges::size(static_cast<const Incomplete(&&)[42]>(array_of_incomplete)) == 42);
struct SizeMember {
- constexpr size_t size() { return 42; }
+ constexpr std::size_t size() { return 42; }
};
struct StaticSizeMember {
- constexpr static size_t size() { return 42; }
+ constexpr static std::size_t size() { return 42; }
};
static_assert(!std::is_invocable_v<RangeSizeT, const SizeMember>);
struct SizeFunction {
- friend constexpr size_t size(SizeFunction) { return 42; }
+ friend constexpr std::size_t size(SizeFunction) { return 42; }
};
// Make sure the size member is preferred.
struct SizeMemberAndFunction {
- constexpr size_t size() { return 42; }
- friend constexpr size_t size(SizeMemberAndFunction) { return 0; }
+ constexpr std::size_t size() { return 42; }
+ friend constexpr std::size_t size(SizeMemberAndFunction) { return 0; }
};
bool constexpr testArrayType() {
@@ -61,19 +61,19 @@
SizeFunction d[4];
assert(std::ranges::size(a) == 4);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), std::size_t);
assert(std::ranges::size(b) == 1);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(b)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(b)), std::size_t);
assert(std::ranges::size(c) == 4);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(c)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(c)), std::size_t);
assert(std::ranges::size(d) == 4);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), std::size_t);
return true;
}
struct SizeMemberConst {
- constexpr size_t size() const { return 42; }
+ constexpr std::size_t size() const { return 42; }
};
struct SizeMemberSigned {
@@ -82,7 +82,7 @@
bool constexpr testHasSizeMember() {
assert(std::ranges::size(SizeMember()) == 42);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMember())), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMember())), std::size_t);
const SizeMemberConst sizeMemberConst;
assert(std::ranges::size(sizeMemberConst) == 42);
@@ -93,7 +93,7 @@
ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMemberSigned())), long);
assert(std::ranges::size(StaticSizeMember()) == 42);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(StaticSizeMember())), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(StaticSizeMember())), std::size_t);
return true;
}
@@ -103,25 +103,25 @@
MoveOnlySizeFunction(MoveOnlySizeFunction &&) = default;
MoveOnlySizeFunction(MoveOnlySizeFunction const&) = delete;
- friend constexpr size_t size(MoveOnlySizeFunction) { return 42; }
+ friend constexpr std::size_t size(MoveOnlySizeFunction) { return 42; }
};
enum EnumSizeFunction {
a, b
};
-constexpr size_t size(EnumSizeFunction) { return 42; }
+constexpr std::size_t size(EnumSizeFunction) { return 42; }
struct SizeFunctionConst {
- friend constexpr size_t size(const SizeFunctionConst) { return 42; }
+ friend constexpr std::size_t size(const SizeFunctionConst) { return 42; }
};
struct SizeFunctionRef {
- friend constexpr size_t size(SizeFunctionRef&) { return 42; }
+ friend constexpr std::size_t size(SizeFunctionRef&) { return 42; }
};
struct SizeFunctionConstRef {
- friend constexpr size_t size(SizeFunctionConstRef const&) { return 42; }
+ friend constexpr std::size_t size(SizeFunctionConstRef const&) { return 42; }
};
struct SizeFunctionSigned {
@@ -130,7 +130,7 @@
bool constexpr testHasSizeFunction() {
assert(std::ranges::size(SizeFunction()) == 42);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeFunction())), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeFunction())), std::size_t);
static_assert(!std::is_invocable_v<RangeSizeT, MoveOnlySizeFunction>);
assert(std::ranges::size(EnumSizeFunction()) == 42);
assert(std::ranges::size(SizeFunctionConst()) == 42);
@@ -159,7 +159,7 @@
};
struct Convertible {
- operator size_t();
+ operator std::size_t();
};
struct ConvertibleReturnTypeMember {
@@ -188,14 +188,14 @@
static_assert(!std::is_invocable_v<RangeSizeT, BoolReturnTypeFunction const&>);
struct SizeMemberDisabled {
- size_t size() { return 42; }
+ std::size_t size() { return 42; }
};
template <>
inline constexpr bool std::ranges::disable_sized_range<SizeMemberDisabled> = true;
struct ImproperlyDisabledMember {
- size_t size() const { return 42; }
+ std::size_t size() const { return 42; }
};
// Intentionally disabling "const ConstSizeMemberDisabled". This doesn't disable anything
@@ -204,14 +204,14 @@
inline constexpr bool std::ranges::disable_sized_range<const ImproperlyDisabledMember> = true;
struct SizeFunctionDisabled {
- friend size_t size(SizeFunctionDisabled) { return 42; }
+ friend std::size_t size(SizeFunctionDisabled) { return 42; }
};
template <>
inline constexpr bool std::ranges::disable_sized_range<SizeFunctionDisabled> = true;
struct ImproperlyDisabledFunction {
- friend size_t size(ImproperlyDisabledFunction const&) { return 42; }
+ friend std::size_t size(ImproperlyDisabledFunction const&) { return 42; }
};
template <>
@@ -224,7 +224,7 @@
// No begin end.
struct HasMinusOperator {
- friend constexpr size_t operator-(HasMinusOperator, HasMinusOperator) { return 2; }
+ friend constexpr std::size_t operator-(HasMinusOperator, HasMinusOperator) { return 2; }
};
static_assert(!std::is_invocable_v<RangeSizeT, HasMinusOperator>);
@@ -277,7 +277,7 @@
int buff[8];
constexpr int* begin() { return buff; }
constexpr int* end() { return buff + 8; }
- constexpr size_t size() { return 1; }
+ constexpr std::size_t size() { return 1; }
};
template <>
@@ -287,14 +287,14 @@
int buff[8];
constexpr int* begin() { return buff; }
constexpr int* end() { return buff + 8; }
- constexpr size_t size() { return 1; }
+ constexpr std::size_t size() { return 1; }
};
constexpr bool testRanges() {
HasMinusBeginEnd a;
assert(std::ranges::size(a) == 2);
// Ensure that this is converted to an *unsigned* type.
- ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), std::size_t);
IntPtrBeginAndEnd b;
assert(std::ranges::size(b) == 8);
@@ -304,7 +304,7 @@
RandomAccessRange d;
assert(std::ranges::size(d) == 2);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), std::size_t);
SizeBeginAndEndMembers e;
assert(std::ranges::size(e) == 1);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.access/ssize.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.access/ssize.pass.cpp
index be35fe2..ac2c5b7 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.access/ssize.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.access/ssize.pass.cpp
@@ -24,12 +24,12 @@
static_assert( std::is_invocable_v<RangeSSizeT, int (&)[1]>);
struct SizeMember {
- constexpr size_t size() { return 42; }
+ constexpr std::size_t size() { return 42; }
};
static_assert(!std::is_invocable_v<decltype(std::ranges::ssize), const SizeMember&>);
struct SizeFunction {
- friend constexpr size_t size(SizeFunction) { return 42; }
+ friend constexpr std::size_t size(SizeFunction) { return 42; }
};
struct SizeFunctionSigned {
@@ -47,7 +47,7 @@
};
// size_t changes depending on the platform.
-using SignedSizeT = std::make_signed_t<size_t>;
+using SignedSizeT = std::make_signed_t<std::size_t>;
constexpr bool test() {
int a[4];
@@ -71,7 +71,7 @@
// This gets converted to ptrdiff_t because it's wider.
ShortUnsignedReturnType c;
assert(std::ranges::ssize(c) == 42);
- ASSERT_SAME_TYPE(decltype(std::ranges::ssize(c)), ptrdiff_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::ssize(c)), std::ptrdiff_t);
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/begin.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/begin.pass.cpp
index 684cdd8..db846b2 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/begin.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/begin.pass.cpp
@@ -84,14 +84,14 @@
};
constexpr bool test() {
- meta::for_each(meta::cpp20_input_iterator_list<int*>{}, []<class Iter> {
+ types::for_each(types::cpp20_input_iterator_list<int*>{}, []<class Iter> {
if constexpr (std::sentinel_for<Iter, Iter>)
test_range<Iter, Iter>();
test_range<Iter, sentinel_wrapper<Iter>>();
test_range<Iter, sized_sentinel<Iter>>();
});
- meta::for_each(meta::forward_iterator_list<const int*>{}, []<class Iter> {
+ types::for_each(types::forward_iterator_list<const int*>{}, []<class Iter> {
test_const_range<Iter, Iter>();
test_const_range<Iter, sentinel_wrapper<Iter>>();
test_const_range<Iter, sized_sentinel<Iter>>();
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
index 4832139..d9b14e4 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/ctor.pass.cpp
@@ -12,6 +12,7 @@
#include <cassert>
#include <ranges>
+#include <type_traits>
#include <vector>
struct DefaultConstructibleView : std::ranges::view_base {
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/end.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/end.pass.cpp
index eb79e14..529a609 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/end.pass.cpp
@@ -118,7 +118,7 @@
test_range<cpp20_input_iterator<int*>, sentinel_wrapper<cpp20_input_iterator<int*>>, false>();
test_range<cpp20_input_iterator<int*>, sized_sentinel<cpp20_input_iterator<int*>>, false>();
- meta::for_each(meta::forward_iterator_list<int*>{}, []<class Iter> {
+ types::for_each(types::forward_iterator_list<int*>{}, []<class Iter> {
test_range<Iter, Iter, true>();
test_range<Iter, sentinel_wrapper<Iter>, false>();
test_range<Iter, sized_sentinel<Iter>, false>();
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
index f330b41..3de1a93 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
@@ -20,7 +20,7 @@
int* begin() const;
int* end() const;
- constexpr size_t size() const {
+ constexpr std::size_t size() const {
*size_called = true;
return 3;
}
@@ -56,7 +56,7 @@
{
bool size_called = false;
std::ranges::as_rvalue_view view(ConstSizedView{{}, &size_called});
- std::same_as<size_t> auto size = view.size();
+ std::same_as<std::size_t> auto size = view.size();
assert(size == 3);
assert(size_called);
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
index 71014f1..e55121f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
@@ -46,7 +46,7 @@
{
static_assert(std::addressof(std::views::counted) == std::addressof(std::ranges::views::counted));
- static_assert( CountedInvocable<int*, size_t>);
+ static_assert( CountedInvocable<int*, std::size_t>);
static_assert(!CountedInvocable<int*, LvalueConvertible>);
static_assert( CountedInvocable<int*, LvalueConvertible&>);
static_assert( CountedInvocable<int*, RvalueConvertible>);
@@ -54,7 +54,7 @@
static_assert(!CountedInvocable<int*, OnlyExplicitlyConvertible>);
static_assert(!CountedInvocable<int*, int*>);
static_assert(!CountedInvocable<int*>);
- static_assert(!CountedInvocable<size_t>);
+ static_assert(!CountedInvocable<std::size_t>);
static_assert(!CountedInvocable<>);
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop.while/ctor.view.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop.while/ctor.view.pass.cpp
index cf9f9db..326cabd 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop.while/ctor.view.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop.while/ctor.view.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr drop_while_view(V base, Pred pred);
+// constexpr drop_while_view(V base, Pred pred); // explicit since C++23
#include <cassert>
#include <ranges>
@@ -16,6 +16,8 @@
#include <utility>
#include "MoveOnly.h"
+#include "test_convertible.h"
+#include "test_macros.h"
struct View : std::ranges::view_base {
MoveOnly mo;
@@ -32,9 +34,23 @@
bool operator()(int) const;
};
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::drop_while_view<View, Pred>, View, Pred>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert( test_convertible<std::ranges::drop_while_view<View, Pred>, View, Pred>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
- std::ranges::drop_while_view<View, Pred> dwv = {View{{}, MoveOnly{5}}, Pred{}};
+ std::ranges::drop_while_view<View, Pred> dwv{View{{}, MoveOnly{5}}, Pred{}};
assert(dwv.pred().moved);
assert(!dwv.pred().copied);
assert(std::move(dwv).base().mo.get() == 5);
@@ -45,5 +61,6 @@
int main(int, char**) {
test();
static_assert(test());
+
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
index 6dd90c5..542f2cd 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
@@ -47,7 +47,7 @@
constexpr auto begin() const { return iterator(begin_); }
constexpr auto end() const { return sentinel(iterator(end_)); }
- constexpr size_t size() const { return end_ - begin_; }
+ constexpr std::size_t size() const { return end_ - begin_; }
};
static_assert(std::ranges::random_access_range<SizedViewWithUnsizedSentinel>);
static_assert(std::ranges::sized_range<SizedViewWithUnsizedSentinel>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
index 5d08c70..cff0884 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
@@ -37,7 +37,7 @@
return nullptr;
}
constexpr int* end() const { return nullptr; }
- constexpr size_t size() const { return 0; }
+ constexpr std::size_t size() const { return 0; }
};
using SimpleView = MaybeSimpleView<true>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
index 504021a..4f4257f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
@@ -8,13 +8,28 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr drop_view(V base, range_difference_t<V> count);
+// constexpr drop_view(V base, range_difference_t<V> count); // explicit since C++23
#include <ranges>
+#include "test_convertible.h"
#include "test_macros.h"
#include "types.h"
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::drop_view<View>, View, std::ranges::range_difference_t<View>>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert(test_convertible<std::ranges::drop_view<View>, View, std::ranges::range_difference_t<View>>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
std::ranges::drop_view dropView1(MoveOnlyView(), 4);
assert(dropView1.size() == 4);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/types.h
index b32c534..32bbddc 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.drop/types.h
@@ -94,4 +94,15 @@
constexpr CountedIter end() const { return CountedIter(ForwardIter(globalBuff + 8)); }
};
+struct View : std::ranges::view_base {
+ constexpr explicit View(int* b, int* e) : begin_(b), end_(e) { }
+
+ constexpr int* begin() const { return begin_; }
+ constexpr int* end() const { return end_; }
+
+private:
+ int* begin_;
+ int* end_;
+};
+
#endif // TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_DROP_TYPES_H
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
index 62aa9b2..11da484 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
@@ -29,7 +29,7 @@
sentinel_wrapper<cpp20_input_iterator<std::tuple<int>*>> end() const;
};
-template <class View, size_t N>
+template <class View, std::size_t N>
using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<View, N>>;
static_assert(!std::default_initializable<ElementsIter<IterNoDefaultCtrView, 0>>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.other.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.other.pass.cpp
index 6756474..4c94cd5 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.other.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.other.pass.cpp
@@ -21,7 +21,7 @@
struct ConvertibleIter : IterBase<ConvertibleIter<Const>> {
using iterator_category = std::random_access_iterator_tag;
using value_type = std::tuple<int>;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
bool movedFromOtherConst = false;
int i = 0;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
index 67ec179..9a76c2f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
@@ -20,7 +20,7 @@
template <class Iter>
using Range = std::ranges::subrange<Iter, sentinel_wrapper<Iter>>;
-template <class Range, size_t N = 0>
+template <class Range, std::size_t N = 0>
using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<Range, N>>;
// using iterator_concept = see below;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
index 021f028..7de72ec 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
@@ -35,7 +35,7 @@
template <class It>
using Range = std::ranges::subrange<It, sentinel_wrapper<It>>;
-template <class V, size_t N>
+template <class V, std::size_t N>
concept HasElementsView = requires { typename std::ranges::elements_view<V, N>; };
static_assert(HasElementsView<Range<std::ranges::subrange<int*>*>, 0>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/equality.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/equality.pass.cpp
index 55477cc..df95e07 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/equality.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/equality.pass.cpp
@@ -23,7 +23,7 @@
std::tuple<int>* it_;
using value_type = std::tuple<int>;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
using iterator_concept = std::input_iterator_tag;
constexpr decltype(auto) operator*() const { return *it_; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/minus.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/minus.pass.cpp
index 9af7b09..343bf80 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/minus.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/minus.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <concepts>
+#include <cstddef>
#include <functional>
#include <ranges>
#include <tuple>
@@ -31,7 +32,7 @@
std::tuple<int>* it_;
using value_type = std::tuple<int>;
- using difference_type = intptr_t;
+ using difference_type = std::ptrdiff_t;
using iterator_concept = std::input_iterator_tag;
constexpr decltype(auto) operator*() const { return *it_; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/types.h
index a1c0884..f1ee165 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.elements/types.h
@@ -93,7 +93,7 @@
struct IterBase {
using iterator_concept = std::random_access_iterator_tag;
using value_type = std::tuple<int>;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
constexpr std::tuple<int> operator*() const { return std::tuple<int>(5); }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/ctor.view_pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/ctor.view_pred.pass.cpp
index 644f8de..3ccab93 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/ctor.view_pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/ctor.view_pred.pass.cpp
@@ -8,12 +8,14 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr filter_view(View, Pred);
-
-#include <ranges>
+// constexpr filter_view(View, Pred); // explicit since C++23
#include <cassert>
+#include <ranges>
#include <utility>
+
+#include "test_convertible.h"
+#include "test_macros.h"
#include "types.h"
struct Range : std::ranges::view_base {
@@ -41,6 +43,20 @@
int* end() const;
};
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::filter_view<Range, Pred>, Range, Pred>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert( test_convertible<std::ranges::filter_view<Range, Pred>, Range, Pred>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
int buff[] = {1, 2, 3, 4, 5, 6, 7, 8};
@@ -57,19 +73,6 @@
assert(it == end);
}
- // Test implicit syntax
- {
- Range range(buff, buff + 8);
- Pred pred;
- std::ranges::filter_view<Range, Pred> view = {range, pred};
- auto it = view.begin(), end = view.end();
- assert(*it++ == 1);
- assert(*it++ == 3);
- assert(*it++ == 5);
- assert(*it++ == 7);
- assert(it == end);
- }
-
// Make sure we move the view
{
bool moved = false, copied = false;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
index 500d875..71d16e4 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// This test is hitting Clang bugs with LSV in older versions of Clang.
+// UNSUPPORTED: modules-build && (clang-15 || apple-clang-14)
+
// UNSUPPORTED: c++03, c++11, c++14, c++17
// constexpr iterator_t<V> operator->() const
@@ -22,7 +25,7 @@
#include "test_macros.h"
#include "../types.h"
-struct Point {
+struct XYPoint {
int x;
int y;
};
@@ -31,21 +34,21 @@
concept has_arrow = requires (T t) {
{ t->x };
};
-static_assert(has_arrow<Point*>); // test the test
+static_assert(has_arrow<XYPoint*>); // test the test
struct WithArrowOperator {
using iterator_category = std::input_iterator_tag;
using difference_type = std::ptrdiff_t;
- using value_type = Point;
+ using value_type = XYPoint;
- constexpr explicit WithArrowOperator(Point* p) : p_(p) { }
- constexpr Point& operator*() const { return *p_; }
- constexpr Point* operator->() const { return p_; } // has arrow
+ constexpr explicit WithArrowOperator(XYPoint* p) : p_(p) { }
+ constexpr XYPoint& operator*() const { return *p_; }
+ constexpr XYPoint* operator->() const { return p_; } // has arrow
constexpr WithArrowOperator& operator++() { ++p_; return *this; }
constexpr WithArrowOperator operator++(int) { return WithArrowOperator(p_++); }
- friend constexpr Point* base(WithArrowOperator const& i) { return i.p_; }
- Point* p_;
+ friend constexpr XYPoint* base(WithArrowOperator const& i) { return i.p_; }
+ XYPoint* p_;
};
static_assert(std::input_iterator<WithArrowOperator>);
@@ -53,29 +56,29 @@
struct iterator {
using iterator_category = std::input_iterator_tag;
using difference_type = std::ptrdiff_t;
- using value_type = Point;
+ using value_type = XYPoint;
iterator(iterator const&) = delete; // not copyable
iterator(iterator&&);
iterator& operator=(iterator&&);
- Point& operator*() const;
+ XYPoint& operator*() const;
iterator operator->() const;
iterator& operator++();
iterator operator++(int);
- // We need this to use Point* as a sentinel type below. sentinel_wrapper
+ // We need this to use XYPoint* as a sentinel type below. sentinel_wrapper
// can't be used because this iterator is not copyable.
- friend bool operator==(iterator const&, Point*);
+ friend bool operator==(iterator const&, XYPoint*);
};
iterator begin() const;
- Point* end() const;
+ XYPoint* end() const;
};
static_assert(std::ranges::input_range<WithNonCopyableIterator>);
template <class Iterator, class Sentinel = sentinel_wrapper<Iterator>>
constexpr void test() {
- std::array<Point, 5> array{{{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}}};
+ std::array<XYPoint, 5> array{{{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}}};
using View = minimal_view<Iterator, Sentinel>;
using FilterView = std::ranges::filter_view<View, AlwaysTrue>;
using FilterIterator = std::ranges::iterator_t<FilterView>;
@@ -97,10 +100,10 @@
constexpr bool tests() {
test<WithArrowOperator>();
- test<Point*>();
- test<Point const*>();
- test<contiguous_iterator<Point*>>();
- test<contiguous_iterator<Point const*>>();
+ test<XYPoint*>();
+ test<XYPoint const*>();
+ test<contiguous_iterator<XYPoint*>>();
+ test<contiguous_iterator<XYPoint const*>>();
// Make sure filter_view::iterator doesn't have operator-> if the
// underlying iterator doesn't have one.
@@ -111,11 +114,11 @@
using FilterIterator = std::ranges::iterator_t<FilterView>;
static_assert(!has_arrow<FilterIterator>);
};
- check_no_arrow.operator()<cpp17_input_iterator<Point*>>();
- check_no_arrow.operator()<cpp20_input_iterator<Point*>>();
- check_no_arrow.operator()<forward_iterator<Point*>>();
- check_no_arrow.operator()<bidirectional_iterator<Point*>>();
- check_no_arrow.operator()<random_access_iterator<Point*>>();
+ check_no_arrow.operator()<cpp17_input_iterator<XYPoint*>>();
+ check_no_arrow.operator()<cpp20_input_iterator<XYPoint*>>();
+ check_no_arrow.operator()<forward_iterator<XYPoint*>>();
+ check_no_arrow.operator()<bidirectional_iterator<XYPoint*>>();
+ check_no_arrow.operator()<random_access_iterator<XYPoint*>>();
check_no_arrow.operator()<int*>();
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/adaptor.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/adaptor.pass.cpp
index 9beb3d2..afaf322 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/adaptor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/adaptor.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// std::views::join
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/base.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/base.pass.cpp
index caf018b..13883e8 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/base.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/base.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr V base() const& requires copy_constructible<V>;
// constexpr V base() &&;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/begin.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/begin.pass.cpp
index 332973d..9e4fa5f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/begin.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/begin.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr auto begin();
// constexpr auto begin() const
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
index a8eafc5..2c47099 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// template<class R>
// explicit join_view(R&&) -> join_view<views::all_t<R>>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.verify.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.verify.cpp
index 2c6eea5..eddc950 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.verify.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// template<class R>
// explicit join_view(R&&) -> join_view<views::all_t<R>>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.default.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.default.pass.cpp
index 0daff7d..26206e3 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.default.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// join_view() requires default_initializable<V> = default;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.view.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.view.pass.cpp
index 75d4c7e..ce53930 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.view.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.view.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr explicit join_view(V base);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp
index 5e49618..7e22520 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr auto end();
// constexpr auto end() const;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/general.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/general.pass.cpp
index f92eb41..e9eab58 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/general.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/general.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// General tests for join_view. This file does not test anything specifically.
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/arrow.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/arrow.pass.cpp
index ddcf66b..e610cde 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/arrow.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/arrow.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr InnerIter operator->() const
// requires has-arrow<InnerIter> && copyable<InnerIter>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp
index 2f9bbb2..e4f193e 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// iterator() requires default_initializable<OuterIter> = default;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.other.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.other.pass.cpp
index 76abcd4..a0406f9 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.other.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.other.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr iterator(iterator<!Const> i)
// requires Const &&
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
index 7cca16a..215318f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr iterator(Parent& parent, OuterIter outer);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/decrement.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/decrement.pass.cpp
index eb2c34c..4363fb0 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/decrement.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/decrement.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr iterator& operator--();
// requires ref-is-glvalue && bidirectional_range<Base> &&
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/eq.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/eq.pass.cpp
index 4885f16..327cc82 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/eq.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/eq.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// friend constexpr bool operator==(const iterator& x, const iterator& y);
// requires ref-is-glvalue && equality_comparable<iterator_t<Base>> &&
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/increment.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/increment.pass.cpp
index f46edd3..4bcb4de 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/increment.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/increment.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr iterator& operator++();
// constexpr void operator++(int);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp
index 917e72d..0bf6aa3 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// friend constexpr decltype(auto) iter_move(const iterator& i);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.swap.pass.cpp
index 28e1bf7..e9b73f1 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.swap.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// friend constexpr void iter_swap(const iterator& x, const iterator& y);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/member_types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/member_types.compile.pass.cpp
index b9b9d73..17b98fa 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/member_types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/member_types.compile.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// Iterator traits and member typedefs in join_view::<iterator>.
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/star.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/star.pass.cpp
index 73457b8..fa6f7bb 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/star.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/star.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr decltype(auto) operator*() const;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.default.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.default.pass.cpp
index 42fcc73..0eebe14 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.default.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// sentinel() = default;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.other.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.other.pass.cpp
index 4bd8025..c2d7058 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.other.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.other.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr sentinel(sentinel<!Const> s);
// requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.parent.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.parent.pass.cpp
index 1ac6827..a9df7c3 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.parent.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.parent.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// constexpr explicit sentinel(Parent& parent);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/eq.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/eq.pass.cpp
index 7852d1b..cbd03b8 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/eq.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/eq.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: !c++experimental
// template<bool OtherConst>
// requires sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/base.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/base.pass.cpp
index b9f2ac2..c08e996 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/base.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/base.pass.cpp
@@ -25,8 +25,8 @@
constexpr MoveOnlyView(std::string_view v) : view_(v) {}
constexpr MoveOnlyView(MoveOnlyView&&) = default;
constexpr MoveOnlyView& operator=(MoveOnlyView&&) = default;
- constexpr const char* begin() const { return view_.begin(); }
- constexpr const char* end() const { return view_.end(); }
+ constexpr std::string_view::const_iterator begin() const { return view_.begin(); }
+ constexpr std::string_view::const_iterator end() const { return view_.end(); }
constexpr bool operator==(MoveOnlyView rhs) const { return view_ == rhs.view_; }
};
static_assert( std::ranges::view<MoveOnlyView>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
index bf9dd99..a942f43 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
@@ -66,7 +66,7 @@
struct AlmostInputIterator {
using value_type = char;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
using iterator_concept = int;
constexpr const char& operator*() const;
@@ -169,7 +169,7 @@
struct AlmostTinyRange : std::ranges::view_base {
int* begin() const;
int* end() const;
- static size_t size() { return 1; }
+ static std::size_t size() { return 1; }
};
using View = InputView;
@@ -192,7 +192,7 @@
struct AlmostTinyRange : std::ranges::view_base {
int* begin() const;
int* end() const;
- constexpr static size_t size() { return 2; }
+ constexpr static std::size_t size() { return 2; }
};
using View = InputView;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.range.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.range.pass.cpp
index a822175..91df304 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.range.pass.cpp
@@ -11,7 +11,7 @@
// template <input_range Range>
// requires constructible_from<View, views::all_t<Range>> &&
// constructible_from<Pattern, single_view<range_value_t<Range>>>
-// constexpr lazy_split_view(Range&& r, range_value_t<Range> e);
+// constexpr lazy_split_view(Range&& r, range_value_t<Range> e); // explicit since C++23
#include <ranges>
@@ -20,6 +20,8 @@
#include <string_view>
#include <type_traits>
#include <utility>
+
+#include "test_convertible.h"
#include "types.h"
struct ElementWithCounting {
@@ -80,14 +82,30 @@
// C++23 and later.
template <std::ranges::range R>
constexpr StrView(R&& r) : buffer_(r.begin(), r.end()) {}
- constexpr const char* begin() const { return buffer_.begin(); }
- constexpr const char* end() const { return buffer_.end(); }
+ constexpr std::string_view::const_iterator begin() const { return buffer_.begin(); }
+ constexpr std::string_view::const_iterator end() const { return buffer_.end(); }
constexpr bool operator==(const StrView& rhs) const { return buffer_ == rhs.buffer_; }
};
static_assert( std::ranges::random_access_range<StrView>);
static_assert( std::ranges::view<StrView>);
static_assert( std::is_copy_constructible_v<StrView>);
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(
+ !test_convertible<std::ranges::lazy_split_view<StrView, StrView>, StrView, std::ranges::range_value_t<StrView>>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert(
+ test_convertible<std::ranges::lazy_split_view<StrView, StrView>, StrView, std::ranges::range_value_t<StrView>>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
using V = std::ranges::lazy_split_view<StrView, StrView>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.view.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.view.pass.cpp
index 264e883..e7bf052 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.view.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.view.pass.cpp
@@ -8,13 +8,14 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr lazy_split_view(View base, Pattern pattern);
-
-#include <ranges>
+// constexpr lazy_split_view(View base, Pattern pattern); // explicit since C++23
#include <cassert>
+#include <ranges>
#include <string_view>
#include <utility>
+
+#include "test_convertible.h"
#include "types.h"
struct ViewWithCounting : std::ranges::view_base {
@@ -41,9 +42,27 @@
constexpr ViewWithCounting& operator=(ViewWithCounting&&) = default;
constexpr bool operator==(const ViewWithCounting&) const { return true; }
};
+
static_assert(std::ranges::forward_range<ViewWithCounting>);
static_assert(std::ranges::view<ViewWithCounting>);
+using View = ViewWithCounting;
+using Pattern = ViewWithCounting;
+
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::lazy_split_view<View, Pattern>, View, Pattern>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert( test_convertible<std::ranges::lazy_split_view<View, Pattern>, View, Pattern>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
// Calling the constructor with `(ForwardView, ForwardView)`.
{
@@ -62,9 +81,6 @@
// Make sure the arguments are moved, not copied.
{
- using View = ViewWithCounting;
- using Pattern = ViewWithCounting;
-
// Arguments are lvalues.
{
int view_copied = 0, view_moved = 0, pattern_copied = 0, pattern_moved = 0;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/end.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/end.pass.cpp
index 690ac7c..0f5ab62 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/end.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/end.pass.cpp
@@ -29,8 +29,8 @@
constexpr ForwardViewCommonIfConst& operator=(const ForwardViewCommonIfConst&) = default;
constexpr forward_iterator<char*> begin() { return forward_iterator<char*>(nullptr); }
constexpr std::default_sentinel_t end() { return std::default_sentinel; }
- constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(view_.begin()); }
- constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(view_.end()); }
+ constexpr forward_iterator<std::string_view::const_iterator> begin() const { return forward_iterator<std::string_view::const_iterator>(view_.begin()); }
+ constexpr forward_iterator<std::string_view::const_iterator> end() const { return forward_iterator<std::string_view::const_iterator>(view_.end()); }
};
bool operator==(forward_iterator<char*>, std::default_sentinel_t) { return false; }
@@ -45,10 +45,10 @@
constexpr ForwardViewNonCommonRange& operator=(const ForwardViewNonCommonRange&) = default;
constexpr forward_iterator<char*> begin() { return forward_iterator<char*>(nullptr); }
constexpr std::default_sentinel_t end() { return std::default_sentinel; }
- constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(view_.begin()); }
+ constexpr forward_iterator<std::string_view::const_iterator> begin() const { return forward_iterator<std::string_view::const_iterator>(view_.begin()); }
constexpr std::default_sentinel_t end() const { return std::default_sentinel; }
};
-bool operator==(forward_iterator<const char*>, std::default_sentinel_t) { return false; }
+bool operator==(forward_iterator<std::string_view::const_iterator>, std::default_sentinel_t) { return false; }
constexpr bool test() {
// non-const: forward_range<V> && simple_view<V> && simple_view<P> -> outer-iterator<Const = true>
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
index 4214532..f4e87bb 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
@@ -75,13 +75,13 @@
return actual_it == view.end() && expected_it == expected.end();
}
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
constexpr bool test_function_call(T&& input, Separator&& separator, std::array<U, M> expected) {
std::ranges::lazy_split_view v(input, separator);
return is_equal(v, expected);
}
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
constexpr bool test_with_piping(T&& input, Separator&& separator, std::array<U, M> expected) {
auto expected_it = expected.begin();
for (auto e : input | std::ranges::views::lazy_split(separator)) {
@@ -166,7 +166,7 @@
return std::string_view(str);
};
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
constexpr void test_one(T&& input, Separator&& separator, std::array<U, M> expected) {
assert(test_function_call(input, separator, expected));
assert(test_with_piping(input, separator, expected));
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
index e4d9eba..45257f2 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
@@ -22,7 +22,7 @@
struct EmptyView : std::ranges::view_base {
constexpr int* begin() const { return nullptr; }
constexpr int* end() const { return nullptr; }
- constexpr static size_t size() { return 0; }
+ constexpr static std::size_t size() { return 0; }
};
static_assert(std::ranges::forward_range<EmptyView>);
static_assert(std::ranges::view<EmptyView>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_move.pass.cpp
index 3e56719..f9d2b3e 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_move.pass.cpp
@@ -23,7 +23,7 @@
template <bool IsNoexcept = false>
struct MaybeNoexceptIterator {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
value_type* ptr_ = nullptr;
int* iter_move_invocations_ = nullptr;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_swap.pass.cpp
index 7d0e8a7..18fd3a3 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_swap.pass.cpp
@@ -24,7 +24,7 @@
template <bool IsNoexcept = false>
struct MaybeNoexceptIterator {
using value_type = int;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
value_type* ptr_ = nullptr;
int* iter_swap_invocations_ = nullptr;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
index a606e91..f2878e8 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
@@ -10,6 +10,7 @@
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_LAZY_SPLIT_TYPES_H
#include <concepts>
+#include <cstddef>
#include <ranges>
#include <string>
#include <string_view>
@@ -24,8 +25,8 @@
constexpr explicit CopyableView() = default;
constexpr CopyableView(const char* ptr) : view_(ptr) {}
constexpr CopyableView(std::string_view v) : view_(v) {}
- constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(view_.begin()); }
- constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(view_.end()); }
+ constexpr forward_iterator<std::string_view::const_iterator> begin() const { return forward_iterator<std::string_view::const_iterator>(view_.begin()); }
+ constexpr forward_iterator<std::string_view::const_iterator> end() const { return forward_iterator<std::string_view::const_iterator>(view_.end()); }
constexpr bool operator==(const CopyableView& rhs) const { return view_ == rhs.view_; }
};
static_assert( std::ranges::forward_range<CopyableView>);
@@ -42,8 +43,8 @@
constexpr ForwardView(std::string_view v) : view_(v) {}
constexpr ForwardView(ForwardView&&) = default;
constexpr ForwardView& operator=(ForwardView&&) = default;
- constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(view_.begin()); }
- constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(view_.end()); }
+ constexpr forward_iterator<std::string_view::const_iterator> begin() const { return forward_iterator<std::string_view::const_iterator>(view_.begin()); }
+ constexpr forward_iterator<std::string_view::const_iterator> end() const { return forward_iterator<std::string_view::const_iterator>(view_.end()); }
};
static_assert( std::ranges::forward_range<ForwardView>);
static_assert( std::ranges::forward_range<const ForwardView>);
@@ -122,13 +123,13 @@
constexpr ForwardOnlyIfNonConstView(ForwardOnlyIfNonConstView&&) = default;
constexpr ForwardOnlyIfNonConstView& operator=(ForwardOnlyIfNonConstView&&) = default;
- constexpr forward_iterator<const char*> begin() { return forward_iterator<const char*>(view_.begin()); }
- constexpr forward_iterator<const char*> end() { return forward_iterator<const char*>(view_.end()); }
- constexpr almost_forward_iterator<const char*> begin() const {
- return almost_forward_iterator<const char*>(view_.begin());
+ constexpr forward_iterator<std::string_view::const_iterator> begin() { return forward_iterator<std::string_view::const_iterator>(view_.begin()); }
+ constexpr forward_iterator<std::string_view::const_iterator> end() { return forward_iterator<std::string_view::const_iterator>(view_.end()); }
+ constexpr almost_forward_iterator<std::string_view::const_iterator> begin() const {
+ return almost_forward_iterator<std::string_view::const_iterator>(view_.begin());
}
- constexpr almost_forward_iterator<const char*> end() const {
- return almost_forward_iterator<const char*>(view_.end());
+ constexpr almost_forward_iterator<std::string_view::const_iterator> end() const {
+ return almost_forward_iterator<std::string_view::const_iterator>(view_.end());
}
};
static_assert( std::ranges::forward_range<ForwardOnlyIfNonConstView>);
@@ -174,7 +175,7 @@
constexpr ForwardTinyView(char c) { *c_ = c; }
constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(c_); }
constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(c_ + 1); }
- constexpr static size_t size() { return 1; }
+ constexpr static std::size_t size() { return 1; }
};
static_assert(std::ranges::forward_range<ForwardTinyView>);
static_assert(std::ranges::view<ForwardTinyView>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
index d74b048..3d74bd2 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
@@ -23,9 +23,9 @@
template<CopyCategory CC>
struct BidirSizedRange : std::ranges::view_base {
int *ptr_;
- size_t size_;
+ std::size_t size_;
- constexpr BidirSizedRange(int *ptr, size_t size) : ptr_(ptr), size_(size) {}
+ constexpr BidirSizedRange(int *ptr, std::size_t size) : ptr_(ptr), size_(size) {}
constexpr BidirSizedRange(const BidirSizedRange &) requires (CC == Copyable) = default;
constexpr BidirSizedRange(BidirSizedRange &&) requires (CC == MoveOnly) = default;
constexpr BidirSizedRange& operator=(const BidirSizedRange &) requires (CC == Copyable) = default;
@@ -36,7 +36,7 @@
constexpr bidirectional_iterator<int*> end() { return bidirectional_iterator<int*>{ptr_ + 8}; }
constexpr bidirectional_iterator<const int*> end() const { return bidirectional_iterator<const int*>{ptr_ + 8}; }
- constexpr size_t size() const { return size_; }
+ constexpr std::size_t size() const { return size_; }
};
constexpr bool test() {
@@ -49,8 +49,8 @@
assert(rev.size() == 4);
assert(std::move(rev).size() == 4);
- ASSERT_SAME_TYPE(decltype(rev.size()), size_t);
- ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
+ ASSERT_SAME_TYPE(decltype(rev.size()), std::size_t);
+ ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
}
// Non-common, const bidirectional range.
{
@@ -59,15 +59,15 @@
assert(rev.size() == 4);
assert(std::move(rev).size() == 4);
- ASSERT_SAME_TYPE(decltype(rev.size()), size_t);
- ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
+ ASSERT_SAME_TYPE(decltype(rev.size()), std::size_t);
+ ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
}
// Non-common, non-const (move only) bidirectional range.
{
auto rev = std::ranges::reverse_view(BidirSizedRange<MoveOnly>{buffer, 4});
assert(std::move(rev).size() == 4);
- ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
+ ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
}
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.range.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.range.pass.cpp
index 605e3d5..bbe08be 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.range.pass.cpp
@@ -11,7 +11,7 @@
// template <input_range Range>
// requires constructible_from<View, views::all_t<Range>> &&
// constructible_from<Pattern, single_view<range_value_t<Range>>>
-// constexpr split_view(Range&& r, range_value_t<Range> e);
+// constexpr split_view(Range&& r, range_value_t<Range> e); // explicit since C++23
#include <algorithm>
#include <cassert>
@@ -21,6 +21,9 @@
#include <type_traits>
#include <utility>
+#include "test_convertible.h"
+#include "test_macros.h"
+
struct Counting {
int* times_copied = nullptr;
int* times_moved = nullptr;
@@ -68,6 +71,22 @@
static_assert(std::ranges::view<StrView>);
static_assert(std::is_copy_constructible_v<StrView>);
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(
+ !test_convertible<std::ranges::split_view<StrView, StrView>, StrView, std::ranges::range_value_t<StrView>>(),
+ "This constructor must be explicit");
+
+# else
+
+static_assert(
+ test_convertible<std::ranges::split_view<StrView, StrView>, StrView, std::ranges::range_value_t<StrView>>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
using V = std::ranges::split_view<StrView, StrView>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.view.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.view.pass.cpp
index ad206ee..963f85f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.view.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/ctor.view.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr split_view(View base, Pattern pattern);
+// constexpr split_view(View base, Pattern pattern); // explicit since C++23
#include <algorithm>
#include <cassert>
@@ -16,6 +16,9 @@
#include <string_view>
#include <utility>
+#include "test_convertible.h"
+#include "test_macros.h"
+
struct ViewWithCounting : std::ranges::view_base {
int* times_copied = nullptr;
int* times_moved = nullptr;
@@ -38,6 +41,23 @@
constexpr bool operator==(const ViewWithCounting&) const { return true; }
};
+using View = ViewWithCounting;
+using Pattern = ViewWithCounting;
+
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::split_view<View, Pattern>, View, Pattern>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert( test_convertible<std::ranges::split_view<View, Pattern>, View, Pattern>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
std::string_view input = "abc def";
@@ -48,9 +68,6 @@
// Make sure the arguments are moved, not copied.
{
- using View = ViewWithCounting;
- using Pattern = ViewWithCounting;
-
// Arguments are lvalues.
{
int view_copied = 0, view_moved = 0, pattern_copied = 0, pattern_moved = 0;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
index 8684e3b..5389d93 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
@@ -33,13 +33,13 @@
return std::ranges::equal(view, expected, std::ranges::equal);
}
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
constexpr bool test_function_call(T&& input, Separator&& separator, std::array<U, M> expected) {
std::ranges::split_view v(input, separator);
return is_equal(v, expected);
}
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
constexpr bool test_with_piping(T&& input, Separator&& separator, std::array<U, M> expected) {
auto expected_it = expected.begin();
for (auto e : input | std::ranges::views::split(separator)) {
@@ -124,7 +124,7 @@
return std::string_view(str);
};
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
constexpr void test_one(T&& input, Separator&& separator, std::array<U, M> expected) {
assert(test_function_call(input, separator, expected));
assert(test_with_piping(input, separator, expected));
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/types.h
index ff2ce38..aa47faf 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.split/types.h
@@ -20,7 +20,7 @@
struct ForwardIterBase {
using iterator_concept = std::forward_iterator_tag;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
constexpr int operator*() const { return 5; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/ctor.view.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/ctor.view.pass.cpp
index 7adeb67..469b269 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/ctor.view.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/ctor.view.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr take_while_view(V base, Pred pred);
+// constexpr take_while_view(V base, Pred pred); // explicit since C++23
#include <cassert>
#include <ranges>
@@ -16,6 +16,8 @@
#include <utility>
#include "MoveOnly.h"
+#include "test_convertible.h"
+#include "test_macros.h"
struct View : std::ranges::view_base {
MoveOnly mo;
@@ -32,9 +34,23 @@
bool operator()(int) const;
};
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::take_while_view<View, Pred>, View, Pred>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert(test_convertible<std::ranges::take_while_view<View, Pred>, View, Pred>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
- std::ranges::take_while_view<View, Pred> twv = {View{{}, MoveOnly{5}}, Pred{}};
+ std::ranges::take_while_view<View, Pred> twv{View{{}, MoveOnly{5}}, Pred{}};
assert(twv.pred().moved);
assert(!twv.pred().copied);
assert(std::move(twv).base().mo.get() == 5);
@@ -45,5 +61,6 @@
int main(int, char**) {
test();
static_assert(test());
+
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/equality.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/equality.pass.cpp
index 3d5b835..db3e576 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/equality.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/equality.pass.cpp
@@ -26,7 +26,7 @@
int* it_;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
using iterator_concept = std::input_iterator_tag;
constexpr decltype(auto) operator*() const { return *it_; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
index ad5442f..f2ac62e 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
@@ -22,7 +22,7 @@
struct NonCommonSimpleView : std::ranges::view_base {
int* begin() const;
sentinel_wrapper<int*> end() const;
- size_t size() { return 0; } // deliberately non-const
+ std::size_t size() { return 0; } // deliberately non-const
};
static_assert(std::ranges::sized_range<NonCommonSimpleView>);
static_assert(!std::ranges::sized_range<const NonCommonSimpleView>);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.default.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.default.pass.cpp
index 33071a9..98fd1e0 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.default.pass.cpp
@@ -10,8 +10,9 @@
// take_view() requires default_initializable<V> = default;
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
int buff[8] = {1, 2, 3, 4, 5, 6, 7, 8};
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
index 63b936d..f37ffb0 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
@@ -8,16 +8,31 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr take_view(V base, range_difference_t<V> count);
+// constexpr take_view(V base, range_difference_t<V> count); // explicit since C++23
-#include <ranges>
#include <cassert>
+#include <ranges>
-#include "test_macros.h"
+#include "test_convertible.h"
#include "test_iterators.h"
+#include "test_macros.h"
#include "test_range.h"
#include "types.h"
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::take_view<View>, View, std::ranges::range_difference_t<View>>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert(test_convertible<std::ranges::take_view<View>, View, std::ranges::range_difference_t<View>>(),
+ "This constructor must be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
int buffer[8] = {1, 2, 3, 4, 5, 6, 7, 8};
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/types.h
index 09549a9..db80e68 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.take/types.h
@@ -54,4 +54,15 @@
static_assert(std::ranges::random_access_range<SizedRandomAccessView>);
static_assert(std::ranges::sized_range<SizedRandomAccessView>);
+struct View : std::ranges::view_base {
+ constexpr explicit View(int* b, int* e) : begin_(b), end_(e) { }
+
+ constexpr int* begin() const { return begin_; }
+ constexpr int* end() const { return end_; }
+
+private:
+ int* begin_;
+ int* end_;
+};
+
#endif // TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TAKE_TYPES_H
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/ctor.view_function.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/ctor.view_function.pass.cpp
index 7ce0426..63a43d1 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/ctor.view_function.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/ctor.view_function.pass.cpp
@@ -8,14 +8,16 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr transform_view(View, F);
-
-#include <ranges>
+// constexpr transform_view(View, F); // explicit since C++23
#include <cassert>
+#include <ranges>
+
+#include "test_convertible.h"
+#include "test_macros.h"
struct Range : std::ranges::view_base {
- constexpr explicit Range(int* b, int* e) : begin_(b), end_(e) { }
+ constexpr explicit Range(int* b, int* e) : begin_(b), end_(e) {}
constexpr int* begin() const { return begin_; }
constexpr int* end() const { return end_; }
@@ -28,6 +30,20 @@
constexpr int operator()(int i) const { return i + 100; }
};
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::transform_view<Range, F>, Range, F>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert( test_convertible<std::ranges::transform_view<Range, F>, Range, F>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
int buff[] = {1, 2, 3, 4, 5, 6, 7, 8};
@@ -41,16 +57,6 @@
assert(view[7] == 108);
}
- {
- Range range(buff, buff + 8);
- F f;
- std::ranges::transform_view<Range, F> view = {range, f};
- assert(view[0] == 101);
- assert(view[1] == 102);
- // ...
- assert(view[7] == 108);
- }
-
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
index f519066..f48aae6 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
@@ -39,7 +39,7 @@
return std::ranges::transform_view(range, [](char c) { return std::toupper(c); });
}
-template<class E1, class E2, size_t N, class Join = std::plus<E1>>
+template<class E1, class E2, std::size_t N, class Join = std::plus<E1>>
auto joinArrays(E1 (&a)[N], E2 (&b)[N], Join join = Join()) {
return std::ranges::transform_view(a, [&a, &b, join](auto& x) {
auto idx = (&x) - a;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
index 2c095d8..25d8936 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
@@ -44,6 +44,15 @@
static_assert(std::same_as<typename TIter::difference_type, std::ptrdiff_t>);
}
{
+ // Member typedefs for random access iterator, LWG3798 rvalue reference.
+ using TView = std::ranges::transform_view<RandomAccessView, IncrementRvalueRef>;
+ using TIter = std::ranges::iterator_t<TView>;
+ static_assert(std::same_as<typename TIter::iterator_concept, std::random_access_iterator_tag>);
+ static_assert(std::same_as<typename TIter::iterator_category, std::random_access_iterator_tag>);
+ static_assert(std::same_as<typename TIter::value_type, int>);
+ static_assert(std::same_as<typename TIter::difference_type, std::ptrdiff_t>);
+ }
+ {
// Member typedefs for random access iterator/not-lvalue-ref.
using TView = std::ranges::transform_view<RandomAccessView, PlusOneMutable>;
using TIter = std::ranges::iterator_t<TView>;
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
index d31db8d..14f8572 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
@@ -9,6 +9,8 @@
#ifndef TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TRANSFORM_TYPES_H
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TRANSFORM_TYPES_H
+#include <cstddef>
+
#include "test_macros.h"
#include "test_iterators.h"
#include "test_range.h"
@@ -106,7 +108,7 @@
struct SizedSentinelNotConstView : std::ranges::view_base {
ForwardIter begin() const;
int *end() const;
- size_t size();
+ std::size_t size();
};
// TODO: remove these bogus operators
bool operator==(const ForwardIter &lhs, int* rhs);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp
index ce7858f..efe64b3 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp
@@ -63,7 +63,7 @@
assert(&y1 == &(b[3]));
using Iter = decltype(it1);
- static_assert(canPlusEqual<Iter, intptr_t>);
+ static_assert(canPlusEqual<Iter, std::intptr_t>);
}
{
@@ -83,7 +83,7 @@
assert(&y1 == &(b[2]));
using Iter = decltype(it1);
- static_assert(canMinusEqual<Iter, intptr_t>);
+ static_assert(canMinusEqual<Iter, std::intptr_t>);
}
{
@@ -116,12 +116,12 @@
// One of the ranges is not random access
std::ranges::zip_view v(a, b, ForwardSizedView{buffer1});
using Iter = decltype(v.begin());
- static_assert(!std::invocable<std::plus<>, Iter, intptr_t>);
- static_assert(!std::invocable<std::plus<>, intptr_t, Iter>);
- static_assert(!canPlusEqual<Iter, intptr_t>);
- static_assert(!std::invocable<std::minus<>, Iter, intptr_t>);
+ static_assert(!std::invocable<std::plus<>, Iter, std::intptr_t>);
+ static_assert(!std::invocable<std::plus<>, std::intptr_t, Iter>);
+ static_assert(!canPlusEqual<Iter, std::intptr_t>);
+ static_assert(!std::invocable<std::minus<>, Iter, std::intptr_t>);
static_assert(std::invocable<std::minus<>, Iter, Iter>);
- static_assert(!canMinusEqual<Iter, intptr_t>);
+ static_assert(!canMinusEqual<Iter, std::intptr_t>);
}
{
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
index 19b5b99..fcbff72 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
@@ -41,7 +41,7 @@
using iterator_category = std::random_access_iterator_tag;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
constexpr int& operator*() const { return *it_; }
constexpr int& operator[](difference_type n) const { return it_[n]; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp
index 8c038ab..98078b2 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp
@@ -20,7 +20,7 @@
using iterator_category = std::random_access_iterator_tag;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
constexpr int operator*() const { return i; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp
index 6b0c086..c19f6c2 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp
@@ -144,16 +144,16 @@
{
// difference_type of single view
- std::ranges::zip_view v{DiffTypeRange<intptr_t>{}};
+ std::ranges::zip_view v{DiffTypeRange<std::intptr_t>{}};
using Iter = decltype(v.begin());
- static_assert(std::is_same_v<Iter::difference_type, intptr_t>);
+ static_assert(std::is_same_v<Iter::difference_type, std::intptr_t>);
}
{
// difference_type of multiple views should be the common type
- std::ranges::zip_view v{DiffTypeRange<intptr_t>{}, DiffTypeRange<std::ptrdiff_t>{}};
+ std::ranges::zip_view v{DiffTypeRange<std::intptr_t>{}, DiffTypeRange<std::ptrdiff_t>{}};
using Iter = decltype(v.begin());
- static_assert(std::is_same_v<Iter::difference_type, std::common_type_t<intptr_t, std::ptrdiff_t>>);
+ static_assert(std::is_same_v<Iter::difference_type, std::common_type_t<std::intptr_t, std::ptrdiff_t>>);
}
const std::array foos{Foo{}};
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/minus.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/minus.pass.cpp
index 7f8b513..c4c85bc 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/minus.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/minus.pass.cpp
@@ -34,7 +34,7 @@
using iterator_category = std::forward_iterator_tag;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
convertible_forward_sized_iterator() = default;
constexpr convertible_forward_sized_iterator(Base it) : it_(it) {}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/types.h
index 299ffea..fa82b83 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.adaptors/range.zip/types.h
@@ -201,7 +201,7 @@
using iterator_category = std::forward_iterator_tag;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
using pointer = Base;
using reference = decltype(*Base{});
@@ -405,7 +405,7 @@
using iterator_category = std::input_iterator_tag;
using value_type = int;
- using difference_type = intptr_t;
+ using difference_type = std::intptr_t;
constexpr int operator*() const { return i; }
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.first.last.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.first.last.pass.cpp
index 0b02cad..ee0e7fc 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.first.last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.first.last.pass.cpp
@@ -8,14 +8,55 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// constexpr iota_view(iterator first, see below last);
+// constexpr iota_view(iterator first, see below last); // explicit since C++23
#include <ranges>
#include <cassert>
+#include "test_convertible.h"
#include "test_macros.h"
#include "types.h"
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+std::ranges::iota_view<SomeInt, SomeInt> view;
+
+static_assert(!test_convertible<std::ranges::iota_view<SomeInt, SomeInt>,
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.begin()),
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.end())>(),
+ "This constructor must be explicit");
+
+static_assert(!test_convertible<std::ranges::iota_view<SomeInt>,
+ decltype(std::ranges::iota_view{SomeInt{0}}.begin()),
+ decltype(std::unreachable_sentinel)>(),
+ "This constructor must be explicit");
+
+static_assert(!test_convertible<std::ranges::iota_view<SomeInt, IntComparableWith<SomeInt>>,
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.begin()),
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.end())>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert(test_convertible<std::ranges::iota_view<SomeInt, SomeInt>,
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.begin()),
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.end())>(),
+ "This constructor must not be explicit");
+
+static_assert(test_convertible<std::ranges::iota_view<SomeInt>,
+ decltype(std::ranges::iota_view{SomeInt{0}}.begin()),
+ decltype(std::unreachable_sentinel)>(),
+ "This constructor must not be explicit");
+
+static_assert(test_convertible<std::ranges::iota_view<SomeInt, IntComparableWith<SomeInt>>,
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.begin()),
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.end())>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
std::ranges::iota_view commonView(SomeInt(0), SomeInt(10));
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
index 906e0e0..7528e1c 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
@@ -14,13 +14,52 @@
TEST_GCC_DIAGNOSTIC_IGNORED("-Wsign-compare")
TEST_MSVC_DIAGNOSTIC_IGNORED(4018 4389) // various "signed/unsigned mismatch"
-// constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
+// constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); // explicit since C++23
#include <ranges>
#include <cassert>
+#include "test_convertible.h"
#include "types.h"
+// SFINAE tests.
+
+#if TEST_STD_VER >= 23
+
+static_assert(!test_convertible<std::ranges::iota_view<SomeInt, SomeInt>,
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.begin()),
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.end())>(),
+ "This constructor must be explicit");
+
+static_assert(!test_convertible<std::ranges::iota_view<SomeInt>,
+ decltype(std::ranges::iota_view<SomeInt>{}.begin()),
+ decltype(std::unreachable_sentinel)>(),
+ "This constructor must be explicit");
+
+static_assert(!test_convertible<std::ranges::iota_view<SomeInt, IntComparableWith<SomeInt>>,
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.begin()),
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.end())>(),
+ "This constructor must be explicit");
+
+#else
+
+static_assert( test_convertible<std::ranges::iota_view<SomeInt, SomeInt>,
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.begin()),
+ decltype(std::ranges::iota_view<SomeInt, SomeInt>{}.end())>(),
+ "This constructor must not be explicit");
+
+static_assert( test_convertible<std::ranges::iota_view<SomeInt>,
+ decltype(std::ranges::iota_view<SomeInt>{}.begin()),
+ decltype(std::unreachable_sentinel)>(),
+ "This constructor must not be explicit");
+
+static_assert( test_convertible<std::ranges::iota_view<SomeInt, IntComparableWith<SomeInt>>,
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.begin()),
+ decltype(std::ranges::iota_view{SomeInt(0), IntComparableWith(SomeInt(10))}.end())>(),
+ "This constructor must not be explicit");
+
+#endif // TEST_STD_VER >= 23
+
constexpr bool test() {
{
std::ranges::iota_view<SomeInt, SomeInt> io(SomeInt(0), SomeInt(10));
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.pass.cpp
index ac5a25b..cda372e 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.pass.cpp
@@ -10,8 +10,9 @@
// constexpr explicit iota_view(W value);
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.pass.cpp
index 5a71837..a84cb91 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.pass.cpp
@@ -10,8 +10,9 @@
// constexpr explicit iterator(W value);
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/decrement.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/decrement.pass.cpp
index 45b5e17..3b1613e 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/decrement.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/decrement.pass.cpp
@@ -11,8 +11,9 @@
// constexpr iterator& operator--() requires decrementable<W>;
// constexpr iterator operator--(int) requires decrementable<W>;
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/increment.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/increment.pass.cpp
index a979a2d..d99e57f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/increment.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/increment.pass.cpp
@@ -12,8 +12,9 @@
// constexpr void operator++(int);
// constexpr iterator operator++(int) requires incrementable<W>;
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
index e009bfc..c2f7fd1 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
@@ -13,6 +13,7 @@
#include <cassert>
#include <cstdint>
#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
index ff425ba..705a744 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
@@ -16,6 +16,7 @@
#include <cassert>
#include <cstdint>
#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus_eq.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus_eq.pass.cpp
index 6b16982..b46a34d 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus_eq.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus_eq.pass.cpp
@@ -11,8 +11,9 @@
// constexpr iterator& operator-=(difference_type n)
// requires advanceable<W>;
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus.pass.cpp
index aaff730..b66dc78 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus.pass.cpp
@@ -13,8 +13,9 @@
// friend constexpr iterator operator+(difference_type n, iterator i)
// requires advanceable<W>;
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus_eq.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus_eq.pass.cpp
index ded3c97..fa9135d 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus_eq.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus_eq.pass.cpp
@@ -11,8 +11,9 @@
// constexpr iterator& operator+=(difference_type n)
// requires advanceable<W>;
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.pass.cpp
index c465345..a56369b 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.pass.cpp
@@ -10,8 +10,9 @@
// constexpr explicit sentinel(Bound bound);
-#include <ranges>
#include <cassert>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "../types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
index d7310cc..a6b268f 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
@@ -10,9 +10,10 @@
// views::iota
-#include <ranges>
#include <cassert>
#include <concepts>
+#include <ranges>
+#include <type_traits>
#include "test_macros.h"
#include "types.h"
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
index 7d6a72d..f57bc40 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
@@ -20,28 +20,28 @@
auto sv = std::ranges::single_view<int>(42);
assert(sv.size() == 1);
- ASSERT_SAME_TYPE(decltype(sv.size()), size_t);
+ ASSERT_SAME_TYPE(decltype(sv.size()), std::size_t);
static_assert(noexcept(sv.size()));
}
{
const auto sv = std::ranges::single_view<int>(42);
assert(sv.size() == 1);
- ASSERT_SAME_TYPE(decltype(sv.size()), size_t);
+ ASSERT_SAME_TYPE(decltype(sv.size()), std::size_t);
static_assert(noexcept(sv.size()));
}
{
auto sv = std::ranges::single_view<int>(42);
assert(std::ranges::size(sv) == 1);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), std::size_t);
static_assert(noexcept(std::ranges::size(sv)));
}
{
const auto sv = std::ranges::single_view<int>(42);
assert(std::ranges::size(sv) == 1);
- ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), std::size_t);
static_assert(noexcept(std::ranges::size(sv)));
}
@@ -49,7 +49,7 @@
{
assert(std::ranges::single_view<int>::size() == 1);
- ASSERT_SAME_TYPE(decltype(std::ranges::single_view<int>::size()), size_t);
+ ASSERT_SAME_TYPE(decltype(std::ranges::single_view<int>::size()), std::size_t);
static_assert(noexcept(std::ranges::single_view<int>::size()));
}
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
index 1cc9403..1367e29 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
@@ -20,6 +20,9 @@
// template<range R>
// using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;
+// template <range R>
+// using range_common_reference_t = iter_common_reference_t<iterator_t<R>>;
+
#include <ranges>
#include <concepts>
@@ -27,9 +30,8 @@
#include "test_iterators.h"
#include "test_range.h"
-
-
static_assert(std::same_as<std::ranges::range_difference_t<test_range<cpp20_input_iterator> >, std::iter_difference_t<int*> >);
static_assert(std::same_as<std::ranges::range_value_t<test_range<cpp20_input_iterator> >, std::iter_value_t<int*> >);
static_assert(std::same_as<std::ranges::range_reference_t<test_range<cpp20_input_iterator> >, std::iter_reference_t<int*> >);
static_assert(std::same_as<std::ranges::range_rvalue_reference_t<test_range<cpp20_input_iterator> >, std::iter_rvalue_reference_t<int*> >);
+static_assert(std::same_as<std::ranges::range_common_reference_t<test_range<cpp20_input_iterator> >, std::iter_common_reference_t<int*> >);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
index c83e83b..52a66f6 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
@@ -28,8 +28,8 @@
static_assert(!std::is_constructible_v<SizedSentinelForwardSubrange, Empty, ConditionallyConvertibleIter, ConditionallyConvertibleIter::udifference_type>); // 1.
static_assert( std::is_constructible_v<ConvertibleSizedSentinelForwardSubrange, ConvertibleSizedSentinelForwardIter, int*, ConvertibleSizedSentinelForwardIter::udifference_type>); // 2.
static_assert( std::is_constructible_v<SizedSentinelForwardSubrange, ConditionallyConvertibleIter, ConditionallyConvertibleIter, ConditionallyConvertibleIter::udifference_type>); // 3. (Same as default case.)
-static_assert(!std::is_constructible_v<SizedIntPtrSubrange, long*, int*, size_t>); // 4.
-static_assert( std::is_constructible_v<SizedIntPtrSubrange, int*, int*, size_t>); // 5.
+static_assert(!std::is_constructible_v<SizedIntPtrSubrange, long*, int*, std::size_t>); // 4.
+static_assert( std::is_constructible_v<SizedIntPtrSubrange, int*, int*, std::size_t>); // 5.
constexpr bool test() {
SizedSentinelForwardSubrange a(ConditionallyConvertibleIter(globalBuff), ConditionallyConvertibleIter(globalBuff + 8), 8);
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
index 5e8969b..e1daf88 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
@@ -16,7 +16,7 @@
#include "test_macros.h"
#include "test_iterators.h"
-template<size_t I, class S>
+template<std::size_t I, class S>
concept HasGet = requires {
std::get<I>(std::declval<S>());
};
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/types.h b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/types.h
index e730d6a..8659350 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/types.h
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/range.subrange/types.h
@@ -211,7 +211,7 @@
constexpr ForwardIter begin() const { return ForwardIter(globalBuff); }
constexpr sentinel end() const { return sentinel{globalBuff + 8}; }
- constexpr size_t size() const { return 8; }
+ constexpr std::size_t size() const { return 8; }
};
template<>
diff --git a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
index b1ed28f..2fc2fa8 100644
--- a/third_party/llvm-project/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
@@ -95,7 +95,7 @@
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
constexpr ForwardIter begin() const { return ForwardIter(const_cast<int*>(buff)); }
constexpr ForwardIter end() const { return ForwardIter(const_cast<int*>(buff) + 8); }
- constexpr size_t size() const { return 10; }
+ constexpr std::size_t size() const { return 10; }
};
static_assert(std::ranges::view<SizeIsTen>);
@@ -262,7 +262,7 @@
}
template<class T>
-concept SubscriptInvocable = requires (T const& obj, size_t n) { obj[n]; };
+concept SubscriptInvocable = requires (T const& obj, std::size_t n) { obj[n]; };
constexpr bool testSubscript() {
static_assert(!SubscriptInvocable<ForwardRange>);
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
index 7d53cd9..6470b95 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
@@ -44,7 +44,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -60,7 +60,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -87,7 +87,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -103,7 +103,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index f3385f4..988beec 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -260,7 +260,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -275,7 +275,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -290,7 +290,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -323,7 +323,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -338,7 +338,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -353,7 +353,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -375,7 +375,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -391,7 +391,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -407,7 +407,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -431,7 +431,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -516,7 +516,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -539,7 +539,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -569,7 +569,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -585,7 +585,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -601,7 +601,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -643,7 +643,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == 4);
+ assert((std::size_t)m.length(0) == 4);
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -659,7 +659,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -677,7 +677,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s+1);
- assert((size_t)m.length(0) == 1);
+ assert((std::size_t)m.length(0) == 1);
assert(m.position(0) == 0);
assert(m.str(0) == L"a");
}
@@ -692,7 +692,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s+2);
- assert((size_t)m.length(0) == 2);
+ assert((std::size_t)m.length(0) == 2);
assert(m.position(0) == 0);
assert(m.str(0) == L"ab");
}
@@ -902,7 +902,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -917,7 +917,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -932,7 +932,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -965,7 +965,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -980,7 +980,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -995,7 +995,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1017,7 +1017,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1033,7 +1033,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1049,7 +1049,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1073,7 +1073,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1158,7 +1158,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1181,7 +1181,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1211,7 +1211,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1227,7 +1227,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1243,7 +1243,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1301,7 +1301,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
index 488385f..430d35f 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
@@ -46,7 +46,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -62,7 +62,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -89,7 +89,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -105,7 +105,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
index d77349d..9765a07 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
@@ -380,7 +380,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -398,7 +398,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -423,7 +423,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -518,7 +518,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -541,7 +541,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -571,7 +571,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -587,7 +587,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -603,7 +603,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -894,7 +894,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -909,7 +909,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -924,7 +924,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -957,7 +957,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -972,7 +972,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -987,7 +987,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1008,7 +1008,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -1026,7 +1026,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1051,7 +1051,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1146,7 +1146,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1169,7 +1169,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1199,7 +1199,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1215,7 +1215,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1231,7 +1231,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
index 0f49b9f..b512fa9 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
@@ -45,7 +45,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -61,7 +61,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -86,7 +86,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -102,7 +102,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
index 58502aa..4face8b 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
@@ -259,7 +259,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -274,7 +274,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -289,7 +289,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -322,7 +322,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -337,7 +337,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -352,7 +352,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -374,7 +374,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -392,7 +392,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -407,7 +407,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -431,7 +431,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -509,7 +509,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -530,7 +530,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -557,7 +557,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -572,7 +572,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -587,7 +587,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -665,7 +665,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -907,7 +907,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -922,7 +922,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -937,7 +937,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -970,7 +970,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -985,7 +985,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1000,7 +1000,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1022,7 +1022,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1040,7 +1040,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1055,7 +1055,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1079,7 +1079,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1157,7 +1157,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1178,7 +1178,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1205,7 +1205,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1220,7 +1220,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1235,7 +1235,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1301,7 +1301,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
index 1e7ded6..472dc19 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
@@ -46,7 +46,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -62,7 +62,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -89,7 +89,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -105,7 +105,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
index b3be567..73c1d83 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
@@ -259,7 +259,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -274,7 +274,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -289,7 +289,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -322,7 +322,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -337,7 +337,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -352,7 +352,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -374,7 +374,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -390,7 +390,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -406,7 +406,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -430,7 +430,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -448,7 +448,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -533,7 +533,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -556,7 +556,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -586,7 +586,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -602,7 +602,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -618,7 +618,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -903,7 +903,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -918,7 +918,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -933,7 +933,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -966,7 +966,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -981,7 +981,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -996,7 +996,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1018,7 +1018,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1034,7 +1034,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1050,7 +1050,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1074,7 +1074,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -1092,7 +1092,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1177,7 +1177,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1200,7 +1200,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1230,7 +1230,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1246,7 +1246,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1262,7 +1262,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
index f2a89d6..9125df4 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
@@ -46,7 +46,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -62,7 +62,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -89,7 +89,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -105,7 +105,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
index 741a74f..2c23cf0 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
@@ -323,7 +323,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -338,7 +338,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -353,7 +353,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -386,7 +386,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -401,7 +401,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -416,7 +416,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -438,7 +438,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -454,7 +454,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -470,7 +470,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -494,7 +494,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -588,7 +588,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -611,7 +611,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -641,7 +641,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -657,7 +657,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -673,7 +673,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -749,7 +749,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1055,7 +1055,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1070,7 +1070,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1085,7 +1085,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1118,7 +1118,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1133,7 +1133,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1148,7 +1148,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1170,7 +1170,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1186,7 +1186,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1202,7 +1202,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1226,7 +1226,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1320,7 +1320,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1343,7 +1343,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1373,7 +1373,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1389,7 +1389,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1405,7 +1405,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1481,7 +1481,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
index fff693e..f85b6a4 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
@@ -46,7 +46,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -62,7 +62,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -89,7 +89,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -105,7 +105,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
index 287ca99..99f94f2 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
@@ -443,7 +443,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -461,7 +461,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -486,7 +486,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -590,7 +590,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -613,7 +613,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -643,7 +643,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -659,7 +659,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -675,7 +675,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1047,7 +1047,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1062,7 +1062,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1077,7 +1077,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1110,7 +1110,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1125,7 +1125,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1140,7 +1140,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1161,7 +1161,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -1179,7 +1179,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1204,7 +1204,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1308,7 +1308,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1331,7 +1331,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1361,7 +1361,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1377,7 +1377,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1393,7 +1393,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
index bb80b16..aa9441c 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
@@ -45,7 +45,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -61,7 +61,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -86,7 +86,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -102,7 +102,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
index 00977d3..518c27e 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
@@ -322,7 +322,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -337,7 +337,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -352,7 +352,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -385,7 +385,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -400,7 +400,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -415,7 +415,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -467,7 +467,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -491,7 +491,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -578,7 +578,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -599,7 +599,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -626,7 +626,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -641,7 +641,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -656,7 +656,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -758,7 +758,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1063,7 +1063,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1078,7 +1078,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1093,7 +1093,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1126,7 +1126,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1141,7 +1141,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1156,7 +1156,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1208,7 +1208,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1232,7 +1232,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1319,7 +1319,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1340,7 +1340,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1367,7 +1367,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1382,7 +1382,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1397,7 +1397,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1499,7 +1499,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
index bbe39e7..9746e45 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
@@ -46,7 +46,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -62,7 +62,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -89,7 +89,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -105,7 +105,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
index 8ffedfc..0ddb49d 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
@@ -323,7 +323,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -338,7 +338,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -353,7 +353,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -386,7 +386,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -401,7 +401,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -416,7 +416,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -438,7 +438,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -454,7 +454,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -470,7 +470,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -494,7 +494,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -512,7 +512,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -606,7 +606,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -629,7 +629,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -659,7 +659,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -675,7 +675,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -691,7 +691,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1057,7 +1057,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1072,7 +1072,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1087,7 +1087,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1120,7 +1120,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1135,7 +1135,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1150,7 +1150,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1172,7 +1172,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1188,7 +1188,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1204,7 +1204,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1228,7 +1228,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -1246,7 +1246,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1340,7 +1340,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1363,7 +1363,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1393,7 +1393,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1409,7 +1409,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1425,7 +1425,7 @@
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index 29300a8..3569ad5 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -24,7 +24,7 @@
extern "C" void LLVMFuzzerTestOneInput(const char *data)
{
#ifndef TEST_HAS_NO_EXCEPTIONS
- size_t size = strlen(data);
+ std::size_t size = strlen(data);
if (size > 0)
{
try
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
index 738ed88..4087c24 100644
--- a/third_party/llvm-project/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
@@ -15,12 +15,7 @@
#include <regex>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::match_results<const char*> c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
new file mode 100644
index 0000000..9e93370
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class BidirectionalIterator> class sub_match;
+
+// void swap(sub_match& s) noexcept(see below);
+
+#include <regex>
+#include <cassert>
+#include "test_macros.h"
+
+int main(int, char**) {
+ {
+ using CharT = char;
+ using SM = std::sub_match<const CharT*>;
+ const CharT s1[] = {'1', '2', '3', 0};
+ SM sm1;
+ sm1.first = s1;
+ sm1.second = s1 + 3;
+ sm1.matched = true;
+
+ SM sm2;
+ const CharT s2[] = {'c', 'a', 't', 0};
+ sm2.first = s2;
+ sm2.second = s2 + 3;
+ sm2.matched = false;
+
+ sm1.swap(sm2);
+
+ assert(sm1.first == s2);
+ assert(sm1.second == s2 + 3);
+ assert(!sm1.matched);
+
+ assert(sm2.first == s1);
+ assert(sm2.second == s1 + 3);
+ assert(sm2.matched);
+
+ ASSERT_NOEXCEPT(sm1.swap(sm2));
+ }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ {
+ using CharT = wchar_t;
+ using SM = std::sub_match<const CharT*>;
+ const CharT s1[] = {L'1', L'2', L'3', 0};
+ SM sm1;
+ sm1.first = s1;
+ sm1.second = s1 + 3;
+ sm1.matched = true;
+
+ SM sm2;
+ const CharT s2[] = {L'c', L'a', L't', 0};
+ sm2.first = s2;
+ sm2.second = s2 + 3;
+ sm2.matched = false;
+
+ sm1.swap(sm2);
+
+ assert(sm1.first == s2);
+ assert(sm1.second == s2 + 3);
+ assert(!sm1.matched);
+
+ assert(sm2.first == s1);
+ assert(sm2.second == s1 + 3);
+ assert(sm2.matched);
+
+ ASSERT_NOEXCEPT(sm1.swap(sm2));
+ }
+#endif
+}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
index 721d7e6..339b200 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
@@ -33,14 +33,14 @@
static inline bool eq(char_type __c1, char_type __c2) { return __c1 == __c2; }
static inline bool lt(char_type __c1, char_type __c2) { return __c1 < __c2; }
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- static size_t length(const char_type* __s);
- static const char_type* find(const char_type* __s, size_t __n,
+ static int compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+ static std::size_t length(const char_type* __s);
+ static const char_type* find(const char_type* __s, std::size_t __n,
const char_type& __a);
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
+ static char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static char_type* assign(char_type* __s, std::size_t __n, char_type __a);
static inline int_type not_eof(int_type __c) {
return eq_int_type(__c, eof()) ? ~eof() : __c;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
index f79b0d9..31e351a 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
@@ -36,12 +36,12 @@
static bool eq(char_type, char_type);
static bool lt(char_type, char_type);
- static int compare(const char_type*, const char_type*, size_t);
- static size_t length(const char_type*);
- static const char_type* find(const char_type*, size_t, const char_type&);
- static char_type* move(char_type*, const char_type*, size_t);
- static char_type* copy(char_type*, const char_type*, size_t);
- static char_type* assign(char_type*, size_t, char_type);
+ static int compare(const char_type*, const char_type*, std::size_t);
+ static std::size_t length(const char_type*);
+ static const char_type* find(const char_type*, std::size_t, const char_type&);
+ static char_type* move(char_type*, const char_type*, std::size_t);
+ static char_type* copy(char_type*, const char_type*, std::size_t);
+ static char_type* assign(char_type*, std::size_t, char_type);
static int_type not_eof(int_type);
static char_type to_char_type(int_type);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp
index 7f040e5..8e2cae7 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string.literals/noexcept.compile.pass.cpp
@@ -9,6 +9,7 @@
// UNSUPPORTED: c++03, c++11
#include <string>
+#include <utility>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
index 3e17d07..9530950 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
@@ -76,7 +76,7 @@
};
TEST_CONSTEXPR_CXX20 bool test() {
- meta::for_each(meta::character_types(), TestCaller());
+ types::for_each(types::character_types(), TestCaller());
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
index 26a4daf..8ba11ee 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
@@ -16,21 +16,7 @@
#include <string>
-#include "test_macros.h"
-
-TEST_CONSTEXPR_CXX20 bool test() {
+void f() {
std::string c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return true;
-}
-
-int main(int, char**)
-{
- test();
-#if TEST_STD_VER > 17
- static_assert(test());
-#endif
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
index b8e4198..ca4b05b 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -30,7 +30,7 @@
test1(const S& s)
{
S s2(s);
- const size_t sz = s2.max_size() - 1;
+ const std::size_t sz = s2.max_size() - 1;
try { s2.resize(sz, 'x'); }
catch ( const std::bad_alloc & ) { return ; }
assert ( s2.size() == sz );
@@ -41,7 +41,7 @@
test2(const S& s)
{
S s2(s);
- const size_t sz = s2.max_size();
+ const std::size_t sz = s2.max_size();
try { s2.resize(sz, 'x'); }
catch ( const std::bad_alloc & ) { return ; }
assert ( s.size() == sz );
@@ -76,7 +76,7 @@
constexpr bool test_constexpr() {
std::string str;
- size_t size = str.max_size();
+ std::size_t size = str.max_size();
assert(size > 0);
return true;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
index 65907e0..80f4e87 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
@@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-exceptions
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// Prior to http://llvm.org/D123580, there was a bug with how the max_size()
// was calculated. That was inlined into some functions in the dylib, which leads
// to failures when running this test against an older system dylib.
-// XFAIL: use_system_cxx_lib && target=arm64-apple-macosx{{11.0|12.0}}
+// XFAIL: stdlib=apple-libc++ && target=arm64-apple-macosx{{11.0|12.0}}
// <string>
@@ -31,7 +31,7 @@
{
assert(s.max_size() >= s.size());
S s2(s);
- const size_t sz = s2.max_size() + 1;
+ const std::size_t sz = s2.max_size() + 1;
try { s2.resize(sz, 'x'); }
catch ( const std::length_error & ) { return ; }
assert ( false );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
index 1b8a5da..632f7fd 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
@@ -14,9 +14,7 @@
#include <string>
-int main(int, char**)
-{
+void f() {
std::string s;
s.reserve(); // expected-warning {{'reserve' is deprecated}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp
index 2999114..45c5867 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp
@@ -12,7 +12,7 @@
// This test relies on https://llvm.org/PR45368 being fixed, which isn't in
// older Apple dylibs
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
#include <string>
#include <stdexcept>
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
index b22a903..3fafde8 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
@@ -21,7 +21,7 @@
#include "test_macros.h"
template <class S>
-constexpr void test_appending(size_t k, size_t N, size_t new_capacity) {
+constexpr void test_appending(std::size_t k, size_t N, size_t new_capacity) {
assert(N > k);
assert(new_capacity >= N);
auto s = S(k, 'a');
@@ -40,7 +40,7 @@
}
template <class S>
-constexpr void test_truncating(size_t o, size_t N) {
+constexpr void test_truncating(std::size_t o, size_t N) {
assert(N < o);
auto s = S(o, 'a');
s.resize_and_overwrite(N, [&](auto* p, auto n) {
@@ -76,10 +76,10 @@
void test_value_categories() {
std::string s;
- s.resize_and_overwrite(10, [](char*&&, size_t&&) { return 0; });
- s.resize_and_overwrite(10, [](char* const&, const size_t&) { return 0; });
+ s.resize_and_overwrite(10, [](char*&&, std::size_t&&) { return 0; });
+ s.resize_and_overwrite(10, [](char* const&, const std::size_t&) { return 0; });
struct RefQualified {
- int operator()(char*, size_t) && { return 0; }
+ int operator()(char*, std::size_t) && { return 0; }
};
s.resize_and_overwrite(10, RefQualified{});
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
index 195491f..9f0f2ed 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
@@ -34,12 +34,12 @@
static void assign(char_type&, const char_type&) { }
static bool eq(const char_type&, const char_type&) { return false; }
static bool lt(const char_type&, const char_type&) { return false; }
- static int compare(const char_type*, const char_type*, size_t) { return 0; }
- static size_t length(const char_type*) { return 0; }
- static const char_type* find(const char_type*, size_t, const char_type&) { return nullptr; }
- static char_type* move(char_type*, const char_type*, size_t) { return nullptr; }
- static char_type* copy(char_type*, const char_type*, size_t) { return nullptr; }
- static char_type* assign(char_type*, size_t, char_type) { return nullptr; }
+ static int compare(const char_type*, const char_type*, std::size_t) { return 0; }
+ static std::size_t length(const char_type*) { return 0; }
+ static const char_type* find(const char_type*, std::size_t, const char_type&) { return nullptr; }
+ static char_type* move(char_type*, const char_type*, std::size_t) { return nullptr; }
+ static char_type* copy(char_type*, const char_type*, std::size_t) { return nullptr; }
+ static char_type* assign(char_type*, std::size_t, char_type) { return nullptr; }
static int_type not_eof(const int_type&) { return 0; }
static char_type to_char_type(const int_type&) { return char_type(); }
static int_type to_int_type(const char_type&) { return int_type(); }
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
index 07e9a60..92d6531 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
@@ -23,7 +23,7 @@
{
typedef T value_type;
throwing_alloc(const throwing_alloc&);
- T *allocate(size_t);
+ T *allocate(std::size_t);
~throwing_alloc() noexcept(false);
};
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
index f9cdeac..5f3064b 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
@@ -81,7 +81,7 @@
}
{ // Testing (4) w/o allocator
const std::string sin("abc");
- std::basic_string s(sin, (size_t)1);
+ std::basic_string s(sin, (std::size_t)1);
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -97,7 +97,7 @@
}
{ // Testing (4) w/ allocator
const std::string sin("abc");
- std::basic_string s(sin, (size_t)1, std::allocator<char>{});
+ std::basic_string s(sin, (std::size_t)1, std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -113,7 +113,7 @@
}
{ // Testing (5) w/o allocator
const std::string sin("abc");
- std::basic_string s(sin, (size_t)1, (size_t)3);
+ std::basic_string s(sin, (std::size_t)1, (size_t)3);
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -129,7 +129,7 @@
}
{ // Testing (5) w/ allocator
const std::string sin("abc");
- std::basic_string s(sin, (size_t)1, (size_t)3, std::allocator<char>{});
+ std::basic_string s(sin, (std::size_t)1, (size_t)3, std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -144,18 +144,18 @@
#endif
}
{ // Testing (6) w/o allocator
- std::basic_string s("abc", (size_t)2);
+ std::basic_string s("abc", (std::size_t)2);
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "ab");
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- std::basic_string w(L"abcdef", (size_t)3);
+ std::basic_string w(L"abcdef", (std::size_t)3);
ASSERT_SAME_TYPE(decltype(w), std::wstring);
assert(w == L"abc");
#endif
}
{ // Testing (6) w/ allocator
- std::basic_string s("abc", (size_t)2, std::allocator<char>{});
+ std::basic_string s("abc", (std::size_t)2, std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "ab");
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
index c2b97ec..1e24c20 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
@@ -31,7 +31,7 @@
{
typedef T value_type;
some_alloc(const some_alloc&);
- T *allocate(size_t);
+ T *allocate(std::size_t);
};
template <class T>
@@ -41,7 +41,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- T *allocate(size_t);
+ T *allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
@@ -55,7 +55,7 @@
some_alloc3() {}
some_alloc3(const some_alloc3&);
- T *allocate(size_t);
+ T *allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cpp
index ebe4e49..6c5049f 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cpp
@@ -17,25 +17,37 @@
#include "test_macros.h"
#include "min_allocator.h"
+#include "nasty_string.h"
+
+template <class S>
+TEST_CONSTEXPR_CXX20 void test() {
+ using CharT = typename S::value_type;
+
+ S s(CONVERT_TO_CSTRING(CharT, "123"));
+ s.append({CharT('a'), CharT('b'), CharT('c')});
+ assert(s == CONVERT_TO_CSTRING(CharT, "123abc"));
+}
TEST_CONSTEXPR_CXX20 bool test() {
- {
- std::string s("123");
- s.append({'a', 'b', 'c'});
- assert(s == "123abc");
- }
- {
- typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
- S s("123");
- s.append({'a', 'b', 'c'});
- assert(s == "123abc");
- }
+ test<std::string>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<std::wstring>();
+#endif
+#if TEST_STD_VER >= 20
+ test<std::u8string>();
+#endif
+ test<std::u16string>();
+ test<std::u32string>();
+
+ test<std::basic_string<char, std::char_traits<char>, min_allocator<char>>>();
+#ifndef TEST_HAS_NO_NASTY_STRING
+ test<nasty_string>();
+#endif
return true;
}
-int main(int, char**)
-{
+int main(int, char**) {
test();
#if TEST_STD_VER > 17
static_assert(test());
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
index 83b8d8a..cf74053 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
@@ -154,7 +154,7 @@
{ // test appending a different type
typedef std::string S;
- const uint8_t p[] = "ABCD";
+ const std::uint8_t p[] = "ABCD";
S s;
s.append(p, p + 4);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
index 7d9cf9a..809ed97 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
@@ -35,15 +35,15 @@
static bool eq(char_type c1, char_type c2);
static bool lt(char_type c1, char_type c2);
- static int compare(const char_type* s1, const char_type* s2, size_t n);
- static size_t length(const char_type* s);
- static const char_type* find(const char_type* s, size_t n, const char_type& a);
- static char_type* move(char_type* s1, const char_type* s2, size_t n);
- static TEST_CONSTEXPR_CXX20 char_type* copy(char_type* s1, const char_type* s2, size_t n) {
+ static int compare(const char_type* s1, const char_type* s2, std::size_t n);
+ static std::size_t length(const char_type* s);
+ static const char_type* find(const char_type* s, std::size_t n, const char_type& a);
+ static char_type* move(char_type* s1, const char_type* s2, std::size_t n);
+ static TEST_CONSTEXPR_CXX20 char_type* copy(char_type* s1, const char_type* s2, std::size_t n) {
std::copy_n(s2, n, s1);
return s1;
}
- static TEST_CONSTEXPR_CXX20 char_type* assign(char_type* s, size_t n, char_type a) {
+ static TEST_CONSTEXPR_CXX20 char_type* assign(char_type* s, std::size_t n, char_type a) {
std::fill_n(s, n, a);
return s;
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
index 3b8d0dc..9af2f12 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
@@ -155,7 +155,7 @@
{ // test assigning a different type
typedef std::string S;
- const uint8_t p[] = "ABCD";
+ const std::uint8_t p[] = "ABCD";
S s;
s.assign(p, p + 4);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
index c0822d4..9950374 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
@@ -15,91 +15,89 @@
#include <cassert>
#include "test_macros.h"
+#include "nasty_string.h"
#include "min_allocator.h"
#include "test_allocator.h"
template <class S>
-TEST_CONSTEXPR_CXX20 void
-test(S s, S str, S expected)
-{
- s.assign(str);
- LIBCPP_ASSERT(s.__invariants());
- assert(s == expected);
+TEST_CONSTEXPR_CXX20 void test(S dest, S src) {
+ dest.assign(src);
+ LIBCPP_ASSERT(dest.__invariants());
+ assert(dest == src);
}
template <class S>
TEST_CONSTEXPR_CXX20 void
-testAlloc(S s, S str, const typename S::allocator_type& a)
+testAlloc(S dest, S src, const typename S::allocator_type& a)
{
- s.assign(str);
- LIBCPP_ASSERT(s.__invariants());
- assert(s == str);
- assert(s.get_allocator() == a);
+ dest.assign(src);
+ LIBCPP_ASSERT(dest.__invariants());
+ assert(dest == src);
+ assert(dest.get_allocator() == a);
+}
+
+template <class S>
+TEST_CONSTEXPR_CXX20 void test_assign() {
+ using CharT = typename S::value_type;
+
+ test(S(), S());
+ test(S(), S(CONVERT_TO_CSTRING(CharT, "12345")));
+ test(S(), S(CONVERT_TO_CSTRING(CharT, "1234567890")));
+ test(S(), S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")));
+
+ test(S(CONVERT_TO_CSTRING(CharT, "12345")), S());
+ test(S(CONVERT_TO_CSTRING(CharT, "12345")), S(CONVERT_TO_CSTRING(CharT, "12345")));
+ test(S(CONVERT_TO_CSTRING(CharT, "12345")), S(CONVERT_TO_CSTRING(CharT, "1234567890")));
+ test(S(CONVERT_TO_CSTRING(CharT, "12345")), S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")));
+
+ test(S(CONVERT_TO_CSTRING(CharT, "1234567890")), S());
+ test(S(CONVERT_TO_CSTRING(CharT, "1234567890")), S(CONVERT_TO_CSTRING(CharT, "12345")));
+ test(S(CONVERT_TO_CSTRING(CharT, "1234567890")), S(CONVERT_TO_CSTRING(CharT, "1234567890")));
+ test(S(CONVERT_TO_CSTRING(CharT, "1234567890")), S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")));
+
+ test(S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")), S());
+ test(S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")), S(CONVERT_TO_CSTRING(CharT, "12345")));
+ test(S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")), S(CONVERT_TO_CSTRING(CharT, "1234567890")));
+ test(S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")), S(CONVERT_TO_CSTRING(CharT, "12345678901234567890")));
}
TEST_CONSTEXPR_CXX20 bool test() {
- {
- typedef std::string S;
- test(S(), S(), S());
- test(S(), S("12345"), S("12345"));
- test(S(), S("1234567890"), S("1234567890"));
- test(S(), S("12345678901234567890"), S("12345678901234567890"));
+ test_assign<std::string>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_assign<std::wstring>();
+#endif
+#if TEST_STD_VER >= 20
+ test_assign<std::u8string>();
+#endif
+#if TEST_STD_VER >= 11
+ test_assign<std::u16string>();
+ test_assign<std::u32string>();
+#endif
+#ifndef TEST_HAS_NO_NASTY_STRING
+ test_assign<nasty_string>();
+#endif
- test(S("12345"), S(), S());
- test(S("12345"), S("12345"), S("12345"));
- test(S("12345"), S("1234567890"), S("1234567890"));
- test(S("12345"), S("12345678901234567890"), S("12345678901234567890"));
+ {
+ typedef std::string S;
+ testAlloc(S(), S(), std::allocator<char>());
+ testAlloc(S(), S("12345"), std::allocator<char>());
+ testAlloc(S(), S("1234567890"), std::allocator<char>());
+ testAlloc(S(), S("12345678901234567890"), std::allocator<char>());
+ }
- test(S("1234567890"), S(), S());
- test(S("1234567890"), S("12345"), S("12345"));
- test(S("1234567890"), S("1234567890"), S("1234567890"));
- test(S("1234567890"), S("12345678901234567890"), S("12345678901234567890"));
-
- test(S("12345678901234567890"), S(), S());
- test(S("12345678901234567890"), S("12345"), S("12345"));
- test(S("12345678901234567890"), S("1234567890"), S("1234567890"));
- test(S("12345678901234567890"), S("12345678901234567890"),
- S("12345678901234567890"));
-
- testAlloc(S(), S(), std::allocator<char>());
- testAlloc(S(), S("12345"), std::allocator<char>());
- testAlloc(S(), S("1234567890"), std::allocator<char>());
- testAlloc(S(), S("12345678901234567890"), std::allocator<char>());
- }
-
- { // LWG#5579 make sure assign takes the allocators where appropriate
- typedef other_allocator<char> A; // has POCCA --> true
- typedef std::basic_string<char, std::char_traits<char>, A> S;
- testAlloc(S(A(5)), S(A(3)), A(3));
- testAlloc(S(A(5)), S("1"), A());
- testAlloc(S(A(5)), S("1", A(7)), A(7));
- testAlloc(S(A(5)), S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)), A(7));
- }
+ { // LWG#5579 make sure assign takes the allocators where appropriate
+ typedef other_allocator<char> A; // has POCCA --> true
+ typedef std::basic_string<char, std::char_traits<char>, A> S;
+ testAlloc(S(A(5)), S(A(3)), A(3));
+ testAlloc(S(A(5)), S("1"), A());
+ testAlloc(S(A(5)), S("1", A(7)), A(7));
+ testAlloc(S(A(5)), S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)), A(7));
+ }
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
- test(S(), S(), S());
- test(S(), S("12345"), S("12345"));
- test(S(), S("1234567890"), S("1234567890"));
- test(S(), S("12345678901234567890"), S("12345678901234567890"));
-
- test(S("12345"), S(), S());
- test(S("12345"), S("12345"), S("12345"));
- test(S("12345"), S("1234567890"), S("1234567890"));
- test(S("12345"), S("12345678901234567890"), S("12345678901234567890"));
-
- test(S("1234567890"), S(), S());
- test(S("1234567890"), S("12345"), S("12345"));
- test(S("1234567890"), S("1234567890"), S("1234567890"));
- test(S("1234567890"), S("12345678901234567890"), S("12345678901234567890"));
-
- test(S("12345678901234567890"), S(), S());
- test(S("12345678901234567890"), S("12345"), S("12345"));
- test(S("12345678901234567890"), S("1234567890"), S("1234567890"));
- test(S("12345678901234567890"), S("12345678901234567890"),
- S("12345678901234567890"));
-
+ test_assign<S>();
testAlloc(S(), S(), min_allocator<char>());
testAlloc(S(), S("12345"), min_allocator<char>());
testAlloc(S(), S("1234567890"), min_allocator<char>());
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
index fb32892..d7f3ca3 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
@@ -145,7 +145,7 @@
{ // test assigning a different type
typedef std::string S;
- const uint8_t p[] = "ABCD";
+ const std::uint8_t p[] = "ABCD";
S s;
s.insert(s.begin(), p, p + 4);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
index 5a1282c..c70a43e 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
@@ -1028,8 +1028,8 @@
}
{ // test assigning a different type
- const uint8_t pc[] = "ABCD";
- uint8_t p[] = "EFGH";
+ const std::uint8_t pc[] = "ABCD";
+ std::uint8_t p[] = "EFGH";
S s;
s.replace(s.begin(), s.end(), pc, pc + 4);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
index d9f71bd..03b3b98 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
@@ -59,8 +59,8 @@
};
static_assert(v.size() == vn.size());
- for (size_t i = 0; i < v.size(); ++i) {
- for (size_t j = 0; j < v.size(); ++j) {
+ for (std::size_t i = 0; i < v.size(); ++i) {
+ for (std::size_t j = 0; j < v.size(); ++j) {
assert(testOrder(v[i], v[j], i == j ? Ordering::equivalent : i < j ? Ordering::less : Ordering::greater));
assert(testOrder(
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
index de82002..9a5513b 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
@@ -34,7 +34,7 @@
some_alloc() {}
some_alloc(const some_alloc&);
- T *allocate(size_t);
+ T *allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::true_type propagate_on_container_swap;
};
@@ -46,7 +46,7 @@
some_alloc2() {}
some_alloc2(const some_alloc2&);
- T *allocate(size_t);
+ T *allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_swap;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
index f7087fd..822f1a6 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
@@ -21,7 +21,7 @@
template <class C>
TEST_CONSTEXPR_CXX20 void test_contiguous ( const C &c )
{
- for ( size_t i = 0; i < c.size(); ++i )
+ for ( std::size_t i = 0; i < c.size(); ++i )
assert ( *(c.begin() + static_cast<typename C::difference_type>(i)) == *(std::addressof(*c.begin()) + i));
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
index 909f2c0..db00cbd 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
@@ -11,9 +11,6 @@
// Apple platforms don't provide <uchar.h> yet, so these tests fail.
// XFAIL: target={{.+}}-apple-{{.+}}
-// The system-provided <uchar.h> seems to be broken on AIX
-// XFAIL: LIBCXX-AIX-FIXME
-
// <cuchar>
#include <cuchar>
@@ -24,12 +21,12 @@
// __STDC_UTF_32__ may or may not be defined by the C standard library
#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
-ASSERT_SAME_TYPE(size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
#endif
-ASSERT_SAME_TYPE(size_t, decltype(std::mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::mbrtoc32((char32_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::c16rtomb((char*)0, (char32_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc32((char32_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char32_t)0, (mbstate_t*)0)));
diff --git a/third_party/llvm-project/libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp b/third_party/llvm-project/libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp
index f39aef4..bc058d4 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp
@@ -8,20 +8,23 @@
// UNSUPPORTED: c++03
-// The system-provided <uchar.h> seems to be broken on AIX:
-// error: 'error' diagnostics seen but not expected:
-// File /usr/include/uchar.h Line 38: cannot combine with previous 'type-name' declaration specifier
-// File /usr/include/uchar.h Line 39: cannot combine with previous 'type-name' declaration specifier
-// 2 errors generated.
-// XFAIL: LIBCXX-AIX-FIXME
-
#include <uchar.h>
+#include "test_macros.h"
+
+// When C++ char8_t support is not enabled, definitions of these functions that
+// match the C2X declarations may still be present in the global namespace with
+// a char8_t typedef substituted for the C++ char8_t type. If so, these are not
+// the declarations we are looking for, so don't test for them.
+#if !defined(TEST_HAS_NO_CHAR8_T)
using U = decltype(::c8rtomb);
using V = decltype(::mbrtoc8);
-#if defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
+# if defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
// expected-error@-3 {{no member named 'c8rtomb' in the global namespace}}
// expected-error@-3 {{no member named 'mbrtoc8' in the global namespace}}
+# else
+// expected-no-diagnostics
+# endif
#else
// expected-no-diagnostics
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stod.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stod.pass.cpp
index bc553ad..dbf10a4 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stod.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stod.pass.cpp
@@ -27,29 +27,29 @@
assert(std::stod("-10") == -10);
assert(std::stod(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stod("10g", &idx) == 10);
assert(idx == 2);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stod("1.e60", &idx) == 1.e60);
assert(idx == 5);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stod("INF", &idx) == INFINITY);
assert(idx == 3);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::isnan(std::stod("NAN", &idx)));
assert(idx == 3);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stod("1.e360", &idx) == INFINITY);
assert(false);
@@ -58,7 +58,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stod("", &idx);
assert(false);
@@ -67,7 +67,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stod(" - 8", &idx);
assert(false);
@@ -76,7 +76,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stod("a1", &idx);
assert(false);
@@ -95,28 +95,28 @@
assert(std::stod(L"-10.5") == -10.5);
assert(std::stod(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stod(L"10g", &idx) == 10);
assert(idx == 2);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stod(L"1.e60", &idx) == 1.e60);
assert(idx == 5);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stod(L"INF", &idx) == INFINITY);
assert(idx == 3);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::isnan(std::stod(L"NAN", &idx)));
assert(idx == 3);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stod(L"1.e360", &idx) == INFINITY);
assert(false);
@@ -125,7 +125,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stod(L"", &idx);
assert(false);
@@ -134,7 +134,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stod(L" - 8", &idx);
assert(false);
@@ -143,7 +143,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stod(L"a1", &idx);
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stof.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stof.pass.cpp
index da4bddd..d95e5d1 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stof.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stof.pass.cpp
@@ -25,23 +25,23 @@
assert(std::stof("-10") == -10);
assert(std::stof(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stof("10g", &idx) == 10);
assert(idx == 2);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stof("INF", &idx) == INFINITY);
assert(idx == 3);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::isnan(std::stof("NAN", &idx)));
assert(idx == 3);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stof("1.e60", &idx) == INFINITY);
assert(false);
@@ -50,7 +50,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stof("1.e360", &idx) == INFINITY);
assert(false);
@@ -59,7 +59,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stof("", &idx);
assert(false);
@@ -68,7 +68,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stof(" - 8", &idx);
assert(false);
@@ -77,7 +77,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stof("a1", &idx);
assert(false);
@@ -93,23 +93,23 @@
assert(std::stof(L"-10.5") == -10.5);
assert(std::stof(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stof(L"10g", &idx) == 10);
assert(idx == 2);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stof(L"INF", &idx) == INFINITY);
assert(idx == 3);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::isnan(std::stof(L"NAN", &idx)));
assert(idx == 3);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stof(L"1.e60", &idx) == INFINITY);
assert(false);
@@ -118,7 +118,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stof(L"1.e360", &idx) == INFINITY);
assert(false);
@@ -127,7 +127,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stof(L"", &idx);
assert(false);
@@ -136,7 +136,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stof(L" - 8", &idx);
assert(false);
@@ -145,7 +145,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stof(L"a1", &idx);
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoi.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
index 8a8ea64..f7650e3 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
@@ -24,13 +24,13 @@
assert(std::stoi("-10") == -10);
assert(std::stoi(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoi("10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max()) {
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi("0x100000000", &idx, 16);
assert(false);
@@ -39,7 +39,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi("", &idx);
assert(false);
@@ -48,7 +48,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi(" - 8", &idx);
assert(false);
@@ -57,7 +57,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi("a1", &idx);
assert(false);
@@ -73,13 +73,13 @@
assert(std::stoi(L"-10") == -10);
assert(std::stoi(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoi(L"10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max()) {
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi(L"0x100000000", &idx, 16);
assert(false);
@@ -88,7 +88,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi(L"", &idx);
assert(false);
@@ -97,7 +97,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi(L" - 8", &idx);
assert(false);
@@ -106,7 +106,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoi(L"a1", &idx);
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stol.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stol.pass.cpp
index 3f37693..2356ae8 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stol.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stol.pass.cpp
@@ -24,13 +24,13 @@
assert(std::stol("-10") == -10);
assert(std::stol(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stol("10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stol("", &idx);
assert(false);
@@ -39,7 +39,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stol(" - 8", &idx);
assert(false);
@@ -48,7 +48,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stol("a1", &idx);
assert(false);
@@ -57,7 +57,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stol("9999999999999999999999999999999999999999999999999", &idx);
@@ -74,13 +74,13 @@
assert(std::stol(L"-10") == -10);
assert(std::stol(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stol(L"10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stol(L"", &idx);
assert(false);
@@ -89,7 +89,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stol(L" - 8", &idx);
assert(false);
@@ -98,7 +98,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stol(L"a1", &idx);
assert(false);
@@ -107,7 +107,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stol(L"9999999999999999999999999999999999999999999999999", &idx);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stold.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stold.pass.cpp
index abe8842..dc9d3c6 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stold.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stold.pass.cpp
@@ -25,29 +25,29 @@
assert(std::stold("-10") == -10);
assert(std::stold(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stold("10g", &idx) == 10);
assert(idx == 2);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stold("1.e60", &idx) == 1.e60L);
assert(idx == 5);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stold("INF", &idx) == INFINITY);
assert(idx == 3);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::isnan(std::stold("NAN", &idx)));
assert(idx == 3);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stold("", &idx);
assert(false);
@@ -56,7 +56,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stold(" - 8", &idx);
assert(false);
@@ -65,7 +65,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stold("a1", &idx);
assert(false);
@@ -74,7 +74,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stold("1.e6000", &idx) == INFINITY);
assert(false);
@@ -90,28 +90,28 @@
assert(std::stold(L"-10.5") == -10.5);
assert(std::stold(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stold(L"10g", &idx) == 10);
assert(idx == 2);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stold(L"1.e60", &idx) == 1.e60L);
assert(idx == 5);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stold(L"INF", &idx) == INFINITY);
assert(idx == 3);
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::isnan(std::stold(L"NAN", &idx)));
assert(idx == 3);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stold(L"", &idx);
assert(false);
@@ -120,7 +120,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stold(L" - 8", &idx);
assert(false);
@@ -129,7 +129,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stold(L"a1", &idx);
assert(false);
@@ -138,7 +138,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
assert(std::stold(L"1.e6000", &idx) == INFINITY);
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoll.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
index b8eb1b5..fc6bd13 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
@@ -24,13 +24,13 @@
assert(std::stoll("-10") == -10);
assert(std::stoll(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoll("10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoll("", &idx);
assert(false);
@@ -39,7 +39,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoll(" - 8", &idx);
assert(false);
@@ -48,7 +48,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoll("a1", &idx);
assert(false);
@@ -57,7 +57,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stoll("99999999999999999999999999", &idx);
@@ -74,13 +74,13 @@
assert(std::stoll(L"-10") == -10);
assert(std::stoll(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoll(L"10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoll(L"", &idx);
assert(false);
@@ -89,7 +89,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoll(L" - 8", &idx);
assert(false);
@@ -98,7 +98,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoll(L"a1", &idx);
assert(false);
@@ -107,7 +107,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stoll(L"99999999999999999999999999", &idx);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoul.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
index b84891e..a8d23f9 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
@@ -23,13 +23,13 @@
assert(std::stoul("-0") == 0);
assert(std::stoul(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoul("10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoul("", &idx);
assert(false);
@@ -38,7 +38,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoul(" - 8", &idx);
assert(false);
@@ -47,7 +47,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoul("a1", &idx);
assert(false);
@@ -56,7 +56,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stoul("9999999999999999999999999999999999999999999999999", &idx);
@@ -72,13 +72,13 @@
assert(std::stoul(L"-0") == 0);
assert(std::stoul(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoul(L"10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoul(L"", &idx);
assert(false);
@@ -87,7 +87,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoul(L" - 8", &idx);
assert(false);
@@ -96,7 +96,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoul(L"a1", &idx);
assert(false);
@@ -105,7 +105,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stoul(L"9999999999999999999999999999999999999999999999999", &idx);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoull.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
index 744dcab..2757cea 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
@@ -23,13 +23,13 @@
assert(std::stoull("-0") == 0);
assert(std::stoull(" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoull("10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoull("", &idx);
assert(false);
@@ -38,7 +38,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoull(" - 8", &idx);
assert(false);
@@ -47,7 +47,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoull("a1", &idx);
assert(false);
@@ -56,7 +56,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stoull("9999999999999999999999999999999999999999999999999", &idx);
@@ -72,13 +72,13 @@
assert(std::stoull(L"-0") == 0);
assert(std::stoull(L" 10") == 10);
{
- size_t idx = 0;
+ std::size_t idx = 0;
assert(std::stoull(L"10g", &idx, 16) == 16);
assert(idx == 2);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoull(L"", &idx);
assert(false);
@@ -87,7 +87,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoull(L" - 8", &idx);
assert(false);
@@ -96,7 +96,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
(void)std::stoull(L"a1", &idx);
assert(false);
@@ -105,7 +105,7 @@
}
}
{
- size_t idx = 0;
+ std::size_t idx = 0;
try {
// LWG#2009 and PR14919
(void)std::stoull(L"9999999999999999999999999999999999999999999999999", &idx);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
index 99a81ac..c010174 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
@@ -17,10 +17,10 @@
#include "test_macros.h"
template <typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
std::basic_string_view<CharT> sv ( s, len );
assert ( sv.length() == len );
- for ( size_t i = 0; i < len; ++i ) {
+ for ( std::size_t i = 0; i < len; ++i ) {
assert ( sv.at(i) == s[i] );
assert ( &sv.at(i) == s + i );
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
index 49b84ab..e63b80d 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
@@ -18,7 +18,7 @@
#include "test_macros.h"
template <typename CharT>
-bool test ( const CharT *s, size_t len ) {
+bool test ( const CharT *s, std::size_t len ) {
typedef std::basic_string_view<CharT> SV;
SV sv ( s, len );
ASSERT_SAME_TYPE(decltype(sv.back()), typename SV::const_reference);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
index 50d2a14..bf5485b 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
@@ -19,7 +19,7 @@
#include "test_macros.h"
template <typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
std::basic_string_view<CharT> sv ( s, len );
assert ( sv.length() == len );
assert ( sv.data() == s );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
index d9e1607..72aa025 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
@@ -18,7 +18,7 @@
#include "test_macros.h"
template <typename CharT>
-bool test ( const CharT *s, size_t len ) {
+bool test ( const CharT *s, std::size_t len ) {
typedef std::basic_string_view<CharT> SV;
SV sv ( s, len );
ASSERT_SAME_TYPE(decltype(sv.front()), typename SV::const_reference);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
index b27bc65..51c60ec 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
@@ -18,13 +18,13 @@
#include "test_macros.h"
template <typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
typedef std::basic_string_view<CharT> SV;
SV sv ( s, len );
ASSERT_SAME_TYPE(decltype(sv[0]), typename SV::const_reference);
LIBCPP_ASSERT_NOEXCEPT( sv[0]);
assert ( sv.length() == len );
- for ( size_t i = 0; i < len; ++i ) {
+ for ( std::size_t i = 0; i < len; ++i ) {
assert ( sv[i] == s[i] );
assert ( &sv[i] == s + i );
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
index 2e11aa1..a9fd862 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
@@ -59,7 +59,7 @@
}
template<typename CharT>
-void test2 ( const CharT *s, size_t len ) {
+void test2 ( const CharT *s, std::size_t len ) {
{
std::basic_string_view<CharT> sv1 ( s );
assert ( sv1.size() == len );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
index 9e6af24..73e0af7 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
#include <string_view>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::string_view c;
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
index 248ef56..ef120cb 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
@@ -32,7 +32,7 @@
static bool eq(char_wrapper lhs, char_wrapper rhs) { return lhs.c == rhs.c; }
- static size_t length(const char_wrapper* a) {
+ static std::size_t length(const char_wrapper* a) {
static_assert(sizeof(char_wrapper) == 1, "strlen requires this");
return std::strlen(reinterpret_cast<const char*>(a));
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
index 120b9a0..bf4ebd9 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
@@ -47,7 +47,7 @@
static constexpr void assign(char_type& __c1, const char_type& __c2) noexcept { __c1 = __c2; }
static constexpr bool eq(char_type __c1, char_type __c2) noexcept { return __c1 == __c2; }
static constexpr bool lt(char_type __c1, char_type __c2) noexcept { return __c1 < __c2; }
- static constexpr int compare(const char_type* __s1, const char_type* __s2, size_t __n) {
+ static constexpr int compare(const char_type* __s1, const char_type* __s2, std::size_t __n) {
for (; __n; --__n, ++__s1, ++__s2) {
if (lt(*__s1, *__s2))
return -1;
@@ -57,11 +57,11 @@
return 0;
}
- static constexpr size_t length(const char_type* __s);
- static constexpr const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- static constexpr char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- static constexpr char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- static constexpr char_type* assign(char_type* __s, size_t __n, char_type __a);
+ static constexpr std::size_t length(const char_type* __s);
+ static constexpr const char_type* find(const char_type* __s, std::size_t __n, const char_type& __a);
+ static constexpr char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static constexpr char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static constexpr char_type* assign(char_type* __s, std::size_t __n, char_type __a);
static constexpr int_type not_eof(int_type __c) noexcept { return eq_int_type(__c, eof()) ? ~eof() : __c; }
static constexpr char_type to_char_type(int_type __c) noexcept { return char_type(__c); }
static constexpr int_type to_int_type(char_type __c) noexcept { return int_type(__c); }
@@ -91,8 +91,8 @@
};
static_assert(v.size() == vn.size());
- for (size_t i = 0; i < v.size(); ++i) {
- for (size_t j = 0; j < v.size(); ++j) {
+ for (std::size_t i = 0; i < v.size(); ++i) {
+ for (std::size_t j = 0; j < v.size(); ++j) {
assert(testOrder(v[i], v[j], i == j ? Ordering::equivalent : i < j ? Ordering::less : Ordering::greater));
assert(testOrder(
v[i],
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
index 09bd1bd..a2c58c3 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
@@ -34,12 +34,12 @@
static constexpr bool eq(char_type&, const char_type&) noexcept;
static constexpr bool lt(char_type&, const char_type&) noexcept;
- static constexpr int compare(const char_type*, const char_type*, size_t) { return 0; }
- static constexpr size_t length(const char_type*);
- static constexpr const char_type* find(const char_type*, size_t, const char_type&);
- static constexpr char_type* move(char_type*, const char_type*, size_t);
- static constexpr char_type* copy(char_type*, const char_type*, size_t);
- static constexpr char_type* assign(char_type*, size_t, char_type);
+ static constexpr int compare(const char_type*, const char_type*, std::size_t) { return 0; }
+ static constexpr std::size_t length(const char_type*);
+ static constexpr const char_type* find(const char_type*, std::size_t, const char_type&);
+ static constexpr char_type* move(char_type*, const char_type*, std::size_t);
+ static constexpr char_type* copy(char_type*, const char_type*, std::size_t);
+ static constexpr char_type* assign(char_type*, std::size_t, char_type);
static constexpr int_type not_eof(int_type) noexcept;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
index 124aaea..2f1e478 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
@@ -22,7 +22,7 @@
template<typename CharT>
size_t StrLen ( const CharT *s ) {
- size_t retVal = 0;
+ std::size_t retVal = 0;
while ( *s != 0 ) { ++retVal; ++s; }
return retVal;
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
index 8d48f90..8ff6061 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
@@ -20,7 +20,7 @@
#include "test_macros.h"
template<typename CharT>
-void test ( const CharT *s, size_t sz ) {
+void test ( const CharT *s, std::size_t sz ) {
{
typedef std::basic_string_view<CharT> SV;
LIBCPP_ASSERT_NOEXCEPT(SV(s, sz));
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
index a645827..bf24d53 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
@@ -20,7 +20,6 @@
#include <type_traits>
#include <vector>
-#include "constexpr_char_traits.h"
#include "make_string.h"
#include "test_iterators.h"
#include "test_range.h"
@@ -107,6 +106,15 @@
assert(sv == "test");
}
+ // Different trait types
+ {
+ struct OtherTraits : std::char_traits<char> {};
+ std::basic_string_view<char> sv1{"hello"};
+ std::basic_string_view<char, OtherTraits> sv2(sv1);
+ assert(sv1.size() == sv2.size());
+ assert(sv1.data() == sv2.data());
+ }
+
return true;
}
@@ -135,25 +143,7 @@
static_assert(std::is_constructible_v<std::string_view, WithStringViewConversionOperator>); // lvalue
static_assert(std::is_constructible_v<std::string_view, const WithStringViewConversionOperator&>); // const lvalue
-static_assert(std::is_constructible_v<std::string_view, WithStringViewConversionOperator&&>); // rvalue
-
-template <class CharTraits>
-struct WithTraitsType {
- typename CharTraits::char_type* begin() const;
- typename CharTraits::char_type* end() const;
- using traits_type = CharTraits;
-};
-
-using CCT = constexpr_char_traits<char>;
-static_assert(std::is_constructible_v<std::string_view, WithTraitsType<std::char_traits<char>>>);
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
-static_assert(std::is_constructible_v<std::wstring_view, WithTraitsType<std::char_traits<wchar_t>>>);
-#endif
-static_assert(std::is_constructible_v<std::basic_string_view<char, CCT>, WithTraitsType<CCT>>);
-static_assert(!std::is_constructible_v<std::string_view, WithTraitsType<CCT>>); // wrong traits type
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
-static_assert(!std::is_constructible_v<std::wstring_view, WithTraitsType<std::char_traits<char>>>); // wrong traits type
-#endif
+static_assert(std::is_constructible_v<std::string_view, WithStringViewConversionOperator&&>); // rvalue
#ifndef TEST_HAS_NO_EXCEPTIONS
void test_throwing() {
@@ -173,7 +163,7 @@
struct ThrowingSize {
char* begin() const { return nullptr; }
char* end() const { return nullptr; }
- size_t size() const { throw 42; return 0; }
+ std::size_t size() const { throw 42; return 0; }
};
try {
ThrowingSize x;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_string1.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_string1.compile.fail.cpp
deleted file mode 100644
index e4cf136..0000000
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_string1.compile.fail.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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: !stdlib=libc++ && (c++03 || c++11 || c++14)
-
-// <string_view>
-
-// template<class Allocator>
-// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
-
-#include <string_view>
-#include <string>
-#include <cassert>
-
-struct dummy_char_traits : public std::char_traits<char> {};
-
-int main(int, char**) {
- using string_view = std::basic_string_view<char>;
- using string = std:: basic_string <char, dummy_char_traits>;
-
- {
- string s{"QBCDE"};
- string_view sv1 ( s );
- assert ( sv1.size() == s.size());
- assert ( sv1.data() == s.data());
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_string2.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_string2.compile.fail.cpp
deleted file mode 100644
index 30540ee..0000000
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.cons/from_string2.compile.fail.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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: !stdlib=libc++ && (c++03 || c++11 || c++14)
-
-// <string_view>
-
-// template<class Allocator>
-// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
-
-#include <string_view>
-#include <string>
-#include <cassert>
-
-struct dummy_char_traits : public std::char_traits<char> {};
-
-int main(int, char**) {
- using string_view = std::basic_string_view<char, dummy_char_traits>;
- using string = std:: basic_string <char>;
-
- {
- string s{"QBCDE"};
- string_view sv1 ( s );
- assert ( sv1.size() == s.size());
- assert ( sv1.data() == s.data());
- }
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
index a1d6c10..c81b61b 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
@@ -33,14 +33,14 @@
static inline bool eq(char_type __c1, char_type __c2) { return __c1 == __c2; }
static inline bool lt(char_type __c1, char_type __c2) { return __c1 < __c2; }
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- static size_t length(const char_type* __s);
- static const char_type* find(const char_type* __s, size_t __n,
+ static int compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+ static std::size_t length(const char_type* __s);
+ static const char_type* find(const char_type* __s, std::size_t __n,
const char_type& __a);
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
+ static char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static char_type* assign(char_type* __s, std::size_t __n, char_type __a);
static inline int_type not_eof(int_type __c) {
return eq_int_type(__c, eof()) ? ~eof() : __c;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
index 407823b..f0fffbd 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
@@ -36,12 +36,12 @@
static bool eq(char_type, char_type);
static bool lt(char_type, char_type);
- static int compare(const char_type*, const char_type*, size_t);
- static size_t length(const char_type*);
- static const char_type* find(const char_type*, size_t, const char_type&);
- static char_type* move(char_type*, const char_type*, size_t);
- static char_type* copy(char_type*, const char_type*, size_t);
- static char_type* assign(char_type*, size_t, char_type);
+ static int compare(const char_type*, const char_type*, std::size_t);
+ static std::size_t length(const char_type*);
+ static const char_type* find(const char_type*, std::size_t, const char_type&);
+ static char_type* move(char_type*, const char_type*, std::size_t);
+ static char_type* copy(char_type*, const char_type*, std::size_t);
+ static char_type* assign(char_type*, std::size_t, char_type);
static int_type not_eof(int_type);
static char_type to_char_type(int_type);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.io/stream_insert_decl_present.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.io/stream_insert_decl_present.compile.pass.cpp
index 42a83f8..9698ba5 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.io/stream_insert_decl_present.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.io/stream_insert_decl_present.compile.pass.cpp
@@ -15,8 +15,9 @@
// operator<<(basic_ostream<charT, traits>& os,
// const basic_string_view<charT,traits> str);
-#include <string_view>
#include <iosfwd>
+#include <string_view>
+#include <utility>
template <class SV, class = void>
struct HasDecl : std::false_type {};
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
index 9b96c05..e5f0db5 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
@@ -27,7 +27,7 @@
typename S::const_reverse_iterator cb2 = s.crbegin();
if (!s.empty())
{
- const size_t last = s.size() - 1;
+ const std::size_t last = s.size() - 1;
assert( *b == s[last]);
assert( &*b == &s[last]);
assert( *cb1 == s[last]);
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
index bda42f0..4e41130 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
@@ -18,7 +18,7 @@
#include "test_macros.h"
template<typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
typedef std::basic_string_view<CharT> SV;
{
SV sv1 ( s );
@@ -39,7 +39,7 @@
}
#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
+constexpr std::size_t test_ce ( size_t n, size_t k ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
sv1.remove_prefix ( k );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
index 95a2331..2ebe665 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
@@ -18,7 +18,7 @@
#include "test_macros.h"
template<typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
typedef std::basic_string_view<CharT> SV;
{
SV sv1 ( s );
@@ -40,7 +40,7 @@
}
#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
+constexpr std::size_t test_ce ( size_t n, size_t k ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
sv1.remove_suffix ( k );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
index db22998..7f46cbf 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
@@ -18,7 +18,7 @@
#include "test_macros.h"
template<typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
typedef std::basic_string_view<CharT> SV;
{
SV sv1(s);
@@ -37,7 +37,7 @@
}
#if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
+constexpr std::size_t test_ce ( size_t n, size_t k ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
SV sv2 { sv1.data(), k };
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
index a7a5c30..b40ff64 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
@@ -23,7 +23,7 @@
template<typename CharT>
void test1 ( std::basic_string_view<CharT> sv1,
- size_t pos1, size_t n1, const CharT *s, int expected ) {
+ std::size_t pos1, size_t n1, const CharT *s, int expected ) {
#ifdef TEST_HAS_NO_EXCEPTIONS
if (pos1 <= sv1.size())
assert(sign(sv1.compare(pos1, n1, s)) == sign(expected));
@@ -40,7 +40,7 @@
template<typename CharT>
void
-test( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected)
+test( const CharT *s1, std::size_t pos1, size_t n1, const CharT *s2, int expected)
{
typedef std::basic_string_view<CharT> string_view_t;
string_view_t sv1 ( s1 );
@@ -378,7 +378,7 @@
test("abcdefghijklmnopqrst", 5, 5, "", 20);
test("abcdefghijklmnopqrst", 0, 8, "abcde", 15);
test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10);
- test("abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), "abcdefghijklmnopqrst", 0);
+ test("abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), "abcdefghijklmnopqrst", 0);
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
@@ -398,7 +398,7 @@
test(L"abcdefghijklmnopqrst", 5, 5, L"", 20);
test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15);
test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
- test(L"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), L"abcdefghijklmnopqrst", 0);
+ test(L"abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), L"abcdefghijklmnopqrst", 0);
}
#endif
@@ -419,7 +419,7 @@
test(U"abcdefghijklmnopqrst", 5, 5, U"", 20);
test(U"abcdefghijklmnopqrst", 0, 8, U"abcde", 15);
test(U"abcdefghijklmnopqrst", 0, 12, U"abcdefghij", 10);
- test(U"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), U"abcdefghijklmnopqrst", 0);
+ test(U"abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), U"abcdefghijklmnopqrst", 0);
}
{
@@ -438,7 +438,7 @@
test(u"abcdefghijklmnopqrst", 5, 5, u"", 20);
test(u"abcdefghijklmnopqrst", 0, 8, u"abcde", 15);
test(u"abcdefghijklmnopqrst", 0, 12, u"abcdefghij", 10);
- test(u"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), u"abcdefghijklmnopqrst", 0);
+ test(u"abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), u"abcdefghijklmnopqrst", 0);
}
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
index 477bfdd..c1999d2 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
@@ -22,7 +22,7 @@
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
+void test1 ( std::basic_string_view<CharT> sv1, std::size_t pos1, size_t n1,
std::basic_string_view<CharT> sv2, int expected ) {
#ifdef TEST_HAS_NO_EXCEPTIONS
if (pos1 <= sv1.size())
@@ -40,7 +40,7 @@
template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected ) {
+void test ( const CharT *s1, std::size_t pos1, size_t n1, const CharT *s2, int expected ) {
typedef std::basic_string_view<CharT> string_view_t;
string_view_t sv1 ( s1 );
string_view_t sv2 ( s2 );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
index f0c4a79..4e5af15 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
@@ -23,8 +23,8 @@
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
- const CharT *s2, size_t n2, int expected ) {
+void test1 ( std::basic_string_view<CharT> sv1, std::size_t pos1, size_t n1,
+ const CharT *s2, std::size_t n2, int expected ) {
#ifdef TEST_HAS_NO_EXCEPTIONS
if (pos1 <= sv1.size())
assert(sign(sv1.compare(pos1, n1, s2, n2)) == sign(expected));
@@ -41,8 +41,8 @@
template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1,
- const CharT *s2, size_t n2,
+void test ( const CharT *s1, std::size_t pos1, size_t n1,
+ const CharT *s2, std::size_t n2,
int expected ) {
typedef std::basic_string_view<CharT> string_view_t;
string_view_t sv1 ( s1 );
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
index a0f661c..a882372 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
@@ -23,8 +23,8 @@
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
- std::basic_string_view<CharT> sv2, size_t pos2, size_t n2,
+void test1 ( std::basic_string_view<CharT> sv1, std::size_t pos1, size_t n1,
+ std::basic_string_view<CharT> sv2, std::size_t pos2, size_t n2,
int expected ) {
#ifdef TEST_HAS_NO_EXCEPTIONS
if (pos1 <= sv1.size() && pos2 <= sv2.size())
@@ -42,8 +42,8 @@
template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1,
- const CharT *s2, size_t pos2, size_t n2,
+void test ( const CharT *s1, std::size_t pos1, size_t n1,
+ const CharT *s2, std::size_t pos2, size_t n2,
int expected ) {
typedef std::basic_string_view<CharT> string_view_t;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
index 54e185f..0128e98 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
@@ -26,8 +26,8 @@
#include "test_macros.h"
template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv, size_t n, size_t pos ) {
- const size_t rlen = std::min ( n, sv.size() - pos );
+void test1 ( std::basic_string_view<CharT> sv, std::size_t n, size_t pos ) {
+ const std::size_t rlen = std::min ( n, sv.size() - pos );
CharT *dest1 = new CharT [rlen + 1]; dest1[rlen] = 0;
CharT *dest2 = new CharT [rlen + 1]; dest2[rlen] = 0;
@@ -45,7 +45,7 @@
} else {
sv.copy(dest1, n, pos);
std::copy_n(sv.begin() + pos, rlen, dest2);
- for ( size_t i = 0; i <= rlen; ++i )
+ for ( std::size_t i = 0; i <= rlen; ++i )
assert ( dest1[i] == dest2[i] );
}
delete [] dest1;
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
index 92f9d8c..0de64f0 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
@@ -24,7 +24,7 @@
#include "test_macros.h"
template<typename CharT>
-void test1(std::basic_string_view<CharT> sv, size_t n, size_t pos) {
+void test1(std::basic_string_view<CharT> sv, std::size_t n, size_t pos) {
std::basic_string_view<CharT> sv1;
#ifdef TEST_HAS_NO_EXCEPTIONS
if (pos > sv.size())
@@ -40,9 +40,9 @@
return ;
}
#endif
- const size_t rlen = std::min(n, sv.size() - pos);
+ const std::size_t rlen = std::min(n, sv.size() - pos);
assert (sv1.size() == rlen);
- for (size_t i = 0; i < rlen; ++i)
+ for (std::size_t i = 0; i < rlen; ++i)
assert(sv[pos+i] == sv1[i]);
}
diff --git a/third_party/llvm-project/libcxx/test/std/strings/string.view/types.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/string.view/types.pass.cpp
index f952f20..25dc54d 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/string.view/types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/string.view/types.pass.cpp
@@ -47,7 +47,7 @@
static_assert((std::is_same<typename S::traits_type, Traits>::value), "");
static_assert((std::is_same<typename S::value_type, typename Traits::char_type>::value), "");
static_assert((std::is_same<typename S::size_type, std::size_t>::value), "");
- static_assert((std::is_same<typename S::difference_type, ptrdiff_t>::value), "");
+ static_assert((std::is_same<typename S::difference_type, std::ptrdiff_t>::value), "");
static_assert((std::is_same<typename S::reference, typename S::value_type&>::value), "");
static_assert((std::is_same<typename S::const_reference, const typename S::value_type&>::value), "");
static_assert((std::is_same<typename S::pointer, typename S::value_type*>::value), "");
diff --git a/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase.pass.cpp
index aa397ca..ed7dc3c 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase.pass.cpp
@@ -22,7 +22,7 @@
#include "min_allocator.h"
template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
assert(expected_erased_count == std::erase(s, val));
LIBCPP_ASSERT(s.__invariants());
diff --git a/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp b/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
index 1957451..b098f88 100644
--- a/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
@@ -21,7 +21,7 @@
#include "min_allocator.h"
template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
assert(expected_erased_count == std::erase_if(s, p));
LIBCPP_ASSERT(s.__invariants());
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async.verify.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async.verify.cpp
index 997d27a..e47ad82 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async.verify.cpp
@@ -21,18 +21,10 @@
#include <future>
-#include <atomic>
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
int foo (int x) { return x; }
-int main(int, char**)
-{
+void f() {
std::async( foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
std::async(std::launch::async, foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async_race.38682.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async_race.38682.pass.cpp
index d0cee30..310aac5 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async_race.38682.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.async/async_race.38682.pass.cpp
@@ -11,7 +11,7 @@
// There's currently no release of OS X whose dylib contains the patch for
// PR38682. Since the fix for future<void> is in the dylib, this test may fail.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// This test is designed to cause and allow TSAN to detect a race condition
// in std::async, as reported in https://llvm.org/PR38682.
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.errors/default_error_condition.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.errors/default_error_condition.pass.cpp
index ea25027..5871861 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.errors/default_error_condition.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.errors/default_error_condition.pass.cpp
@@ -16,6 +16,7 @@
#include <future>
#include <cassert>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.future_error/what.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.future_error/what.pass.cpp
index f62212e..48ae35b 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.future_error/what.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.future_error/what.pass.cpp
@@ -11,7 +11,7 @@
// LWG 2056 changed the values of future_errc, so if we're using new headers
// with an old library we'll get incorrect messages.
//
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11}}
// <future>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
index 96d7e57..84fa1c4 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
@@ -16,10 +16,7 @@
#include <future>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
{
std::promise<int> p0, p;
p = p0; // expected-error {{overload resolution selected deleted operator '='}}
@@ -32,6 +29,4 @@
std::promise<void> p0, p;
p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
index b4f3d7f..437642b 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
@@ -16,10 +16,7 @@
#include <future>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
{
std::promise<int> p0;
std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}}
@@ -32,6 +29,4 @@
std::promise<void> p0;
std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}}
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.shared_future/wait.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.shared_future/wait.pass.cpp
index 12c71ab..5709e9d 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.shared_future/wait.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.shared_future/wait.pass.cpp
@@ -18,6 +18,7 @@
#include <cassert>
#include <chrono>
#include <future>
+#include <ratio>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
index 284ccd8..cb7e855 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
@@ -16,10 +16,7 @@
#include <future>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
{
std::future<int> f0, f;
f = f0; // expected-error {{overload resolution selected deleted operator '='}}
@@ -32,6 +29,4 @@
std::future<void> f0, f;
f = f0; // expected-error {{overload resolution selected deleted operator '='}}
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
index 4424890..4ab51ef 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
@@ -16,10 +16,7 @@
#include <future>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
{
std::future<int> f0;
std::future<int> f = f0; // expected-error {{call to deleted constructor of 'std::future<int>'}}
@@ -32,6 +29,4 @@
std::future<void> f0;
std::future<void> f = f0; // expected-error {{call to deleted constructor of 'std::future<void>'}}
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/wait.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/wait.pass.cpp
index 2385156..4e6b789 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/wait.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/futures/futures.unique_future/wait.pass.cpp
@@ -18,6 +18,7 @@
#include <cassert>
#include <chrono>
#include <future>
+#include <ratio>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
index c982c27..18cdc6d 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <barrier>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
index da75565..3fc4826 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <barrier>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
index 14503b4..2aee862 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <barrier>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/completion.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
index 7cc7ce9..7354dbe 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <barrier>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
index a49a438..ffb632a 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
@@ -8,11 +8,15 @@
//
// UNSUPPORTED: no-threads
-// ALLOW_RETRIES: 3
-
// notify_all_at_thread_exit(...) requires move semantics to transfer the unique_lock.
// UNSUPPORTED: c++03
+// The fix of LWG3343 is done in the dylib. That means Apple backdeployment
+// targets remain broken. Due to the nature of the test, testing on a broken
+// system does not guarantee that the test fails, so the test can't use XFAIL.
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{.+}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx11.{{.+}}
+
// This is a regression test for LWG3343.
//
// <condition_variable>
@@ -29,6 +33,8 @@
#include <mutex>
#include <thread>
+int condition_variable_lock_skipped_counter = 0;
+
union X {
X() : cv_() {}
~X() {}
@@ -46,11 +52,13 @@
for (int i = 0; i < N; ++i) {
std::thread t = support::make_test_thread([&] {
- // Signal thread completion
+ // Emulate work being done.
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
+
+ // Signal thread completion.
std::unique_lock<std::mutex> lk(m);
--threads_active;
std::notify_all_at_thread_exit(x.cv_, std::move(lk));
- std::this_thread::sleep_for(std::chrono::milliseconds(1));
});
t.detach();
}
@@ -62,6 +70,15 @@
// unlocks `m`.
{
std::unique_lock<std::mutex> lk(m);
+ // Due to OS scheduling the workers might have terminated when this
+ // code is reached. In that case the wait will not sleep and the call
+ // to notify_all_at_thread_exit has no effect; the condition variable
+ // will not be used here.
+ //
+ // Keep track of how often that happens, if too often the test needs
+ // to be improved.
+ if(threads_active == 0)
+ ++condition_variable_lock_skipped_counter;
x.cv_.wait(lk, [&]() { return threads_active == 0; });
}
@@ -92,5 +109,9 @@
test();
}
+ // The threshold is arbitrary, it just makes sure the notification is
+ // tested a reasonable number of times.
+ assert(condition_variable_lock_skipped_counter < 250);
+
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp
index fd61634..4e20862 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp
@@ -55,13 +55,14 @@
// that terminate has been called)
-#include <condition_variable>
#include <atomic>
-#include <thread>
-#include <chrono>
-#include <string>
-#include <cstdlib>
#include <cassert>
+#include <chrono>
+#include <condition_variable>
+#include <cstdlib>
+#include <exception>
+#include <string>
+#include <thread>
#include "make_test_thread.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
index 37b0c6e..ddc06d2 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <latch>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.latch/count_down.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.latch/count_down.pass.cpp
index fe9578b..1503c09 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.latch/count_down.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.latch/count_down.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <latch>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
index 6533b6c..70ef2cd 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <latch>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp
index cb105f2..4d11674 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/implicit_ctad.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/implicit_ctad.pass.cpp
index 3fa4373..23a946b 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/implicit_ctad.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/implicit_ctad.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++98, c++03, c++11, c++14
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
index e901591..547e514 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
index 1db771d..4f6801e 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
index 9bbbb93..c76b73a 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
index c5536d8..3742bec 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
@@ -10,8 +10,7 @@
// UNSUPPORTED: c++03, c++11
// ALLOW_RETRIES: 2
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
@@ -22,11 +21,12 @@
// template<class _Mutex> shared_lock(shared_lock<_Mutex>)
// -> shared_lock<_Mutex>; // C++17
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
#include <vector>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
index da4db9e..6a2e259 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
index 5c698e0..949d6c2 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
index 4c4f04a..3259ca7 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
index 7ab3c2c..c5d1614 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
index fde0ed6..4f7b764 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
@@ -10,8 +10,7 @@
// UNSUPPORTED: c++03, c++11
// ALLOW_RETRIES: 2
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
@@ -19,11 +18,13 @@
// shared_lock(mutex_type& m, try_to_lock_t);
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
+#include <mutex>
#include <shared_mutex>
#include <thread>
#include <vector>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
index 1bc131a..e7d2462 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
@@ -10,8 +10,7 @@
// UNSUPPORTED: c++03, c++11
// ALLOW_RETRIES: 2
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
@@ -19,11 +18,14 @@
// void lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
+#include <mutex>
#include <shared_mutex>
+#include <system_error>
#include <thread>
#include <vector>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
index ae387cd..0e707fc 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
@@ -17,9 +17,10 @@
// bool try_lock();
-#include <shared_mutex>
#include <cassert>
#include <mutex>
+#include <shared_mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
index 7f8189c..d28ae39 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
@@ -16,10 +16,11 @@
// template <class Rep, class Period>
// bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
-#include <shared_mutex>
#include <cassert>
#include <chrono>
#include <mutex>
+#include <shared_mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
index fb4afdd..880bf1c 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
@@ -16,10 +16,11 @@
// template <class Clock, class Duration>
// bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
-#include <shared_mutex>
#include <cassert>
#include <chrono>
#include <mutex>
+#include <shared_mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
index 210824e..4f31a75 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
@@ -15,8 +15,9 @@
// void unlock();
-#include <shared_mutex>
#include <cassert>
+#include <cerrno>
+#include <shared_mutex>
#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
index 216a6a0..d5c88ce 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
index abe9198..91e25a2 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// dylib support for shared_mutex was added in macosx10.12
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// XFAIL: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
index bba78cf..2be2574 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
@@ -18,10 +18,11 @@
// template<class _Mutex> unique_lock(unique_lock<_Mutex>)
// -> unique_lock<_Mutex>; // C++17
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_adopt_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_adopt_lock.pass.cpp
index b2e8065..4adbe26 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_adopt_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_adopt_lock.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_defer_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_defer_lock.pass.cpp
index fa00da6..06ef204 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_defer_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_defer_lock.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_try_to_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_try_to_lock.pass.cpp
index 39d3bde..992d383 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_try_to_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_try_to_lock.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// ALLOW_RETRIES: 2
// <mutex>
@@ -15,10 +16,11 @@
// unique_lock(mutex_type& m, try_to_lock_t);
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
index b1b5af0..920baa7 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// ALLOW_RETRIES: 2
// <mutex>
@@ -15,10 +16,12 @@
// void lock();
-#include <mutex>
-#include <thread>
-#include <cstdlib>
#include <cassert>
+#include <chrono>
+#include <cstdlib>
+#include <mutex>
+#include <system_error>
+#include <thread>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
index 83e1d7e..4cf5ec2 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
-//
+// UNSUPPORTED: c++03
// ALLOW_RETRIES: 2
// <mutex>
@@ -16,8 +16,9 @@
// bool try_lock();
-#include <mutex>
#include <cassert>
+#include <mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
index 1a0fba6..8e7004e 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
@@ -15,8 +16,9 @@
// template <class Rep, class Period>
// bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
-#include <mutex>
#include <cassert>
+#include <mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
index 3f6f213..077bc51 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
@@ -15,8 +16,9 @@
// template <class Clock, class Duration>
// bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
-#include <mutex>
#include <cassert>
+#include <mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp
index 4cd72b6..30c7951 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp
@@ -14,8 +14,9 @@
// void unlock();
-#include <mutex>
#include <cassert>
+#include <mutex>
+#include <system_error>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp
index 2776e00..bb4e9b4 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock/types.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: no-threads
+// UNSUPPORTED: c++03
// <mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/lock.pass.cpp
index 6f91cc3..b3e76cf 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/lock.pass.cpp
@@ -15,10 +15,11 @@
// void lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/try_lock.pass.cpp
index 645b74b..bf3cb65 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/try_lock.pass.cpp
@@ -15,10 +15,11 @@
// bool try_lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/lock.pass.cpp
index 51b64b9..d9bff9b 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/lock.pass.cpp
@@ -15,10 +15,11 @@
// void lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/try_lock.pass.cpp
index 801e2e7..1247c1c 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/try_lock.pass.cpp
@@ -15,10 +15,11 @@
// bool try_lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp
index 4f95c5c..0dcd48e 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp
index 182ba37..ad3ffd8 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp
index 0402a89..84763cd 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/default.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11, c++14
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp
index 24a52ae..82ad573 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
@@ -20,10 +19,11 @@
// void lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp
index 3f5a064..b761675 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
@@ -20,11 +19,12 @@
// void lock_shared();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
#include <vector>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp
index 92727ea..675369f 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
@@ -20,10 +19,11 @@
// bool try_lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp
index ac6a95b..33bbf0a 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
@@ -20,11 +19,12 @@
// bool try_lock_shared();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
#include <vector>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.compile.fail.cpp
index 9af5a4f..ca1d0ff 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.compile.fail.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.compile.fail.cpp
index c9ec248..0458f9c 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.compile.fail.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
index 1456606..e663366 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
index c4836a5..606a377 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// ALLOW_RETRIES: 3
@@ -20,12 +19,12 @@
// void lock();
-#include <thread>
-
#include <atomic>
-#include <cstdlib>
#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
+#include <thread>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
index 1ec0814..20d7347 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// ALLOW_RETRIES: 3
@@ -20,12 +19,13 @@
// void lock_shared();
-#include <thread>
#include <atomic>
#include <cassert>
+#include <chrono>
#include <cstdlib>
#include <shared_mutex>
+#include <thread>
#include <vector>
#include "make_test_thread.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp
index 20eda45..52d7e22 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
@@ -20,10 +19,11 @@
// bool try_lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
index fd08a2e..d5b9e2f 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
@@ -10,8 +10,7 @@
// UNSUPPORTED: c++03, c++11
// ALLOW_RETRIES: 2
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
index d1f37a9..1c15acb 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
@@ -20,11 +19,12 @@
// bool try_lock_shared();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <shared_mutex>
#include <thread>
#include <vector>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
index 1f8795e..a8b3802 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 3
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
index a3a37d5..9b57c76 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
index 5ac3cfb..6e53704 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
@@ -11,8 +11,7 @@
// ALLOW_RETRIES: 2
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp
index 9589c8d..a8b44ef 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// shared_timed_mutex was introduced in macosx10.12
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11}}
+// UNSUPPORTED: availability-shared_mutex-missing
// <shared_mutex>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/lock.pass.cpp
index a2a91bc..a71bd3d 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/lock.pass.cpp
@@ -15,10 +15,11 @@
// void lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/try_lock.pass.cpp
index 02d0874..f3942cc 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/try_lock.pass.cpp
@@ -15,10 +15,11 @@
// bool try_lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp
index 91c6f1c..bad5a44 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp
@@ -15,10 +15,11 @@
// void lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp
index 5915698..63be0ac 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp
@@ -15,10 +15,11 @@
// bool try_lock();
+#include <cassert>
+#include <chrono>
+#include <cstdlib>
#include <mutex>
#include <thread>
-#include <cstdlib>
-#include <cassert>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
index 32dd77c..3f6e310 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <semaphore>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
index fe1d49f..111a650 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <semaphore>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/max.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/max.pass.cpp
index 5a3026b..ca7ad0c 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/max.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/max.pass.cpp
@@ -21,6 +21,6 @@
static_assert(std::counting_semaphore<>::max() >= 1, "");
static_assert(std::counting_semaphore<1>::max() >= 1, "");
static_assert(std::counting_semaphore<std::numeric_limits<int>::max()>::max() >= std::numeric_limits<int>::max(), "");
- static_assert(std::counting_semaphore<std::numeric_limits<ptrdiff_t>::max()>::max() == std::numeric_limits<ptrdiff_t>::max(), "");
+ static_assert(std::counting_semaphore<std::numeric_limits<std::ptrdiff_t>::max()>::max() == std::numeric_limits<ptrdiff_t>::max(), "");
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/release.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/release.pass.cpp
index 31a9264..bf3dd7f 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/release.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/release.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <semaphore>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
index 9cdee8e..9fa01fc 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <semaphore>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
index d6c898e..0d0f779 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: c++03, c++11
-// This test requires the dylib support introduced in D68480, which shipped in macOS 11.0.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: availability-synchronization_library-missing
// <semaphore>
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
index 7766505..1d959e9 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
@@ -15,10 +15,11 @@
// ~thread();
-#include <thread>
-#include <new>
-#include <cstdlib>
#include <cassert>
+#include <cstdlib>
+#include <exception>
+#include <new>
+#include <thread>
#include "make_test_thread.h"
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.format.pass.cpp
new file mode 100644
index 0000000..5ac9ec7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.format.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: no-threads
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
+// <thread>
+
+// template<class charT>
+// struct formatter<thread::id, charT>;
+
+// template<class... Args>
+// string format(format_string<Args...> fmt, Args&&... args);
+// template<class... Args>
+// wstring format(wformat_string<Args...> fmt, Args&&... args);
+
+#include <format>
+#include <cassert>
+
+#include "assert_macros.h"
+#include "concat_macros.h"
+#include "format.functions.tests.h"
+#include "test_format_string.h"
+#include "test_macros.h"
+
+auto test = []<class CharT, class... Args>(
+ std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
+ std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+};
+
+auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
+ // After P2216 most exceptions thrown by std::format become ill-formed.
+ // Therefore this tests does nothing.
+};
+
+int main(int, char**) {
+ format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ format_tests<wchar_t>(test, test_exception);
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h
new file mode 100644
index 0000000..82e7212
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEST_STD_THREAD_THREAD_THREADS_THREAD_THREAD_CLASS_THREAD_THREAD_ID_FORMAT_FUNCTIONS_TESTS_H
+#define TEST_STD_THREAD_THREAD_THREADS_THREAD_THREAD_CLASS_THREAD_THREAD_ID_FORMAT_FUNCTIONS_TESTS_H
+
+#include <thread>
+
+#include "format.functions.common.h"
+#include "test_macros.h"
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void format_tests(TestFunction check, ExceptionTest check_exception) {
+ // Note the output of std::thread::id is unspecified. The output text is the
+ // same as the stream operator. Since that format is already released this
+ // test follows the practice on existing systems.
+ std::thread::id input{};
+
+ /***** Test the type specific part *****/
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ check(SV("0"), SV("{}"), input);
+
+ // *** align-fill & width ***
+ check(SV(" 0"), SV("{:5}"), input);
+ check(SV("0****"), SV("{:*<5}"), input);
+ check(SV("__0__"), SV("{:_^5}"), input);
+ check(SV("::::0"), SV("{::>5}"), input); // This is not a range, so : is allowed as fill character.
+
+ check(SV(" 0"), SV("{:{}}"), input, 5);
+ check(SV("0****"), SV("{:*<{}}"), input, 5);
+ check(SV("__0__"), SV("{:_^{}}"), input, 5);
+ check(SV("####0"), SV("{:#>{}}"), input, 5);
+#else // !defined(__APPLE__) && !defined(__FreeBSD__)
+ check(SV("0x0"), SV("{}"), input);
+
+ // *** align-fill & width ***
+ check(SV(" 0x0"), SV("{:7}"), input);
+ check(SV("0x0****"), SV("{:*<7}"), input);
+ check(SV("__0x0__"), SV("{:_^7}"), input);
+ check(SV("::::0x0"), SV("{::>7}"), input); // This is not a range, so : is allowed as fill character.
+
+ check(SV(" 0x0"), SV("{:{}}"), input, 7);
+ check(SV("0x0****"), SV("{:*<{}}"), input, 7);
+ check(SV("__0x0__"), SV("{:_^{}}"), input, 7);
+ check(SV("####0x0"), SV("{:#>{}}"), input, 7);
+#endif // !defined(__APPLE__) && !defined(__FreeBSD__)
+
+ /***** Test the type generic part *****/
+ check_exception("The format-spec fill field contains an invalid character", SV("{:}<}"), input);
+ check_exception("The format-spec fill field contains an invalid character", SV("{:{<}"), input);
+
+ // *** sign ***
+ check_exception("The replacement field misses a terminating '}'", SV("{:-}"), input);
+ check_exception("The replacement field misses a terminating '}'", SV("{:+}"), input);
+ check_exception("The replacement field misses a terminating '}'", SV("{: }"), input);
+
+ // *** alternate form ***
+ check_exception("The replacement field misses a terminating '}'", SV("{:#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+
+ // *** precision ***
+ check_exception("The replacement field misses a terminating '}'", SV("{:.}"), input);
+
+ // *** locale-specific form ***
+ check_exception("The replacement field misses a terminating '}'", SV("{:L}"), input);
+
+ // *** type ***
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>(""))
+ check_exception("The replacement field misses a terminating '}'", fmt, input);
+}
+
+#endif // TEST_STD_THREAD_THREAD_THREADS_THREAD_THREAD_CLASS_THREAD_THREAD_ID_FORMAT_FUNCTIONS_TESTS_H
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.vformat.pass.cpp
new file mode 100644
index 0000000..555a10c
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.vformat.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: no-threads
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
+// <thread>
+
+// template<class charT>
+// struct formatter<thread::id, charT>;
+
+// string vformat(string_view fmt, format_args args);
+// wstring vformat(wstring_view fmt, wformat_args args);
+
+#include <format>
+#include <cassert>
+
+#include "assert_macros.h"
+#include "concat_macros.h"
+#include "format.functions.tests.h"
+#include "test_macros.h"
+
+auto test = []<class CharT, class... Args>(
+ std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
+ std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+};
+
+auto test_exception =
+ []<class CharT, class... Args>(
+ [[maybe_unused]] std::string_view what,
+ [[maybe_unused]] std::basic_string_view<CharT> fmt,
+ [[maybe_unused]] Args&&... args) {
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
+ };
+
+int main(int, char**) {
+ format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ format_tests<wchar_t>(test, test_exception);
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.pass.cpp
new file mode 100644
index 0000000..548c9c1
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: no-threads
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// <thread>
+
+// template<class charT>
+// struct formatter<thread::id, charT>;
+
+// template<class FormatContext>
+// typename FormatContext::iterator
+// format(const T& r, FormatContext& ctx) const;
+
+// Note this tests the basics of this function. It's tested in more detail in
+// the format functions test.
+
+#include <cassert>
+#include <concepts>
+#include <thread>
+
+#include "test_format_context.h"
+#include "test_macros.h"
+#include "make_string.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class StringViewT>
+void test_format(StringViewT expected, std::thread::id arg) {
+ using CharT = typename StringViewT::value_type;
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+
+ const std::formatter<std::thread::id, CharT> formatter;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+ formatter.format(arg, format_ctx);
+ assert(result == expected);
+}
+
+template <class CharT>
+void test_fmt() {
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ test_format(SV("0"), std::thread::id());
+#else
+ test_format(SV("0x0"), std::thread::id());
+#endif
+}
+
+void test() {
+ test_fmt<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_fmt<wchar_t>();
+#endif
+}
+
+int main(int, char**) {
+ test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/parse.pass.cpp
new file mode 100644
index 0000000..e4b235e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/parse.pass.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: no-threads
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// <thread>
+
+// template<class charT>
+// struct formatter<thread::id, charT>;
+
+// template<class ParseContext>
+// constexpr typename ParseContext::iterator
+// parse(ParseContext& ctx);
+
+// Note this tests the basics of this function. It's tested in more detail in
+// the format functions test.
+
+#include <cassert>
+#include <concepts>
+#include <thread>
+
+#include "test_format_context.h"
+#include "test_macros.h"
+#include "make_string.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class StringViewT>
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
+ using CharT = typename StringViewT::value_type;
+ auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
+ std::formatter<std::thread::id, CharT> formatter;
+ static_assert(std::semiregular<decltype(formatter)>);
+
+ std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
+ assert(it == fmt.end() - offset);
+}
+
+template <class CharT>
+constexpr void test_fmt() {
+ test_parse(SV(""), 0);
+ test_parse(SV("1"), 0);
+
+ test_parse(SV("}"), 1);
+ test_parse(SV("1}"), 1);
+}
+
+constexpr bool test() {
+ test_fmt<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_fmt<wchar_t>();
+#endif
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/stream.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/stream.pass.cpp
index 9050d9c..d9d21cc 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/stream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/stream.pass.cpp
@@ -9,6 +9,9 @@
// UNSUPPORTED: no-threads
// UNSUPPORTED: no-localization
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// <thread>
// class thread::id
@@ -18,16 +21,38 @@
// operator<<(basic_ostream<charT, traits>& out, thread::id id);
#include <thread>
+#include <format>
#include <sstream>
#include <cassert>
+#include "make_string.h"
#include "test_macros.h"
-int main(int, char**)
-{
- std::thread::id id0 = std::this_thread::get_id();
- std::ostringstream os;
- os << id0;
+template <class CharT>
+static void test() {
+ std::thread::id id0 = std::this_thread::get_id();
+ std::basic_ostringstream<CharT> os;
+ os << id0;
+
+#if TEST_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+ // C++23 added a formatter specialization for thread::id.
+ // This changed the requirement of ostream to have a
+ // [thread.thread.id]/2
+ // The text representation for the character type charT of an object of
+ // type thread::id is an unspecified sequence of charT ...
+ // This definition is used for both streaming and formatting.
+ //
+ // Test whether the output is identical.
+ std::basic_string<CharT> s = std::format(MAKE_STRING_VIEW(CharT, "{}"), id0);
+ assert(s == os.str());
+#endif
+}
+
+int main(int, char**) {
+ test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp
index 3b4ae20..7a08065 100644
--- a/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp
@@ -13,9 +13,10 @@
// template <class Clock, class Duration>
// void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
-#include <thread>
-#include <cstdlib>
#include <cassert>
+#include <chrono>
+#include <cstdlib>
+#include <thread>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.day/time.cal.day.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.day/time.cal.day.nonmembers/ostream.pass.cpp
index 0e17304..c09a7ce 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.day/time.cal.day.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.day/time.cal.day.nonmembers/ostream.pass.cpp
@@ -15,6 +15,9 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.md/time.cal.md.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.md/time.cal.md.nonmembers/ostream.pass.cpp
index 4e4feda..6bf798e 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.md/time.cal.md.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.md/time.cal.md.nonmembers/ostream.pass.cpp
@@ -16,6 +16,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp
index 491d30b..d0e3c14 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp
@@ -18,6 +18,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp
index 2efc023..b2c7a94 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp
@@ -15,6 +15,12 @@
// TODO FMT Investigate Windows issues.
// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp
index 006df5e..1eb750c 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp
@@ -18,6 +18,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp
index 0a76fbd..4e2675b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp
@@ -18,6 +18,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/ostream.pass.cpp
index 7a59350..e1ebe3b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/ostream.pass.cpp
@@ -13,6 +13,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/ostream.pass.cpp
index 90dca78..b1b8ebb 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/ostream.pass.cpp
@@ -13,6 +13,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/ostream.pass.cpp
index b52293b..b3b211d 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/ostream.pass.cpp
@@ -10,6 +10,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.year/time.cal.year.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.year/time.cal.year.nonmembers/ostream.pass.cpp
index c979fc2..43cb202 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.year/time.cal.year.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.year/time.cal.year.nonmembers/ostream.pass.cpp
@@ -13,6 +13,12 @@
// TODO FMT Investigate Windows issues.
// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp
index 13257cc..0d7923b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp
@@ -18,6 +18,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp
index 595e00f..0bb2655 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp
@@ -16,6 +16,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp
index 9ded734..ac18927 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp
@@ -18,6 +18,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/ostream.pass.cpp
index 05578f6..6567f2f 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/ostream.pass.cpp
@@ -16,6 +16,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/ostream.pass.cpp
index 1508133..f2a5620 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/ostream.pass.cpp
@@ -16,6 +16,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp
index ad3daf7..cf4e39b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/now.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <chrono>
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp
index df84bee..261b08b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: no-filesystem
-// Filesystem is supported on Apple platforms starting with macosx10.15.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// UNSUPPORTED: availability-filesystem-missing
// <chrono>
//
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.system/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.system/ostream.pass.cpp
new file mode 100644
index 0000000..dfa5122
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.clock/time.clock.system/ostream.pass.cpp
@@ -0,0 +1,197 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+// UNSUPPORTED: no-localization
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Investigate Windows issues.
+// UNSUPPORTED msvc, target={{.+}}-windows-gnu
+// TODO FMT It seems GCC uses too much memory in the CI and fails.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
+// REQUIRES: locale.fr_FR.UTF-8
+// REQUIRES: locale.ja_JP.UTF-8
+
+// <chrono>
+
+// class system_clock;
+
+// template<class charT, class traits, class Duration>
+// basic_ostream<charT, traits>&
+// operator<<(basic_ostream<charT, traits>& os, const sys_time<Duration>& tp);
+
+#include <chrono>
+#include <cassert>
+#include <ratio>
+#include <sstream>
+
+#include "make_string.h"
+#include "platform_support.h" // locale name macros
+#include "test_macros.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class CharT, class Duration>
+static std::basic_string<CharT> stream_c_locale(std::chrono::sys_time<Duration> time_point) {
+ std::basic_stringstream<CharT> sstr;
+ sstr << std::fixed << time_point;
+ return sstr.str();
+}
+
+template <class CharT, class Duration>
+static std::basic_string<CharT> stream_fr_FR_locale(std::chrono::sys_time<Duration> time_point) {
+ std::basic_stringstream<CharT> sstr;
+ const std::locale locale(LOCALE_fr_FR_UTF_8);
+ sstr.imbue(locale);
+ sstr << std::fixed << time_point;
+ return sstr.str();
+}
+
+template <class CharT, class Duration>
+static std::basic_string<CharT> stream_ja_JP_locale(std::chrono::sys_time<Duration> time_point) {
+ std::basic_stringstream<CharT> sstr;
+ const std::locale locale(LOCALE_ja_JP_UTF_8);
+ sstr.imbue(locale);
+ sstr << std::fixed << time_point;
+ return sstr.str();
+}
+
+template <class CharT>
+static void test_c() {
+ using namespace std::literals::chrono_literals;
+
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::nanoseconds>{946'688'523'123'456'789ns}) ==
+ SV("2000-01-01 01:02:03.123456789"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::microseconds>{946'688'523'123'456us}) ==
+ SV("2000-01-01 01:02:03.123456"));
+
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::milliseconds>{946'684'800'123ms}) ==
+ SV("2000-01-01 00:00:00.123"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_seconds{1'234'567'890s}) == SV("2009-02-13 23:31:30"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::minutes>{20'576'131min}) ==
+ SV("2009-02-13 23:31:00"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::hours>{342'935h}) == SV("2009-02-13 23:00:00"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_days{std::chrono::days{14'288}}) == SV("2009-02-13 00:00:00"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::weeks>{std::chrono::weeks{2041}}) ==
+ SV("2009-02-12 00:00:00"));
+
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<signed char, std::ratio<2, 1>>>{
+ std::chrono::duration<signed char, std::ratio<2, 1>>{60}}) == SV("1970-01-01 00:02:00"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<short, std::ratio<1, 2>>>{
+ std::chrono::duration<short, std::ratio<1, 2>>{3600}}) == SV("1970-01-01 00:30:00.0"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<int, std::ratio<1, 4>>>{
+ std::chrono::duration<int, std::ratio<1, 4>>{3600}}) == SV("1970-01-01 00:15:00.00"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long, std::ratio<1, 10>>>{
+ std::chrono::duration<long, std::ratio<1, 10>>{36611}}) == SV("1970-01-01 01:01:01.1"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long long, std::ratio<1, 100>>>{
+ std::chrono::duration<long long, std::ratio<1, 100>>{12'345'678'9010}}) == SV("2009-02-13 23:31:30.10"));
+
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<float, std::ratio<1, 1>>>{
+ std::chrono::duration<float, std::ratio<1, 1>>{123.456}}) == SV("1970-01-01 00:02:03"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<double, std::ratio<1, 10>>>{
+ std::chrono::duration<double, std::ratio<1, 10>>{123.456}}) == SV("1970-01-01 00:00:12.3"));
+ assert(stream_c_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long double, std::ratio<1, 100>>>{
+ std::chrono::duration<long double, std::ratio<1, 100>>{123.456}}) == SV("1970-01-01 00:00:01.23"));
+}
+
+template <class CharT>
+static void test_fr_FR() {
+ using namespace std::literals::chrono_literals;
+
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::nanoseconds>{946'688'523'123'456'789ns}) ==
+ SV("2000-01-01 01:02:03,123456789"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::microseconds>{946'688'523'123'456us}) ==
+ SV("2000-01-01 01:02:03,123456"));
+
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::milliseconds>{946'684'800'123ms}) ==
+ SV("2000-01-01 00:00:00,123"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_seconds{1'234'567'890s}) == SV("2009-02-13 23:31:30"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::minutes>{20'576'131min}) ==
+ SV("2009-02-13 23:31:00"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::hours>{342'935h}) == SV("2009-02-13 23:00:00"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_days{std::chrono::days{14'288}}) == SV("2009-02-13 00:00:00"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::weeks>{std::chrono::weeks{2041}}) ==
+ SV("2009-02-12 00:00:00"));
+
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<signed char, std::ratio<2, 1>>>{
+ std::chrono::duration<signed char, std::ratio<2, 1>>{60}}) == SV("1970-01-01 00:02:00"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<short, std::ratio<1, 2>>>{
+ std::chrono::duration<short, std::ratio<1, 2>>{3600}}) == SV("1970-01-01 00:30:00,0"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<int, std::ratio<1, 4>>>{
+ std::chrono::duration<int, std::ratio<1, 4>>{3600}}) == SV("1970-01-01 00:15:00,00"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long, std::ratio<1, 10>>>{
+ std::chrono::duration<long, std::ratio<1, 10>>{36611}}) == SV("1970-01-01 01:01:01,1"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long long, std::ratio<1, 100>>>{
+ std::chrono::duration<long long, std::ratio<1, 100>>{12'345'678'9010}}) == SV("2009-02-13 23:31:30,10"));
+
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<float, std::ratio<1, 1>>>{
+ std::chrono::duration<float, std::ratio<1, 1>>{123.456}}) == SV("1970-01-01 00:02:03"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<double, std::ratio<1, 10>>>{
+ std::chrono::duration<double, std::ratio<1, 10>>{123.456}}) == SV("1970-01-01 00:00:12,3"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long double, std::ratio<1, 100>>>{
+ std::chrono::duration<long double, std::ratio<1, 100>>{123.456}}) == SV("1970-01-01 00:00:01,23"));
+}
+
+template <class CharT>
+static void test_ja_JP() {
+ using namespace std::literals::chrono_literals;
+
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::nanoseconds>{946'688'523'123'456'789ns}) ==
+ SV("2000-01-01 01:02:03.123456789"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::microseconds>{946'688'523'123'456us}) ==
+ SV("2000-01-01 01:02:03.123456"));
+
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::milliseconds>{946'684'800'123ms}) ==
+ SV("2000-01-01 00:00:00.123"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_seconds{1'234'567'890s}) == SV("2009-02-13 23:31:30"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::minutes>{20'576'131min}) ==
+ SV("2009-02-13 23:31:00"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::hours>{342'935h}) == SV("2009-02-13 23:00:00"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_days{std::chrono::days{14'288}}) == SV("2009-02-13 00:00:00"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::weeks>{std::chrono::weeks{2041}}) ==
+ SV("2009-02-12 00:00:00"));
+
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<signed char, std::ratio<2, 1>>>{
+ std::chrono::duration<signed char, std::ratio<2, 1>>{60}}) == SV("1970-01-01 00:02:00"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<short, std::ratio<1, 2>>>{
+ std::chrono::duration<short, std::ratio<1, 2>>{3600}}) == SV("1970-01-01 00:30:00.0"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<int, std::ratio<1, 4>>>{
+ std::chrono::duration<int, std::ratio<1, 4>>{3600}}) == SV("1970-01-01 00:15:00.00"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long, std::ratio<1, 10>>>{
+ std::chrono::duration<long, std::ratio<1, 10>>{36611}}) == SV("1970-01-01 01:01:01.1"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long long, std::ratio<1, 100>>>{
+ std::chrono::duration<long long, std::ratio<1, 100>>{12'345'678'9010}}) == SV("2009-02-13 23:31:30.10"));
+
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<float, std::ratio<1, 1>>>{
+ std::chrono::duration<float, std::ratio<1, 1>>{123.456}}) == SV("1970-01-01 00:02:03"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<double, std::ratio<1, 10>>>{
+ std::chrono::duration<double, std::ratio<1, 10>>{123.456}}) == SV("1970-01-01 00:00:12.3"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::sys_time<std::chrono::duration<long double, std::ratio<1, 100>>>{
+ std::chrono::duration<long double, std::ratio<1, 100>>{123.456}}) == SV("1970-01-01 00:00:01.23"));
+}
+
+template <class CharT>
+static void test() {
+ test_c<CharT>();
+ test_fr_FR<CharT>();
+ test_ja_JP<CharT>();
+}
+
+int main(int, char**) {
+ test<char>();
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.comparisons/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.comparisons/compare.three_way.pass.cpp
new file mode 100644
index 0000000..282df3e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.comparisons/compare.three_way.pass.cpp
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <chrono>
+
+// duration
+
+// template<class Rep1, class Period1, class Rep2, class Period2>
+// requires ThreeWayComparable<typename CT::rep>
+// constexpr auto operator<=>(const duration<Rep1, Period1>& lhs,
+// const duration<Rep2, Period2>& rhs);
+
+#include <cassert>
+#include <chrono>
+#include <ratio>
+
+#include "test_comparisons.h"
+
+constexpr bool test() {
+ {
+ std::chrono::seconds s1(3);
+ std::chrono::seconds s2(3);
+ assert((s1 <=> s2) == std::strong_ordering::equal);
+ assert(testOrder(s1, s2, std::strong_ordering::equal));
+ }
+ {
+ std::chrono::seconds s1(3);
+ std::chrono::seconds s2(4);
+ assert((s1 <=> s2) == std::strong_ordering::less);
+ assert(testOrder(s1, s2, std::strong_ordering::less));
+ }
+ {
+ std::chrono::milliseconds s1(3);
+ std::chrono::microseconds s2(3000);
+ assert((s1 <=> s2) == std::strong_ordering::equal);
+ assert(testOrder(s1, s2, std::strong_ordering::equal));
+ }
+ {
+ std::chrono::milliseconds s1(3);
+ std::chrono::microseconds s2(4000);
+ assert((s1 <=> s2) == std::strong_ordering::less);
+ assert(testOrder(s1, s2, std::strong_ordering::less));
+ }
+ {
+ std::chrono::duration<int, std::ratio<2, 3>> s1(9);
+ std::chrono::duration<int, std::ratio<3, 5>> s2(10);
+ assert((s1 <=> s2) == std::strong_ordering::equal);
+ assert(testOrder(s1, s2, std::strong_ordering::equal));
+ }
+ {
+ std::chrono::duration<int, std::ratio<2, 3>> s1(10);
+ std::chrono::duration<int, std::ratio<3, 5>> s2(9);
+ assert((s1 <=> s2) == std::strong_ordering::greater);
+ assert(testOrder(s1, s2, std::strong_ordering::greater));
+ }
+ {
+ std::chrono::duration<int, std::ratio<2, 3>> s1(9);
+ std::chrono::duration<double, std::ratio<3, 5>> s2(10.1);
+ assert((s1 <=> s2) == std::strong_ordering::less);
+ assert(testOrder(s1, s2, std::strong_ordering::less));
+ }
+
+ return true;
+}
+
+int main(int, char**) {
+ assert(test());
+ static_assert(test());
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp
index 0c2f685..2eab1c4 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp
@@ -15,6 +15,9 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -31,6 +34,7 @@
#include <cassert>
#include <concepts>
+#include <ratio>
#include <sstream>
#include "make_string.h"
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
index 7aa9f3c..f0723be 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
@@ -24,7 +24,7 @@
#include "test_macros.h"
template <typename Duration>
-constexpr int64_t check_seconds(Duration d)
+constexpr std::int64_t check_seconds(Duration d)
{
using HMS = std::chrono::hh_mm_ss<Duration>;
ASSERT_SAME_TYPE(std::chrono::seconds, decltype(std::declval<HMS>().seconds()));
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
index b3b46a9..6504d19 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
@@ -24,7 +24,7 @@
#include "test_macros.h"
template <typename Duration>
-constexpr int64_t check_subseconds(Duration d)
+constexpr std::int64_t check_subseconds(Duration d)
{
using HMS = std::chrono::hh_mm_ss<Duration>;
ASSERT_SAME_TYPE(typename HMS::precision, decltype(std::declval<HMS>().subseconds()));
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.nonmembers/ostream.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.nonmembers/ostream.pass.cpp
new file mode 100644
index 0000000..c9937e7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.hms/time.hms.nonmembers/ostream.pass.cpp
@@ -0,0 +1,162 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+// UNSUPPORTED: no-localization
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Evaluate gcc-12 status
+// UNSUPPORTED: gcc-12
+
+// TODO FMT Investigate Windows issues.
+// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+
+// XFAIL: availability-fp_to_chars-missing
+
+// REQUIRES: locale.fr_FR.UTF-8
+// REQUIRES: locale.ja_JP.UTF-8
+
+// <chrono>
+
+// class hh_mm_ss;
+
+// template<class charT, class traits, class Duration>
+// basic_ostream<charT, traits>&
+// operator<<(basic_ostream<charT, traits>& os, const hh_mm_ss<Duration>& hms);
+
+#include <cassert>
+#include <chrono>
+#include <ratio>
+#include <sstream>
+
+#include "make_string.h"
+#include "platform_support.h" // locale name macros
+#include "test_macros.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class CharT, class Duration>
+static std::basic_string<CharT> stream_c_locale(std::chrono::hh_mm_ss<Duration> hms) {
+ std::basic_stringstream<CharT> sstr;
+ sstr << hms;
+ return sstr.str();
+}
+
+template <class CharT, class Duration>
+static std::basic_string<CharT> stream_fr_FR_locale(std::chrono::hh_mm_ss<Duration> hms) {
+ std::basic_stringstream<CharT> sstr;
+ const std::locale locale(LOCALE_fr_FR_UTF_8);
+ sstr.imbue(locale);
+ sstr << hms;
+ return sstr.str();
+}
+
+template <class CharT, class Duration>
+static std::basic_string<CharT> stream_ja_JP_locale(std::chrono::hh_mm_ss<Duration> hms) {
+ std::basic_stringstream<CharT> sstr;
+ const std::locale locale(LOCALE_ja_JP_UTF_8);
+ sstr.imbue(locale);
+ sstr << hms;
+ return sstr.str();
+}
+
+template <class CharT>
+static void test() {
+ // Note std::atto can't be tested since the ratio conversion from std::atto
+ // std::chrono::seconds to std::chrono::hours overflows when intmax_t is a
+ // 64-bit type. This is a limitiation in the constructor of
+ // std::chrono::hh_mm_ss.
+
+ // C locale - integral power of 10 ratios
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::femto>{1'234'567'890}}) ==
+ SV("00:00:00.000001234567890"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::pico>{1'234'567'890}}) ==
+ SV("00:00:00.001234567890"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::nano>{1'234'567'890}}) ==
+ SV("00:00:01.234567890"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::micro>{1'234'567}}) ==
+ SV("00:00:01.234567"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::milli>{123'456}}) ==
+ SV("00:02:03.456"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::centi>{12'345}}) ==
+ SV("00:02:03.45"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::deci>{1'234}}) ==
+ SV("00:02:03.4"));
+
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t>{123}}) == SV("00:02:03"));
+
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::deca>{-366}}) ==
+ SV("-01:01:00"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::hecto>{-72}}) ==
+ SV("-02:00:00"));
+ assert(stream_c_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::kilo>{-86}}) ==
+ SV("-23:53:20"));
+
+ // Starting at mega it will pass one day
+
+ // fr_FR locale - integral power of not 10 ratios
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{
+ std::chrono::duration<std::intmax_t, std::ratio<1, 5'000'000>>{5'000}}) == SV("00:00:00,0010000"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 8'000>>{3}}) ==
+ SV("00:00:00,000375"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 4'000>>{1}}) ==
+ SV("00:00:00,00025"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 5'000>>{5}}) ==
+ SV("00:00:00,0010"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 8>>{-4}}) ==
+ SV("-00:00:00,500"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 4>>{-8}}) ==
+ SV("-00:00:02,00"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 5>>{-5}}) ==
+ SV("-00:00:01,0"));
+
+ // TODO FMT Note there's no wording on the rounding
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 9>>{5}}) ==
+ SV("00:00:00,555555"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 7>>{7}}) ==
+ SV("00:00:01,000000"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 6>>{1}}) ==
+ SV("00:00:00,166666"));
+ assert(stream_fr_FR_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<std::intmax_t, std::ratio<1, 3>>{2}}) ==
+ SV("00:00:00,666666"));
+
+ // ja_JP locale - floating points
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{
+ std::chrono::duration<long double, std::femto>{1'234'567'890.123}}) == SV("00:00:00.000001234567890"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{
+ std::chrono::duration<long double, std::pico>{1'234'567'890.123}}) == SV("00:00:00.001234567890"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{
+ std::chrono::duration<long double, std::nano>{1'234'567'890.123}}) == SV("00:00:01.234567890"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<double, std::micro>{1'234'567.123}}) ==
+ SV("00:00:01.234567"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<double, std::milli>{123'456.123}}) ==
+ SV("00:02:03.456"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<double, std::centi>{12'345.123}}) ==
+ SV("00:02:03.45"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<float, std::deci>{1'234.123}}) ==
+ SV("00:02:03.4"));
+
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<float>{123.123}}) == SV("00:02:03"));
+
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<double, std::deca>{-366.5}}) ==
+ SV("-01:01:05"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<double, std::hecto>{-72.64}}) ==
+ SV("-02:01:04"));
+ assert(stream_ja_JP_locale<CharT>(std::chrono::hh_mm_ss{std::chrono::duration<double, std::kilo>{-86}}) ==
+ SV("-23:53:20"));
+}
+
+int main(int, char**) {
+ test<char>();
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.point/time.point.comparisons/compare.three_way.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/time/time.point/time.point.comparisons/compare.three_way.compile.fail.cpp
new file mode 100644
index 0000000..9d4ab04
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.point/time.point.comparisons/compare.three_way.compile.fail.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <chrono>
+
+// time_point
+
+// template<class Clock, class Duration1,
+// three_way_comparable_with<Duration1> Duration2>
+// constexpr auto operator<=>(const time_point<Clock, Duration1>& lhs,
+// const time_point<Clock, Duration2>& rhs);
+
+// time_points with different clocks should not compare
+
+#include <chrono>
+
+#include "../../clock.h"
+
+int main(int, char**) {
+ using namespace std::chrono_literals;
+ std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds> t1{3ms};
+ std::chrono::time_point<Clock, std::chrono::milliseconds> t2{3ms};
+
+ t1 <=> t2;
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.point/time.point.comparisons/compare.three_way.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.point/time.point.comparisons/compare.three_way.pass.cpp
new file mode 100644
index 0000000..aed8013
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.point/time.point.comparisons/compare.three_way.pass.cpp
@@ -0,0 +1,127 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17
+
+// <chrono>
+
+// time_point
+
+// template<class Clock, class Duration1,
+// three_way_comparable_with<Duration1> Duration2>
+// constexpr auto operator<=>(const time_point<Clock, Duration1>& lhs,
+// const time_point<Clock, Duration2>& rhs);
+
+#include <cassert>
+#include <chrono>
+#include <ratio>
+
+#include "test_comparisons.h"
+
+constexpr void test_with_integral_ticks_value() {
+ using Clock = std::chrono::system_clock;
+
+ using Duration1 = std::chrono::milliseconds;
+ using Duration2 = std::chrono::microseconds;
+ using T1 = std::chrono::time_point<Clock, Duration1>;
+ using T2 = std::chrono::time_point<Clock, Duration2>;
+
+ {
+ T1 t1(Duration1(3));
+ T1 t2(Duration1(3));
+ assert((t1 <=> t2) == std::strong_ordering::equal);
+ assert(testOrder(t1, t2, std::strong_ordering::equal));
+ }
+ {
+ T1 t1(Duration1(3));
+ T1 t2(Duration1(4));
+ assert((t1 <=> t2) == std::strong_ordering::less);
+ assert(testOrder(t1, t2, std::strong_ordering::less));
+ }
+ {
+ T1 t1(Duration1(3));
+ T2 t2(Duration2(3000));
+ assert((t1 <=> t2) == std::strong_ordering::equal);
+ assert(testOrder(t1, t2, std::strong_ordering::equal));
+ }
+ {
+ T1 t1(Duration1(3));
+ T2 t2(Duration2(3001));
+ assert((t1 <=> t2) == std::strong_ordering::less);
+ assert(testOrder(t1, t2, std::strong_ordering::less));
+ assert((t2 <=> t1) == std::strong_ordering::greater);
+ assert(testOrder(t2, t1, std::strong_ordering::greater));
+ }
+}
+
+constexpr void test_with_integral_ticks_value_and_custom_period_value() {
+ using Clock = std::chrono::system_clock;
+
+ using DInt30Hz = std::chrono::duration<int, std::ratio<1, 30>>;
+ using DInt60Hz = std::chrono::duration<int, std::ratio<1, 60>>;
+
+ using TIntR1 = std::chrono::time_point<Clock, DInt30Hz>;
+ using TIntR2 = std::chrono::time_point<Clock, DInt60Hz>;
+
+ {
+ TIntR1 t1(DInt30Hz(10));
+ TIntR2 t2(DInt60Hz(20));
+ assert((t1 <=> t2) == std::strong_ordering::equal);
+ assert(testOrder(t1, t2, std::strong_ordering::equal));
+ }
+ {
+ TIntR1 t1(DInt30Hz(10));
+ TIntR2 t2(DInt60Hz(21));
+ assert((t1 <=> t2) == std::strong_ordering::less);
+ assert(testOrder(t1, t2, std::strong_ordering::less));
+ }
+ {
+ TIntR1 t1(DInt30Hz(11));
+ TIntR2 t2(DInt60Hz(20));
+ assert((t1 <=> t2) == std::strong_ordering::greater);
+ assert(testOrder(t1, t2, std::strong_ordering::greater));
+ }
+}
+
+constexpr void test_with_floating_point_ticks_value() {
+ using Clock = std::chrono::system_clock;
+
+ using DF30Hz = std::chrono::duration<double, std::ratio<1, 30>>;
+ using DF60Hz = std::chrono::duration<double, std::ratio<1, 60>>;
+ using F1 = std::chrono::time_point<Clock, DF30Hz>;
+ using F2 = std::chrono::time_point<Clock, DF60Hz>;
+
+ // No equality comparison test for floating point values.
+
+ {
+ F1 t1(DF30Hz(3.5));
+ F2 t2(DF60Hz(7.1));
+ assert((t1 <=> t2) == std::weak_ordering::less);
+ assert(testOrder(t1, t2, std::weak_ordering::less));
+ }
+ {
+ F1 t1(DF30Hz(3.6));
+ F2 t2(DF60Hz(7.0));
+ assert((t1 <=> t2) == std::weak_ordering::greater);
+ assert(testOrder(t1, t2, std::weak_ordering::greater));
+ }
+}
+
+constexpr bool test() {
+ test_with_integral_ticks_value();
+ test_with_integral_ticks_value_and_custom_period_value();
+ test_with_floating_point_ticks_value();
+
+ return true;
+}
+
+int main(int, char**) {
+ assert(test());
+ static_assert(test());
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.day.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
index 373db72..88057ea 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
@@ -14,6 +14,12 @@
// TODO FMT Investigate Windows issues.
// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
index 1a2fcca..1ae518e 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
@@ -16,6 +16,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -31,6 +33,7 @@
#include <concepts>
#include <locale>
#include <iostream>
+#include <ratio>
#include <type_traits>
#include "formatter_tests.h"
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
new file mode 100644
index 0000000..c3001a7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
@@ -0,0 +1,561 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: no-localization
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Evaluate gcc-12 status
+// UNSUPPORTED: gcc-12
+
+// TODO FMT Investigate Windows issues.
+// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+
+// XFAIL: LIBCXX-FREEBSD-FIXME
+
+// XFAIL: availability-fp_to_chars-missing
+
+// REQUIRES: locale.fr_FR.UTF-8
+// REQUIRES: locale.ja_JP.UTF-8
+
+// <chrono>
+
+// template<class Rep, class Period, class charT>
+// struct formatter<chrono::hh_mm_ss<duration<Rep, Period>>, charT>;
+
+#include <chrono>
+#include <format>
+
+#include <cassert>
+#include <concepts>
+#include <locale>
+#include <iostream>
+#include <ratio>
+#include <type_traits>
+
+#include "formatter_tests.h"
+#include "make_string.h"
+#include "platform_support.h" // locale name macros
+#include "string_literal.h"
+#include "test_macros.h"
+
+template <class CharT>
+static void test_no_chrono_specs() {
+ using namespace std::literals::chrono_literals;
+
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output
+ check(SV("00:00:00.000"), SV("{}"), std::chrono::hh_mm_ss{0ms});
+ check(SV("*00:00:00.000*"), SV("{:*^14}"), std::chrono::hh_mm_ss{0ms});
+ check(SV("*00:00:00.000"), SV("{:*>13}"), std::chrono::hh_mm_ss{0ms});
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV(
+ "{:"
+ "%%H='%H'%t"
+ "%%OH='%OH'%t"
+ "%%I='%I'%t"
+ "%%OI='%OI'%t"
+ "%%M='%M'%t"
+ "%%OM='%OM'%t"
+ "%%S='%S'%t"
+ "%%OS='%OS'%t"
+ "%%p='%p'%t"
+ "%%R='%R'%t"
+ "%%T='%T'%t"
+ "%%r='%r'%t"
+ "%%X='%X'%t"
+ "%%EX='%EX'%t"
+ "%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV(
+ "{:L"
+ "%%H='%H'%t"
+ "%%OH='%OH'%t"
+ "%%I='%I'%t"
+ "%%OI='%OI'%t"
+ "%%M='%M'%t"
+ "%%OM='%OM'%t"
+ "%%S='%S'%t"
+ "%%OS='%OS'%t"
+ "%%p='%p'%t"
+ "%%R='%R'%t"
+ "%%T='%T'%t"
+ "%%r='%r'%t"
+ "%%X='%X'%t"
+ "%%EX='%EX'%t"
+ "%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%H='00'\t"
+ "%OH='00'\t"
+ "%I='12'\t"
+ "%OI='12'\t"
+ "%M='00'\t"
+ "%OM='00'\t"
+ "%S='00'\t"
+ "%OS='00'\t"
+ "%p='AM'\t"
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+ "%r='12:00:00 AM'\t"
+ "%X='00:00:00'\t"
+ "%EX='00:00:00'\t"
+ "\n"),
+ fmt,
+ std::chrono::hh_mm_ss(0s));
+
+ check(SV("%H='23'\t"
+ "%OH='23'\t"
+ "%I='11'\t"
+ "%OI='11'\t"
+ "%M='31'\t"
+ "%OM='31'\t"
+ "%S='30.123'\t"
+ "%OS='30.123'\t"
+ "%p='PM'\t"
+ "%R='23:31'\t"
+ "%T='23:31:30.123'\t"
+ "%r='11:31:30 PM'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
+ "\n"),
+ fmt,
+ std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
+
+ check(SV("-%H='03'\t"
+ "%OH='03'\t"
+ "%I='03'\t"
+ "%OI='03'\t"
+ "%M='02'\t"
+ "%OM='02'\t"
+ "%S='01.123456789012'\t"
+ "%OS='01.123456789012'\t"
+ "%p='AM'\t"
+ "%R='03:02'\t"
+ "%T='03:02:01.123456789012'\t"
+ "%r='03:02:01 AM'\t"
+ "%X='03:02:01'\t"
+ "%EX='03:02:01'\t"
+ "\n"),
+ fmt,
+ std::chrono::hh_mm_ss(-(3h + 2min + 1s + std::chrono::duration<std::int64_t, std::pico>(123456789012))));
+
+ // The number of fractional seconds is 0 according to the Standard
+ // TODO FMT Determine what to do.
+ check(SV("%H='01'\t"
+ "%OH='01'\t"
+ "%I='01'\t"
+ "%OI='01'\t"
+ "%M='01'\t"
+ "%OM='01'\t"
+ "%S='01'\t"
+ "%OS='01'\t"
+ "%p='AM'\t"
+ "%R='01:01'\t"
+ "%T='01:01:01'\t"
+ "%r='01:01:01 AM'\t"
+ "%X='01:01:01'\t"
+ "%EX='01:01:01'\t"
+ "\n"),
+ fmt,
+ std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
+
+ // Use the global locale (fr_FR)
+ check(SV("%H='00'\t"
+ "%OH='00'\t"
+ "%I='12'\t"
+ "%OI='12'\t"
+ "%M='00'\t"
+ "%OM='00'\t"
+ "%S='00'\t"
+ "%OS='00'\t"
+#if defined(_AIX)
+ "%p='AM'\t"
+#else
+ "%p=''\t"
+#endif
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+#ifdef _WIN32
+ "%r='00:00:00'\t"
+#elif defined(_AIX)
+ "%r='12:00:00 AM'\t"
+#elif defined(__APPLE__)
+ "%r=''\t"
+#else
+ "%r='12:00:00 '\t"
+#endif
+ "%X='00:00:00'\t"
+ "%EX='00:00:00'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(0s));
+
+ check(SV("%H='23'\t"
+ "%OH='23'\t"
+ "%I='11'\t"
+ "%OI='11'\t"
+ "%M='31'\t"
+ "%OM='31'\t"
+ "%S='30,123'\t"
+ "%OS='30,123'\t"
+#if defined(_AIX)
+ "%p='PM'\t"
+#else
+ "%p=''\t"
+#endif
+ "%R='23:31'\t"
+ "%T='23:31:30,123'\t"
+#ifdef _WIN32
+ "%r='23:31:30'\t"
+#elif defined(_AIX)
+ "%r='11:31:30 PM'\t"
+#elif defined(__APPLE__)
+ "%r=''\t"
+#else
+ "%r='11:31:30 '\t"
+#endif
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
+
+ check(SV("-%H='03'\t"
+ "%OH='03'\t"
+ "%I='03'\t"
+ "%OI='03'\t"
+ "%M='02'\t"
+ "%OM='02'\t"
+ "%S='01,123456789012'\t"
+ "%OS='01,123456789012'\t"
+#if defined(_AIX)
+ "%p='AM'\t"
+#else
+ "%p=''\t"
+#endif
+ "%R='03:02'\t"
+ "%T='03:02:01,123456789012'\t"
+#ifdef _WIN32
+ "%r='03:02:01'\t"
+#elif defined(_AIX)
+ "%r='03:02:01 AM'\t"
+#elif defined(__APPLE__)
+ "%r=''\t"
+#else
+ "%r='03:02:01 '\t"
+#endif
+ "%X='03:02:01'\t"
+ "%EX='03:02:01'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(-(3h + 2min + 1s + std::chrono::duration<std::int64_t, std::pico>(123456789012))));
+
+ check(SV("%H='01'\t"
+ "%OH='01'\t"
+ "%I='01'\t"
+ "%OI='01'\t"
+ "%M='01'\t"
+ "%OM='01'\t"
+ "%S='01'\t"
+ "%OS='01'\t"
+#if defined(_AIX)
+ "%p='AM'\t"
+#else
+ "%p=''\t"
+#endif
+ "%R='01:01'\t"
+ "%T='01:01:01'\t"
+#ifdef _WIN32
+ "%r='01:01:01'\t"
+#elif defined(_AIX)
+ "%r='01:01:01 AM'\t"
+#elif defined(__APPLE__)
+ "%r=''\t"
+#else
+ "%r='01:01:01 '\t"
+#endif
+ "%X='01:01:01'\t"
+ "%EX='01:01:01'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#if defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%H='00'\t"
+ "%OH='00'\t"
+ "%I='12'\t"
+ "%OI='12'\t"
+ "%M='00'\t"
+ "%OM='00'\t"
+ "%S='00'\t"
+ "%OS='00'\t"
+# if defined(__APPLE__)
+ "%p='AM'\t"
+# else
+ "%p='午前'\t"
+# endif
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+# if defined(__APPLE__)
+ "%r='12:00:00 AM'\t"
+ "%X='00時00分00秒'\t"
+ "%EX='00時00分00秒'\t"
+# else
+ "%r='午前12:00:00'\t"
+ "%X='00:00:00'\t"
+ "%EX='00:00:00'\t"
+# endif
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(0s));
+
+ check(loc,
+ SV("%H='23'\t"
+ "%OH='23'\t"
+ "%I='11'\t"
+ "%OI='11'\t"
+ "%M='31'\t"
+ "%OM='31'\t"
+ "%S='30.123'\t"
+ "%OS='30.123'\t"
+# if defined(__APPLE__)
+ "%p='PM'\t"
+# else
+ "%p='午後'\t"
+# endif
+ "%R='23:31'\t"
+ "%T='23:31:30.123'\t"
+# if defined(__APPLE__)
+ "%r='11:31:30 PM'\t"
+ "%X='23時31分30秒'\t"
+ "%EX='23時31分30秒'\t"
+# else
+ "%r='午後11:31:30'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
+# endif
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
+
+ check(loc,
+ SV("-%H='03'\t"
+ "%OH='03'\t"
+ "%I='03'\t"
+ "%OI='03'\t"
+ "%M='02'\t"
+ "%OM='02'\t"
+ "%S='01.123456789012'\t"
+ "%OS='01.123456789012'\t"
+# if defined(__APPLE__)
+ "%p='AM'\t"
+# else
+ "%p='午前'\t"
+# endif
+ "%R='03:02'\t"
+ "%T='03:02:01.123456789012'\t"
+# if defined(__APPLE__)
+ "%r='03:02:01 AM'\t"
+ "%X='03時02分01秒'\t"
+ "%EX='03時02分01秒'\t"
+# else
+ "%r='午前03:02:01'\t"
+ "%X='03:02:01'\t"
+ "%EX='03:02:01'\t"
+# endif
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(-(3h + 2min + 1s + std::chrono::duration<std::int64_t, std::pico>(123456789012))));
+
+ check(loc,
+ SV("%H='01'\t"
+ "%OH='01'\t"
+ "%I='01'\t"
+ "%OI='01'\t"
+ "%M='01'\t"
+ "%OM='01'\t"
+ "%S='01'\t"
+ "%OS='01'\t"
+# if defined(__APPLE__)
+ "%p='AM'\t"
+# else
+ "%p='午前'\t"
+# endif
+ "%R='01:01'\t"
+ "%T='01:01:01'\t"
+# if defined(__APPLE__)
+ "%r='01:01:01 AM'\t"
+ "%X='01時01分01秒'\t"
+ "%EX='01時01分01秒'\t"
+# else
+ "%r='午前01:01:01'\t"
+ "%X='01:01:01'\t"
+ "%EX='01:01:01'\t"
+# endif
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
+#else // defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%H='00'\t"
+ "%OH='〇'\t"
+ "%I='12'\t"
+ "%OI='十二'\t"
+ "%M='00'\t"
+ "%OM='〇'\t"
+ "%S='00'\t"
+ "%OS='〇'\t"
+ "%p='午前'\t"
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+ "%r='午前12時00分00秒'\t"
+ "%X='00時00分00秒'\t"
+ "%EX='00時00分00秒'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(0s));
+
+ // TODO FMT What should fractions be in alternate display mode?
+ check(loc,
+ SV("%H='23'\t"
+ "%OH='二十三'\t"
+ "%I='11'\t"
+ "%OI='十一'\t"
+ "%M='31'\t"
+ "%OM='三十一'\t"
+ "%S='30.123'\t"
+ "%OS='三十.123'\t"
+ "%p='午後'\t"
+ "%R='23:31'\t"
+ "%T='23:31:30.123'\t"
+ "%r='午後11時31分30秒'\t"
+ "%X='23時31分30秒'\t"
+ "%EX='23時31分30秒'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
+
+ check(loc,
+ SV("-%H='03'\t"
+ "%OH='三'\t"
+ "%I='03'\t"
+ "%OI='三'\t"
+ "%M='02'\t"
+ "%OM='二'\t"
+ "%S='01.123456789012'\t"
+ "%OS='一.123456789012'\t"
+ "%p='午前'\t"
+ "%R='03:02'\t"
+ "%T='03:02:01.123456789012'\t"
+ "%r='午前03時02分01秒'\t"
+ "%X='03時02分01秒'\t"
+ "%EX='03時02分01秒'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(-(3h + 2min + 1s + std::chrono::duration<std::int64_t, std::pico>(123456789012))));
+
+ check(loc,
+ SV("%H='01'\t"
+ "%OH='一'\t"
+ "%I='01'\t"
+ "%OI='一'\t"
+ "%M='01'\t"
+ "%OM='一'\t"
+ "%S='01'\t"
+ "%OS='一'\t"
+ "%p='午前'\t"
+ "%R='01:01'\t"
+ "%T='01:01:01'\t"
+ "%r='午前01時01分01秒'\t"
+ "%X='01時01分01秒'\t"
+ "%EX='01時01分01秒'\t"
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
+#endif // defined(__APPLE__) || defined(_AIX)
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_invalid_values() {
+ using namespace std::literals::chrono_literals;
+
+ // This looks odd, however the 24 hours is not valid for a 24 hour clock.
+ // TODO FMT discuss what the "proper" behaviour is.
+ check_exception("formatting a hour needs a valid value", SV("{:%H"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%OH"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%I"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%OI"), std::chrono::hh_mm_ss{24h});
+ check(SV("00"), SV("{:%M}"), std::chrono::hh_mm_ss{24h});
+ check(SV("00"), SV("{:%OM}"), std::chrono::hh_mm_ss{24h});
+ check(SV("00"), SV("{:%S}"), std::chrono::hh_mm_ss{24h});
+ check(SV("00"), SV("{:%OS}"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%p"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%R"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%T"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%r"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%X"), std::chrono::hh_mm_ss{24h});
+ check_exception("formatting a hour needs a valid value", SV("{:%EX"), std::chrono::hh_mm_ss{24h});
+}
+
+template <class CharT>
+static void test() {
+ using namespace std::literals::chrono_literals;
+
+ test_no_chrono_specs<CharT>();
+ test_valid_values<CharT>();
+ test_invalid_values<CharT>();
+ check_invalid_types<CharT>(
+ {SV("H"),
+ SV("I"),
+ SV("M"),
+ SV("S"),
+ SV("p"),
+ SV("r"),
+ SV("R"),
+ SV("T"),
+ SV("X"),
+ SV("OH"),
+ SV("OI"),
+ SV("OM"),
+ SV("OS"),
+ SV("EX")},
+ std::chrono::hh_mm_ss{0ms});
+
+ check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::hh_mm_ss{0ms});
+ check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::hh_mm_ss{0ms});
+ check_exception(
+ "End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::hh_mm_ss{0ms});
+ check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::hh_mm_ss{0ms});
+ check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::hh_mm_ss{0ms});
+
+ check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::hh_mm_ss{0ms});
+}
+
+int main(int, char**) {
+ test<char>();
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month.pass.cpp
index 324887f..5342ef7 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month.pass.cpp
@@ -11,6 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
index f86476f..146b98b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
@@ -17,6 +17,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
index 7c78271..b3b6944 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
@@ -14,6 +14,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
index f34b22c..56b60c7 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
@@ -14,6 +14,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
new file mode 100644
index 0000000..cdaa19e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
@@ -0,0 +1,940 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: no-localization
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// XFAIL: LIBCXX-FREEBSD-FIXME
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
+// TODO FMT Investigate Windows issues.
+// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+// TODO FMT It seems GCC uses too much memory in the CI and fails.
+// UNSUPPORTED: gcc-12
+
+// REQUIRES: locale.fr_FR.UTF-8
+// REQUIRES: locale.ja_JP.UTF-8
+
+// <chrono>
+//
+// template<class charT> struct formatter<chrono::day, charT>;
+
+#include <chrono>
+#include <format>
+
+#include <cassert>
+#include <concepts>
+#include <locale>
+#include <iostream>
+#include <type_traits>
+
+#include "formatter_tests.h"
+#include "make_string.h"
+#include "platform_support.h" // locale name macros
+#include "test_macros.h"
+
+template <class CharT>
+static void test_no_chrono_specs() {
+ using namespace std::literals::chrono_literals;
+
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output
+ check(SV("1970-01-01 00:00:00"), SV("{}"), std::chrono::sys_seconds(0s));
+ check(SV("2000-01-01 00:00:00"), SV("{}"), std::chrono::sys_seconds(946'684'800s));
+ check(SV("2000-01-01 01:02:03"), SV("{}"), std::chrono::sys_seconds(946'688'523s));
+
+ check(SV("2000-01-01 01:02:03.123"), SV("{}"), std::chrono::sys_time<std::chrono::milliseconds>(946'688'523'123ms));
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_year() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt =
+ SV("{:%%C='%C'%t%%EC='%EC'%t%%y='%y'%t%%Oy='%Oy'%t%%Ey='%Ey'%t%%Y='%Y'%t%%EY='%EY'%n}");
+ constexpr std::basic_string_view<CharT> lfmt =
+ SV("{:L%%C='%C'%t%%EC='%EC'%t%%y='%y'%t%%Oy='%Oy'%t%%Ey='%Ey'%t%%Y='%Y'%t%%EY='%EY'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%C='19'\t%EC='19'\t%y='70'\t%Oy='70'\t%Ey='70'\t%Y='1970'\t%EY='1970'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%C='20'\t%EC='20'\t%y='09'\t%Oy='09'\t%Ey='09'\t%Y='2009'\t%EY='2009'\n"),
+ fmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use the global locale (fr_FR)
+ check(SV("%C='19'\t%EC='19'\t%y='70'\t%Oy='70'\t%Ey='70'\t%Y='1970'\t%EY='1970'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%C='20'\t%EC='20'\t%y='09'\t%Oy='09'\t%Ey='09'\t%Y='2009'\t%EY='2009'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%C='19'\t%EC='19'\t%y='70'\t%Oy='70'\t%Ey='70'\t%Y='1970'\t%EY='1970'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%C='20'\t%EC='20'\t%y='09'\t%Oy='09'\t%Ey='09'\t%Y='2009'\t%EY='2009'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%C='19'\t%EC='昭和'\t%y='70'\t%Oy='七十'\t%Ey='45'\t%Y='1970'\t%EY='昭和45年'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%C='20'\t%EC='平成'\t%y='09'\t%Oy='九'\t%Ey='21'\t%Y='2009'\t%EY='平成21年'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_month() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%b='%b'%t%%h='%h'%t%%B='%B'%t%%m='%m'%t%%Om='%Om'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%b='%b'%t%%h='%h'%t%%B='%B'%t%%m='%m'%t%%Om='%Om'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%b='Jan'\t%h='Jan'\t%B='January'\t%m='01'\t%Om='01'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%b='May'\t%h='May'\t%B='May'\t%m='05'\t%Om='05'\n"),
+ fmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ // Use the global locale (fr_FR)
+#if defined(__APPLE__)
+ check(SV("%b='jan'\t%h='jan'\t%B='janvier'\t%m='01'\t%Om='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+#else
+ check(SV("%b='janv.'\t%h='janv.'\t%B='janvier'\t%m='01'\t%Om='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+#endif
+
+ check(SV("%b='mai'\t%h='mai'\t%B='mai'\t%m='05'\t%Om='05'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#ifdef _WIN32
+ check(loc,
+ SV("%b='1'\t%h='1'\t%B='1月'\t%m='01'\t%Om='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%b='5'\t%h='5'\t%B='5月'\t%m='05'\t%Om='05'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+#elif defined(_AIX) // _WIN32
+ check(loc,
+ SV("%b='1月'\t%h='1月'\t%B='1月'\t%m='01'\t%Om='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%b='5月'\t%h='5月'\t%B='5月'\t%m='05'\t%Om='05'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+#elif defined(__APPLE__) // _WIN32
+ check(loc,
+ SV("%b=' 1'\t%h=' 1'\t%B='1月'\t%m='01'\t%Om='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%b=' 5'\t%h=' 5'\t%B='5月'\t%m='05'\t%Om='05'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+#else // _WIN32
+ check(loc,
+ SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='一'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%b=' 5月'\t%h=' 5月'\t%B='5月'\t%m='05'\t%Om='五'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+#endif // _WIN32
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_day() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%d='%d'%t%%Od='%Od'%t%%e='%e'%t%%Oe='%Oe'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%d='%d'%t%%Od='%Od'%t%%e='%e'%t%%Oe='%Oe'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%d='13'\t%Od='13'\t%e='13'\t%Oe='13'\n"),
+ fmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use the global locale (fr_FR)
+ check(SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%d='13'\t%Od='13'\t%e='13'\t%Oe='13'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%d='13'\t%Od='13'\t%e='13'\t%Oe='13'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#else // _WIN32
+ check(loc,
+ SV("%d='01'\t%Od='一'\t%e=' 1'\t%Oe='一'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%d='13'\t%Od='十三'\t%e='13'\t%Oe='十三'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+#endif // _WIN32
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_weekday() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt =
+ SV("{:%%a='%a'%t%%A='%A'%t%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}");
+ constexpr std::basic_string_view<CharT> lfmt =
+ SV("{:L%%a='%a'%t%%A='%A'%t%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%a='Thu'\t%A='Thursday'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%a='Sun'\t%A='Sunday'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"),
+ fmt,
+ std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106
+
+ // Use the global locale (fr_FR)
+#if defined(__APPLE__)
+ check(SV("%a='Jeu'\t%A='Jeudi'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%a='Dim'\t%A='Dimanche'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"),
+ lfmt,
+ std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106
+#else
+ check(SV("%a='jeu.'\t%A='jeudi'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%a='dim.'\t%A='dimanche'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"),
+ lfmt,
+ std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106
+#endif
+
+ // Use supplied locale (ja_JP).
+ // This locale has a different alternate, but not on all platforms
+#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"),
+ lfmt,
+ std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106
+#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='四'\t%w='4'\t%Ow='四'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\n"),
+ lfmt,
+ std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106
+#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_day_of_year() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%j='%j'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%j='%j'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%j='001'\n"), fmt, std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(SV("%j='138'\n"), fmt, std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ // Use the global locale (fr_FR)
+ check(SV("%j='001'\n"), lfmt, std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(SV("%j='138'\n"), lfmt, std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+ check(loc, SV("%j='001'\n"), lfmt, std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(
+ loc, SV("%j='138'\n"), lfmt, std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_week() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%U='%U'%t%%OU='%OU'%t%%W='%W'%t%%OW='%OW'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%U='%U'%t%%OU='%OU'%t%%W='%W'%t%%OW='%OW'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%U='00'\t%OU='00'\t%W='00'\t%OW='00'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%U='20'\t%OU='20'\t%W='20'\t%OW='20'\n"),
+ fmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ // Use the global locale (fr_FR)
+ check(SV("%U='00'\t%OU='00'\t%W='00'\t%OW='00'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%U='20'\t%OU='20'\t%W='20'\t%OW='20'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%U='00'\t%OU='00'\t%W='00'\t%OW='00'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%U='20'\t%OU='20'\t%W='20'\t%OW='20'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%U='00'\t%OU='〇'\t%W='00'\t%OW='〇'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%U='20'\t%OU='二十'\t%W='20'\t%OW='二十'\n"),
+ lfmt,
+ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
+#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_iso_8601_week() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%g='%g'%t%%G='%G'%t%%V='%V'%t%%OV='%OV'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%g='%g'%t%%G='%G'%t%%V='%V'%t%%OV='%OV'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%g='70'\t%G='1970'\t%V='01'\t%OV='01'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%g='09'\t%G='2009'\t%V='07'\t%OV='07'\n"),
+ fmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use the global locale (fr_FR)
+ check(SV("%g='70'\t%G='1970'\t%V='01'\t%OV='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%g='09'\t%G='2009'\t%V='07'\t%OV='07'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%g='70'\t%G='1970'\t%V='01'\t%OV='01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='07'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%g='70'\t%G='1970'\t%V='01'\t%OV='一'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='七'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_date() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%D='%D'%t%%F='%F'%t%%x='%x'%t%%Ex='%Ex'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%D='%D'%t%%F='%F'%t%%x='%x'%t%%Ex='%Ex'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%D='01/01/70'\t%F='1970-01-01'\t%x='01/01/70'\t%Ex='01/01/70'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%D='02/13/09'\t%F='2009-02-13'\t%x='02/13/09'\t%Ex='02/13/09'\n"),
+ fmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use the global locale (fr_FR)
+#if defined(__APPLE__)
+ check(SV("%D='01/01/70'\t%F='1970-01-01'\t%x='01.01.1970'\t%Ex='01.01.1970'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%D='02/13/09'\t%F='2009-02-13'\t%x='13.02.2009'\t%Ex='13.02.2009'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#else
+ check(SV("%D='01/01/70'\t%F='1970-01-01'\t%x='01/01/1970'\t%Ex='01/01/1970'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%D='02/13/09'\t%F='2009-02-13'\t%x='13/02/2009'\t%Ex='13/02/2009'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#endif
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.
+#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970/01/01'\t%Ex='1970/01/01'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009/02/13'\t%Ex='2009/02/13'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970年01月01日'\t%Ex='昭和45年01月01日'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009年02月13日'\t%Ex='平成21年02月13日'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_time() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV(
+ "{:"
+ "%%H='%H'%t"
+ "%%OH='%OH'%t"
+ "%%I='%I'%t"
+ "%%OI='%OI'%t"
+ "%%M='%M'%t"
+ "%%OM='%OM'%t"
+ "%%S='%S'%t"
+ "%%OS='%OS'%t"
+ "%%p='%p'%t"
+ "%%R='%R'%t"
+ "%%T='%T'%t"
+ "%%r='%r'%t"
+ "%%X='%X'%t"
+ "%%EX='%EX'%t"
+ "%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV(
+ "{:L"
+ "%%H='%H'%t"
+ "%%OH='%OH'%t"
+ "%%I='%I'%t"
+ "%%OI='%OI'%t"
+ "%%M='%M'%t"
+ "%%OM='%OM'%t"
+ "%%S='%S'%t"
+ "%%OS='%OS'%t"
+ "%%p='%p'%t"
+ "%%R='%R'%t"
+ "%%T='%T'%t"
+ "%%r='%r'%t"
+ "%%X='%X'%t"
+ "%%EX='%EX'%t"
+ "%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%H='00'\t"
+ "%OH='00'\t"
+ "%I='12'\t"
+ "%OI='12'\t"
+ "%M='00'\t"
+ "%OM='00'\t"
+ "%S='00'\t"
+ "%OS='00'\t"
+ "%p='AM'\t"
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+ "%r='12:00:00 AM'\t"
+ "%X='00:00:00'\t"
+ "%EX='00:00:00'\t"
+ "\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%H='23'\t"
+ "%OH='23'\t"
+ "%I='11'\t"
+ "%OI='11'\t"
+ "%M='31'\t"
+ "%OM='31'\t"
+ "%S='30.123'\t"
+ "%OS='30.123'\t"
+ "%p='PM'\t"
+ "%R='23:31'\t"
+ "%T='23:31:30.123'\t"
+ "%r='11:31:30 PM'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
+ "\n"),
+ fmt,
+ std::chrono::sys_time<std::chrono::milliseconds>(
+ 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
+ // Use the global locale (fr_FR)
+ check(SV("%H='00'\t"
+ "%OH='00'\t"
+ "%I='12'\t"
+ "%OI='12'\t"
+ "%M='00'\t"
+ "%OM='00'\t"
+ "%S='00'\t"
+ "%OS='00'\t"
+#if defined(_AIX)
+ "%p='AM'\t"
+#else
+ "%p=''\t"
+#endif
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+#ifdef _WIN32
+ "%r='00:00:00'\t"
+#elif defined(_AIX)
+ "%r='12:00:00 AM'\t"
+#elif defined(__APPLE__)
+ "%r=''\t"
+#else
+ "%r='12:00:00 '\t"
+#endif
+ "%X='00:00:00'\t"
+ "%EX='00:00:00'\t"
+ "\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%H='23'\t"
+ "%OH='23'\t"
+ "%I='11'\t"
+ "%OI='11'\t"
+ "%M='31'\t"
+ "%OM='31'\t"
+ "%S='30,123'\t"
+ "%OS='30,123'\t"
+#if defined(_AIX)
+ "%p='PM'\t"
+#else
+ "%p=''\t"
+#endif
+ "%R='23:31'\t"
+ "%T='23:31:30,123'\t"
+#ifdef _WIN32
+ "%r='23:31:30'\t"
+#elif defined(_AIX)
+ "%r='11:31:30 PM'\t"
+#elif defined(__APPLE__)
+ "%r=''\t"
+#else
+ "%r='11:31:30 '\t"
+#endif
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
+ "\n"),
+ lfmt,
+ std::chrono::sys_time<std::chrono::milliseconds>(
+ 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.a
+#if defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%H='00'\t"
+ "%OH='00'\t"
+ "%I='12'\t"
+ "%OI='12'\t"
+ "%M='00'\t"
+ "%OM='00'\t"
+ "%S='00'\t"
+ "%OS='00'\t"
+# if defined(__APPLE__)
+ "%p='AM'\t"
+# else
+ "%p='午前'\t"
+# endif
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+# if defined(__APPLE__)
+ "%r='12:00:00 AM'\t"
+ "%X='00時00分00秒'\t"
+ "%EX='00時00分00秒'\t"
+# else
+ "%r='午前12:00:00'\t"
+ "%X='00:00:00'\t"
+ "%EX='00:00:00'\t"
+# endif
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(0s));
+
+ check(loc,
+ SV("%H='23'\t"
+ "%OH='23'\t"
+ "%I='11'\t"
+ "%OI='11'\t"
+ "%M='31'\t"
+ "%OM='31'\t"
+ "%S='30.123'\t"
+ "%OS='30.123'\t"
+# if defined(__APPLE__)
+ "%p='PM'\t"
+# else
+ "%p='午後'\t"
+# endif
+ "%R='23:31'\t"
+ "%T='23:31:30.123'\t"
+# if defined(__APPLE__)
+ "%r='11:31:30 PM'\t"
+ "%X='23時31分30秒'\t"
+ "%EX='23時31分30秒'\t"
+# else
+ "%r='午後11:31:30'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
+# endif
+ "\n"),
+ lfmt,
+ std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
+#else // defined(__APPLE__) || defined(_AIX)
+ check(loc,
+ SV("%H='00'\t"
+ "%OH='〇'\t"
+ "%I='12'\t"
+ "%OI='十二'\t"
+ "%M='00'\t"
+ "%OM='〇'\t"
+ "%S='00'\t"
+ "%OS='〇'\t"
+ "%p='午前'\t"
+ "%R='00:00'\t"
+ "%T='00:00:00'\t"
+ "%r='午前12時00分00秒'\t"
+ "%X='00時00分00秒'\t"
+ "%EX='00時00分00秒'\t"
+ "\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%H='23'\t"
+ "%OH='二十三'\t"
+ "%I='11'\t"
+ "%OI='十一'\t"
+ "%M='31'\t"
+ "%OM='三十一'\t"
+ "%S='30.123'\t"
+ "%OS='三十.123'\t"
+ "%p='午後'\t"
+ "%R='23:31'\t"
+ "%T='23:31:30.123'\t"
+ "%r='午後11時31分30秒'\t"
+ "%X='23時31分30秒'\t"
+ "%EX='23時31分30秒'\t"
+ "\n"),
+ lfmt,
+ std::chrono::sys_time<std::chrono::milliseconds>(
+ 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
+#endif // defined(__APPLE__) || defined(_AIX)
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_date_time() {
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%c='%c'%t%%Ec='%Ec'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%c='%c'%t%%Ec='%Ec'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+ // Non localized output using C-locale
+ check(SV("%c='Thu Jan 1 00:00:00 1970'\t%Ec='Thu Jan 1 00:00:00 1970'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(SV("%c='Fri Feb 13 23:31:30 2009'\t%Ec='Fri Feb 13 23:31:30 2009'\n"),
+ fmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use the global locale (fr_FR)
+ check(
+// https://sourceware.org/bugzilla/show_bug.cgi?id=24054
+#if defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 29
+ SV("%c='jeu. 01 janv. 1970 00:00:00 GMT'\t%Ec='jeu. 01 janv. 1970 00:00:00 GMT'\n"),
+#elif defined(_AIX)
+ SV("%c=' 1 janvier 1970 à 00:00:00 UTC'\t%Ec=' 1 janvier 1970 à 00:00:00 UTC'\n"),
+#elif defined(__APPLE__)
+ SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"),
+#else
+ SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"),
+#endif
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(
+// https://sourceware.org/bugzilla/show_bug.cgi?id=24054
+#if defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 29
+ SV("%c='ven. 13 févr. 2009 23:31:30 GMT'\t%Ec='ven. 13 févr. 2009 23:31:30 GMT'\n"),
+#elif defined(_AIX)
+ SV("%c='13 février 2009 à 23:31:30 UTC'\t%Ec='13 février 2009 à 23:31:30 UTC'\n"),
+#elif defined(__APPLE__)
+ SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"),
+#else
+ SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"),
+#endif
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.a
+#if defined(__APPLE__)
+ check(loc,
+ SV("%c='木 1/ 1 00:00:00 1970'\t%Ec='木 1/ 1 00:00:00 1970'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(loc,
+ SV("%c='金 2/13 23:31:30 2009'\t%Ec='金 2/13 23:31:30 2009'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#elif defined(_AIX) // __APPLE__
+ check(loc,
+ SV("%c='1970年01月 1日 00:00:00 UTC'\t%Ec='1970年01月 1日 00:00:00 UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(loc,
+ SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#else // __APPLE__
+ check(loc,
+ SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ check(loc,
+ SV("%c='2009年02月13日 23時31分30秒'\t%Ec='平成21年02月13日 23時31分30秒'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#endif // __APPLE__
+
+ std::locale::global(std::locale::classic());
+}
+
+template <class CharT>
+static void test_valid_values_time_zone() {
+// The Apple CI gives %z='-0700' %Ez='-0700' %Oz='-0700' %Z='UTC'
+// -0700 looks like the local time where the CI happens to recide, therefore
+// omit this test on Apple.
+#if !defined(__APPLE__)
+ using namespace std::literals::chrono_literals;
+
+ constexpr std::basic_string_view<CharT> fmt = SV("{:%%z='%z'%t%%Ez='%Ez'%t%%Oz='%Oz'%t%%Z='%Z'%n}");
+ constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%z='%z'%t%%Ez='%Ez'%t%%Oz='%Oz'%t%%Z='%Z'%n}");
+
+ const std::locale loc(LOCALE_ja_JP_UTF_8);
+ std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
+
+# if defined(_AIX)
+ // Non localized output using C-locale
+ check(SV("%z='UTC'\t%Ez='UTC'\t%Oz='UTC'\t%Z='UTC'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use the global locale (fr_FR)
+ check(SV("%z='UTC'\t%Ez='UTC'\t%Oz='UTC'\t%Z='UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.a
+ check(loc,
+ SV("%z='UTC'\t%Ez='UTC'\t%Oz='UTC'\t%Z='UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+# else // defined(_AIX)
+ // Non localized output using C-locale
+ check(SV("%z='+0000'\t%Ez='+0000'\t%Oz='+0000'\t%Z='UTC'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use the global locale (fr_FR)
+ check(SV("%z='+0000'\t%Ez='+0000'\t%Oz='+0000'\t%Z='UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use supplied locale (ja_JP). This locale has a different alternate.a
+ check(loc,
+ SV("%z='+0000'\t%Ez='+0000'\t%Oz='+〇'\t%Z='UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+# endif // defined(_AIX)
+ std::locale::global(std::locale::classic());
+#endif // !defined(__APPLE__)
+}
+
+template <class CharT>
+static void test_valid_values() {
+ test_valid_values_year<CharT>();
+ test_valid_values_month<CharT>();
+ test_valid_values_day<CharT>();
+ test_valid_values_weekday<CharT>();
+ test_valid_values_day_of_year<CharT>();
+ test_valid_values_week<CharT>();
+ test_valid_values_iso_8601_week<CharT>();
+ test_valid_values_date<CharT>();
+ test_valid_values_time<CharT>();
+ test_valid_values_date_time<CharT>();
+ test_valid_values_time_zone<CharT>();
+}
+
+template <class CharT>
+static void test() {
+ using namespace std::literals::chrono_literals;
+
+ test_no_chrono_specs<CharT>();
+ test_valid_values<CharT>();
+ check_invalid_types<CharT>(
+ {SV("a"), SV("A"), SV("b"), SV("B"), SV("c"), SV("C"), SV("d"), SV("D"), SV("e"), SV("F"), SV("g"),
+ SV("G"), SV("h"), SV("H"), SV("I"), SV("j"), SV("m"), SV("M"), SV("p"), SV("r"), SV("R"), SV("S"),
+ SV("T"), SV("u"), SV("U"), SV("V"), SV("w"), SV("W"), SV("x"), SV("X"), SV("y"), SV("Y"), SV("z"),
+ SV("Z"), SV("Ec"), SV("EC"), SV("Ex"), SV("EX"), SV("Ey"), SV("EY"), SV("Ez"), SV("Od"), SV("Oe"), SV("OH"),
+ SV("OI"), SV("Om"), SV("OM"), SV("OS"), SV("Ou"), SV("OU"), SV("OV"), SV("Ow"), SV("OW"), SV("Oy"), SV("Oz")},
+ std::chrono::sys_seconds(0s));
+
+ check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::sys_seconds(0s));
+ check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::sys_seconds(0s));
+ check_exception(
+ "End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::sys_seconds(0s));
+ check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::sys_seconds(0s));
+ check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::sys_seconds(0s));
+
+ // Precision not allowed
+ check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::sys_seconds(0s));
+}
+
+int main(int, char**) {
+ test<char>();
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
index 1b3fbe9..7901d9d 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
@@ -14,6 +14,12 @@
// TODO FMT Investigate Windows issues.
// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
index 5493034..e2e2425 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
@@ -17,6 +17,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
index e3fa9ae..33661be 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
@@ -17,6 +17,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year.pass.cpp
index beb4732..ec254f4 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year.pass.cpp
@@ -14,6 +14,12 @@
// TODO FMT Investigate Windows issues.
// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
index 344967d..3875ce1 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
@@ -14,6 +14,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
index 25d5a58..f97675e 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
@@ -17,6 +17,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
index 35ce599..7462811 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
@@ -14,6 +14,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
index 617f183..03d8c3b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
@@ -14,6 +14,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
index 50968a3..5d59bf0 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
@@ -12,6 +12,9 @@
// TODO FMT It seems GCC uses too much memory in the CI and fails.
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
diff --git a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h
index 115d6cc..42c176b 100644
--- a/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h
+++ b/third_party/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h
@@ -15,6 +15,7 @@
#include <algorithm>
#include <cassert>
+#include <iostream>
#include <set>
#include <string>
#include <string_view>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
index fd4d03e..6bd5f80 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
@@ -16,14 +16,10 @@
// pointer allocate(size_type n);
#include <scoped_allocator>
-#include <cassert>
#include "allocators.h"
-int main(int, char**)
-{
+void f() {
std::scoped_allocator_adaptor<A1<int>> a;
a.allocate(10); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
index 6e60b6a..05588df 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
@@ -16,14 +16,10 @@
// pointer allocate(size_type n, const_void_pointer hint);
#include <scoped_allocator>
-#include <cassert>
#include "allocators.h"
-int main(int, char**)
-{
+void f() {
std::scoped_allocator_adaptor<A1<int>> a;
a.allocate(10, (const void*)0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
index f235b70..0d4cab8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/move.pass.cpp
index ec0b6c0..08c9acd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/move.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/value.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/value.pass.cpp
index a4a4095..7bd0ffa 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.assign/value.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
index 892ef43..6bb5f13 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
index a1205bf..ec53bf1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/move.pass.cpp
index d70b688..a8a362b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/move.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/value.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/value.pass.cpp
index c7ccc58..ed7f4e9 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.cons/value.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
index 7c5fbfe..00c4c50 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
@@ -25,9 +24,11 @@
#include "test_macros.h"
struct Tracked {
- static int count;
- Tracked() {++count;}
- ~Tracked() { --count; }
+ static int count;
+ Tracked() { ++count; }
+ Tracked(Tracked const&) noexcept { ++count; }
+ Tracked& operator=(Tracked const&) = default;
+ ~Tracked() { --count; }
};
int Tracked::count = 0;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
index 7499ed0..eee478d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
index 9e07586..163dafc 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
index 2afac84..4faa75f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index 5c7c29f..e2db999 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
index 2dc8bd2..23847fe 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// UNSUPPORTED: availability-bad_any_cast-missing
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
index a066c6a..3bf6279 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// UNSUPPORTED: availability-bad_any_cast-missing
// <any>
@@ -30,8 +29,7 @@
struct TestType {};
struct TestType2 {};
-int main(int, char**)
-{
+void f() {
std::any a;
// expected-error-re@any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
@@ -45,6 +43,4 @@
// expected-error-re@any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
std::any_cast<TestType2 &&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
index a3b3b3b..d1fd05b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// UNSUPPORTED: availability-bad_any_cast-missing
// <any>
@@ -33,20 +32,19 @@
#include <any>
-struct no_copy
-{
+struct no_copy {
no_copy() {}
no_copy(no_copy &&) {}
no_copy(no_copy const &) = delete;
};
struct no_move {
- no_move() {}
- no_move(no_move&&) = delete;
- no_move(no_move const&) {}
+ no_move() {}
+ no_move(no_move&&) = delete;
+ no_move(no_move const&) {}
};
-int main(int, char**) {
+void f() {
std::any a;
// expected-error-re@any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
std::any_cast<no_copy>(static_cast<std::any&>(a)); // expected-note {{requested here}}
@@ -58,6 +56,4 @@
// expected-error-re@any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
std::any_cast<no_move>(static_cast<std::any &&>(a));
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
index 987b387..1a68488 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/swap.pass.cpp
index d372b71..becd198 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/any/any.nonmembers/swap.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_any_cast is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_any_cast-missing && !no-exceptions
// <any>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/floating_point_test_cases.hpp b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/floating_point_test_cases.hpp
index 55c61db..5ea7143 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/floating_point_test_cases.hpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/floating_point_test_cases.hpp
@@ -7,7 +7,7 @@
#include <stdint.h>
#include <utility>
-constexpr std::pair<const char*, uint64_t> floating_point_test_cases_double[] = {
+constexpr std::pair<const char*, std::uint64_t> floating_point_test_cases_double[] = {
// Verify small exactly-representable integers:
{"1", 0x3FF0000000000000ULL},
{"2", 0x4000000000000000ULL},
@@ -202,7 +202,7 @@
{"8.32116e+55", 0x4B8B2628393E02CDULL},
};
-constexpr std::pair<const char*, uint32_t> floating_point_test_cases_float[] = {
+constexpr std::pair<const char*, std::uint32_t> floating_point_test_cases_float[] = {
// Verify small exactly-representable integers:
{"1", 0x3F800000U},
{"2", 0x40000000U},
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
index 69e11a6..30ee9ad 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
@@ -49,12 +49,12 @@
using namespace std;
void initialize_randomness(mt19937_64& mt64, const int argc, char** const /*argv*/) {
- constexpr size_t n = mt19937_64::state_size;
- constexpr size_t w = mt19937_64::word_size;
+ constexpr std::size_t n = mt19937_64::state_size;
+ constexpr std::size_t w = mt19937_64::word_size;
static_assert(w % 32 == 0);
- constexpr size_t k = w / 32;
+ constexpr std::size_t k = w / 32;
- vector<uint32_t> vec(n * k);
+ vector<std::uint32_t> vec(n * k);
puts("USAGE:");
puts("test.exe : generates seed data from random_device.");
@@ -70,7 +70,7 @@
puts("SEED DATA:");
for (const auto& elem : vec) {
- printf("%zu ", static_cast<size_t>(elem));
+ printf("%zu ", static_cast<std::size_t>(elem));
}
printf("\n");
@@ -103,14 +103,14 @@
// without attempting to write to extra chars even when they're available. Finally, we also verify that we aren't
// underrunning the buffer. This is a concern because sometimes we walk backwards when rounding.
- constexpr size_t BufferPrefix = 20; // detect buffer underruns (specific value isn't important)
+ constexpr std::size_t BufferPrefix = 20; // detect buffer underruns (specific value isn't important)
- constexpr size_t Space = is_integral_v<T> ? 1 + 64 // worst case: -2^63 in binary
+ constexpr std::size_t Space = is_integral_v<T> ? 1 + 64 // worst case: -2^63 in binary
: is_same_v<T, float>
? 1 + 151 // worst case: negative min subnormal float, fixed notation
: 1 + 1076; // worst case: negative min subnormal double, fixed notation
- constexpr size_t BufferSuffix = 30; // detect buffer overruns (specific value isn't important)
+ constexpr std::size_t BufferSuffix = 30; // detect buffer overruns (specific value isn't important)
array<char, BufferPrefix + Space + BufferSuffix> buff;
@@ -118,12 +118,12 @@
char* const first = buff_begin + BufferPrefix;
char* const buff_end = buff_begin + buff.size();
- constexpr size_t ExtraChars = 3;
+ constexpr std::size_t ExtraChars = 3;
static_assert(ExtraChars + 10 < BufferSuffix,
"The specific values aren't important, but there should be plenty of room to detect buffer overruns.");
- for (size_t n = 0; n <= correct.size() + ExtraChars; ++n) {
- assert(n <= static_cast<size_t>(buff_end - first));
+ for (std::size_t n = 0; n <= correct.size() + ExtraChars; ++n) {
+ assert(n <= static_cast<std::size_t>(buff_end - first));
char* const last = first + n;
buff.fill('@');
@@ -187,12 +187,12 @@
"1t", "1u", "1v", "1w", "1x", "1y", "1z"};
// https://www.wolframalpha.com : Table[BaseForm[k, n], {k, {MEOW, MEOW, MEOW}}, {n, 2, 36}]
-constexpr uint64_t stress_chunks_positive = 12000000345000678900ULL;
-constexpr pair<uint64_t, array<const char*, 37>> output_positive[] = {
+constexpr std::uint64_t stress_chunks_positive = 12000000345000678900ULL;
+constexpr pair<std::uint64_t, array<const char*, 37>> output_positive[] = {
{123U, {{"skip0", "skip1", "1111011", "11120", "1323", "443", "323", "234", "173", "146", "123", "102", "a3", "96",
"8b", "83", "7b", "74", "6f", "69", "63", "5i", "5d", "58", "53", "4n", "4j", "4f", "4b", "47", "43",
"3u", "3r", "3o", "3l", "3i", "3f"}}},
- {uint64_t{INT8_MAX}, {{"skip0", "skip1", "1111111", "11201", "1333", "1002", "331", "241", "177", "151", "127",
+ {std::uint64_t{INT8_MAX}, {{"skip0", "skip1", "1111111", "11201", "1333", "1002", "331", "241", "177", "151", "127",
"106", "a7", "9a", "91", "87", "7f", "78", "71", "6d", "67", "61", "5h", "5c", "57", "52",
"4n", "4j", "4f", "4b", "47", "43", "3v", "3s", "3p", "3m", "3j"}}},
{161U, {{"skip0", "skip1", "10100001", "12222", "2201", "1121", "425", "320", "241", "188", "161", "137", "115",
@@ -204,7 +204,7 @@
{1729U, {{"skip0", "skip1", "11011000001", "2101001", "123001", "23404", "12001", "5020", "3301", "2331", "1729",
"1332", "1001", "a30", "8b7", "7a4", "6c1", "5gc", "561", "4f0", "469", "3j7", "3cd", "364", "301",
"2j4", "2ed", "2a1", "25l", "21i", "1rj", "1oo", "1m1", "1jd", "1gt", "1ee", "1c1"}}},
- {uint64_t{INT16_MAX}, {{"skip0", "skip1", "111111111111111", "1122221121", "13333333", "2022032", "411411",
+ {std::uint64_t{INT16_MAX}, {{"skip0", "skip1", "111111111111111", "1122221121", "13333333", "2022032", "411411",
"164350", "77777", "48847", "32767", "22689", "16b67", "11bb7", "bd27", "9a97", "7fff",
"6b68", "5b27", "4eeb", "41i7", "3b67", "31f9", "2flf", "28l7", "22ah", "1mc7", "1hpg",
"1dm7", "19rq", "16c7", "1330", "vvv", "u2v", "sbp", "qq7", "pa7"}}},
@@ -221,7 +221,7 @@
"1b9a06b2", "11973ba8", "9636514", "639e338", "43d49e6", "2g19gfb", "21b9d18", "19dec94", "124addi",
"h8f25b", "dhdfa6", "b13hg2", "8m91he", "7720j3", "5pgj58", "4pmelq", "43k17i", "3dg8ek", "2ro898",
"2f0et8", "23qif6", "1qw5lh", "1j7l7s", "1cdvli", "16cgrq"}}},
- {uint64_t{INT32_MAX},
+ {std::uint64_t{INT32_MAX},
{{"skip0", "skip1", "1111111111111111111111111111111", "12112122212110202101", "1333333333333333",
"13344223434042", "553032005531", "104134211161", "17777777777", "5478773671", "2147483647", "a02220281",
"4bb2308a7", "282ba4aaa", "1652ca931", "c87e66b7", "7fffffff", "53g7f548", "3928g3h1", "27c57h32",
@@ -247,7 +247,7 @@
"4d0d5e232c53", "2d63h403i580", "1bf5h8185hdj", "kc3g550fkcg", "d41id5k9984", "8ef5n0him4g", "5i2dijfe1la",
"3me22fm5fhi", "2hfmhgg73kd", "1ngpfabr53c", "18i7220bh11", "rm0lcjngpa", "kk1elesni1", "fgfge3c3fg",
"bp4q5l6bjg", "8xna46jp0k", "6wejomvji5", "5di2s1qhv4"}}},
- {uint64_t{INT64_MAX},
+ {std::uint64_t{INT64_MAX},
{{"skip0", "skip1", "111111111111111111111111111111111111111111111111111111111111111",
"2021110011022210012102010021220101220221", "13333333333333333333333333333333",
"1104332401304422434310311212", "1540241003031030222122211", "22341010611245052052300",
@@ -290,8 +290,8 @@
};
// https://www.wolframalpha.com : Table[BaseForm[k, n], {k, {MEOW, MEOW, MEOW}}, {n, 2, 36}]
-constexpr int64_t stress_chunks_negative = -9000876000000054321LL;
-constexpr pair<int64_t, array<const char*, 37>> output_negative[] = {
+constexpr std::int64_t stress_chunks_negative = -9000876000000054321LL;
+constexpr pair<std::int64_t, array<const char*, 37>> output_negative[] = {
{-85, {{"skip0", "skip1", "-1010101", "-10011", "-1111", "-320", "-221", "-151", "-125", "-104", "-85", "-78",
"-71", "-67", "-61", "-5a", "-55", "-50", "-4d", "-49", "-45", "-41", "-3j", "-3g", "-3d", "-3a", "-37",
"-34", "-31", "-2r", "-2p", "-2n", "-2l", "-2j", "-2h", "-2f", "-2d"}}},
@@ -360,8 +360,8 @@
test_integer_to_chars(static_cast<T>(base * 2 - 1), base, output_max_digit[base]);
for (const auto& p : output_positive) {
- if (p.first <= static_cast<uint64_t>(numeric_limits<T>::max())) {
- test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<size_t>(base)]);
+ if (p.first <= static_cast<std::uint64_t>(numeric_limits<T>::max())) {
+ test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<std::size_t>(base)]);
}
}
@@ -369,8 +369,8 @@
test_integer_to_chars(static_cast<T>(-1), base, "-1");
for (const auto& p : output_negative) {
- if (p.first >= static_cast<int64_t>(numeric_limits<T>::min())) {
- test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<size_t>(base)]);
+ if (p.first >= static_cast<std::int64_t>(numeric_limits<T>::min())) {
+ test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<std::size_t>(base)]);
}
}
}
@@ -382,7 +382,7 @@
enum class TestFromCharsMode { Normal, SignalingNaN };
template <typename T, typename BaseOrFmt>
-void test_from_chars(const string_view input, const BaseOrFmt base_or_fmt, const size_t correct_idx,
+void test_from_chars(const string_view input, const BaseOrFmt base_or_fmt, const std::size_t correct_idx,
const errc correct_ec, const optional<T> opt_correct = nullopt,
const TestFromCharsMode mode = TestFromCharsMode::Normal) {
@@ -402,7 +402,7 @@
if (correct_ec == errc{} || (is_floating_point_v<T> && correct_ec == errc::result_out_of_range)) {
if constexpr (is_floating_point_v<T>) {
if (mode == TestFromCharsMode::Normal) {
- using Uint = conditional_t<is_same_v<T, float>, uint32_t, uint64_t>;
+ using Uint = conditional_t<is_same_v<T, float>, std::uint32_t, std::uint64_t>;
assert(opt_correct.has_value());
assert(_Bit_cast<Uint>(dest) == _Bit_cast<Uint>(opt_correct.value()));
} else {
@@ -543,9 +543,9 @@
test_from_chars<int>("-2147483650", 10, 11, out_ran); // beyond risky
}
-void assert_message_bits(const bool b, const char* const msg, const uint32_t bits) {
+void assert_message_bits(const bool b, const char* const msg, const std::uint32_t bits) {
if (!b) {
- fprintf(stderr, "%s failed for 0x%08zX\n", msg, static_cast<size_t>(bits));
+ fprintf(stderr, "%s failed for 0x%08zX\n", msg, static_cast<std::size_t>(bits));
fprintf(stderr, "This is a randomized test.\n");
fprintf(stderr, "DO NOT IGNORE/RERUN THIS FAILURE.\n");
fprintf(stderr, "You must report it to the STL maintainers.\n");
@@ -553,7 +553,7 @@
}
}
-void assert_message_bits(const bool b, const char* const msg, const uint64_t bits) {
+void assert_message_bits(const bool b, const char* const msg, const std::uint64_t bits) {
if (!b) {
// libc++ uses long for 64-bit values.
fprintf(stderr, "%s failed for 0x%016llX\n", msg, static_cast<unsigned long long>(bits));
@@ -564,30 +564,30 @@
}
}
-constexpr uint32_t FractionBits = 10; // Tunable for test coverage vs. performance.
+constexpr std::uint32_t FractionBits = 10; // Tunable for test coverage vs. performance.
static_assert(FractionBits >= 1, "Must test at least 1 fraction bit.");
static_assert(FractionBits <= 23, "There are only 23 fraction bits in a float.");
-constexpr uint32_t Fractions = 1U << FractionBits;
-constexpr uint32_t Mask32 = ~((1U << FractionBits) - 1U);
-constexpr uint64_t Mask64 = ~((1ULL << FractionBits) - 1ULL);
+constexpr std::uint32_t Fractions = 1U << FractionBits;
+constexpr std::uint32_t Mask32 = ~((1U << FractionBits) - 1U);
+constexpr std::uint64_t Mask64 = ~((1ULL << FractionBits) - 1ULL);
-constexpr uint32_t PrefixesToTest = 100; // Tunable for test coverage vs. performance.
+constexpr std::uint32_t PrefixesToTest = 100; // Tunable for test coverage vs. performance.
static_assert(PrefixesToTest >= 1, "Must test at least 1 prefix.");
-constexpr uint32_t PrefixLimit = 2 // sign bit
+constexpr std::uint32_t PrefixLimit = 2 // sign bit
* 255 // non-INF/NAN exponents for float
* (1U << (23 - FractionBits)); // fraction bits in prefix
static_assert(PrefixesToTest <= PrefixLimit, "Too many prefixes.");
template <bool IsDouble>
-void test_floating_prefix(const conditional_t<IsDouble, uint64_t, uint32_t> prefix) {
+void test_floating_prefix(const conditional_t<IsDouble, std::uint64_t, std::uint32_t> prefix) {
- using UIntType = conditional_t<IsDouble, uint64_t, uint32_t>;
+ using UIntType = conditional_t<IsDouble, std::uint64_t, std::uint32_t>;
using FloatingType = conditional_t<IsDouble, double, float>;
// "-1.2345678901234567e-100" or "-1.23456789e-10"
- constexpr size_t buffer_size = IsDouble ? 24 : 15;
+ constexpr std::size_t buffer_size = IsDouble ? 24 : 15;
char buffer[buffer_size];
// TODO Enable once std::from_chars has floating point support.
#if 0
@@ -600,14 +600,14 @@
// 1 character for a negative sign
// + 325 (for double; 46 for float) characters in the "0.000~~~000" prefix of the min subnormal
// + 17 (for double; 9 for float) characters for round-trip digits
- constexpr size_t fixed_buffer_size = IsDouble ? 1 + 325 + 17 : 1 + 46 + 9;
+ constexpr std::size_t fixed_buffer_size = IsDouble ? 1 + 325 + 17 : 1 + 46 + 9;
char fixed_buffer[fixed_buffer_size];
// worst case: negative sign + max normal + null terminator
- constexpr size_t stdio_buffer_size = 1 + (IsDouble ? 309 : 39) + 1;
+ constexpr std::size_t stdio_buffer_size = 1 + (IsDouble ? 309 : 39) + 1;
char stdio_buffer[stdio_buffer_size];
- for (uint32_t frac = 0; frac < Fractions; ++frac) {
+ for (std::uint32_t frac = 0; frac < Fractions; ++frac) {
const UIntType bits = prefix + frac;
const FloatingType input = _Bit_cast<FloatingType>(bits);
@@ -630,7 +630,7 @@
// Also verify that to_chars() and sprintf_s() emit the same output for integers in fixed notation.
const auto fixed_result = to_chars(fixed_buffer, end(fixed_buffer), input, chars_format::fixed);
assert_message_bits(fixed_result.ec == errc{}, "fixed_result.ec", bits);
- const string_view fixed_sv(fixed_buffer, static_cast<size_t>(fixed_result.ptr - fixed_buffer));
+ const string_view fixed_sv(fixed_buffer, static_cast<std::size_t>(fixed_result.ptr - fixed_buffer));
if (find(fixed_sv.begin(), fixed_sv.end(), '.') == fixed_sv.end()) {
const int stdio_ret = sprintf_s(stdio_buffer, size(stdio_buffer), "%.0f", input);
@@ -643,9 +643,9 @@
}
template <bool IsDouble>
-void test_floating_hex_prefix(const conditional_t<IsDouble, uint64_t, uint32_t> prefix) {
+void test_floating_hex_prefix(const conditional_t<IsDouble, std::uint64_t, std::uint32_t> prefix) {
- using UIntType = conditional_t<IsDouble, uint64_t, uint32_t>;
+ using UIntType = conditional_t<IsDouble, std::uint64_t, std::uint32_t>;
using FloatingType = conditional_t<IsDouble, double, float>;
// The precision is the number of hexits after the decimal point.
@@ -654,14 +654,14 @@
// float explicitly stores 23 fraction bits. 23 / 4 == 5.75, so we need 6 hexits.
// "-1.fffffffffffffp+1023" or "-1.fffffep+127"
- constexpr size_t buffer_size = IsDouble ? 22 : 14;
+ constexpr std::size_t buffer_size = IsDouble ? 22 : 14;
char buffer[buffer_size];
// TODO Enable once std::from_chars has floating point support.
#if 0
FloatingType val;
#endif
- for (uint32_t frac = 0; frac < Fractions; ++frac) {
+ for (std::uint32_t frac = 0; frac < Fractions; ++frac) {
const UIntType bits = prefix + frac;
const FloatingType input = _Bit_cast<FloatingType>(bits);
@@ -681,9 +681,9 @@
}
template <bool IsDouble>
-void test_floating_precision_prefix(const conditional_t<IsDouble, uint64_t, uint32_t> prefix) {
+void test_floating_precision_prefix(const conditional_t<IsDouble, std::uint64_t, std::uint32_t> prefix) {
- using UIntType = conditional_t<IsDouble, uint64_t, uint32_t>;
+ using UIntType = conditional_t<IsDouble, std::uint64_t, std::uint32_t>;
using FloatingType = conditional_t<IsDouble, double, float>;
// Precision for min subnormal in fixed notation. (More than enough for scientific notation.)
@@ -693,28 +693,28 @@
constexpr int max_integer_length = IsDouble ? 309 : 39;
// Size for fixed notation. (More than enough for scientific notation.)
- constexpr size_t charconv_buffer_size = 1 // negative sign
+ constexpr std::size_t charconv_buffer_size = 1 // negative sign
+ max_integer_length // integer digits
+ 1 // decimal point
+ precision; // fractional digits
char charconv_buffer[charconv_buffer_size];
- constexpr size_t stdio_buffer_size = charconv_buffer_size + 1; // null terminator
+ constexpr std::size_t stdio_buffer_size = charconv_buffer_size + 1; // null terminator
char stdio_buffer[stdio_buffer_size];
// 1 character for a negative sign
// + worst cases: 0x1.fffffffffffffp-1022 and 0x1.fffffep-126f
- constexpr size_t general_buffer_size = 1 + (IsDouble ? 773 : 117);
+ constexpr std::size_t general_buffer_size = 1 + (IsDouble ? 773 : 117);
char general_buffer[general_buffer_size];
char general_stdio_buffer[general_buffer_size + 1]; // + null terminator
- for (uint32_t frac = 0; frac < Fractions; ++frac) {
+ for (std::uint32_t frac = 0; frac < Fractions; ++frac) {
const UIntType bits = prefix + frac;
const FloatingType input = _Bit_cast<FloatingType>(bits);
auto result = to_chars(charconv_buffer, end(charconv_buffer), input, chars_format::fixed, precision);
assert_message_bits(result.ec == errc{}, "to_chars fixed precision", bits);
- string_view charconv_sv(charconv_buffer, static_cast<size_t>(result.ptr - charconv_buffer));
+ string_view charconv_sv(charconv_buffer, static_cast<std::size_t>(result.ptr - charconv_buffer));
int stdio_ret = sprintf_s(stdio_buffer, size(stdio_buffer), "%.*f", precision, input);
assert_message_bits(stdio_ret != -1, "sprintf_s fixed precision", bits);
@@ -725,7 +725,7 @@
result = to_chars(charconv_buffer, end(charconv_buffer), input, chars_format::scientific, precision);
assert_message_bits(result.ec == errc{}, "to_chars scientific precision", bits);
- charconv_sv = string_view(charconv_buffer, static_cast<size_t>(result.ptr - charconv_buffer));
+ charconv_sv = string_view(charconv_buffer, static_cast<std::size_t>(result.ptr - charconv_buffer));
stdio_ret = sprintf_s(stdio_buffer, size(stdio_buffer), "%.*e", precision, input);
assert_message_bits(stdio_ret != -1, "sprintf_s scientific precision", bits);
@@ -736,7 +736,7 @@
result = to_chars(general_buffer, end(general_buffer), input, chars_format::general, 5000);
assert_message_bits(result.ec == errc{}, "to_chars general precision", bits);
- charconv_sv = string_view(general_buffer, static_cast<size_t>(result.ptr - general_buffer));
+ charconv_sv = string_view(general_buffer, static_cast<std::size_t>(result.ptr - general_buffer));
stdio_ret = sprintf_s(general_stdio_buffer, size(general_stdio_buffer), "%.5000g", input);
assert_message_bits(stdio_ret != -1, "sprintf_s general precision", bits);
@@ -748,10 +748,10 @@
void test_floating_prefixes(mt19937_64& mt64) {
{
- set<uint64_t> prefixes64;
+ set<std::uint64_t> prefixes64;
while (prefixes64.size() < PrefixesToTest) {
- const uint64_t val = mt64();
+ const std::uint64_t val = mt64();
if ((val & 0x7FF0000000000000ULL) != 0x7FF0000000000000ULL) { // skip INF/NAN
prefixes64.insert(val & Mask64);
@@ -767,10 +767,10 @@
}
{
- set<uint32_t> prefixes32;
+ set<std::uint32_t> prefixes32;
while (prefixes32.size() < PrefixesToTest) {
- const uint32_t val = static_cast<uint32_t>(mt64());
+ const std::uint32_t val = static_cast<std::uint32_t>(mt64());
if ((val & 0x7F800000U) != 0x7F800000U) { // skip INF/NAN
prefixes32.insert(val & Mask32);
@@ -1072,7 +1072,7 @@
const long long ms = chrono::duration_cast<chrono::milliseconds>(finish - start).count();
puts("PASS");
- printf("Randomized test cases: %zu\n", static_cast<size_t>(PrefixesToTest * Fractions));
+ printf("Randomized test cases: %zu\n", static_cast<std::size_t>(PrefixesToTest * Fractions));
printf("Total time: %lld ms\n", ms);
if (ms < 3'000) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
index 3fdc0d3..eb6d648 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
@@ -21,7 +21,7 @@
struct FloatFromCharsTestCase {
const char* input;
chars_format fmt;
- size_t correct_idx;
+ std::size_t correct_idx;
errc correct_ec;
float correct_value;
};
@@ -42,7 +42,7 @@
struct DoubleFromCharsTestCase {
const char* input;
chars_format fmt;
- size_t correct_idx;
+ std::size_t correct_idx;
errc correct_ec;
double correct_value;
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
index c1a4699..09ef70e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
@@ -10,7 +10,7 @@
// to_chars requires functions in the dylib that have not been introduced in older
// versions of the dylib on macOS.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
+// XFAIL: availability-fp_to_chars-missing
// steady_clock requires threads.
// UNSUPPORTED: no-threads
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp
index beee526..85b78c4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp
@@ -18,8 +18,9 @@
// general = fixed | scientific
// };
-#include <charconv>
#include <cassert>
+#include <charconv>
+#include <type_traits>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
index 4bdb8ca..3fc5670 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
@@ -23,26 +23,26 @@
#include "charconv_test_helpers.h"
#ifndef TEST_HAS_NO_INT128
-TEST_CONSTEXPR_CXX23 __uint128_t make_u128(__uint128_t a, uint64_t b) {
+TEST_CONSTEXPR_CXX23 __uint128_t make_u128(__uint128_t a, std::uint64_t b) {
a *= 1000000000000000000UL;
a *= 10;
return a + b;
}
-TEST_CONSTEXPR_CXX23 __uint128_t make_u128(__uint128_t a, uint64_t b, uint64_t c) {
+TEST_CONSTEXPR_CXX23 __uint128_t make_u128(__uint128_t a, std::uint64_t b, std::uint64_t c) {
a *= 10000000000000ULL;
a += b;
a *= 10000000000000ULL;
return a + c;
}
-TEST_CONSTEXPR_CXX23 __int128_t make_i128(__int128_t a, int64_t b) {
+TEST_CONSTEXPR_CXX23 __int128_t make_i128(__int128_t a, std::int64_t b) {
if (a < 0)
return -make_u128(-a, b);
return make_u128(a, b);
}
-TEST_CONSTEXPR_CXX23 __int128_t make_i128(__int128_t a, __int128_t b, int64_t c) {
+TEST_CONSTEXPR_CXX23 __int128_t make_i128(__int128_t a, __int128_t b, std::int64_t c) {
if (a < 0)
return -make_u128(-a, b, c);
return make_u128(a, b, c);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.pass.cpp
index 2e60242..44fee37 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.pass.cpp
@@ -22,10 +22,10 @@
#include "test_macros.h"
int main(int, char**) {
- [[maybe_unused]] auto store = std::make_format_args(42, nullptr, false, 1.0);
+ [[maybe_unused]] auto store = std::make_format_args(42, nullptr, false, 'x');
LIBCPP_STATIC_ASSERT(
- std::same_as<decltype(store), std::__format_arg_store<std::format_context, int, nullptr_t, bool, double>>);
+ std::same_as<decltype(store), std::__format_arg_store<std::format_context, int, nullptr_t, bool, char>>);
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
index d36f189..0e46dbe 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
@@ -19,6 +19,7 @@
// - otherwise, if T is char and char_type is wchar_t, initializes value with static_cast<wchar_t>(v);
#include <format>
+#include <iterator>
#include <string>
void test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
index 14328a1..feb23c5 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
@@ -22,10 +22,10 @@
#include "test_macros.h"
int main(int, char**) {
- [[maybe_unused]] auto store = std::make_wformat_args(42, nullptr, false, 1.0);
+ [[maybe_unused]] auto store = std::make_wformat_args(42, nullptr, false, 'x');
LIBCPP_STATIC_ASSERT(
- std::same_as<decltype(store), std::__format_arg_store<std::wformat_context, int, nullptr_t, bool, double>>);
+ std::same_as<decltype(store), std::__format_arg_store<std::wformat_context, int, nullptr_t, bool, char>>);
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
index ea2680a..c67d868 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
@@ -8,14 +8,12 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
// <format>
// template<class Visitor, class Context>
// see below visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg);
+#include <algorithm>
#include <format>
#include <cassert>
#include <type_traits>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp
new file mode 100644
index 0000000..b500b1e
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/ctad.compile.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// <format>
+
+// template<class Context, class... Args>
+// basic_format_args(format-arg-store<Context, Args...>) -> basic_format_args<Context>;
+
+#include <concepts>
+#include <format>
+
+#include "test_macros.h"
+
+void test() {
+ // Note the Standard way to create a format-arg-store is by using make_format_args.
+ static_assert(std::same_as<decltype(std::basic_format_args(std::make_format_args(42))),
+ std::basic_format_args<std::format_context>>);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ static_assert(std::same_as<decltype(std::basic_format_args(std::make_wformat_args(42))),
+ std::basic_format_args<std::wformat_context>>);
+
+#endif
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
index 35bee3e..ecb055e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
@@ -8,9 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
// <format>
// basic_format_arg<Context> get(size_t i) const noexcept;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
index 9ca1d31..4121d0b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
@@ -26,6 +26,3 @@
static_assert(std::is_same_v<std::wformat_args,
std::basic_format_args<std::wformat_context>>);
#endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.error/format.error.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.error/format.error.pass.cpp
index e3d3c48..c2d3d6b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.error/format.error.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.error/format.error.pass.cpp
@@ -9,9 +9,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
// <format>
// class format_error;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/ctor.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/ctor.verify.cpp
index 8f5404d..d51531d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/ctor.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/ctor.verify.cpp
@@ -33,14 +33,14 @@
(void)std::basic_format_string<char>{"{}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
(void)std::basic_format_string<char, int>{"{0:{0}P}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
(void)std::basic_format_string<char, int>{"{0:{0}}"};
- (void)std::basic_format_string<char, float>{"{0:{0}}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
+ (void)std::basic_format_string<char, bool>{"{0:{0}}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
(void)std::basic_format_string<char, int>{"{.3}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
(void)std::basic_format_string<wchar_t>{L"foo"};
(void)std::basic_format_string<wchar_t>{L"{}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
(void)std::basic_format_string<wchar_t, int>{L"{0:{0}P}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
(void)std::basic_format_string<wchar_t, int>{L"{0:{0}}"};
- (void)std::basic_format_string<wchar_t, float>{L"{0:{0}}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
+ (void)std::basic_format_string<wchar_t, bool>{L"{0:{0}}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
(void)std::basic_format_string<wchar_t, int>{L"{.3}"}; // expected-error-re {{call to consteval function{{.*}}is not a constant expression}}
#endif
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/get.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/get.pass.cpp
index bf7e2ad..d9a8c9f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/get.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/get.pass.cpp
@@ -35,10 +35,10 @@
constexpr bool test() {
assert((std::basic_format_string<CharT>{CSTR("foo")}.get() == SV("foo")));
assert((std::basic_format_string<CharT, int>{CSTR("{}")}.get() == SV("{}")));
- assert((std::basic_format_string<CharT, int, float>{CSTR("{} {:01.23L}")}.get() == SV("{} {:01.23L}")));
+ assert((std::basic_format_string<CharT, int, char>{CSTR("{} {:*>6}")}.get() == SV("{} {:*>6}")));
// Embedded NUL character
- assert((std::basic_format_string<CharT, void*, double>{SV("{}\0{}")}.get() == SV("{}\0{}")));
+ assert((std::basic_format_string<CharT, void*, bool>{SV("{}\0{}")}.get() == SV("{}\0{}")));
return true;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp
index 3ebd2bf..1ecfb5d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp
@@ -29,12 +29,11 @@
static_assert(std::same_as<std::format_string<>, std::basic_format_string<char>>);
static_assert(std::same_as<std::format_string<int>, std::basic_format_string<char, int>>);
-static_assert(std::same_as<std::format_string<int, float>, std::basic_format_string<char, int, float>>);
-static_assert(std::same_as<std::format_string<int, float, void*>, std::basic_format_string<char, int, float, void*>>);
+static_assert(std::same_as<std::format_string<int, bool>, std::basic_format_string<char, int, bool>>);
+static_assert(std::same_as<std::format_string<int, bool, void*>, std::basic_format_string<char, int, bool, void*>>);
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
static_assert(std::same_as<std::wformat_string<>, std::basic_format_string<wchar_t>>);
static_assert(std::same_as<std::wformat_string<int>, std::basic_format_string<wchar_t, int>>);
-static_assert(std::same_as<std::wformat_string<int, float>, std::basic_format_string<wchar_t, int, float>>);
-static_assert(
- std::same_as<std::wformat_string<int, float, void*>, std::basic_format_string<wchar_t, int, float, void*>>);
+static_assert(std::same_as<std::wformat_string<int, bool>, std::basic_format_string<wchar_t, int, bool>>);
+static_assert(std::same_as<std::wformat_string<int, bool, void*>, std::basic_format_string<wchar_t, int, bool, void*>>);
#endif
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
index b0abc2c..6957c7b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// This test uses std::filesystem::path, which is not always available
+// XFAIL: availability-filesystem-missing
+
// <format>
// template<class T, class charT>
@@ -107,9 +110,7 @@
assert_is_formattable<__uint128_t, CharT>();
#endif
- assert_is_formattable<float, CharT>();
- assert_is_formattable<double, CharT>();
- assert_is_formattable<long double, CharT>();
+ // floating-point types are tested in concept.formattable.float.compile.pass.cpp
assert_is_formattable<std::nullptr_t, CharT>();
assert_is_formattable<void*, CharT>();
@@ -135,7 +136,7 @@
assert_is_formattable<std::chrono::microseconds, CharT>();
- assert_is_not_formattable<std::chrono::sys_time<std::chrono::microseconds>, CharT>();
+ assert_is_formattable<std::chrono::sys_time<std::chrono::microseconds>, CharT>();
//assert_is_formattable<std::chrono::utc_time<std::chrono::microseconds>, CharT>();
//assert_is_formattable<std::chrono::tai_time<std::chrono::microseconds>, CharT>();
//assert_is_formattable<std::chrono::gps_time<std::chrono::microseconds>, CharT>();
@@ -161,7 +162,7 @@
assert_is_formattable<std::chrono::year_month_weekday, CharT>();
assert_is_formattable<std::chrono::year_month_weekday_last, CharT>();
- assert_is_not_formattable<std::chrono::hh_mm_ss<std::chrono::microseconds>, CharT>();
+ assert_is_formattable<std::chrono::hh_mm_ss<std::chrono::microseconds>, CharT>();
//assert_is_formattable<std::chrono::sys_info, CharT>();
//assert_is_formattable<std::chrono::local_info, CharT>();
@@ -174,7 +175,8 @@
// Tests for P1636 Formatters for library types
//
// The paper hasn't been voted in so currently all formatters are disabled.
-// TODO validate whether the test is correct after the paper has been accepted.
+// Note the paper has been abandoned, the types are kept since other papers may
+// introduce these formatters.
template <class CharT>
void test_P1636() {
assert_is_not_formattable<std::basic_streambuf<CharT>, CharT>();
@@ -190,7 +192,7 @@
assert_is_not_formattable<std::sub_match<CharT*>, CharT>();
#endif
#ifndef TEST_HAS_NO_THREADS
- assert_is_not_formattable<std::thread::id, CharT>();
+ assert_is_formattable<std::thread::id, CharT>();
#endif
assert_is_not_formattable<std::unique_ptr<int>, CharT>();
}
@@ -199,6 +201,12 @@
void test_P2286_vector_bool() {
assert_is_formattable<Vector, CharT>();
assert_is_formattable<typename Vector::reference, CharT>();
+
+ // The const_reference shall be a bool.
+ // However libc++ uses a __bit_const_reference<vector> when
+ // _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL is defined.
+ assert_is_formattable<const Vector&, CharT>();
+ assert_is_formattable<typename Vector::const_reference, CharT>();
}
// Tests for P2286 Formatting ranges
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.float.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.float.compile.pass.cpp
new file mode 100644
index 0000000..09b957f
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formattable/concept.formattable.float.compile.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// <format>
+
+// template<class T, class charT>
+// concept formattable = ...
+
+#include <concepts>
+#include <format>
+
+#include "test_macros.h"
+
+template <class T, class CharT>
+void assert_is_not_formattable() {
+ static_assert(!std::formattable<T, CharT>);
+}
+
+template <class T, class CharT>
+void assert_is_formattable() {
+ // Only formatters for CharT == char || CharT == wchar_t are enabled for the
+ // standard formatters. When CharT is a different type the formatter should
+ // be disabled.
+ if constexpr (std::same_as<CharT, char>
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ || std::same_as<CharT, wchar_t>
+#endif
+ )
+ static_assert(std::formattable<T, CharT>);
+ else
+ assert_is_not_formattable<T, CharT>();
+}
+
+template <class CharT>
+void test() {
+ assert_is_formattable<float, CharT>();
+ assert_is_formattable<double, CharT>();
+ assert_is_formattable<long double, CharT>();
+}
+
+void test() {
+ test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
+ test<char8_t>();
+ test<char16_t>();
+ test<char32_t>();
+
+ test<int>();
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
index 84f328a..bb190c5 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
@@ -13,6 +13,7 @@
// basic_format_arg<basic_format_context> arg(size_t id) const;
#include <format>
+#include <iterator>
#include <cassert>
#include "test_basic_format_arg.h"
@@ -31,7 +32,7 @@
const std::basic_format_context context = test_format_context_create(OutIt{output}, args);
LIBCPP_ASSERT(args.__size() == 4);
ASSERT_NOEXCEPT(context.arg(0));
- for (size_t i = 0, e = args.__size(); i != e; ++i) {
+ for (std::size_t i = 0, e = args.__size(); i != e; ++i) {
assert(context.arg(i));
}
assert(!context.arg(args.__size()));
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
index d270a86..a3ab5e4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
@@ -24,6 +24,7 @@
#include <format>
#include <cassert>
+#include <iterator>
#include <type_traits>
#include "test_basic_format_arg.h"
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
index 06730b3..2a6b5c6 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
@@ -17,6 +17,7 @@
// std::locale locale();
#include <format>
+#include <iterator>
#include <cassert>
#include "make_string.h"
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp
index da886d3..c3263d0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp
@@ -22,6 +22,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "test_format_context.h"
@@ -31,14 +32,14 @@
#define STR(S) MAKE_STRING(CharT, S)
template <class StringT, class StringViewT>
-void test(StringT expected, StringViewT fmt, bool arg) {
+void test(StringT expected, StringViewT fmt, bool arg, std::size_t offset) {
using CharT = typename StringT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<bool, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -60,9 +61,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 0);
}
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp
index 1c94ca7..16b9f4b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp
@@ -21,6 +21,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "test_format_context.h"
@@ -32,13 +33,13 @@
#define CSTR(S) MAKE_CSTRING(CharT, S)
template <class T, class StringT, class StringViewT, class CharT>
-void test(StringT expected, StringViewT fmt, const CharT* a) {
+void test(StringT expected, StringViewT fmt, const CharT* a, std::size_t offset) {
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<T, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -60,9 +61,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test<ArgumentT>(expected, fmt, arg);
+ test<ArgumentT>(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test<ArgumentT>(expected, fmt, arg);
+ test<ArgumentT>(expected, fmt, arg, 0);
}
#if TEST_STD_VER > 20
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp
index 1a228e7..ac1dfec 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp
@@ -22,6 +22,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "test_format_context.h"
@@ -32,14 +33,14 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class StringT, class StringViewT, class ArgumentT>
-void test(StringT expected, StringViewT fmt, ArgumentT arg) {
+void test(StringT expected, StringViewT fmt, ArgumentT arg, std::size_t offset) {
using CharT = typename StringT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<ArgumentT, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -61,9 +62,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 0);
}
#if TEST_STD_VER > 20
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
index 4788ffe..10aaeaa 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
@@ -21,6 +21,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "test_format_context.h"
@@ -33,24 +34,25 @@
// This is based on the method found in
// clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-cxx20.cpp
-template <size_t N>
+template <std::size_t N>
struct Tester {
// This is not part of the real test, but is used the deduce the size of the input.
constexpr Tester(const char (&r)[N]) { __builtin_memcpy(text, r, N); }
char text[N];
// The size of the array shouldn't include the NUL character.
- static const size_t size = N - 1;
+ static const std::size_t size = N - 1;
template <class CharT>
- void test(const std::basic_string<CharT>& expected, const std::basic_string_view<CharT>& fmt) const {
+ void
+ test(const std::basic_string<CharT>& expected, const std::basic_string_view<CharT>& fmt, std::size_t offset) const {
using Str = CharT[size];
std::basic_format_parse_context<CharT> parse_ctx{fmt};
std::formatter<Str, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
std::basic_string<CharT> result;
auto out = std::back_inserter(result);
@@ -75,13 +77,13 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(expected, fmt);
+ test(expected, fmt, 1);
fmt.remove_suffix(1);
- test(expected, fmt);
+ test(expected, fmt, 0);
}
};
-template <size_t N>
+template <std::size_t N>
Tester(const char (&)[N]) -> Tester<N>;
template <Tester t, class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.const_char_array.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.const_char_array.pass.cpp
deleted file mode 100644
index 624fb81..0000000
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.const_char_array.pass.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//===----------------------------------------------------------------------===//
-// 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, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-format
-// TODO FMT Evaluate gcc-12 status
-// UNSUPPORTED: gcc-12
-
-// <format>
-
-// C++23 the formatter is a debug-enabled specialization.
-// [format.formatter.spec]:
-// Each header that declares the template `formatter` provides the following
-// enabled specializations:
-// For each `charT`, the string type specializations
-// template<size_t N> struct formatter<const charT[N], charT>;
-
-#include <format>
-#include <cassert>
-#include <concepts>
-#include <type_traits>
-
-#include "test_format_context.h"
-#include "test_macros.h"
-#include "make_string.h"
-
-#define STR(S) MAKE_STRING(CharT, S)
-#define SV(S) MAKE_STRING_VIEW(CharT, S)
-#define CSTR(S) MAKE_CSTRING(CharT, S)
-
-// This is based on the method found in
-// clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-cxx20.cpp
-template <size_t N>
-struct Tester {
- // This is not part of the real test, but is used the deduce the size of the input.
- constexpr Tester(const char (&r)[N]) { __builtin_memcpy(text, r, N); }
- char text[N];
-
- // The size of the array shouldn't include the NUL character.
- static const size_t size = N - 1;
-
- template <class CharT>
- void test(const std::basic_string<CharT>& expected,
- const std::basic_string_view<CharT>& fmt) const {
- using Str = const CharT[size];
- std::basic_format_parse_context<CharT> parse_ctx{fmt};
- std::formatter<Str, CharT> formatter;
- static_assert(std::semiregular<decltype(formatter)>);
-
- auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
-
- std::basic_string<CharT> result;
- auto out = std::back_inserter(result);
- using FormatCtxT = std::basic_format_context<decltype(out), CharT>;
-
- std::basic_string<CharT> buffer{text, text + N};
- // Note not too found of this hack
- Str* data = reinterpret_cast<Str*>(buffer.c_str());
-
- FormatCtxT format_ctx =
- test_format_context_create<decltype(out), CharT>(out, std::make_format_args<FormatCtxT>(*data));
- formatter.format(*data, format_ctx);
- assert(result == expected);
- }
-
- template <class CharT>
- void test_termination_condition(const std::basic_string<CharT>& expected,
- const std::basic_string<CharT>& f) const {
- // The format-spec is valid if completely consumed or terminates at a '}'.
- // The valid inputs all end with a '}'. The test is executed twice:
- // - first with the terminating '}',
- // - second consuming the entire input.
- std::basic_string_view<CharT> fmt{f};
- assert(fmt.back() == CharT('}') && "Pre-condition failure");
-
- test(expected, fmt);
- fmt.remove_suffix(1);
- test(expected, fmt);
- }
-};
-
-template <size_t N>
-Tester(const char (&)[N]) -> Tester<N>;
-
-template <Tester t, class CharT>
-void test_helper_wrapper(std::basic_string<CharT> expected,
- std::basic_string<CharT> fmt) {
- t.test_termination_condition(expected, fmt);
-}
-
-#if TEST_STD_VER > 20
-template <class CharT>
-constexpr bool test_set_debug_format() {
- std::formatter<const CharT[1], CharT> formatter;
- LIBCPP_ASSERT(formatter.__parser_.__type_ == std::__format_spec::__type::__default);
-
- formatter.set_debug_format();
- LIBCPP_ASSERT(formatter.__parser_.__type_ == std::__format_spec::__type::__debug);
-
- std::basic_string_view fmt = SV("s}");
- std::basic_format_parse_context<CharT> parse_ctx{fmt};
- formatter.parse(parse_ctx);
- LIBCPP_ASSERT(formatter.__parser_.__type_ == std::__format_spec::__type::__string);
-
- formatter.set_debug_format();
- LIBCPP_ASSERT(formatter.__parser_.__type_ == std::__format_spec::__type::__debug);
-
- return true;
-}
-#endif
-template <class CharT>
-void test_array() {
- test_helper_wrapper<" azAZ09,./<>?">(STR(" azAZ09,./<>?"), STR("}"));
-
- std::basic_string<CharT> s(CSTR("abc\0abc"), 7);
- test_helper_wrapper<"abc\0abc">(s, STR("}"));
-
- test_helper_wrapper<"world">(STR("world"), STR("}"));
- test_helper_wrapper<"world">(STR("world"), STR("_>}"));
-
- test_helper_wrapper<"world">(STR(" world"), STR(">8}"));
- test_helper_wrapper<"world">(STR("___world"), STR("_>8}"));
- test_helper_wrapper<"world">(STR("_world__"), STR("_^8}"));
- test_helper_wrapper<"world">(STR("world___"), STR("_<8}"));
-
- test_helper_wrapper<"world">(STR("world"), STR(".5}"));
- test_helper_wrapper<"universe">(STR("unive"), STR(".5}"));
-
- test_helper_wrapper<"world">(STR("%world%"), STR("%^7.7}"));
- test_helper_wrapper<"universe">(STR("univers"), STR("%^7.7}"));
-
-#if TEST_STD_VER > 20
- test_set_debug_format<CharT>();
- static_assert(test_set_debug_format<CharT>());
-#endif
-}
-
-int main(int, char**) {
- test_array<char>();
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- test_array<wchar_t>();
-#endif
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
index 123d0ac..2fde253 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
@@ -8,6 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// [format.formatter.spec]:
@@ -31,6 +33,7 @@
#include <cmath>
#include <charconv>
#include <concepts>
+#include <iterator>
#include <string>
#include <type_traits>
@@ -41,13 +44,13 @@
#define STR(S) MAKE_STRING(CharT, S)
template <class CharT, class ArithmeticT>
-void test(std::basic_string_view<CharT> fmt, ArithmeticT arg, std::basic_string<CharT> expected) {
+void test(std::basic_string_view<CharT> fmt, ArithmeticT arg, std::basic_string<CharT> expected, std::size_t offset) {
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<ArithmeticT, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
std::basic_string<CharT> result;
auto out = std::back_inserter(result);
@@ -75,9 +78,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(fmt, arg, expected);
+ test(fmt, arg, expected, 1);
fmt.remove_suffix(1);
- test(fmt, arg, expected);
+ test(fmt, arg, expected, 0);
}
template <class CharT, class ArithmeticT>
@@ -86,7 +89,7 @@
char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::hex, 20'000).ptr;
test_termination_condition(STR(".20000a}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000a}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -126,7 +129,7 @@
std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
test_termination_condition(STR(".20000A}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000A}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -166,7 +169,7 @@
char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::scientific, 20'000).ptr;
test_termination_condition(STR(".20000e}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000e}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -206,7 +209,7 @@
std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
test_termination_condition(STR(".20000E}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000E}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -246,7 +249,7 @@
char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::fixed, 20'000).ptr;
test_termination_condition(STR(".20000f}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000f}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -286,7 +289,7 @@
std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
test_termination_condition(STR(".20000F}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000F}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -326,7 +329,7 @@
char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::general, 20'000).ptr;
test_termination_condition(STR(".20000g}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000g}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -366,7 +369,7 @@
std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
test_termination_condition(STR(".20000G}"), value, std::basic_string<CharT>{buffer.begin(), end});
- size_t size = buffer.end() - end;
+ std::size_t size = buffer.end() - end;
std::fill_n(end, size, '#');
test_termination_condition(STR("#<25000.20000G}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
index 1523fd3..b963232 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
@@ -21,6 +21,7 @@
#include <cmath>
#include <charconv>
#include <concepts>
+#include <iterator>
#include <string>
#include <type_traits>
@@ -37,13 +38,13 @@
}
};
-void test(std::string expected, std::string_view fmt, color arg) {
+void test(std::string expected, std::string_view fmt, color arg, std::size_t offset) {
auto parse_ctx = std::format_parse_context(fmt);
std::formatter<color, char> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
std::string result;
auto out = std::back_inserter(result);
@@ -63,9 +64,9 @@
std::string_view fmt{f};
assert(fmt.back() == '}' && "Pre-condition failure");
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 0);
}
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp
index 316667a..330ac06 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp
@@ -26,6 +26,7 @@
#include <cmath>
#include <charconv>
#include <concepts>
+#include <iterator>
#include <string>
#include <type_traits>
@@ -36,14 +37,14 @@
#define STR(S) MAKE_STRING(CharT, S)
template <class StringT, class StringViewT, class PointerT>
-void test(StringT expected, StringViewT fmt, PointerT arg) {
+void test(StringT expected, StringViewT fmt, PointerT arg, std::size_t offset) {
using CharT = typename StringT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<PointerT, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -58,7 +59,7 @@
buffer[0] = CharT('0');
buffer[1] = CharT('x');
expected.append(buffer.begin(),
- std::to_chars(buffer.begin() + 2, buffer.end(), reinterpret_cast<uintptr_t>(arg), 16).ptr);
+ std::to_chars(buffer.begin() + 2, buffer.end(), reinterpret_cast<std::uintptr_t>(arg), 16).ptr);
}
assert(result == expected);
}
@@ -73,9 +74,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 0);
}
template <class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp
index 07f5be4..65caa6b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp
@@ -29,6 +29,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "test_format_context.h"
@@ -38,14 +39,14 @@
#define STR(S) MAKE_STRING(CharT, S)
template <class StringT, class StringViewT, class ArithmeticT>
-void test(StringT expected, StringViewT fmt, ArithmeticT arg) {
+void test(StringT expected, StringViewT fmt, ArithmeticT arg, std::size_t offset) {
using CharT = typename StringT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<ArithmeticT, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -67,9 +68,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 0);
}
template <class Arithmetic, class CharT>
@@ -87,8 +88,8 @@
test_termination_condition(STR("2147483647"), STR("}"), A(2147483647));
}
if (sizeof(A) > 4) {
- test_termination_condition(STR("-9223372036854775808"), STR("}"), A(std::numeric_limits<int64_t>::min()));
- test_termination_condition(STR("9223372036854775807"), STR("}"), A(std::numeric_limits<int64_t>::max()));
+ test_termination_condition(STR("-9223372036854775808"), STR("}"), A(std::numeric_limits<std::int64_t>::min()));
+ test_termination_condition(STR("9223372036854775807"), STR("}"), A(std::numeric_limits<std::int64_t>::max()));
}
#ifndef TEST_HAS_NO_INT128
if (sizeof(A) > 8) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp
index 994916d..3b91834 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp
@@ -23,6 +23,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "make_string.h"
@@ -34,7 +35,7 @@
#define CSTR(S) MAKE_CSTRING(CharT, S)
template <class T, class ArgumentT, class StringT, class StringViewT>
-void test(StringT expected, StringViewT fmt, StringT a) {
+void test(StringT expected, StringViewT fmt, StringT a, std::size_t offset) {
static_assert(
std::same_as<typename T::value_type,
typename std::decay_t<ArgumentT>::value_type> &&
@@ -46,7 +47,7 @@
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -69,9 +70,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test<T, ArgumentT>(expected, fmt, arg);
+ test<T, ArgumentT>(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test<T, ArgumentT>(expected, fmt, arg);
+ test<T, ArgumentT>(expected, fmt, arg, 0);
}
#if TEST_STD_VER > 20
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp
index 11025af..c413aba 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp
@@ -29,6 +29,7 @@
#include <format>
#include <cassert>
#include <concepts>
+#include <iterator>
#include <type_traits>
#include "test_format_context.h"
@@ -38,14 +39,14 @@
#define STR(S) MAKE_STRING(CharT, S)
template <class StringT, class StringViewT, class ArithmeticT>
-void test(StringT expected, StringViewT fmt, ArithmeticT arg) {
+void test(StringT expected, StringViewT fmt, ArithmeticT arg, std::size_t offset) {
using CharT = typename StringT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<ArithmeticT, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
StringT result;
auto out = std::back_inserter(result);
@@ -67,9 +68,9 @@
std::basic_string_view<CharT> fmt{f};
assert(fmt.back() == CharT('}') && "Pre-condition failure");
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 1);
fmt.remove_suffix(1);
- test(expected, fmt, arg);
+ test(expected, fmt, arg, 0);
}
template <class ArithmeticT, class CharT>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
index 2f45544..f106105 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
@@ -9,9 +9,6 @@
// UNSUPPORTED: no-exceptions
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
// <format>
// constexpr void check_arg_id(size_t id);
@@ -19,13 +16,14 @@
#include <format>
#include <cassert>
+#include <cstring>
#include <string_view>
#include "test_macros.h"
constexpr bool test() {
std::format_parse_context context("", 10);
- for (size_t i = 0; i < 10; ++i)
+ for (std::size_t i = 0; i < 10; ++i)
context.check_arg_id(i);
return true;
@@ -39,20 +37,19 @@
context.check_arg_id(0);
assert(false);
} catch ([[maybe_unused]] const std::format_error& e) {
- LIBCPP_ASSERT(strcmp(e.what(), "Using manual argument numbering in automatic "
- "argument numbering mode") == 0);
+ LIBCPP_ASSERT(std::strcmp(e.what(), "Using manual argument numbering in automatic argument numbering mode") == 0);
return;
}
assert(false);
}();
- auto test_arg = [](size_t num_args) {
+ auto test_arg = [](std::size_t num_args) {
std::format_parse_context context("", num_args);
// Out of bounds access is valid if !std::is_constant_evaluated()
- for (size_t i = 0; i <= num_args; ++i)
+ for (std::size_t i = 0; i <= num_args; ++i)
context.check_arg_id(i);
};
- for (size_t i = 0; i < 10; ++i)
+ for (std::size_t i = 0; i < 10; ++i)
test_arg(i);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
index 74342c7..c3f6820 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
@@ -12,8 +12,6 @@
#include <format>
-#include "test_macros.h"
-
constexpr bool test() {
// [format.parse.ctx]/11
// Remarks: Call expressions where id >= num_args_ are not
@@ -24,9 +22,7 @@
return true;
}
-int main(int, char**) {
+void f() {
// expected-error-re@+1 {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(test());
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
index 581defb..03da8fd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
@@ -9,9 +9,6 @@
// UNSUPPORTED: no-exceptions
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-
// <format>
// constexpr size_t next_arg_id();
@@ -19,13 +16,14 @@
#include <format>
#include <cassert>
+#include <cstring>
#include <string_view>
#include "test_macros.h"
constexpr bool test() {
- std::format_parse_context context("");
- for (size_t i = 0; i < 10; ++i)
+ std::format_parse_context context("", 10);
+ for (std::size_t i = 0; i < 10; ++i)
assert(i == context.next_arg_id());
return true;
@@ -39,8 +37,7 @@
TEST_IGNORE_NODISCARD context.next_arg_id();
assert(false);
} catch ([[maybe_unused]] const std::format_error& e) {
- LIBCPP_ASSERT(strcmp(e.what(), "Using automatic argument numbering in manual "
- "argument numbering mode") == 0);
+ LIBCPP_ASSERT(std::strcmp(e.what(), "Using automatic argument numbering in manual argument numbering mode") == 0);
return;
}
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp
new file mode 100644
index 0000000..8448560
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// constexpr size_t next_arg_id()
+
+#include <format>
+
+constexpr bool test() {
+ // [format.parse.ctx]/8
+ // Let cur-arg-id be the value of next_arg_id_ prior to this call. Call
+ // expressions where cur-arg-id >= num_args_ is true are not core constant
+ // expressions (7.7 [expr.const]).
+ std::format_parse_context context("", 0);
+ context.next_arg_id();
+
+ return true;
+}
+
+void f() {
+ // expected-error-re@+1 {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(test());
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
index eaa18a4..f224dae 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
@@ -62,6 +62,3 @@
static_assert(std::is_same_v<std::wformat_parse_context,
std::basic_format_parse_context<wchar_t> >);
#endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp
index 9a5baec..1b3a8e4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp
@@ -10,6 +10,9 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Tests whether a move only type can be formatted. This is required by
// P2418R2 "Add support for std::generator-like types to std::format"
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp
index 4b94ebb..1f6e052 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp
@@ -11,6 +11,9 @@
// Force unicode to be disabled.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_HAS_NO_UNICODE
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// Tests Unicode is ignored and handled as ASCII.
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
index 329124f..bcba8e9 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Force unicode to be disabled.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_HAS_NO_UNICODE
@@ -18,6 +21,7 @@
#include <cassert>
#include <concepts>
+#include <iterator>
#include <list>
#include <vector>
@@ -25,6 +29,7 @@
#include "make_string.h"
#include "test_format_string.h"
#include "assert_macros.h"
+#include "concat_macros.h"
#ifndef TEST_HAS_NO_LOCALIZATION
# include <iostream>
@@ -37,7 +42,7 @@
{
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
TEST_REQUIRE(out == expected,
- test_concat_message(
+ TEST_WRITE_CONCATENATED(
"\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
}
#ifndef TEST_HAS_NO_LOCALIZATION
@@ -89,12 +94,12 @@
[]<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
{
- size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
assert(size == expected.size());
}
#ifndef TEST_HAS_NO_LOCALIZATION
{
- size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
assert(size == expected.size());
}
#endif // TEST_HAS_NO_LOCALIZATION
@@ -104,37 +109,37 @@
[]<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
{
- size_t n = expected.size();
+ std::size_t n = expected.size();
std::basic_string<CharT> out(n, CharT(' '));
std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out == expected);
}
#ifndef TEST_HAS_NO_LOCALIZATION
{
- size_t n = expected.size();
+ std::size_t n = expected.size();
std::basic_string<CharT> out(n, CharT(' '));
std::format_to_n_result result =
std::format_to_n(out.begin(), n, std::locale(), fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out == expected);
}
#endif // TEST_HAS_NO_LOCALIZATION
{
- ptrdiff_t n = 0;
+ std::ptrdiff_t n = 0;
std::basic_string<CharT> out;
std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out.empty());
}
{
- ptrdiff_t n = expected.size() / 2;
+ std::ptrdiff_t n = expected.size() / 2;
std::basic_string<CharT> out(n, CharT(' '));
std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out == expected.substr(0, n));
}
@@ -222,7 +227,7 @@
// Unicode fitting in a 32-bit wchar_t
constexpr wchar_t x = 0x1ffff;
- constexpr uint32_t y = 0x1ffff;
+ constexpr std::uint32_t y = 0x1ffff;
static_assert(x == y);
using V = std::basic_string_view<CharT>;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
index c940bcb..8ee7396 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
@@ -15,6 +15,12 @@
// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
// UNSUPPORTED: LIBCXX-AIX-FIXME
+// TODO FMT Fix this test using GCC, it currently crashes.
+// UNSUPPORTED: gcc-12
+
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// This test the debug string type for the formatter specializations for char
@@ -24,6 +30,7 @@
#include <cassert>
#include <concepts>
+#include <iterator>
#include <list>
#include <vector>
@@ -31,6 +38,7 @@
#include "make_string.h"
#include "test_format_string.h"
#include "assert_macros.h"
+#include "concat_macros.h"
#ifndef TEST_HAS_NO_LOCALIZATION
# include <iostream>
@@ -43,7 +51,7 @@
{
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
TEST_REQUIRE(out == expected,
- test_concat_message(
+ TEST_WRITE_CONCATENATED(
"\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
}
#ifndef TEST_HAS_NO_LOCALIZATION
@@ -95,12 +103,12 @@
[]<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
{
- size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
assert(size == expected.size());
}
#ifndef TEST_HAS_NO_LOCALIZATION
{
- size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
assert(size == expected.size());
}
#endif // TEST_HAS_NO_LOCALIZATION
@@ -110,37 +118,37 @@
[]<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
{
- size_t n = expected.size();
+ std::size_t n = expected.size();
std::basic_string<CharT> out(n, CharT(' '));
std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out == expected);
}
#ifndef TEST_HAS_NO_LOCALIZATION
{
- size_t n = expected.size();
+ std::size_t n = expected.size();
std::basic_string<CharT> out(n, CharT(' '));
std::format_to_n_result result =
std::format_to_n(out.begin(), n, std::locale(), fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out == expected);
}
#endif // TEST_HAS_NO_LOCALIZATION
{
- ptrdiff_t n = 0;
+ std::ptrdiff_t n = 0;
std::basic_string<CharT> out;
std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out.empty());
}
{
- ptrdiff_t n = expected.size() / 2;
+ std::ptrdiff_t n = expected.size() / 2;
std::basic_string<CharT> out(n, CharT(' '));
std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
- assert(result.size == static_cast<ptrdiff_t>(expected.size()));
+ assert(result.size == static_cast<std::ptrdiff_t>(expected.size()));
assert(result.out == out.end());
assert(out == expected.substr(0, n));
}
@@ -200,14 +208,9 @@
test_format(V{L"'\\u{600}'"}, L"{:?}", L'\x600'); // ARABIC NUMBER SIGN
test_format(V{L"'\\u{feff}'"}, L"{:?}", L'\xfeff'); // ZERO WIDTH NO-BREAK SPACE
- if constexpr (sizeof(CharT) == 2) {
- // Incomplete surrogate pair in UTF-16
- test_format(V{L"'\\x{d800}'"}, L"{:?}", L'\xd800'); // <surrogate-D800>
- test_format(V{L"'\\x{dfff}'"}, L"{:?}", L'\xdfff'); // <surrogate-DFFF>
- } else {
- test_format(V{L"'\\u{d800}'"}, L"{:?}", L'\xd800'); // <surrogate-D800>
- test_format(V{L"'\\u{dfff}'"}, L"{:?}", L'\xdfff'); // <surrogate-DFFF>
- }
+ // Incomplete surrogate pair in UTF-16
+ test_format(V{L"'\\x{d800}'"}, L"{:?}", L'\xd800'); // <surrogate-D800>
+ test_format(V{L"'\\x{dfff}'"}, L"{:?}", L'\xdfff'); // <surrogate-DFFF>
// Private_Use
test_format(V{L"'\\u{e000}'"}, L"{:?}", L'\xe000'); // <private-use-E000>
@@ -228,7 +231,7 @@
// Unicode fitting in a 32-bit wchar_t
constexpr wchar_t x = 0x1ffff;
- constexpr uint32_t y = 0x1ffff;
+ constexpr std::uint32_t y = 0x1ffff;
static_assert(x == y);
using V = std::basic_string_view<CharT>;
@@ -275,6 +278,48 @@
// Ill-formend UTF-8
test_format(SV(R"(["\x{c3}"])"), SV("[{:?}]"), "\xc3");
test_format(SV(R"(["\x{c3}("])"), SV("[{:?}]"), "\xc3\x28");
+
+ /* U+0000..U+0007F 1 code unit range, encoded in 2 code units. */
+ test_format(SV(R"(["\x{c0}\x{80}"])"), SV("[{:?}]"), "\xc0\x80"); // U+0000
+ test_format(SV(R"(["\x{c1}\x{bf}"])"), SV("[{:?}]"), "\xc1\xbf"); // U+007F
+ test_format(SV(R"(["\u{80}"])"), SV("[{:?}]"), "\xc2\x80"); // U+0080 first valid (General_Category=Control)
+
+ /* U+0000..U+07FFF 1 and 2 code unit range, encoded in 3 code units. */
+ test_format(SV(R"(["\x{e0}\x{80}\x{80}"])"), SV("[{:?}]"), "\xe0\x80\x80"); // U+0000
+ test_format(SV(R"(["\x{e0}\x{81}\x{bf}"])"), SV("[{:?}]"), "\xe0\x81\xbf"); // U+007F
+ test_format(SV(R"(["\x{e0}\x{82}\x{80}"])"), SV("[{:?}]"), "\xe0\x82\x80"); // U+0080
+ test_format(SV(R"(["\x{e0}\x{9f}\x{bf}"])"), SV("[{:?}]"), "\xe0\x9f\xbf"); // U+07FF
+ test_format(SV("[\"\u0800\"]"), SV("[{:?}]"), "\xe0\xa0\x80"); // U+0800 first valid
+
+#if 0
+ // This code point is in the Hangul Jamo Extended-B block and at the time of writing
+ // it's unassigned. When it comes defined, this branch might become true.
+ test_format(SV("[\"\ud7ff\"]"), SV("[{:?}]"), "\xed\x9f\xbf"); // U+D7FF last valid
+#else
+ /* U+D800..D+DFFFF surrogate range */
+ test_format(SV(R"(["\u{d7ff}"])"), SV("[{:?}]"), "\xed\x9f\xbf"); // U+D7FF last valid
+#endif
+ test_format(SV(R"(["\x{ed}\x{a0}\x{80}"])"), SV("[{:?}]"), "\xed\xa0\x80"); // U+D800
+ test_format(SV(R"(["\x{ed}\x{af}\x{bf}"])"), SV("[{:?}]"), "\xed\xaf\xbf"); // U+DBFF
+ test_format(SV(R"(["\x{ed}\x{bf}\x{80}"])"), SV("[{:?}]"), "\xed\xbf\x80"); // U+DC00
+ test_format(SV(R"(["\x{ed}\x{bf}\x{bf}"])"), SV("[{:?}]"), "\xed\xbf\xbf"); // U+DFFF
+ test_format(SV(R"(["\u{e000}"])"), SV("[{:?}]"), "\xee\x80\x80"); // U+E000 first valid
+ // (in the Private Use Area block)
+
+ /* U+0000..U+FFFF 1, 2, and 3 code unit range */
+ test_format(SV(R"(["\x{f0}\x{80}\x{80}\x{80}"])"), SV("[{:?}]"), "\xf0\x80\x80\x80"); // U+0000
+ test_format(SV(R"(["\x{f0}\x{80}\x{81}\x{bf}"])"), SV("[{:?}]"), "\xf0\x80\x81\xbf"); // U+007F
+ test_format(SV(R"(["\x{f0}\x{80}\x{82}\x{80}"])"), SV("[{:?}]"), "\xf0\x80\x82\x80"); // U+0080
+ test_format(SV(R"(["\x{f0}\x{80}\x{9f}\x{bf}"])"), SV("[{:?}]"), "\xf0\x80\x9f\xbf"); // U+07FF
+ test_format(SV(R"(["\x{f0}\x{80}\x{a0}\x{80}"])"), SV("[{:?}]"), "\xf0\x80\xa0\x80"); // U+0800
+ test_format(SV(R"(["\x{f0}\x{8f}\x{bf}\x{bf}"])"), SV("[{:?}]"), "\xf0\x8f\xbf\xbf"); // U+FFFF
+ test_format(SV("[\"\U00010000\"]"), SV("[{:?}]"), "\xf0\x90\x80\x80"); // U+10000 first valid
+
+ /* U+10FFFF..U+1FFFFF invalid range */
+ test_format(SV(R"(["\u{10ffff}"])"), SV("[{:?}]"), "\xf4\x8f\xbf\xbf"); // U+10FFFF last valid
+ // (in Supplementary Private Use Area-B)
+ test_format(SV(R"(["\x{f4}\x{90}\x{80}\x{80}"])"), SV("[{:?}]"), "\xf4\x90\x80\x80"); // U+110000
+ test_format(SV(R"(["\x{f4}\x{bf}\x{bf}\x{bf}"])"), SV("[{:?}]"), "\xf4\xbf\xbf\xbf"); // U+11FFFF
} else {
// Valid UTF-16 and UTF-32
test_format(SV("[\"\u00c3\"]"), SV("[{:?}]"), L"\xc3"); // LATIN CAPITAL LETTER A WITH TILDE
@@ -318,11 +363,8 @@
// Format
test_format(V{LR"("\u{ad}\u{600}\u{feff}")"}, L"{:?}", L"\xad\x600\xfeff");
- if constexpr (sizeof(CharT) == 2)
- // Incomplete surrogate pair in UTF-16
- test_format(V{LR"("\x{d800}")"}, L"{:?}", L"\xd800");
- else
- test_format(V{LR"("\u{d800}")"}, L"{:?}", L"\xd800");
+ // Incomplete surrogate pair in UTF-16
+ test_format(V{LR"("\x{d800}")"}, L"{:?}", L"\xd800");
// Private_Use
test_format(V{LR"("\u{e000}\u{f8ff}")"}, L"{:?}", L"\xe000\xf8ff");
@@ -339,7 +381,7 @@
// Unicode fitting in a 32-bit wchar_t
constexpr wchar_t x = 0x1ffff;
- constexpr uint32_t y = 0x1ffff;
+ constexpr std::uint32_t y = 0x1ffff;
static_assert(x == y);
using V = std::basic_string_view<CharT>;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
index ab34558..506938f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
@@ -11,6 +11,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED:gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class... Args>
@@ -28,6 +30,7 @@
#include "string_literal.h"
#include "test_format_string.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test =
[]<class CharT, class... Args>(
@@ -35,7 +38,7 @@
std::basic_string<CharT> out = std::format(std::locale(), fmt, std::forward<Args>(args)...);
TEST_REQUIRE(
out == expected,
- test_concat_message(
+ TEST_WRITE_CONCATENATED(
"\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp
index de182c7..6421376 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp
@@ -9,6 +9,9 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.pass.cpp
index ca9d1d9..8eab255 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.pass.cpp
@@ -10,6 +10,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// Note this formatter shows additional information when tests are failing.
// This aids the development. Since other formatters fail in the same fashion
// they don't have this additional output.
@@ -30,6 +32,7 @@
#include "string_literal.h"
#include "test_format_string.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test =
[]<class CharT, class... Args>(
@@ -37,7 +40,7 @@
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
TEST_REQUIRE(
out == expected,
- test_concat_message(
+ TEST_WRITE_CONCATENATED(
"\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.verify.cpp
index 23c9c2c..aee8b20 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format.verify.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_tests.h b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_tests.h
index 86d11f2..c798b36 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_tests.h
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_tests.h
@@ -154,8 +154,8 @@
check_exception("A format-spec arg-id replacement exceeds the maximum supported value", SV("hello {:{}}"), world,
unsigned(-1));
check_exception("Argument index out of bounds", SV("hello {:{}}"), world);
- check_exception("A format-spec arg-id replacement argument isn't an integral type", SV("hello {:{}}"), world,
- universe);
+ check_exception(
+ "Replacement argument isn't a standard signed or unsigned integer type", SV("hello {:{}}"), world, universe);
check_exception("Using manual argument numbering in automatic argument numbering mode", SV("hello {:{0}}"), world, 1);
check_exception("Using automatic argument numbering in manual argument numbering mode", SV("hello {0:{}}"), world, 1);
// Arg-id may not have leading zeros.
@@ -178,8 +178,8 @@
check_exception("A format-spec arg-id replacement exceeds the maximum supported value", SV("hello {:.{}}"), world,
~0u);
check_exception("Argument index out of bounds", SV("hello {:.{}}"), world);
- check_exception("A format-spec arg-id replacement argument isn't an integral type", SV("hello {:.{}}"), world,
- universe);
+ check_exception(
+ "Replacement argument isn't a standard signed or unsigned integer type", SV("hello {:.{}}"), world, universe);
check_exception("Using manual argument numbering in automatic argument numbering mode", SV("hello {:.{0}}"), world,
1);
check_exception("Using automatic argument numbering in manual argument numbering mode", SV("hello {0:.{}}"), world,
@@ -662,28 +662,28 @@
#ifndef TEST_HAS_NO_INT128
format_test_integer<__int128_t, CharT>(check, check_exception);
#endif
- // *** check the minma and maxima ***
- check(SV("-0b10000000"), SV("{:#b}"), std::numeric_limits<int8_t>::min());
- check(SV("-0200"), SV("{:#o}"), std::numeric_limits<int8_t>::min());
- check(SV("-128"), SV("{:#}"), std::numeric_limits<int8_t>::min());
- check(SV("-0x80"), SV("{:#x}"), std::numeric_limits<int8_t>::min());
+ // *** check the minima and maxima ***
+ check(SV("-0b10000000"), SV("{:#b}"), std::numeric_limits<std::int8_t>::min());
+ check(SV("-0200"), SV("{:#o}"), std::numeric_limits<std::int8_t>::min());
+ check(SV("-128"), SV("{:#}"), std::numeric_limits<std::int8_t>::min());
+ check(SV("-0x80"), SV("{:#x}"), std::numeric_limits<std::int8_t>::min());
- check(SV("-0b1000000000000000"), SV("{:#b}"), std::numeric_limits<int16_t>::min());
- check(SV("-0100000"), SV("{:#o}"), std::numeric_limits<int16_t>::min());
- check(SV("-32768"), SV("{:#}"), std::numeric_limits<int16_t>::min());
- check(SV("-0x8000"), SV("{:#x}"), std::numeric_limits<int16_t>::min());
+ check(SV("-0b1000000000000000"), SV("{:#b}"), std::numeric_limits<std::int16_t>::min());
+ check(SV("-0100000"), SV("{:#o}"), std::numeric_limits<std::int16_t>::min());
+ check(SV("-32768"), SV("{:#}"), std::numeric_limits<std::int16_t>::min());
+ check(SV("-0x8000"), SV("{:#x}"), std::numeric_limits<std::int16_t>::min());
- check(SV("-0b10000000000000000000000000000000"), SV("{:#b}"), std::numeric_limits<int32_t>::min());
- check(SV("-020000000000"), SV("{:#o}"), std::numeric_limits<int32_t>::min());
- check(SV("-2147483648"), SV("{:#}"), std::numeric_limits<int32_t>::min());
- check(SV("-0x80000000"), SV("{:#x}"), std::numeric_limits<int32_t>::min());
+ check(SV("-0b10000000000000000000000000000000"), SV("{:#b}"), std::numeric_limits<std::int32_t>::min());
+ check(SV("-020000000000"), SV("{:#o}"), std::numeric_limits<std::int32_t>::min());
+ check(SV("-2147483648"), SV("{:#}"), std::numeric_limits<std::int32_t>::min());
+ check(SV("-0x80000000"), SV("{:#x}"), std::numeric_limits<std::int32_t>::min());
check(SV("-0b1000000000000000000000000000000000000000000000000000000000000000"),
SV("{:#b}"),
- std::numeric_limits<int64_t>::min());
- check(SV("-01000000000000000000000"), SV("{:#o}"), std::numeric_limits<int64_t>::min());
- check(SV("-9223372036854775808"), SV("{:#}"), std::numeric_limits<int64_t>::min());
- check(SV("-0x8000000000000000"), SV("{:#x}"), std::numeric_limits<int64_t>::min());
+ std::numeric_limits<std::int64_t>::min());
+ check(SV("-01000000000000000000000"), SV("{:#o}"), std::numeric_limits<std::int64_t>::min());
+ check(SV("-9223372036854775808"), SV("{:#}"), std::numeric_limits<std::int64_t>::min());
+ check(SV("-0x8000000000000000"), SV("{:#x}"), std::numeric_limits<std::int64_t>::min());
#ifndef TEST_HAS_NO_INT128
check(SV("-0b1000000000000000000000000000000000000000000000000000000000000000"
@@ -695,27 +695,27 @@
check(SV("-0x80000000000000000000000000000000"), SV("{:#x}"), std::numeric_limits<__int128_t>::min());
#endif
- check(SV("0b1111111"), SV("{:#b}"), std::numeric_limits<int8_t>::max());
- check(SV("0177"), SV("{:#o}"), std::numeric_limits<int8_t>::max());
- check(SV("127"), SV("{:#}"), std::numeric_limits<int8_t>::max());
- check(SV("0x7f"), SV("{:#x}"), std::numeric_limits<int8_t>::max());
+ check(SV("0b1111111"), SV("{:#b}"), std::numeric_limits<std::int8_t>::max());
+ check(SV("0177"), SV("{:#o}"), std::numeric_limits<std::int8_t>::max());
+ check(SV("127"), SV("{:#}"), std::numeric_limits<std::int8_t>::max());
+ check(SV("0x7f"), SV("{:#x}"), std::numeric_limits<std::int8_t>::max());
- check(SV("0b111111111111111"), SV("{:#b}"), std::numeric_limits<int16_t>::max());
- check(SV("077777"), SV("{:#o}"), std::numeric_limits<int16_t>::max());
- check(SV("32767"), SV("{:#}"), std::numeric_limits<int16_t>::max());
- check(SV("0x7fff"), SV("{:#x}"), std::numeric_limits<int16_t>::max());
+ check(SV("0b111111111111111"), SV("{:#b}"), std::numeric_limits<std::int16_t>::max());
+ check(SV("077777"), SV("{:#o}"), std::numeric_limits<std::int16_t>::max());
+ check(SV("32767"), SV("{:#}"), std::numeric_limits<std::int16_t>::max());
+ check(SV("0x7fff"), SV("{:#x}"), std::numeric_limits<std::int16_t>::max());
- check(SV("0b1111111111111111111111111111111"), SV("{:#b}"), std::numeric_limits<int32_t>::max());
- check(SV("017777777777"), SV("{:#o}"), std::numeric_limits<int32_t>::max());
- check(SV("2147483647"), SV("{:#}"), std::numeric_limits<int32_t>::max());
- check(SV("0x7fffffff"), SV("{:#x}"), std::numeric_limits<int32_t>::max());
+ check(SV("0b1111111111111111111111111111111"), SV("{:#b}"), std::numeric_limits<std::int32_t>::max());
+ check(SV("017777777777"), SV("{:#o}"), std::numeric_limits<std::int32_t>::max());
+ check(SV("2147483647"), SV("{:#}"), std::numeric_limits<std::int32_t>::max());
+ check(SV("0x7fffffff"), SV("{:#x}"), std::numeric_limits<std::int32_t>::max());
check(SV("0b111111111111111111111111111111111111111111111111111111111111111"),
SV("{:#b}"),
- std::numeric_limits<int64_t>::max());
- check(SV("0777777777777777777777"), SV("{:#o}"), std::numeric_limits<int64_t>::max());
- check(SV("9223372036854775807"), SV("{:#}"), std::numeric_limits<int64_t>::max());
- check(SV("0x7fffffffffffffff"), SV("{:#x}"), std::numeric_limits<int64_t>::max());
+ std::numeric_limits<std::int64_t>::max());
+ check(SV("0777777777777777777777"), SV("{:#o}"), std::numeric_limits<std::int64_t>::max());
+ check(SV("9223372036854775807"), SV("{:#}"), std::numeric_limits<std::int64_t>::max());
+ check(SV("0x7fffffffffffffff"), SV("{:#x}"), std::numeric_limits<std::int64_t>::max());
#ifndef TEST_HAS_NO_INT128
check(SV("0b111111111111111111111111111111111111111111111111111111111111111"
@@ -739,27 +739,27 @@
format_test_integer<__uint128_t, CharT>(check, check_exception);
#endif
// *** test the maxima ***
- check(SV("0b11111111"), SV("{:#b}"), std::numeric_limits<uint8_t>::max());
- check(SV("0377"), SV("{:#o}"), std::numeric_limits<uint8_t>::max());
- check(SV("255"), SV("{:#}"), std::numeric_limits<uint8_t>::max());
- check(SV("0xff"), SV("{:#x}"), std::numeric_limits<uint8_t>::max());
+ check(SV("0b11111111"), SV("{:#b}"), std::numeric_limits<std::uint8_t>::max());
+ check(SV("0377"), SV("{:#o}"), std::numeric_limits<std::uint8_t>::max());
+ check(SV("255"), SV("{:#}"), std::numeric_limits<std::uint8_t>::max());
+ check(SV("0xff"), SV("{:#x}"), std::numeric_limits<std::uint8_t>::max());
- check(SV("0b1111111111111111"), SV("{:#b}"), std::numeric_limits<uint16_t>::max());
- check(SV("0177777"), SV("{:#o}"), std::numeric_limits<uint16_t>::max());
- check(SV("65535"), SV("{:#}"), std::numeric_limits<uint16_t>::max());
- check(SV("0xffff"), SV("{:#x}"), std::numeric_limits<uint16_t>::max());
+ check(SV("0b1111111111111111"), SV("{:#b}"), std::numeric_limits<std::uint16_t>::max());
+ check(SV("0177777"), SV("{:#o}"), std::numeric_limits<std::uint16_t>::max());
+ check(SV("65535"), SV("{:#}"), std::numeric_limits<std::uint16_t>::max());
+ check(SV("0xffff"), SV("{:#x}"), std::numeric_limits<std::uint16_t>::max());
- check(SV("0b11111111111111111111111111111111"), SV("{:#b}"), std::numeric_limits<uint32_t>::max());
- check(SV("037777777777"), SV("{:#o}"), std::numeric_limits<uint32_t>::max());
- check(SV("4294967295"), SV("{:#}"), std::numeric_limits<uint32_t>::max());
- check(SV("0xffffffff"), SV("{:#x}"), std::numeric_limits<uint32_t>::max());
+ check(SV("0b11111111111111111111111111111111"), SV("{:#b}"), std::numeric_limits<std::uint32_t>::max());
+ check(SV("037777777777"), SV("{:#o}"), std::numeric_limits<std::uint32_t>::max());
+ check(SV("4294967295"), SV("{:#}"), std::numeric_limits<std::uint32_t>::max());
+ check(SV("0xffffffff"), SV("{:#x}"), std::numeric_limits<std::uint32_t>::max());
check(SV("0b1111111111111111111111111111111111111111111111111111111111111111"),
SV("{:#b}"),
- std::numeric_limits<uint64_t>::max());
- check(SV("01777777777777777777777"), SV("{:#o}"), std::numeric_limits<uint64_t>::max());
- check(SV("18446744073709551615"), SV("{:#}"), std::numeric_limits<uint64_t>::max());
- check(SV("0xffffffffffffffff"), SV("{:#x}"), std::numeric_limits<uint64_t>::max());
+ std::numeric_limits<std::uint64_t>::max());
+ check(SV("01777777777777777777777"), SV("{:#o}"), std::numeric_limits<std::uint64_t>::max());
+ check(SV("18446744073709551615"), SV("{:#}"), std::numeric_limits<std::uint64_t>::max());
+ check(SV("0xffffffffffffffff"), SV("{:#x}"), std::numeric_limits<std::uint64_t>::max());
#ifndef TEST_HAS_NO_INT128
check(SV("0b1111111111111111111111111111111111111111111111111111111111111111"
@@ -2367,6 +2367,7 @@
// *** alternate form **
// When precision is zero there's no decimal point except when the alternate form is specified.
+ // Note unlike the g and G option the trailing zeros are still removed.
check(SV("answer is '0'"), SV("answer is '{:.0}'"), F(0));
check(SV("answer is '0.'"), SV("answer is '{:#.0}'"), F(0));
@@ -2449,6 +2450,57 @@
// See locale-specific_form.pass.cpp
}
+template <class F, class CharT, class TestFunction>
+void format_test_floating_point_PR58714(TestFunction check) {
+ check(SV("+1234"), SV("{:+}"), F(1234.0));
+ check(SV("+1.348p+10"), SV("{:+a}"), F(1234.0));
+ check(SV("+1.234000e+03"), SV("{:+e}"), F(1234.0));
+ check(SV("+1234.000000"), SV("{:+f}"), F(1234.0));
+ check(SV("+1234"), SV("{:+g}"), F(1234.0));
+
+ check(SV("1234."), SV("{:#}"), F(1234.0));
+ check(SV("1.348p+10"), SV("{:#a}"), F(1234.0));
+ check(SV("1.234000e+03"), SV("{:#e}"), F(1234.0));
+ check(SV("1234.000000"), SV("{:#f}"), F(1234.0));
+ check(SV("1234.00"), SV("{:#g}"), F(1234.0));
+
+ check(SV("4.e+30"), SV("{:#}"), F(4.0e+30));
+ check(SV("1.p+102"), SV("{:#a}"), F(0x4.0p+100));
+ check(SV("4.000000e+30"), SV("{:#e}"), F(4.0e+30));
+ check(SV("5070602400912917605986812821504.000000"), SV("{:#f}"), F(0x4.0p+100));
+ check(SV("4.00000e+30"), SV("{:#g}"), F(4.0e+30));
+
+ check(SV("1234."), SV("{:#.6}"), F(1234.0)); // # does not restore zeros
+ check(SV("1.348000p+10"), SV("{:#.6a}"), F(1234.0));
+ check(SV("1.234000e+03"), SV("{:#.6e}"), F(1234.0));
+ check(SV("1234.000000"), SV("{:#.6f}"), F(1234.0));
+ check(SV("1234.00"), SV("{:#.6g}"), F(1234.0));
+
+ check(SV("-1234."), SV("{:#}"), F(-1234.0));
+ check(SV("-1.348p+10"), SV("{:#a}"), F(-1234.0));
+ check(SV("-1.234000e+03"), SV("{:#e}"), F(-1234.0));
+ check(SV("-1234.000000"), SV("{:#f}"), F(-1234.0));
+ check(SV("-1234.00"), SV("{:#g}"), F(-1234.0));
+
+ check(SV("-1234."), SV("{:#.6}"), F(-1234.0)); // # does not restore zeros
+ check(SV("-1.348000p+10"), SV("{:#.6a}"), F(-1234.0));
+ check(SV("-1.234000e+03"), SV("{:#.6e}"), F(-1234.0));
+ check(SV("-1234.000000"), SV("{:#.6f}"), F(-1234.0));
+ check(SV("-1234.00"), SV("{:#.6g}"), F(-1234.0));
+
+ check(SV("+1234."), SV("{:+#}"), F(1234.0));
+ check(SV("+1.348p+10"), SV("{:+#a}"), F(1234.0));
+ check(SV("+1.234000e+03"), SV("{:+#e}"), F(1234.0));
+ check(SV("+1234.000000"), SV("{:+#f}"), F(1234.0));
+ check(SV("+1234.00"), SV("{:+#g}"), F(1234.0));
+
+ check(SV("+1234."), SV("{:+#.6}"), F(1234.0)); // # does not restore zeros
+ check(SV("+1.348000p+10"), SV("{:+#.6a}"), F(1234.0));
+ check(SV("+1.234000e+03"), SV("{:+#.6e}"), F(1234.0));
+ check(SV("+1234.000000"), SV("{:+#.6f}"), F(1234.0));
+ check(SV("+1234.00"), SV("{:+#.6g}"), F(1234.0));
+}
+
template <class F, class CharT, class TestFunction, class ExceptionTest>
void format_test_floating_point(TestFunction check, ExceptionTest check_exception) {
format_test_floating_point_hex_lower_case<F, CharT>(check);
@@ -2468,6 +2520,8 @@
format_test_floating_point_default<F, CharT>(check);
format_test_floating_point_default_precision<F, CharT>(check);
+ format_test_floating_point_PR58714<F, CharT>(check);
+
// *** type ***
for (const auto& fmt : invalid_types<CharT>("aAeEfFgG"))
check_exception("The format-spec type has a type not supported for a floating-point argument", fmt, F(1));
@@ -2617,6 +2671,10 @@
check(SV("{"), SV("{{"));
check(SV("}"), SV("}}"));
+ check(SV("{:^}"), SV("{{:^}}"));
+ check(SV("{: ^}"), SV("{{:{}^}}"), CharT(' '));
+ check(SV("{:{}^}"), SV("{{:{{}}^}}"));
+ check(SV("{:{ }^}"), SV("{{:{{{}}}^}}"), CharT(' '));
// *** Test argument ID ***
check(SV("hello false true"), SV("hello {0:} {1:}"), false, true);
@@ -2669,7 +2727,6 @@
check_exception("The format string contains an invalid escape sequence", SV("{:}-}"), 42);
check_exception("The format string contains an invalid escape sequence", SV("} "));
-
check_exception("The arg-id of the format-spec starts with an invalid character", SV("{-"), 42);
check_exception("Argument index out of bounds", SV("hello {}"));
check_exception("Argument index out of bounds", SV("hello {0}"));
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
index f497e2d..af87108 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
@@ -11,6 +11,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class Out, class... Args>
@@ -23,6 +25,7 @@
#include <format>
#include <algorithm>
#include <cassert>
+#include <iterator>
#include <list>
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp
index e399060..c06a8ef 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp
@@ -9,6 +9,9 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
index 90615f7..7a97f55 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
@@ -10,6 +10,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class Out, class... Args>
@@ -20,6 +22,7 @@
#include <format>
#include <algorithm>
#include <cassert>
+#include <iterator>
#include <list>
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp
index a40b532..43fee3f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// Basic test to validate ill-formed code is properly detected.
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
index 8a9a539..80d1a6c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
@@ -11,6 +11,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class Out, class... Args>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp
index ec4e292..a4c7aad 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp
@@ -9,6 +9,9 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
index 8ce91da..b0ca148 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
@@ -10,6 +10,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class Out, class... Args>
@@ -22,6 +24,7 @@
#include <format>
#include <algorithm>
#include <cassert>
+#include <iterator>
#include <list>
#include <vector>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp
index 7c064c5..51abc5b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
index 625b99f..47ca522 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
@@ -11,6 +11,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class... Args>
@@ -32,7 +34,7 @@
auto test =
[]<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) constexpr {
- size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
assert(size == expected.size());
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp
index dc80c12..3e32f84 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp
@@ -9,6 +9,9 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
index 6a627ec..d1d2330 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
@@ -10,6 +10,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class... Args>
@@ -29,7 +31,7 @@
auto test =
[]<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) constexpr {
- size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
assert(size == expected.size());
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp
index 1662d89..2bd0e62 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// Basic test to validate ill-formed code is properly detected.
// <format>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
index 86d56da..6cf6931 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
@@ -12,6 +12,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// REQUIRES: locale.en_US.UTF-8
// <format>
@@ -94,6 +96,7 @@
#include "string_literal.h"
#include "test_format_string.h"
#include "assert_macros.h"
+#include "concat_macros.h"
#define STR(S) MAKE_STRING(CharT, S)
#define SV(S) MAKE_STRING_VIEW(CharT, S)
@@ -129,7 +132,7 @@
{
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
TEST_REQUIRE(out == expected,
- test_concat_message(
+ TEST_WRITE_CONCATENATED(
"\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
}
// *** vformat ***
@@ -164,7 +167,7 @@
}
// *** formatted_size ***
{
- size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
assert(size == expected.size());
}
}
@@ -214,7 +217,7 @@
}
// *** formatted_size ***
{
- size_t size = std::formatted_size(loc, fmt, std::forward<Args>(args)...);
+ std::size_t size = std::formatted_size(loc, fmt, std::forward<Args>(args)...);
assert(size == expected.size());
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp
index db659f5..a5c5fdb 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp
@@ -15,6 +15,9 @@
// UNSUPPORTED msvc, target={{.+}}-windows-gnu
// UNSUPPORTED: LIBCXX-AIX-FIXME
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// Tests the Unicode width support of the standard format specifiers.
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
index 90c56df..dd6c24e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
@@ -11,6 +11,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// string vformat(const locale& loc, string_view fmt, format_args args);
@@ -24,13 +26,14 @@
#include "format_tests.h"
#include "string_literal.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) constexpr {
std::basic_string<CharT> out = std::vformat(std::locale(), fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -38,19 +41,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(std::locale(), fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch ([[maybe_unused]] const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(std::locale(), fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
index 236d83e..a6aa38d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
@@ -10,6 +10,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// string vformat(string_view fmt, format_args args);
@@ -23,13 +25,14 @@
#include "format_tests.h"
#include "string_literal.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) constexpr {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -37,20 +40,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch ([[maybe_unused]] const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
index 993f19a..8aecf7b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
@@ -11,6 +11,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class Out>
@@ -26,7 +28,8 @@
#include <list>
#include <vector>
-#include "test_macros.h"
+#include "assert_macros.h"
+#include "concat_macros.h"
#include "format_tests.h"
#include "string_literal.h"
@@ -58,23 +61,22 @@
}
};
-auto test_exception =
- []<class CharT, class... Args>(
- [[maybe_unused]] std::string_view what,
- [[maybe_unused]] std::basic_string_view<CharT> fmt,
- [[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
+auto test_exception = []<class CharT, class... Args>([[maybe_unused]] std::string_view what,
+ [[maybe_unused]] std::basic_string_view<CharT> fmt,
+ [[maybe_unused]] Args&&... args) {
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ [&] {
std::basic_string<CharT> out;
std::vformat_to(std::back_inserter(out), std::locale(), fmt, std::make_format_args<context_t<CharT>>(args...));
- assert(false);
- } catch ([[maybe_unused]] const std::format_error& e) {
- LIBCPP_ASSERT(e.what() == what);
- return;
- }
- assert(false);
-#endif
- };
+ }());
+};
int main(int, char**) {
format_tests<char, execution_modus::partial>(test, test_exception);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
index 0574d49..3be94e5 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
@@ -10,6 +10,8 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
+// XFAIL: availability-fp_to_chars-missing
+
// <format>
// template<class Out>
@@ -23,6 +25,8 @@
#include <list>
#include <vector>
+#include "assert_macros.h"
+#include "concat_macros.h"
#include "test_macros.h"
#include "format_tests.h"
#include "string_literal.h"
@@ -60,17 +64,18 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- std::basic_string<CharT> out;
- std::vformat_to(std::back_inserter(out), fmt, std::make_format_args<context_t<CharT>>(args...));
- assert(false);
- } catch ([[maybe_unused]] const std::format_error& e) {
- LIBCPP_ASSERT(e.what() == what);
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ [&] {
+ std::basic_string<CharT> out;
+ std::vformat_to(std::back_inserter(out), fmt, std::make_format_args<context_t<CharT>>(args...));
+ }());
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/format.pass.cpp
new file mode 100644
index 0000000..9c29722
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/format.pass.cpp
@@ -0,0 +1,111 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// struct range-default-formatter<range_format::sequence, R, charT>
+
+// template<class FormatContext>
+// typename FormatContext::iterator
+// format(maybe-const-r& elems, FormatContext& ctx) const;
+
+#include <array>
+#include <cassert>
+#include <concepts>
+#include <format>
+#include <iterator>
+
+#include "assert_macros.h"
+#include "format.functions.common.h"
+#include "test_format_context.h"
+#include "test_macros.h"
+#include "make_string.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class StringViewT>
+void test_format(StringViewT expected, std::array<int, 2> arg) {
+ using CharT = typename StringViewT::value_type;
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+
+ std::formatter<std::array<int, 2>, CharT> formatter;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+ formatter.format(arg, format_ctx);
+ assert(result == expected);
+}
+
+template <class CharT>
+void test_assure_parse_is_called(std::basic_string_view<CharT> fmt) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::array<parse_call_validator, 2> arg;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ std::formatter<decltype(arg), CharT> formatter;
+ std::basic_format_parse_context<CharT> ctx{fmt};
+
+ formatter.parse(ctx);
+ formatter.format(arg, format_ctx);
+}
+
+template <class CharT>
+void test_assure_parse_is_called() {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::array<parse_call_validator, 2> arg;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ { // parse not called
+ [[maybe_unused]] const std::formatter<decltype(arg), CharT> formatter;
+ TEST_THROWS_TYPE(parse_call_validator::parse_function_not_called, formatter.format(arg, format_ctx));
+ }
+
+ test_assure_parse_is_called(SV("5"));
+ test_assure_parse_is_called(SV("n"));
+ test_assure_parse_is_called(SV("5n"));
+}
+
+template <class CharT>
+void test_fmt() {
+ test_format(SV("[1, 42]"), std::array<int, 2>{{1, 42}});
+ test_format(SV("[0, 99]"), std::array<int, 2>{{0, 99}});
+
+ test_assure_parse_is_called<CharT>();
+}
+
+void test() {
+ test_fmt<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_fmt<wchar_t>();
+#endif
+}
+
+int main(int, char**) {
+ test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/parse.pass.cpp
new file mode 100644
index 0000000..f66ef7b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/parse.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// struct range-default-formatter<range_format::sequence, R, charT>
+
+// template<class ParseContext>
+// constexpr typename ParseContext::iterator
+// parse(ParseContext& ctx);
+
+#include <array>
+#include <cassert>
+#include <concepts>
+#include <format>
+
+#include "test_format_context.h"
+#include "test_macros.h"
+#include "make_string.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class StringViewT>
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
+ using CharT = typename StringViewT::value_type;
+ auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
+ std::formatter<std::array<int, 2>, CharT> formatter;
+ static_assert(std::semiregular<decltype(formatter)>);
+
+ std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
+ assert(it == fmt.end() - offset);
+}
+
+template <class CharT>
+constexpr void test_fmt() {
+ test_parse(SV(""), 0);
+ test_parse(SV(":5"), 0);
+
+ test_parse(SV("}"), 1);
+ test_parse(SV(":5}"), 1);
+}
+
+constexpr bool test() {
+ test_fmt<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_fmt<wchar_t>();
+#endif
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_brackets.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_brackets.pass.cpp
new file mode 100644
index 0000000..c17edb2
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_brackets.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// struct range-default-formatter<range_format::sequence, R, charT>
+
+// constexpr void constexpr void set_brackets(basic_string_view<charT> opening,
+// basic_string_view<charT> closing) noexcept;
+
+#include <format>
+#include <cassert>
+#include <iterator>
+#include <type_traits>
+#include <vector>
+
+#include "make_string.h"
+#include "test_format_context.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class CharT>
+constexpr void test_setter() {
+ std::formatter<std::vector<int>, CharT> formatter;
+ formatter.set_brackets(SV("open"), SV("close"));
+ // Note the SV macro may throw, so can't use it.
+ static_assert(noexcept(formatter.set_brackets(std::basic_string_view<CharT>{}, std::basic_string_view<CharT>{})));
+
+ // Note there is no direct way to validate this function modified the object.
+ if (!std::is_constant_evaluated()) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>());
+ formatter.format(std::vector<int>{0, 42, 99}, format_ctx);
+ assert(result == SV("open0, 42, 99close"));
+ }
+}
+
+constexpr bool test() {
+ test_setter<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_setter<wchar_t>();
+#endif
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_separator.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_separator.pass.cpp
new file mode 100644
index 0000000..3f91e7b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_separator.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// struct range-default-formatter<range_format::sequence, R, charT>
+
+// constexpr void set_separator(basic_string_view<charT> sep) noexcept;
+
+#include <format>
+#include <cassert>
+#include <iterator>
+#include <type_traits>
+#include <vector>
+
+#include "make_string.h"
+#include "test_format_context.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class CharT>
+constexpr void test_setter() {
+ std::formatter<std::vector<int>, CharT> formatter;
+ formatter.set_separator(SV("sep"));
+ // Note the SV macro may throw, so can't use it.
+ static_assert(noexcept(formatter.set_separator(std::basic_string_view<CharT>{})));
+
+ // Note there is no direct way to validate this function modified the object.
+ if (!std::is_constant_evaluated()) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>());
+ formatter.format(std::vector<int>{0, 42, 99}, format_ctx);
+ assert(result == SV("[0sep42sep99]"));
+ }
+}
+
+constexpr bool test() {
+ test_setter<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_setter<wchar_t>();
+#endif
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtkind/format_kind.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtkind/format_kind.compile.pass.cpp
index d343ad1..9a0c155 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtkind/format_kind.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtkind/format_kind.compile.pass.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// This test uses std::filesystem::path, which is not always available
+// XFAIL: availability-filesystem-missing
+
// <format>
// template<ranges::input_range R>
@@ -47,7 +50,7 @@
struct iterator {
using iterator_concept = std::input_iterator_tag;
using value_type = recursive_range;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
using reference = recursive_range;
reference operator*() const;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.format.pass.cpp
index b2e65ec..2dcdfc8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.format.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -32,13 +30,14 @@
#include "test_format_string.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
index 005a2bd..3aa8953 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
@@ -26,20 +26,20 @@
void test_char(TestFunction check, ExceptionTest check_exception) {
std::map<CharT, CharT> input{{CharT('a'), CharT('A')}, {CharT('c'), CharT('C')}, {CharT('b'), CharT('B')}};
- check(SV("{a: A, b: B, c: C}"), SV("{}"), input);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{}"), input);
// ***** underlying has no format-spec
// *** align-fill & width ***
- check(SV("{a: A, b: B, c: C} "), SV("{:23}"), input);
- check(SV("{a: A, b: B, c: C}*****"), SV("{:*<23}"), input);
- check(SV("__{a: A, b: B, c: C}___"), SV("{:_^23}"), input);
- check(SV("#####{a: A, b: B, c: C}"), SV("{:#>23}"), input);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'} "), SV("{:35}"), input);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}*****"), SV("{:*<35}"), input);
+ check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^35}"), input);
+ check(SV("#####{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{:#>35}"), input);
- check(SV("{a: A, b: B, c: C} "), SV("{:{}}"), input, 23);
- check(SV("{a: A, b: B, c: C}*****"), SV("{:*<{}}"), input, 23);
- check(SV("__{a: A, b: B, c: C}___"), SV("{:_^{}}"), input, 23);
- check(SV("#####{a: A, b: B, c: C}"), SV("{:#>{}}"), input, 23);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'} "), SV("{:{}}"), input, 35);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}*****"), SV("{:*<{}}"), input, 35);
+ check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^{}}"), input, 35);
+ check(SV("#####{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{:#>{}}"), input, 35);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
@@ -63,10 +63,10 @@
check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
- check(SV("__a: A, b: B, c: C___"), SV("{:_^21n}"), input);
+ check(SV("__'a': 'A', 'b': 'B', 'c': 'C'___"), SV("{:_^33n}"), input);
// *** type ***
- check(SV("__{a: A, b: B, c: C}___"), SV("{:_^23m}"), input); // the m type does the same as the default.
+ check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^35m}"), input); // the m type does the same as the default.
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
@@ -134,20 +134,20 @@
std::map<char, char> input{{'a', 'A'}, {'c', 'C'}, {'b', 'B'}};
using CharT = wchar_t;
- check(SV("{a: A, b: B, c: C}"), SV("{}"), input);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{}"), input);
// ***** underlying has no format-spec
// *** align-fill & width ***
- check(SV("{a: A, b: B, c: C} "), SV("{:23}"), input);
- check(SV("{a: A, b: B, c: C}*****"), SV("{:*<23}"), input);
- check(SV("__{a: A, b: B, c: C}___"), SV("{:_^23}"), input);
- check(SV("#####{a: A, b: B, c: C}"), SV("{:#>23}"), input);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'} "), SV("{:35}"), input);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}*****"), SV("{:*<35}"), input);
+ check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^35}"), input);
+ check(SV("#####{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{:#>35}"), input);
- check(SV("{a: A, b: B, c: C} "), SV("{:{}}"), input, 23);
- check(SV("{a: A, b: B, c: C}*****"), SV("{:*<{}}"), input, 23);
- check(SV("__{a: A, b: B, c: C}___"), SV("{:_^{}}"), input, 23);
- check(SV("#####{a: A, b: B, c: C}"), SV("{:#>{}}"), input, 23);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'} "), SV("{:{}}"), input, 35);
+ check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}*****"), SV("{:*<{}}"), input, 35);
+ check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^{}}"), input, 35);
+ check(SV("#####{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{:#>{}}"), input, 35);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
@@ -171,10 +171,10 @@
check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
- check(SV("__a: A, b: B, c: C___"), SV("{:_^21n}"), input);
+ check(SV("__'a': 'A', 'b': 'B', 'c': 'C'___"), SV("{:_^33n}"), input);
// *** type ***
- check(SV("__{a: A, b: B, c: C}___"), SV("{:_^23m}"), input); // the m type does the same as the default.
+ check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^35m}"), input); // the m type does the same as the default.
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
@@ -642,20 +642,20 @@
std::map<std::basic_string<CharT>, std::basic_string<CharT>> input{
{STR("hello"), STR("HELLO")}, {STR("world"), STR("WORLD")}};
- check(SV(R"({hello: HELLO, world: WORLD})"), SV("{}"), input);
+ check(SV(R"({"hello": "HELLO", "world": "WORLD"})"), SV("{}"), input);
// ***** underlying has no format-spec
// *** align-fill & width ***
- check(SV(R"({hello: HELLO, world: WORLD} )"), SV("{:33}"), input);
- check(SV(R"({hello: HELLO, world: WORLD}*****)"), SV("{:*<33}"), input);
- check(SV(R"(__{hello: HELLO, world: WORLD}___)"), SV("{:_^33}"), input);
- check(SV(R"(#####{hello: HELLO, world: WORLD})"), SV("{:#>33}"), input);
+ check(SV(R"({"hello": "HELLO", "world": "WORLD"} )"), SV("{:41}"), input);
+ check(SV(R"({"hello": "HELLO", "world": "WORLD"}*****)"), SV("{:*<41}"), input);
+ check(SV(R"(__{"hello": "HELLO", "world": "WORLD"}___)"), SV("{:_^41}"), input);
+ check(SV(R"(#####{"hello": "HELLO", "world": "WORLD"})"), SV("{:#>41}"), input);
- check(SV(R"({hello: HELLO, world: WORLD} )"), SV("{:{}}"), input, 33);
- check(SV(R"({hello: HELLO, world: WORLD}*****)"), SV("{:*<{}}"), input, 33);
- check(SV(R"(__{hello: HELLO, world: WORLD}___)"), SV("{:_^{}}"), input, 33);
- check(SV(R"(#####{hello: HELLO, world: WORLD})"), SV("{:#>{}}"), input, 33);
+ check(SV(R"({"hello": "HELLO", "world": "WORLD"} )"), SV("{:{}}"), input, 41);
+ check(SV(R"({"hello": "HELLO", "world": "WORLD"}*****)"), SV("{:*<{}}"), input, 41);
+ check(SV(R"(__{"hello": "HELLO", "world": "WORLD"}___)"), SV("{:_^{}}"), input, 41);
+ check(SV(R"(#####{"hello": "HELLO", "world": "WORLD"})"), SV("{:#>{}}"), input, 41);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
@@ -677,10 +677,10 @@
check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
- check(SV(R"(__hello: HELLO, world: WORLD___)"), SV("{:_^31n}"), input);
+ check(SV(R"(__"hello": "HELLO", "world": "WORLD"___)"), SV("{:_^39n}"), input);
// *** type ***
- check(SV(R"(__{hello: HELLO, world: WORLD}___)"), SV("{:_^33m}"), input);
+ check(SV(R"(__{"hello": "HELLO", "world": "WORLD"}___)"), SV("{:_^41m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.vformat.pass.cpp
index 27b8805..b2d32ba 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.vformat.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -29,13 +27,14 @@
#include "format.functions.tests.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -43,20 +42,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch (const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.pass.cpp
index 0001618..8ac3220 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<ranges::input_range R, class charT>
@@ -30,8 +26,11 @@
#include <cassert>
#include <concepts>
#include <format>
+#include <iterator>
#include <map>
+#include "assert_macros.h"
+#include "format.functions.common.h"
#include "test_format_context.h"
#include "test_macros.h"
#include "make_string.h"
@@ -55,9 +54,52 @@
}
template <class CharT>
+void test_assure_parse_is_called(std::basic_string_view<CharT> fmt) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::map<parse_call_validator, parse_call_validator> arg{{parse_call_validator{}, parse_call_validator{}}};
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ std::formatter<decltype(arg), CharT> formatter;
+ std::basic_format_parse_context<CharT> ctx{fmt};
+
+ formatter.parse(ctx);
+ formatter.format(arg, format_ctx);
+}
+
+template <class CharT>
+void test_assure_parse_is_called() {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::map<parse_call_validator, parse_call_validator> arg{{parse_call_validator{}, parse_call_validator{}}};
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ { // parse not called
+ [[maybe_unused]] const std::formatter<decltype(arg), CharT> formatter;
+ TEST_THROWS_TYPE(parse_call_validator::parse_function_not_called, formatter.format(arg, format_ctx));
+ }
+
+ test_assure_parse_is_called(SV("5"));
+ test_assure_parse_is_called(SV("n"));
+ test_assure_parse_is_called(SV("m"));
+ test_assure_parse_is_called(SV("5n"));
+ test_assure_parse_is_called(SV("5m"));
+}
+
+template <class CharT>
void test_fmt() {
test_format(SV("{1: 42}"), std::map<int, int>{{1, 42}});
test_format(SV("{0: 99}"), std::map<int, int>{{0, 99}});
+
+ test_assure_parse_is_called<CharT>();
}
void test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/parse.pass.cpp
index 92763be..441a717 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/parse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/parse.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<ranges::input_range R, class charT>
@@ -39,23 +35,23 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class StringViewT>
-constexpr void test_parse(StringViewT fmt) {
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
using CharT = typename StringViewT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<std::map<int, int>, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
}
template <class CharT>
constexpr void test_fmt() {
- test_parse(SV(""));
- test_parse(SV(":5"));
+ test_parse(SV(""), 0);
+ test_parse(SV(":5"), 0);
- test_parse(SV("}"));
- test_parse(SV(":5}"));
+ test_parse(SV("}"), 1);
+ test_parse(SV(":5}"), 1);
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.format.pass.cpp
index 1361626..8272d13 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.format.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -32,13 +30,14 @@
#include "test_format_string.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
index a884ba7..bbb49e2 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
@@ -1100,20 +1100,20 @@
template <class CharT, class TestFunction, class ExceptionTest>
void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& input) {
- check(SV("{(1, a), (42, *)}"), SV("{}"), input);
+ check(SV("{(1, 'a'), (42, '*')}"), SV("{}"), input);
// ***** underlying has no format-spec
// *** align-fill & width ***
- check(SV("{(1, a), (42, *)} "), SV("{:22}"), input);
- check(SV("{(1, a), (42, *)}*****"), SV("{:*<22}"), input);
- check(SV("__{(1, a), (42, *)}___"), SV("{:_^22}"), input);
- check(SV("#####{(1, a), (42, *)}"), SV("{:#>22}"), input);
+ check(SV("{(1, 'a'), (42, '*')} "), SV("{:26}"), input);
+ check(SV("{(1, 'a'), (42, '*')}*****"), SV("{:*<26}"), input);
+ check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^26}"), input);
+ check(SV("#####{(1, 'a'), (42, '*')}"), SV("{:#>26}"), input);
- check(SV("{(1, a), (42, *)} "), SV("{:{}}"), input, 22);
- check(SV("{(1, a), (42, *)}*****"), SV("{:*<{}}"), input, 22);
- check(SV("__{(1, a), (42, *)}___"), SV("{:_^{}}"), input, 22);
- check(SV("#####{(1, a), (42, *)}"), SV("{:#>{}}"), input, 22);
+ check(SV("{(1, 'a'), (42, '*')} "), SV("{:{}}"), input, 26);
+ check(SV("{(1, 'a'), (42, '*')}*****"), SV("{:*<{}}"), input, 26);
+ check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^{}}"), input, 26);
+ check(SV("#####{(1, 'a'), (42, '*')}"), SV("{:#>{}}"), input, 26);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
@@ -1137,11 +1137,11 @@
check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
- check(SV("__(1, a), (42, *)___"), SV("{:_^20n}"), input);
- check(SV("__(1, a), (42, *)___"), SV("{:_^20nm}"), input); // m should have no effect
+ check(SV("__(1, 'a'), (42, '*')___"), SV("{:_^24n}"), input);
+ check(SV("__(1, 'a'), (42, '*')___"), SV("{:_^24nm}"), input); // m should have no effect
// *** type ***
- check(SV("__{(1, a), (42, *)}___"), SV("{:_^22m}"), input);
+ check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^26m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
@@ -1260,7 +1260,7 @@
check(SV("__(42), (99)___"), SV("{:_^15n}"), input);
// *** type ***
- check(SV("__{(42), (99)}___"), SV("{:_^17m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
@@ -1366,7 +1366,7 @@
check(SV("__(1, 10, 100), (42, 99, 0)___"), SV("{:_^30n}"), input);
// *** type ***
- check(SV("__{(1, 10, 100), (42, 99, 0)}___"), SV("{:_^32m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.vformat.pass.cpp
index 4a8ee4c..8113b01 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.vformat.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -29,13 +27,14 @@
#include "format.functions.tests.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -43,20 +42,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch (const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.pass.cpp
index 651ae86..2da3c7f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
// <format>
@@ -26,9 +25,12 @@
#include <cassert>
#include <concepts>
+#include <iterator>
#include <format>
#include <set>
+#include "assert_macros.h"
+#include "format.functions.common.h"
#include "test_format_context.h"
#include "test_macros.h"
#include "make_string.h"
@@ -52,8 +54,49 @@
}
template <class CharT>
+void test_assure_parse_is_called(std::basic_string_view<CharT> fmt) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::set<parse_call_validator> arg{parse_call_validator{}};
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ std::formatter<decltype(arg), CharT> formatter;
+ std::basic_format_parse_context<CharT> ctx{fmt};
+
+ formatter.parse(ctx);
+ formatter.format(arg, format_ctx);
+}
+
+template <class CharT>
+void test_assure_parse_is_called() {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::set<parse_call_validator> arg{parse_call_validator{}};
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ { // parse not called
+ [[maybe_unused]] const std::formatter<decltype(arg), CharT> formatter;
+ TEST_THROWS_TYPE(parse_call_validator::parse_function_not_called, formatter.format(arg, format_ctx));
+ }
+
+ test_assure_parse_is_called(SV("5"));
+ test_assure_parse_is_called(SV("n"));
+ test_assure_parse_is_called(SV("5n"));
+}
+
+template <class CharT>
void test_fmt() {
test_format(SV("{42}"), std::set<int>{42});
+
+ test_assure_parse_is_called<CharT>();
}
void test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/parse.pass.cpp
index 753a975..fede410 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/parse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtset/parse.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
// <format>
@@ -36,23 +35,23 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class StringViewT>
-constexpr void test_parse(StringViewT fmt) {
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
using CharT = typename StringViewT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<std::set<int>, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
}
template <class CharT>
constexpr void test_fmt() {
- test_parse(SV(""));
- test_parse(SV(":5"));
+ test_parse(SV(""), 0);
+ test_parse(SV(":5"), 0);
- test_parse(SV("}"));
- test_parse(SV(":5}"));
+ test_parse(SV("}"), 1);
+ test_parse(SV(":5}"), 1);
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.format.pass.cpp
new file mode 100644
index 0000000..2de2376
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.format.pass.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// XFAIL: availability-fp_to_chars-missing
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// requires (K == range_format::string || K == range_format::debug_string)
+// struct range-default-formatter<K, R, charT>
+//
+// template<class... Args>
+// string format(format_string<Args...> fmt, Args&&... args);
+// template<class... Args>
+// wstring format(wformat_string<Args...> fmt, Args&&... args);
+
+#include <format>
+#include <cassert>
+
+#include "format.functions.tests.h"
+#include "test_format_string.h"
+#include "test_macros.h"
+#include "assert_macros.h"
+#include "concat_macros.h"
+
+auto test = []<class CharT, class... Args>(
+ std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
+ std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
+};
+
+auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
+ // After P2216 most exceptions thrown by std::format become ill-formed.
+ // Therefore this tests does nothing.
+};
+
+int main(int, char**) {
+ format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ format_tests<wchar_t>(test, test_exception);
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h
new file mode 100644
index 0000000..c0e9c9d
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h
@@ -0,0 +1,439 @@
+//===----------------------------------------------------------------------===//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEST_STD_UTILITIES_FORMAT_FORMAT_RANGE_FORMAT_RANGE_FMTSTR_FORMAT_FUNCTIONS_TESTS_H
+#define TEST_STD_UTILITIES_FORMAT_FORMAT_RANGE_FORMAT_RANGE_FMTSTR_FORMAT_FUNCTIONS_TESTS_H
+
+#include <array>
+#include <format>
+#include <list>
+
+#include "format.functions.common.h"
+#include "make_string.h"
+#include "platform_support.h" // locale name macros
+#include "test_macros.h"
+
+//
+// Types
+//
+
+template <class Container>
+class test_range_format_string {
+public:
+ explicit test_range_format_string(Container str) : str_(std::move(str)) {}
+
+ typename Container::const_iterator begin() const { return str_.begin(); }
+ typename Container::const_iterator end() const { return str_.end(); }
+
+private:
+ Container str_;
+};
+
+template <class Container>
+constexpr std::range_format std::format_kind<test_range_format_string<Container>> = std::range_format::string;
+
+template <class Container>
+class test_range_format_debug_string {
+public:
+ explicit test_range_format_debug_string(Container str) : str_(std::move(str)) {}
+
+ typename Container::const_iterator begin() const { return str_.begin(); }
+ typename Container::const_iterator end() const { return str_.end(); }
+
+private:
+ Container str_;
+};
+
+template <class Container>
+constexpr std::range_format std::format_kind<test_range_format_debug_string<Container>> =
+ std::range_format::debug_string;
+
+//
+// String
+//
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_string(TestFunction check, ExceptionTest check_exception, auto&& input) {
+ check(SV("hello"), SV("{}"), input);
+
+ // *** align-fill & width ***
+ check(SV("hello "), SV("{:10}"), input);
+ check(SV("hello*****"), SV("{:*<10}"), input);
+ check(SV("__hello___"), SV("{:_^10}"), input);
+ check(SV(":::::hello"), SV("{::>10}"), input);
+
+ check(SV("hello "), SV("{:{}}"), input, 10);
+ check(SV("hello*****"), SV("{:*<{}}"), input, 10);
+ check(SV("__hello___"), SV("{:_^{}}"), input, 10);
+ check(SV(":::::hello"), SV("{::>{}}"), input, 10);
+
+ check_exception("The format-spec fill field contains an invalid character", SV("{:}<}"), input);
+ check_exception("The format-spec fill field contains an invalid character", SV("{:{<}"), input);
+
+ // *** sign ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** alternate form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+
+ // *** precision ***
+ check(SV("hel"), SV("{:.3}"), input);
+ check(SV("hel"), SV("{:.{}}"), input, 3);
+
+ check(SV("hel "), SV("{:5.3}"), input);
+ check(SV("hel "), SV("{:{}.{}}"), input, 5, 3);
+
+ // *** locale-specific form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+
+ // *** type ***
+ check(SV("hello"), SV("{:s}"), input);
+ check(SV("\"hello\""), SV("{:?}"), input);
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s?"))
+ check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+}
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_string(TestFunction check, ExceptionTest check_exception) {
+ // libc++ uses different containers for contiguous and non-contiguous ranges.
+ std::basic_string<CharT> input = STR("hello");
+ test_string<CharT>(check, check_exception, test_range_format_string<std::basic_string<CharT>>{input});
+ test_string<CharT>(check, check_exception, test_range_format_string<std::basic_string_view<CharT>>{input});
+ test_string<CharT>(
+ check, check_exception, test_range_format_string<std::list<CharT>>{std::list<CharT>{input.begin(), input.end()}});
+}
+
+//
+// String range
+//
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_range_string(TestFunction check, ExceptionTest check_exception, auto&& input) {
+ check(SV(R"([Hello, world])"), SV("{}"), input);
+
+ // ***** underlying has no format-spec
+
+ // *** align-fill & width ***
+ check(SV(R"([Hello, world] )"), SV("{:19}"), input);
+ check(SV(R"([Hello, world]*****)"), SV("{:*<19}"), input);
+ check(SV(R"(__[Hello, world]___)"), SV("{:_^19}"), input);
+ check(SV(R"(#####[Hello, world])"), SV("{:#>19}"), input);
+
+ check(SV(R"([Hello, world] )"), SV("{:{}}"), input, 19);
+ check(SV(R"([Hello, world]*****)"), SV("{:*<{}}"), input, 19);
+ check(SV(R"(__[Hello, world]___)"), SV("{:_^{}}"), input, 19);
+ check(SV(R"(#####[Hello, world])"), SV("{:#>{}}"), input, 19);
+
+ check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
+ check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
+ check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+
+ // *** sign ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** alternate form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+
+ // *** precision ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+
+ // *** locale-specific form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+
+ // *** n
+ check(SV(R"(_Hello, world_)"), SV("{:_^14n}"), input);
+
+ // *** type ***
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
+ check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
+ check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+
+ // ***** Only underlying has a format-spec
+ check(SV(R"([Hello , world ])"), SV("{::8}"), input);
+ check(SV(R"([Hello***, world***])"), SV("{::*<8}"), input);
+ check(SV(R"([_Hello__, _world__])"), SV("{::_^8}"), input);
+ check(SV(R"([:::Hello, :::world])"), SV("{:::>8}"), input);
+
+ check(SV(R"([Hello , world ])"), SV("{::{}}"), input, 8);
+ check(SV(R"([Hello***, world***])"), SV("{::*<{}}"), input, 8);
+ check(SV(R"([_Hello__, _world__])"), SV("{::_^{}}"), input, 8);
+ check(SV(R"([:::Hello, :::world])"), SV("{:::>{}}"), input, 8);
+
+ check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
+ check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+
+ // *** sign ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
+
+ // *** alternate form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+
+ // *** precision ***
+ check(SV(R"([Hel, wor])"), SV("{::.3}"), input);
+
+ check(SV(R"([Hel, wor])"), SV("{::.{}}"), input, 3);
+
+ check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+
+ // *** locale-specific form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+
+ // *** type ***
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
+ check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+
+ // ***** Both have a format-spec
+ check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^25::>8}"), input);
+ check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>8}"), input, 25);
+ check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>{}}"), input, 25, 8);
+
+ check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^25::>8}"), input);
+ check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>8}"), input, 25);
+ check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>{}}"), input, 25, 8);
+
+ check_exception("Argument index out of bounds", SV("{:^^{}::>8}"), input);
+ check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+}
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_range_string(TestFunction check, ExceptionTest check_exception) {
+ // libc++ uses different containers for contiguous and non-contiguous ranges.
+ std::array input{STR("Hello"), STR("world")};
+ test_range_string<CharT>(
+ check,
+ check_exception,
+ std::array{test_range_format_string<std::basic_string<CharT>>{input[0]},
+ test_range_format_string<std::basic_string<CharT>>{input[1]}});
+ test_range_string<CharT>(
+ check,
+ check_exception,
+ std::array{test_range_format_string<std::basic_string_view<CharT>>{input[0]},
+ test_range_format_string<std::basic_string_view<CharT>>{input[1]}});
+ test_range_string<CharT>(
+ check,
+ check_exception,
+ std::array{test_range_format_string<std::list<CharT>>{std::list<CharT>{input[0].begin(), input[0].end()}},
+ test_range_format_string<std::list<CharT>>{std::list<CharT>{input[1].begin(), input[1].end()}}});
+ test_range_string<CharT>(
+ check,
+ check_exception,
+ std::list{test_range_format_string<std::list<CharT>>{std::list<CharT>{input[0].begin(), input[0].end()}},
+ test_range_format_string<std::list<CharT>>{std::list<CharT>{input[1].begin(), input[1].end()}}});
+}
+
+//
+// Debug string
+//
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_debug_string(TestFunction check, ExceptionTest check_exception, auto&& input) {
+ check(SV("\"hello\""), SV("{}"), input);
+
+ // *** align-fill & width ***
+ check(SV("\"hello\" "), SV("{:12}"), input);
+ check(SV("\"hello\"*****"), SV("{:*<12}"), input);
+ check(SV("__\"hello\"___"), SV("{:_^12}"), input);
+ check(SV(":::::\"hello\""), SV("{::>12}"), input);
+
+ check(SV("\"hello\" "), SV("{:{}}"), input, 12);
+ check(SV("\"hello\"*****"), SV("{:*<{}}"), input, 12);
+ check(SV("__\"hello\"___"), SV("{:_^{}}"), input, 12);
+ check(SV(":::::\"hello\""), SV("{::>{}}"), input, 12);
+
+ check_exception("The format-spec fill field contains an invalid character", SV("{:}<}"), input);
+ check_exception("The format-spec fill field contains an invalid character", SV("{:{<}"), input);
+
+ // *** sign ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** alternate form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+
+ // *** precision ***
+ check(SV("\"he"), SV("{:.3}"), input);
+ check(SV("\"he"), SV("{:.{}}"), input, 3);
+
+ check(SV("\"he "), SV("{:5.3}"), input);
+ check(SV("\"he "), SV("{:{}.{}}"), input, 5, 3);
+
+ // *** locale-specific form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+
+ // *** type ***
+ check(SV("\"hello\""), SV("{:s}"), input); // escape overrides the type option s
+ check(SV("\"hello\""), SV("{:?}"), input);
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s?"))
+ check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+}
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_debug_string(TestFunction check, ExceptionTest check_exception) {
+ // libc++ uses different containers for contiguous and non-contiguous ranges.
+ std::basic_string<CharT> input = STR("hello");
+ test_debug_string<CharT>(check, check_exception, test_range_format_debug_string<std::basic_string<CharT>>{input});
+ test_debug_string<CharT>(
+ check, check_exception, test_range_format_debug_string<std::basic_string_view<CharT>>{input});
+ test_debug_string<CharT>(
+ check,
+ check_exception,
+ test_range_format_debug_string<std::list<CharT>>{std::list<CharT>{input.begin(), input.end()}});
+}
+
+//
+// Debug string range
+//
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_range_debug_string(TestFunction check, ExceptionTest check_exception, auto&& input) {
+ // ***** underlying has no format-spec
+
+ // *** align-fill & width ***
+ check(SV(R"(["Hello", "world"] )"), SV("{:23}"), input);
+ check(SV(R"(["Hello", "world"]*****)"), SV("{:*<23}"), input);
+ check(SV(R"(__["Hello", "world"]___)"), SV("{:_^23}"), input);
+ check(SV(R"(#####["Hello", "world"])"), SV("{:#>23}"), input);
+
+ check(SV(R"(["Hello", "world"] )"), SV("{:{}}"), input, 23);
+ check(SV(R"(["Hello", "world"]*****)"), SV("{:*<{}}"), input, 23);
+ check(SV(R"(__["Hello", "world"]___)"), SV("{:_^{}}"), input, 23);
+ check(SV(R"(#####["Hello", "world"])"), SV("{:#>{}}"), input, 23);
+
+ check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
+ check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
+ check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+
+ // *** sign ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** alternate form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+
+ // *** precision ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+
+ // *** locale-specific form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+
+ // *** n
+ check(SV(R"(_"Hello", "world"_)"), SV("{:_^18n}"), input);
+
+ // *** type ***
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
+ check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
+ check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+
+ // ***** Only underlying has a format-spec
+ check(SV(R"(["Hello" , "world" ])"), SV("{::10}"), input);
+ check(SV(R"(["Hello"***, "world"***])"), SV("{::*<10}"), input);
+ check(SV(R"([_"Hello"__, _"world"__])"), SV("{::_^10}"), input);
+ check(SV(R"([:::"Hello", :::"world"])"), SV("{:::>10}"), input);
+
+ check(SV(R"(["Hello" , "world" ])"), SV("{::{}}"), input, 10);
+ check(SV(R"(["Hello"***, "world"***])"), SV("{::*<{}}"), input, 10);
+ check(SV(R"([_"Hello"__, _"world"__])"), SV("{::_^{}}"), input, 10);
+ check(SV(R"([:::"Hello", :::"world"])"), SV("{:::>{}}"), input, 10);
+
+ check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
+ check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+
+ // *** sign ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
+
+ // *** alternate form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+
+ // *** zero-padding ***
+ check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+
+ // *** precision ***
+ check(SV(R"(["He, "wo])"), SV("{::.3}"), input);
+
+ check(SV(R"(["He, "wo])"), SV("{::.{}}"), input, 3);
+
+ check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+
+ // *** locale-specific form ***
+ check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+
+ // *** type ***
+ for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
+ check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+
+ // ***** Both have a format-spec
+ check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^29::>10}"), input);
+ check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^{}::>10}"), input, 29);
+ check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^{}::>{}}"), input, 29, 10);
+
+ check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^29::>10}"), input);
+ check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^{}::>10}"), input, 29);
+ check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^{}::>{}}"), input, 29, 10);
+
+ check_exception("Argument index out of bounds", SV("{:^^{}::>10}"), input);
+ check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 29);
+}
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void test_range_debug_string(TestFunction check, ExceptionTest check_exception) {
+ // libc++ uses different containers for contiguous and non-contiguous ranges.
+ std::array input{STR("Hello"), STR("world")};
+ test_range_debug_string<CharT>(
+ check,
+ check_exception,
+ std::array{test_range_format_debug_string<std::basic_string<CharT>>{input[0]},
+ test_range_format_debug_string<std::basic_string<CharT>>{input[1]}});
+ test_range_debug_string<CharT>(
+ check,
+ check_exception,
+ std::array{test_range_format_debug_string<std::basic_string_view<CharT>>{input[0]},
+ test_range_format_debug_string<std::basic_string_view<CharT>>{input[1]}});
+ test_range_debug_string<CharT>(
+ check,
+ check_exception,
+ std::array{test_range_format_debug_string<std::list<CharT>>{std::list<CharT>{input[0].begin(), input[0].end()}},
+ test_range_format_debug_string<std::list<CharT>>{std::list<CharT>{input[1].begin(), input[1].end()}}});
+ test_range_debug_string<CharT>(
+ check,
+ check_exception,
+ std::list{test_range_format_debug_string<std::list<CharT>>{std::list<CharT>{input[0].begin(), input[0].end()}},
+ test_range_format_debug_string<std::list<CharT>>{std::list<CharT>{input[1].begin(), input[1].end()}}});
+}
+
+//
+// Driver
+//
+
+template <class CharT, class TestFunction, class ExceptionTest>
+void format_tests(TestFunction check, ExceptionTest check_exception) {
+ test_string<CharT>(check, check_exception);
+ test_range_string<CharT>(check, check_exception);
+
+ test_debug_string<CharT>(check, check_exception);
+ test_range_debug_string<CharT>(check, check_exception);
+}
+
+#endif // TEST_STD_UTILITIES_FORMAT_FORMAT_RANGE_FORMAT_RANGE_FMTSTR_FORMAT_FUNCTIONS_TESTS_H
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.vformat.pass.cpp
new file mode 100644
index 0000000..a549b69
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.vformat.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Fix this test using GCC, it currently times out.
+// UNSUPPORTED: gcc-12
+
+// XFAIL: availability-fp_to_chars-missing
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// requires (K == range_format::string || K == range_format::debug_string)
+// struct range-default-formatter<K, R, charT>
+//
+// string vformat(string_view fmt, format_args args);
+// wstring vformat(wstring_view fmt, wformat_args args);
+
+#include <format>
+#include <cassert>
+
+#include "format.functions.tests.h"
+#include "test_macros.h"
+#include "assert_macros.h"
+#include "concat_macros.h"
+
+auto test = []<class CharT, class... Args>(
+ std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
+ std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+};
+
+auto test_exception =
+ []<class CharT, class... Args>(
+ [[maybe_unused]] std::string_view what,
+ [[maybe_unused]] std::basic_string_view<CharT> fmt,
+ [[maybe_unused]] Args&&... args) {
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
+ };
+
+int main(int, char**) {
+ format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ format_tests<wchar_t>(test, test_exception);
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.pass.cpp
new file mode 100644
index 0000000..9ae44b3
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Investigate why this fails.
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// requires (K == range_format::string || K == range_format::debug_string)
+// struct range-default-formatter<K, R, charT>
+
+// template<class FormatContext>
+// typename FormatContext::iterator
+// format(const T& ref, FormatContext& ctx) const;
+
+// Note this tests the basics of this function. It's tested in more detail in
+// the format.functions test.
+
+#include <cassert>
+#include <concepts>
+#include <format>
+
+#include "format.functions.tests.h"
+#include "test_format_context.h"
+#include "test_macros.h"
+
+template <class StringViewT, class ArgT>
+void test_format(StringViewT expected, ArgT arg) {
+ using CharT = typename StringViewT::value_type;
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+
+ std::formatter<ArgT, CharT> formatter;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+ formatter.format(arg, format_ctx);
+ assert(result == expected);
+}
+
+template <class CharT>
+void test_fmt() {
+ test_format(SV("hello"), test_range_format_string<std::basic_string<CharT>>{STR("hello")});
+ test_format(SV("hello"), test_range_format_debug_string<std::basic_string<CharT>>{STR("hello")});
+}
+
+void test() {
+ test_fmt<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_fmt<wchar_t>();
+#endif
+}
+
+int main(int, char**) {
+ test();
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/parse.pass.cpp
new file mode 100644
index 0000000..64919eb
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/parse.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17, c++20
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// TODO FMT Investigate why this fails.
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+
+// <format>
+
+// template<ranges::input_range R, class charT>
+// requires (K == range_format::string || K == range_format::debug_string)
+// struct range-default-formatter<K, R, charT>
+
+// template<class ParseContext>
+// constexpr typename ParseContext::iterator
+// parse(ParseContext& ctx);
+
+// Note this tests the basics of this function. It's tested in more detail in
+// the format.functions test.
+
+#include <cassert>
+#include <concepts>
+#include <format>
+
+#include "format.functions.tests.h"
+#include "test_format_context.h"
+#include "test_macros.h"
+
+template <class FormatterT, class StringViewT>
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
+ using CharT = typename StringViewT::value_type;
+ auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
+ FormatterT formatter;
+ static_assert(std::semiregular<decltype(formatter)>);
+
+ std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
+ assert(it == fmt.end() - offset);
+}
+
+template <class StringViewT>
+constexpr void test_formatters(StringViewT fmt, std::size_t offset) {
+ using CharT = typename StringViewT::value_type;
+ test_parse<std::formatter<test_range_format_string<std::basic_string<CharT>>, CharT>>(fmt, offset);
+ test_parse<std::formatter<test_range_format_debug_string<std::basic_string<CharT>>, CharT>>(fmt, offset);
+}
+
+template <class CharT>
+constexpr void test_char_type() {
+ test_formatters(SV(""), 0);
+ test_formatters(SV("}"), 1);
+}
+
+constexpr bool test() {
+ test_char_type<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test_char_type<wchar_t>();
+#endif
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.format.pass.cpp
index 78e04fe..02c9467 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.format.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -33,13 +31,14 @@
#include "test_format_string.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
index a465916..57f1861 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
@@ -17,6 +17,7 @@
#include <list>
#include <ranges>
#include <span>
+#include <tuple>
#include <vector>
#include "format.functions.common.h"
@@ -927,20 +928,20 @@
// So when there is no range-underlying-spec, there is no need to call parse
// thus the char element is not escaped.
// TODO FMT P2733 addresses this issue.
- check(SV("[(1, a), (42, *)]"), SV("{}"), input);
+ check(SV("[(1, 'a'), (42, '*')]"), SV("{}"), input);
// ***** underlying has no format-spec
// *** align-fill & width ***
- check(SV("[(1, a), (42, *)] "), SV("{:22}"), input);
- check(SV("[(1, a), (42, *)]*****"), SV("{:*<22}"), input);
- check(SV("__[(1, a), (42, *)]___"), SV("{:_^22}"), input);
- check(SV("#####[(1, a), (42, *)]"), SV("{:#>22}"), input);
+ check(SV("[(1, 'a'), (42, '*')] "), SV("{:26}"), input);
+ check(SV("[(1, 'a'), (42, '*')]*****"), SV("{:*<26}"), input);
+ check(SV("__[(1, 'a'), (42, '*')]___"), SV("{:_^26}"), input);
+ check(SV("#####[(1, 'a'), (42, '*')]"), SV("{:#>26}"), input);
- check(SV("[(1, a), (42, *)] "), SV("{:{}}"), input, 22);
- check(SV("[(1, a), (42, *)]*****"), SV("{:*<{}}"), input, 22);
- check(SV("__[(1, a), (42, *)]___"), SV("{:_^{}}"), input, 22);
- check(SV("#####[(1, a), (42, *)]"), SV("{:#>{}}"), input, 22);
+ check(SV("[(1, 'a'), (42, '*')] "), SV("{:{}}"), input, 26);
+ check(SV("[(1, 'a'), (42, '*')]*****"), SV("{:*<{}}"), input, 26);
+ check(SV("__[(1, 'a'), (42, '*')]___"), SV("{:_^{}}"), input, 26);
+ check(SV("#####[(1, 'a'), (42, '*')]"), SV("{:#>{}}"), input, 26);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
@@ -964,11 +965,11 @@
check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
- check(SV("__(1, a), (42, *)___"), SV("{:_^20n}"), input);
- check(SV("__(1, a), (42, *)___"), SV("{:_^20nm}"), input); // m should have no effect
+ check(SV("__(1, 'a'), (42, '*')___"), SV("{:_^24n}"), input);
+ check(SV("__(1, 'a'), (42, '*')___"), SV("{:_^24nm}"), input); // m should have no effect
// *** type ***
- check(SV("__{(1, a), (42, *)}___"), SV("{:_^22m}"), input);
+ check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^26m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
@@ -1083,7 +1084,7 @@
check(SV("__(42), (99)___"), SV("{:_^15n}"), input);
// *** type ***
- check(SV("__{(42), (99)}___"), SV("{:_^17m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
@@ -1184,7 +1185,7 @@
check(SV("__(42, 99, 0), (1, 10, 100)___"), SV("{:_^30n}"), input);
// *** type ***
- check(SV("__{(42, 99, 0), (1, 10, 100)}___"), SV("{:_^32m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.vformat.pass.cpp
index c473893..06558b3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.vformat.pass.cpp
@@ -11,9 +11,7 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -30,13 +28,14 @@
#include "format.functions.tests.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -44,20 +43,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch (const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.pass.cpp
index acfe8cc..e62c562 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class T, class charT = char>
@@ -30,12 +26,15 @@
#include <cassert>
#include <concepts>
+#include <iterator>
#include <format>
#include <vector>
+#include "assert_macros.h"
+#include "format.functions.common.h"
+#include "make_string.h"
#include "test_format_context.h"
#include "test_macros.h"
-#include "make_string.h"
#define SV(S) MAKE_STRING_VIEW(CharT, S)
@@ -56,9 +55,55 @@
}
template <class CharT>
+void test_assure_parse_is_called(std::basic_string_view<CharT> fmt) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::vector<parse_call_validator> arg{1};
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ std::range_formatter<parse_call_validator, CharT> formatter;
+ std::basic_format_parse_context<CharT> ctx{fmt};
+
+ formatter.parse(ctx);
+ formatter.format(arg, format_ctx);
+}
+
+template <class CharT>
+void test_assure_parse_is_called() {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::vector<parse_call_validator> arg{1};
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ { // parse not called
+ [[maybe_unused]] const std::range_formatter<parse_call_validator, CharT> formatter;
+ TEST_THROWS_TYPE(parse_call_validator::parse_function_not_called, formatter.format(arg, format_ctx));
+ }
+
+ // The range-format-spec has no range-underlying-spec
+ // This uses various variants, which have different code paths in libc++
+ test_assure_parse_is_called(SV("5"));
+ test_assure_parse_is_called(SV("n"));
+ test_assure_parse_is_called(SV(":"));
+ test_assure_parse_is_called(SV("5"));
+ test_assure_parse_is_called(SV("5n"));
+ test_assure_parse_is_called(SV("5n:"));
+}
+
+template <class CharT>
void test_fmt() {
test_format(SV("[1]"), std::vector<int>{1});
test_format(SV("[0]"), std::vector<int>{0});
+
+ test_assure_parse_is_called<CharT>();
}
void test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/parse.pass.cpp
index ce1c0c9..9ea2ed8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/parse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/parse.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class T, class charT = char>
@@ -39,23 +35,23 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class StringViewT>
-constexpr void test_parse(StringViewT fmt) {
+constexpr void test_parse(StringViewT fmt, std::size_t offset) {
using CharT = typename StringViewT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::range_formatter<int, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
}
template <class CharT>
constexpr void test_fmt() {
- test_parse(SV(""));
- test_parse(SV(":d"));
+ test_parse(SV(""), 0);
+ test_parse(SV(":d"), 0);
- test_parse(SV("}"));
- test_parse(SV(":d}"));
+ test_parse(SV("}"), 1);
+ test_parse(SV(":d}"), 1);
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_brackets.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_brackets.pass.cpp
index fe2d72c..0b0e3a1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_brackets.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_brackets.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class T, class charT = char>
@@ -22,13 +18,14 @@
// class range_formatter
// constexpr void constexpr void set_brackets(basic_string_view<charT> opening,
-// basic_string_view<charT> closing);
+// basic_string_view<charT> closing) noexcept;
// Note this tests the basics of this function. It's tested in more detail in
// the format functions test.
#include <format>
#include <cassert>
+#include <iterator>
#include <type_traits>
#include <vector>
@@ -41,6 +38,8 @@
constexpr void test_setter() {
std::range_formatter<int, CharT> formatter;
formatter.set_brackets(SV("open"), SV("close"));
+ // Note the SV macro may throw, so can't use it.
+ static_assert(noexcept(formatter.set_brackets(std::basic_string_view<CharT>{}, std::basic_string_view<CharT>{})));
// Note there is no direct way to validate this function modified the object.
if (!std::is_constant_evaluated()) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_separator.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_separator.pass.cpp
index 413f5b4..c63cc52 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_separator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/set_separator.pass.cpp
@@ -11,23 +11,20 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class T, class charT = char>
// requires same_as<remove_cvref_t<T>, T> && formattable<T, charT>
// class range_formatter
-// constexpr void set_separator(basic_string_view<charT> sep);
+// constexpr void set_separator(basic_string_view<charT> sep) noexcept;
// Note this tests the basics of this function. It's tested in more detail in
// the format functions test.
#include <format>
#include <cassert>
+#include <iterator>
#include <type_traits>
#include <vector>
@@ -40,6 +37,8 @@
constexpr void test_setter() {
std::range_formatter<int, CharT> formatter;
formatter.set_separator(SV("sep"));
+ // Note the SV macro may throw, so can't use it.
+ static_assert(noexcept(formatter.set_separator(std::basic_string_view<CharT>{})));
// Note there is no direct way to validate this function modified the object.
if (!std::is_constant_evaluated()) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/underlying.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/underlying.pass.cpp
index 7d819d4..52ac58a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/underlying.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.range/format.range.formatter/underlying.pass.cpp
@@ -11,18 +11,14 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class T, class charT = char>
// requires same_as<remove_cvref_t<T>, T> && formattable<T, charT>
// class range_formatter
-// constexpr formatter<T, charT>& underlying();
-// constexpr const formatter<T, charT>& underlying() const;
+// constexpr formatter<T, charT>& underlying() noexcept;
+// constexpr const formatter<T, charT>& underlying() const noexcept;
#include <concepts>
#include <format>
@@ -34,10 +30,12 @@
{
std::range_formatter<int, CharT> formatter;
[[maybe_unused]] std::same_as<std::formatter<int, CharT>&> decltype(auto) underlying = formatter.underlying();
+ static_assert(noexcept(formatter.underlying()));
}
{
const std::range_formatter<int, CharT> formatter;
[[maybe_unused]] std::same_as<const std::formatter<int, CharT>&> decltype(auto) underlying = formatter.underlying();
+ static_assert(noexcept(formatter.underlying()));
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp
new file mode 100644
index 0000000..6d148ae
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// XFAIL: availability-fp_to_chars-missing
+
+// <format>
+
+// [format.string.std]/8
+// If { arg-idopt } is used in a width or precision, the value of the
+// corresponding formatting argument is used in its place. If the
+// corresponding formatting argument is not of standard signed or unsigned
+// integer type, or its value is negative for precision or non-positive for
+// width, an exception of type format_error is thrown.
+//
+// This test does the run-time validation
+
+#include <cassert>
+#include <format>
+
+#include "assert_macros.h"
+#include "concat_macros.h"
+#include "format.functions.common.h"
+#include "make_string.h"
+#include "test_macros.h"
+
+#define SV(S) MAKE_STRING_VIEW(CharT, S)
+
+template <class CharT, class... Args>
+void test_exception([[maybe_unused]] std::basic_string_view<CharT> fmt, [[maybe_unused]] Args&&... args) {
+ [[maybe_unused]] std::string_view what = "Replacement argument isn't a standard signed or unsigned integer type";
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
+}
+
+template <class CharT>
+void test() {
+ // *** Width ***
+ test_exception(SV("{:{}}"), 42, true);
+ test_exception(SV("{:{}}"), 42, '0');
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ if constexpr (std::same_as<CharT, wchar_t>)
+ test_exception(SV("{:{}}"), 42, L'0');
+#endif
+#ifndef TEST_HAS_NO_INT128
+ test_exception(SV("{:{}}"), 42, __int128_t(0));
+ test_exception(SV("{:{}}"), 42, __uint128_t(0));
+#endif
+ test_exception(SV("{:{}}"), 42, 42.0f);
+ test_exception(SV("{:{}}"), 42, 42.0);
+ test_exception(SV("{:{}}"), 42, 42.0l);
+
+ // *** Precision ***
+ test_exception(SV("{:0.{}}"), 42.0, true);
+ test_exception(SV("{:0.{}}"), 42.0, '0');
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ if constexpr (std::same_as<CharT, wchar_t>)
+ test_exception(SV("{:0.{}}"), 42.0, L'0');
+#endif
+#ifndef TEST_HAS_NO_INT128
+ test_exception(SV("{:0.{}}"), 42.0, __int128_t(0));
+ test_exception(SV("{:0.{}}"), 42.0, __uint128_t(0));
+#endif
+ test_exception(SV("{:0.{}}"), 42.0, 42.0f);
+ test_exception(SV("{:0.{}}"), 42.0, 42.0);
+ test_exception(SV("{:0.{}}"), 42.0, 42.0l);
+}
+
+int main(int, char**) {
+ test<char>();
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+ test<wchar_t>();
+#endif
+
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.verify.cpp
new file mode 100644
index 0000000..ce6ca7b
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.verify.cpp
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+// 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, c++17
+// UNSUPPORTED: libcpp-has-no-incomplete-format
+
+// XFAIL: availability-fp_to_chars-missing
+
+// <format>
+
+// [format.string.std]/8
+// If { arg-idopt } is used in a width or precision, the value of the
+// corresponding formatting argument is used in its place. If the
+// corresponding formatting argument is not of standard signed or unsigned
+// integer type, or its value is negative for precision or non-positive for
+// width, an exception of type format_error is thrown.
+//
+// This test does the compile-time validation
+
+#include <format>
+
+#include "test_macros.h"
+
+void test_char_width() {
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, true);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, '0');
+#ifndef TEST_HAS_NO_INT128
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, __int128_t(0));
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, __uint128_t(0));
+#endif
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, 42.0f);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, 42.0);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:{}}", 42, 42.0l);
+}
+
+void test_char_precision() {
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, true);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, '0');
+#ifndef TEST_HAS_NO_INT128
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, __int128_t(0));
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, __uint128_t(0));
+#endif
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, 42.0f);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, 42.0);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format("{:0.{}}", 42.0, 42.0l);
+}
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+void test_wchar_t_width() {
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, true);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, '0');
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, L'0');
+# ifndef TEST_HAS_NO_INT128
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, __int128_t(0));
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, __uint128_t(0));
+# endif
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, 42.0f);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, 42.0);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:{}}", 42, 42.0l);
+}
+
+void test_wchar_t_precision() {
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, true);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, '0');
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, L'0');
+# ifndef TEST_HAS_NO_INT128
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, __int128_t(0));
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, __uint128_t(0));
+# endif
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, 42.0f);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, 42.0);
+ // expected-error-re@*:* {{call to consteval function {{.*}} is not a constant expression}}
+ TEST_IGNORE_NODISCARD std::format(L"{:0.{}}", 42.0, 42.0l);
+}
+
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.syn/format_to_n_result.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.syn/format_to_n_result.pass.cpp
index 6b21023..d1e1b2d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.syn/format_to_n_result.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.syn/format_to_n_result.pass.cpp
@@ -22,6 +22,7 @@
#include <cassert>
#include <concepts>
+#include <iterator>
#include "test_macros.h"
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.pass.cpp
index 6f64016..1132815 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.pass.cpp
@@ -11,9 +11,8 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -34,13 +33,14 @@
#include "test_format_string.h"
#include "test_macros.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
std::basic_string<CharT> out = std::format(fmt, std::forward<Args>(args)...);
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt.get(), "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception = []<class CharT, class... Args>(std::string_view, std::basic_string_view<CharT>, Args&&...) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.verify.cpp
index 58685f9..92fd195 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.format.verify.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// UNSUPPORTED: libcpp-has-no-incomplete-format
+// TODO FMT This test should not require std::to_chars(floating-point)
+// XFAIL: availability-fp_to_chars-missing
+
#include <format>
#include <utility>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
index 3f7a1fa..6ebc17d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
@@ -10,6 +10,7 @@
#include <concepts>
#include <format>
+#include <tuple>
#include "format.functions.common.h"
@@ -287,18 +288,18 @@
// P2733 Fix handling of empty specifiers in std::format
// addressed this.
- check(SV("(42, (hello, red))"), SV("{}"), input);
+ check(SV("(42, (\"hello\", \"red\"))"), SV("{}"), input);
// *** align-fill & width ***
- check(SV("(42, (hello, red)) "), SV("{:23}"), input);
- check(SV("(42, (hello, red))*****"), SV("{:*<23}"), input);
- check(SV("__(42, (hello, red))___"), SV("{:_^23}"), input);
- check(SV("#####(42, (hello, red))"), SV("{:#>23}"), input);
+ check(SV("(42, (\"hello\", \"red\")) "), SV("{:27}"), input);
+ check(SV("(42, (\"hello\", \"red\"))*****"), SV("{:*<27}"), input);
+ check(SV("__(42, (\"hello\", \"red\"))___"), SV("{:_^27}"), input);
+ check(SV("#####(42, (\"hello\", \"red\"))"), SV("{:#>27}"), input);
- check(SV("(42, (hello, red)) "), SV("{:{}}"), input, 23);
- check(SV("(42, (hello, red))*****"), SV("{:*<{}}"), input, 23);
- check(SV("__(42, (hello, red))___"), SV("{:_^{}}"), input, 23);
- check(SV("#####(42, (hello, red))"), SV("{:#>{}}"), input, 23);
+ check(SV("(42, (\"hello\", \"red\")) "), SV("{:{}}"), input, 27);
+ check(SV("(42, (\"hello\", \"red\"))*****"), SV("{:*<{}}"), input, 27);
+ check(SV("__(42, (\"hello\", \"red\"))___"), SV("{:_^{}}"), input, 27);
+ check(SV("#####(42, (\"hello\", \"red\"))"), SV("{:#>{}}"), input, 27);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
@@ -322,8 +323,8 @@
check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
// *** type ***
- check(SV("__42: (hello, red)___"), SV("{:_^21m}"), input);
- check(SV("__42, (hello, red)___"), SV("{:_^21n}"), input);
+ check(SV("__42: (\"hello\", \"red\")___"), SV("{:_^25m}"), input);
+ check(SV("__42, (\"hello\", \"red\")___"), SV("{:_^25n}"), input);
for (CharT c : SV("aAbBcdeEfFgGopsxX?")) {
check_exception("The format-spec should consume the input or end with a '}'",
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp
index 6853134..fd97e00 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp
@@ -10,9 +10,7 @@
// TODO FMT Evaluate gcc-12 status
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
+// XFAIL: availability-fp_to_chars-missing
// <format>
@@ -30,13 +28,14 @@
#include "test_macros.h"
#include "format.functions.tests.h"
#include "assert_macros.h"
+#include "concat_macros.h"
auto test = []<class CharT, class... Args>(
std::basic_string_view<CharT> expected, std::basic_string_view<CharT> fmt, Args&&... args) {
std::basic_string<CharT> out = std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_REQUIRE(
- out == expected,
- test_concat_message("\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
+ TEST_REQUIRE(out == expected,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected output ", expected, "\nActual output ", out, '\n'));
};
auto test_exception =
@@ -44,20 +43,15 @@
[[maybe_unused]] std::string_view what,
[[maybe_unused]] std::basic_string_view<CharT> fmt,
[[maybe_unused]] Args&&... args) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
- TEST_FAIL(test_concat_message("\nFormat string ", fmt, "\nDidn't throw an exception.\n"));
- } catch ([[maybe_unused]] const std::format_error& e) {
- TEST_LIBCPP_REQUIRE(
- e.what() == what,
- test_concat_message(
- "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
-
- return;
- }
- assert(false);
-#endif
+ TEST_VALIDATE_EXCEPTION(
+ std::format_error,
+ [&]([[maybe_unused]] const std::format_error& e) {
+ TEST_LIBCPP_REQUIRE(
+ e.what() == what,
+ TEST_WRITE_CONCATENATED(
+ "\nFormat string ", fmt, "\nExpected exception ", what, "\nActual exception ", e.what(), '\n'));
+ },
+ TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...)));
};
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.pass.cpp
index 442df5d..d9571e6 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class charT, formattable<charT>... Ts>
@@ -30,12 +26,15 @@
#include <cassert>
#include <concepts>
#include <format>
+#include <iterator>
#include <tuple>
#include <utility>
+#include "assert_macros.h"
+#include "format.functions.common.h"
+#include "make_string.h"
#include "test_format_context.h"
#include "test_macros.h"
-#include "make_string.h"
#define SV(S) MAKE_STRING_VIEW(CharT, S)
@@ -56,11 +55,54 @@
}
template <class CharT>
+void test_assure_parse_is_called(std::basic_string_view<CharT> fmt) {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::pair<parse_call_validator, parse_call_validator> arg;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ std::formatter<decltype(arg), CharT> formatter;
+ std::basic_format_parse_context<CharT> ctx{fmt};
+
+ formatter.parse(ctx);
+ formatter.format(arg, format_ctx);
+}
+
+template <class CharT>
+void test_assure_parse_is_called() {
+ using String = std::basic_string<CharT>;
+ using OutIt = std::back_insert_iterator<String>;
+ using FormatCtxT = std::basic_format_context<OutIt, CharT>;
+ std::pair<parse_call_validator, parse_call_validator> arg;
+
+ String result;
+ OutIt out = std::back_inserter(result);
+ FormatCtxT format_ctx = test_format_context_create<OutIt, CharT>(out, std::make_format_args<FormatCtxT>(arg));
+
+ { // parse not called
+ [[maybe_unused]] const std::formatter<decltype(arg), CharT> formatter;
+ TEST_THROWS_TYPE(parse_call_validator::parse_function_not_called, formatter.format(arg, format_ctx));
+ }
+
+ test_assure_parse_is_called(SV("5"));
+ test_assure_parse_is_called(SV("n"));
+ test_assure_parse_is_called(SV("m"));
+ test_assure_parse_is_called(SV("5n"));
+ test_assure_parse_is_called(SV("5m"));
+}
+
+template <class CharT>
void test() {
test(SV("(1)"), std::tuple<int>{1});
test(SV("(1, 1)"), std::tuple<int, CharT>{1, CharT('1')});
test(SV("(1, 1)"), std::pair<int, CharT>{1, CharT('1')});
- test(SV("(1, 1, 1)"), std::tuple<int, CharT, double>{1, CharT('1'), 1.0});
+ test(SV("(1, 1, true)"), std::tuple<int, CharT, bool>{1, CharT('1'), true});
+
+ test_assure_parse_is_called<CharT>();
}
void test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
index 05c9055..3cb699a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
@@ -11,10 +11,6 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class charT, formattable<charT>... Ts>
@@ -40,23 +36,23 @@
#define SV(S) MAKE_STRING_VIEW(CharT, S)
template <class Arg, class StringViewT>
-constexpr void test(StringViewT fmt) {
+constexpr void test(StringViewT fmt, std::size_t offset) {
using CharT = typename StringViewT::value_type;
auto parse_ctx = std::basic_format_parse_context<CharT>(fmt);
std::formatter<Arg, CharT> formatter;
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - (!fmt.empty() && fmt.back() == '}'));
+ assert(it == fmt.end() - offset);
}
template <class CharT, class Arg>
constexpr void test() {
- test<Arg>(SV(""));
- test<Arg>(SV("42"));
+ test<Arg>(SV(""), 0);
+ test<Arg>(SV("42"), 0);
- test<Arg>(SV("}"));
- test<Arg>(SV("42}"));
+ test<Arg>(SV("}"), 1);
+ test<Arg>(SV("42}"), 1);
}
template <class CharT>
@@ -64,7 +60,7 @@
test<CharT, std::tuple<int>>();
test<CharT, std::tuple<int, CharT>>();
test<CharT, std::pair<int, CharT>>();
- test<CharT, std::tuple<int, CharT, double>>();
+ test<CharT, std::tuple<int, CharT, bool>>();
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_brackets.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_brackets.pass.cpp
index 86c9845..63efdb0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_brackets.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_brackets.pass.cpp
@@ -11,17 +11,13 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// template<class charT, formattable<charT>... Ts>
// struct formatter<pair-or-tuple<Ts...>, charT>
// constexpr void constexpr void set_brackets(basic_string_view<charT> opening,
-// basic_string_view<charT> closing);
+// basic_string_view<charT> closing) noexcept;
// Note this tests the basics of this function. It's tested in more detail in
// the format functions tests.
@@ -38,6 +34,8 @@
constexpr void test() {
std::formatter<Arg, CharT> formatter;
formatter.set_brackets(SV("open"), SV("close"));
+ // Note the SV macro may throw, so can't use it.
+ static_assert(noexcept(formatter.set_brackets(std::basic_string_view<CharT>{}, std::basic_string_view<CharT>{})));
// Note there is no direct way to validate this function modified the object.
}
@@ -47,7 +45,7 @@
test<CharT, std::tuple<int>>();
test<CharT, std::tuple<int, CharT>>();
test<CharT, std::pair<int, CharT>>();
- test<CharT, std::tuple<int, CharT, double>>();
+ test<CharT, std::tuple<int, CharT, bool>>();
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp
index fd2c827..92a77b3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp
@@ -11,17 +11,13 @@
// TODO FMT Fix this test using GCC, it currently times out.
// UNSUPPORTED: gcc-12
-// This test requires the dylib support introduced in D92214.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{.+}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx11.{{.+}}
-
// <format>
// class range_formatter
// template<class charT, formattable<charT>... Ts>
// struct formatter<pair-or-tuple<Ts...>, charT>
-// constexpr void set_separator(basic_string_view<charT> sep);
+// constexpr void set_separator(basic_string_view<charT> sep) noexcept;
// Note this tests the basics of this function. It's tested in more detail in
// the format functions tests.
@@ -38,6 +34,8 @@
constexpr void test() {
std::formatter<Arg, CharT> formatter;
formatter.set_separator(SV("sep"));
+ // Note the SV macro may throw, so can't use it.
+ static_assert(noexcept(formatter.set_separator(std::basic_string_view<CharT>{})));
// Note there is no direct way to validate this function modified the object.
}
@@ -47,7 +45,7 @@
test<CharT, std::tuple<int>>();
test<CharT, std::tuple<int, CharT>>();
test<CharT, std::pair<int, CharT>>();
- test<CharT, std::tuple<int, CharT, double>>();
+ test<CharT, std::tuple<int, CharT, bool>>();
}
constexpr bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
index f3ef086..5940988 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
@@ -23,8 +23,10 @@
LIBCPP_STATIC_ASSERT(std::is_bind_expression<T&>::value == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_bind_expression<const T>::value == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_bind_expression<const T&>::value == Expected, "");
+ static_assert(std::is_base_of<std::integral_constant<bool, Expected>, std::is_bind_expression<T> >::value, "");
#if TEST_STD_VER > 14
+ ASSERT_SAME_TYPE(decltype(std::is_bind_expression_v<T>), const bool);
static_assert(std::is_bind_expression_v<T> == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_bind_expression_v<T&> == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_bind_expression_v<const T> == Expected, "");
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isplace/is_placeholder.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isplace/is_placeholder.pass.cpp
index c020ea4..1e85ca7 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isplace/is_placeholder.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isplace/is_placeholder.pass.cpp
@@ -21,8 +21,13 @@
LIBCPP_STATIC_ASSERT(std::is_placeholder<T&>::value == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_placeholder<const T>::value == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_placeholder<const T&>::value == Expected, "");
+ static_assert(std::is_base_of<std::integral_constant<int, Expected>, std::is_placeholder<T> >::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_base_of<std::integral_constant<int, Expected>, std::is_placeholder<T&> >::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_base_of<std::integral_constant<int, Expected>, std::is_placeholder<const T> >::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_base_of<std::integral_constant<int, Expected>, std::is_placeholder<const T&> >::value, "");
#if TEST_STD_VER > 14
+ ASSERT_SAME_TYPE(decltype(std::is_placeholder_v<T>), const int);
static_assert(std::is_placeholder_v<T> == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_placeholder_v<T&> == Expected, "");
LIBCPP_STATIC_ASSERT(std::is_placeholder_v<const T> == Expected, "");
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
index f7d2499..ac9c97d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
@@ -15,8 +15,6 @@
#include <functional>
-#include "test_macros.h"
-
constexpr int pass(const int n) { return n; }
int simple(int n) { return n; }
@@ -34,8 +32,7 @@
void testNotMoveConst(NotMoveConst) { }
-int main(int, char**)
-{
+void f() {
int n = 1;
const int c = 1;
@@ -45,6 +42,4 @@
auto d = std::bind_front(do_nothing, n); // expected-error {{no matching function for call to 'bind_front'}}
auto t = std::bind_front(testNotMoveConst, NotMoveConst(0)); // expected-error {{no matching function for call to 'bind_front'}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp
deleted file mode 100644
index b040465..0000000
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template <class F, class ...Args>
-// result_of_t<F&&(Args&&...)> invoke(F&&, Args&&...);
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-#if TEST_STD_VER <= 14
-# ifdef __cpp_lib_invoke
-# error Feature test macro should be defined
-# endif
-#else
-# ifndef __cpp_lib_invoke
-# error Feature test macro not defined
-# endif
-# if __cpp_lib_invoke != 201411
-# error __cpp_lib_invoke has the wrong value
-# endif
-#endif
-
-int foo(int) { return 42; }
-
-int main(int, char**) {
-#if defined(__cpp_lib_invoke)
- assert(std::invoke(foo, 101) == 42);
-#endif
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.pass.cpp
new file mode 100644
index 0000000..af4c0ba
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.pass.cpp
@@ -0,0 +1,139 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17, c++20
+
+// <functional>
+
+// template<class R, class F, class... Args>
+// constexpr R invoke_r(F&& f, Args&&... args) // C++23
+// noexcept(is_nothrow_invocable_r_v<R, F, Args...>);
+
+#include <cassert>
+#include <concepts>
+#include <functional>
+#include <type_traits>
+#include <utility> // declval
+
+template <class R, class F, class ...Args>
+concept can_invoke_r = requires {
+ { std::invoke_r<R>(std::declval<F>(), std::declval<Args>()...) } -> std::same_as<R>;
+};
+
+constexpr bool test() {
+ // Make sure basic functionality works (i.e. we actually call the function and
+ // return the right result).
+ {
+ auto f = [](int i) { return i + 3; };
+ assert(std::invoke_r<int>(f, 4) == 7);
+ }
+
+ // Make sure invoke_r is SFINAE-friendly
+ {
+ auto f = [](int) -> char* { return nullptr; };
+ static_assert( can_invoke_r<char*, decltype(f), int>);
+ static_assert( can_invoke_r<void*, decltype(f), int>);
+ static_assert( can_invoke_r<void, decltype(f), int>); // discard return type
+ static_assert(!can_invoke_r<char*, decltype(f), void*>); // wrong argument type
+ static_assert(!can_invoke_r<char*, decltype(f)>); // missing argument
+ static_assert(!can_invoke_r<int*, decltype(f), int>); // incompatible return type
+ static_assert(!can_invoke_r<void, decltype(f), void*>); // discard return type, invalid argument type
+ }
+
+ // Make sure invoke_r has the right noexcept specification
+ {
+ auto f = [](int) noexcept(true) -> char* { return nullptr; };
+ auto g = [](int) noexcept(false) -> char* { return nullptr; };
+ struct ConversionNotNoexcept {
+ constexpr ConversionNotNoexcept(char*) noexcept(false) { }
+ };
+ static_assert( noexcept(std::invoke_r<char*>(f, 0)));
+ static_assert(!noexcept(std::invoke_r<char*>(g, 0))); // function call is not noexcept
+ static_assert(!noexcept(std::invoke_r<ConversionNotNoexcept>(f, 0))); // function call is noexcept, conversion isn't
+ static_assert(!noexcept(std::invoke_r<ConversionNotNoexcept>(g, 0))); // function call and conversion are both not noexcept
+ }
+
+ // Make sure invoke_r works with cv-qualified void return type
+ {
+ auto check = []<class CV_Void> {
+ bool was_called = false;
+ auto f = [&](int) -> char* { was_called = true; return nullptr; };
+ std::invoke_r<CV_Void>(f, 3);
+ assert(was_called);
+ static_assert(std::is_void_v<decltype(std::invoke_r<CV_Void>(f, 3))>);
+ };
+ check.template operator()<void>();
+ check.template operator()<void const>();
+ // volatile void is deprecated, so not testing it
+ // const volatile void is deprecated, so not testing it
+ }
+
+ // Make sure invoke_r forwards its arguments
+ {
+ struct NonCopyable {
+ NonCopyable() = default;
+ NonCopyable(NonCopyable const&) = delete;
+ NonCopyable(NonCopyable&&) = default;
+ };
+ // Forward argument, with void return
+ {
+ bool was_called = false;
+ auto f = [&](NonCopyable) { was_called = true; };
+ std::invoke_r<void>(f, NonCopyable());
+ assert(was_called);
+ }
+ // Forward argument, with non-void return
+ {
+ bool was_called = false;
+ auto f = [&](NonCopyable) -> int { was_called = true; return 0; };
+ std::invoke_r<int>(f, NonCopyable());
+ assert(was_called);
+ }
+ // Forward function object, with void return
+ {
+ struct MoveOnlyVoidFunction {
+ bool& was_called;
+ constexpr void operator()() && { was_called = true; }
+ };
+ bool was_called = false;
+ std::invoke_r<void>(MoveOnlyVoidFunction{was_called});
+ assert(was_called);
+ }
+ // Forward function object, with non-void return
+ {
+ struct MoveOnlyIntFunction {
+ bool& was_called;
+ constexpr int operator()() && { was_called = true; return 0; }
+ };
+ bool was_called = false;
+ std::invoke_r<int>(MoveOnlyIntFunction{was_called});
+ assert(was_called);
+ }
+ }
+
+ // Make sure invoke_r performs an implicit conversion of the result
+ {
+ struct Convertible {
+ constexpr operator int() const { return 42; }
+ };
+ auto f = []() -> Convertible { return Convertible{}; };
+ int result = std::invoke_r<int>(f);
+ assert(result == 42);
+ }
+
+ // Note: We don't test that `std::invoke_r` works with all kinds of callable types here,
+ // since that is extensively tested in the `std::invoke` tests.
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.temporary.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.temporary.verify.cpp
new file mode 100644
index 0000000..2506ea0
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.temporary.verify.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++17, c++20
+
+// <functional>
+
+// template<class R, class F, class... Args>
+// constexpr R invoke_r(F&& f, Args&&... args) // C++23
+// noexcept(is_nothrow_invocable_r_v<R, F, Args...>);
+//
+// Make sure that we diagnose when std::invoke_r is used with a return type that
+// would yield a dangling reference to a temporary.
+
+// TODO: We currently can't diagnose because we don't implement reference_converts_from_temporary.
+// XFAIL: *
+
+#include <functional>
+#include <cassert>
+
+#include "test_macros.h"
+
+void f() {
+ auto func = []() -> int { return 0; };
+ std::invoke_r<int&&>(func); // expected-error {{Returning from invoke_r would bind a temporary object}}
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
index a7665f1..1704eb6 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
@@ -39,7 +39,7 @@
#include "test_iterators.h"
template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
+ std::size_t operator () (T t) const { return static_cast<size_t>(t); }
};
template <typename Iter1, typename Iter2>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
index c70782c..3648be9 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
@@ -39,7 +39,7 @@
#include "test_iterators.h"
template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
+ std::size_t operator () (T t) const { return static_cast<size_t>(t); }
};
struct count_equal
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
index 8ada7ef..d0e6d5f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
@@ -38,7 +38,7 @@
#include "test_iterators.h"
template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
+ std::size_t operator () (T t) const { return static_cast<size_t>(t); }
};
template <typename Iter1, typename Iter2>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
index ec74f53..59b5b30 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
@@ -38,7 +38,7 @@
#include "test_iterators.h"
template <typename T> struct MyHash {
- size_t operator () (T t) const { return static_cast<size_t>(t); }
+ std::size_t operator () (T t) const { return static_cast<size_t>(t); }
};
struct count_equal
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
index 49c8284..b5d4a72 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
@@ -17,12 +17,8 @@
// This signature was removed in C++17
#include <functional>
-#include <cassert>
+#include <memory>
-#include "min_allocator.h"
-
-int main(int, char**)
-{
+void f() {
std::function<int(int)> f(std::allocator_arg, std::allocator<int>()); // expected-error {{no matching constructor for initialization of}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
index 1c54647..733a057 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
@@ -33,6 +33,12 @@
};
#endif
+template <class T>
+struct non_default_test_allocator : test_allocator<T> {
+ non_default_test_allocator() = delete;
+ using test_allocator<T>::test_allocator;
+};
+
test_allocator_statistics alloc_stats;
class DummyClass {};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
index 2353b51..88f8149 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
@@ -17,15 +17,10 @@
// This signature was removed in C++17
#include <functional>
-#include <cassert>
#include <memory>
-#include "test_macros.h"
-
void foo(int) {}
-int main(int, char**)
-{
+void f() {
std::function<void(int)> f(std::allocator_arg, std::allocator<int>(), foo); // expected-error {{no matching constructor for initialization of}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
index 4537e6d..00b3675 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
@@ -22,6 +22,12 @@
#include "count_new.h"
#include "../function_types.h"
+template <class T>
+struct non_default_test_allocator : test_allocator<T> {
+ non_default_test_allocator() = delete;
+ using test_allocator<T>::test_allocator;
+};
+
class DummyClass {};
template <class FuncType, class AllocType>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
index 4263eee..acb42fc 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
@@ -17,15 +17,10 @@
// This signature was removed in C++17
#include <functional>
-#include <cassert>
#include <memory>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
typedef std::function<void(int)> F;
F f1;
F f2(std::allocator_arg, std::allocator<int>(), f1); // expected-error {{no matching constructor for initialization of}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
index 6e9a6c4..d457e21 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
@@ -17,12 +17,8 @@
// This signature was removed in C++17
#include <functional>
-#include <cassert>
+#include <memory>
-#include "min_allocator.h"
-
-int main(int, char**)
-{
+void f() {
std::function<int(int)> f(std::allocator_arg, std::allocator<int>(), nullptr); // expected-error {{no matching constructor for initialization of}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
index b04b958..5fd6c96 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
@@ -16,13 +16,10 @@
//
// This signature was removed in C++17
-#include <cassert>
#include <functional>
#include <memory>
#include <utility>
-#include "test_macros.h"
-
class A
{
int data_[10];
@@ -52,9 +49,7 @@
int g(int) { return 0; }
-int main(int, char**)
-{
+void f() {
std::function<int(int)> f = A();
std::function<int(int)> f2(std::allocator_arg, std::allocator<A>(), std::move(f)); // expected-error {{no matching constructor for initialization of}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
index cc20a01..520e5f0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
@@ -19,15 +19,13 @@
// Make sure we stick to the specification.
#include <functional>
-#include <type_traits>
struct R { };
struct f0 { R operator()() && { return {}; } };
struct f1 { R operator()(int, ...) { return {}; } };
-int main(int, char**) {
+void f() {
std::function f = f0{}; // expected-error{{no viable constructor or deduction guide for deduction of template arguments of 'function'}}
std::function g = f1{}; // expected-error{{no viable constructor or deduction guide for deduction of template arguments of 'function'}}
std::function h = nullptr; // expected-error{{no viable constructor or deduction guide for deduction of template arguments of 'function'}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
index 1f6e153..5e7947f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
@@ -16,17 +16,13 @@
#include <functional>
-#include "test_macros.h"
-
struct Predicate {
typedef int first_argument_type;
typedef int second_argument_type;
bool operator()(first_argument_type, second_argument_type) const { return true; }
};
-int main(int, char**) {
+void test() {
std::binary_negate<Predicate> f((Predicate())); // expected-warning {{'binary_negate<Predicate>' is deprecated}}
(void)f;
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
index e807a1e..4758a17 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
@@ -16,15 +16,11 @@
#include <functional>
-#include "test_macros.h"
-
struct Predicate {
typedef int argument_type;
bool operator()(argument_type) const { return true; }
};
-int main(int, char**) {
+void f() {
std::not1(Predicate()); // expected-warning {{'not1<Predicate>' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
index 7e079f5..e6e1637 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
@@ -16,16 +16,12 @@
#include <functional>
-#include "test_macros.h"
-
struct Predicate {
typedef int first_argument_type;
typedef int second_argument_type;
bool operator()(first_argument_type, second_argument_type) const { return true; }
};
-int main(int, char**) {
+void f() {
std::not2(Predicate()); // expected-warning {{'not2<Predicate>' is deprecated}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
index 1cf1629..70c871f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
@@ -16,16 +16,12 @@
#include <functional>
-#include "test_macros.h"
-
struct Predicate {
typedef int argument_type;
bool operator()(argument_type) const { return true; }
};
-int main(int, char**) {
+void test() {
std::unary_negate<Predicate> f((Predicate())); // expected-warning {{'unary_negate<Predicate>' is deprecated}}
(void)f;
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp
index e5f3b13..f4743e1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp
@@ -10,16 +10,22 @@
// reference_wrapper
-// template <class... ArgTypes>
-// requires Callable<T, ArgTypes&&...>
-// Callable<T, ArgTypes&&...>::result_type
-// operator()(ArgTypes&&... args) const;
+// template <class... ArgTypes>
+// constexpr typename result_of<T&(ArgTypes&&...)>::type // constexpr since C++20
+// operator() (ArgTypes&&...) const
+// noexcept(is_nothrow_invocable_v<T&, ArgTypes...>); // noexcept since C++17
#include <functional>
#include <cassert>
#include "test_macros.h"
+#if TEST_STD_VER > 14
+# define INVOKE_NOEXCEPT(expected, ...) static_assert(noexcept(__VA_ARGS__) == expected)
+#else
+# define INVOKE_NOEXCEPT(expected, ...)
+#endif
+
int count = 0;
// 1 arg, return void
@@ -49,6 +55,7 @@
std::reference_wrapper<void (int)> r1(f_void_1);
int i = 2;
r1(i);
+ INVOKE_NOEXCEPT(false, r1(i));
assert(count == save_count+2);
save_count = count;
}
@@ -58,6 +65,7 @@
std::reference_wrapper<void (*)(int)> r1(fp);
int i = 3;
r1(i);
+ INVOKE_NOEXCEPT(false, r1(i));
assert(count == save_count+3);
save_count = count;
}
@@ -67,6 +75,7 @@
std::reference_wrapper<A_void_1> r1(a0);
int i = 4;
r1(i);
+ INVOKE_NOEXCEPT(false, r1(i));
assert(count == save_count+4);
save_count = count;
}
@@ -76,10 +85,12 @@
std::reference_wrapper<void (A_void_1::*)()> r1(fp);
A_void_1 a;
r1(a);
+ INVOKE_NOEXCEPT(false, r1(a));
assert(count == save_count+1);
save_count = count;
A_void_1* ap = &a;
r1(ap);
+ INVOKE_NOEXCEPT(false, r1(ap));
assert(count == save_count+1);
save_count = count;
}
@@ -89,10 +100,12 @@
std::reference_wrapper<void (A_void_1::*)() const> r1(fp);
A_void_1 a;
r1(a);
+ INVOKE_NOEXCEPT(false, r1(a));
assert(count == save_count+1);
save_count = count;
A_void_1* ap = &a;
r1(ap);
+ INVOKE_NOEXCEPT(false, r1(ap));
assert(count == save_count+1);
save_count = count;
}
@@ -126,6 +139,7 @@
std::reference_wrapper<int (int)> r1(f_int_1);
int i = 2;
assert(r1(i) == 3);
+ INVOKE_NOEXCEPT(false, r1(i));
}
// function pointer
{
@@ -133,6 +147,7 @@
std::reference_wrapper<int (*)(int)> r1(fp);
int i = 3;
assert(r1(i) == 4);
+ INVOKE_NOEXCEPT(false, r1(i));
}
// functor
{
@@ -140,6 +155,7 @@
std::reference_wrapper<A_int_1> r1(a0);
int i = 4;
assert(r1(i) == 3);
+ INVOKE_NOEXCEPT(false, r1(i));
}
// member function pointer
{
@@ -147,8 +163,10 @@
std::reference_wrapper<int (A_int_1::*)()> r1(fp);
A_int_1 a;
assert(r1(a) == 3);
+ INVOKE_NOEXCEPT(false, r1(a));
A_int_1* ap = &a;
assert(r1(ap) == 3);
+ INVOKE_NOEXCEPT(false, r1(ap));
}
// const member function pointer
{
@@ -156,8 +174,10 @@
std::reference_wrapper<int (A_int_1::*)() const> r1(fp);
A_int_1 a;
assert(r1(a) == 4);
+ INVOKE_NOEXCEPT(false, r1(a));
A_int_1* ap = &a;
assert(r1(ap) == 4);
+ INVOKE_NOEXCEPT(false, r1(ap));
}
// member data pointer
{
@@ -165,12 +185,14 @@
std::reference_wrapper<int A_int_1::*> r1(fp);
A_int_1 a;
assert(r1(a) == 5);
+ INVOKE_NOEXCEPT(true, r1(a));
r1(a) = 6;
assert(r1(a) == 6);
A_int_1* ap = &a;
assert(r1(ap) == 6);
r1(ap) = 7;
assert(r1(ap) == 7);
+ INVOKE_NOEXCEPT(true, r1(ap));
}
}
@@ -202,6 +224,7 @@
int i = 2;
int j = 3;
r1(i, j);
+ INVOKE_NOEXCEPT(false, r1(i, j));
assert(count == save_count+5);
save_count = count;
}
@@ -212,6 +235,7 @@
int i = 3;
int j = 4;
r1(i, j);
+ INVOKE_NOEXCEPT(false, r1(i, j));
assert(count == save_count+7);
save_count = count;
}
@@ -222,6 +246,7 @@
int i = 4;
int j = 5;
r1(i, j);
+ INVOKE_NOEXCEPT(false, r1(i, j));
assert(count == save_count+9);
save_count = count;
}
@@ -236,6 +261,7 @@
save_count = count;
A_void_2* ap = &a;
r1(ap, i);
+ INVOKE_NOEXCEPT(false, r1(ap, i));
assert(count == save_count+3);
save_count = count;
}
@@ -246,10 +272,12 @@
A_void_2 a;
int i = 4;
r1(a, i);
+ INVOKE_NOEXCEPT(false, r1(a, i));
assert(count == save_count+4);
save_count = count;
A_void_2* ap = &a;
r1(ap, i);
+ INVOKE_NOEXCEPT(false, r1(ap, i));
assert(count == save_count+4);
save_count = count;
}
@@ -274,7 +302,7 @@
};
void
-testint_2()
+test_int_2()
{
// function
{
@@ -282,6 +310,7 @@
int i = 2;
int j = 3;
assert(r1(i, j) == i+j);
+ INVOKE_NOEXCEPT(false, r1(i, j));
}
// function pointer
{
@@ -290,6 +319,7 @@
int i = 3;
int j = 4;
assert(r1(i, j) == i+j);
+ INVOKE_NOEXCEPT(false, r1(i, j));
}
// functor
{
@@ -298,6 +328,7 @@
int i = 4;
int j = 5;
assert(r1(i, j) == i+j);
+ INVOKE_NOEXCEPT(false, r1(i, j));
}
// member function pointer
{
@@ -306,8 +337,10 @@
A_int_2 a;
int i = 3;
assert(r1(a, i) == i+1);
+ INVOKE_NOEXCEPT(false, r1(a, i));
A_int_2* ap = &a;
assert(r1(ap, i) == i+1);
+ INVOKE_NOEXCEPT(false, r1(ap, i));
}
// const member function pointer
{
@@ -316,17 +349,357 @@
A_int_2 a;
int i = 4;
assert(r1(a, i) == i+2);
+ INVOKE_NOEXCEPT(false, r1(a, i));
A_int_2* ap = &a;
assert(r1(ap, i) == i+2);
+ INVOKE_NOEXCEPT(false, r1(ap, i));
}
}
+#if TEST_STD_VER >= 11
+
+// 1 arg, return void, noexcept
+
+void f_void_1_noexcept(int i) noexcept
+{
+ count += i;
+}
+
+struct A_void_1_noexcept
+{
+ void operator()(int i) noexcept
+ {
+ count += i;
+ }
+
+ void mem1() noexcept {++count;}
+ void mem2() const noexcept {++count;}
+};
+
+void
+test_void_1_noexcept()
+{
+ int save_count = count;
+ // function
+ {
+ std::reference_wrapper<void (int) noexcept> r1(f_void_1_noexcept);
+ int i = 2;
+ r1(i);
+ INVOKE_NOEXCEPT(true, r1(i));
+ assert(count == save_count+2);
+ save_count = count;
+ }
+ // function pointer
+ {
+ void (*fp)(int) noexcept = f_void_1_noexcept;
+ std::reference_wrapper<void (*)(int) noexcept> r1(fp);
+ int i = 3;
+ r1(i);
+ INVOKE_NOEXCEPT(true, r1(i));
+ assert(count == save_count+3);
+ save_count = count;
+ }
+ // functor
+ {
+ A_void_1_noexcept a0;
+ std::reference_wrapper<A_void_1_noexcept> r1(a0);
+ int i = 4;
+ r1(i);
+ INVOKE_NOEXCEPT(true, r1(i));
+ assert(count == save_count+4);
+ save_count = count;
+ }
+ // member function pointer
+ {
+ void (A_void_1_noexcept::*fp)() noexcept = &A_void_1_noexcept::mem1;
+ std::reference_wrapper<void (A_void_1_noexcept::*)() noexcept> r1(fp);
+ A_void_1_noexcept a;
+ r1(a);
+ INVOKE_NOEXCEPT(true, r1(a));
+ assert(count == save_count+1);
+ save_count = count;
+ A_void_1_noexcept* ap = &a;
+ r1(ap);
+ INVOKE_NOEXCEPT(true, r1(ap));
+ assert(count == save_count+1);
+ save_count = count;
+ }
+ // const member function pointer
+ {
+ void (A_void_1_noexcept::*fp)() const noexcept = &A_void_1_noexcept::mem2;
+ std::reference_wrapper<void (A_void_1_noexcept::*)() const noexcept> r1(fp);
+ A_void_1_noexcept a;
+ r1(a);
+ INVOKE_NOEXCEPT(true, r1(a));
+ assert(count == save_count+1);
+ save_count = count;
+ A_void_1_noexcept* ap = &a;
+ r1(ap);
+ INVOKE_NOEXCEPT(true, r1(ap));
+ assert(count == save_count+1);
+ save_count = count;
+ }
+}
+
+// 1 arg, return int, noexcept
+
+int f_int_1_noexcept(int i) noexcept
+{
+ return i + 1;
+}
+
+struct A_int_1_noexcept
+{
+ A_int_1_noexcept() : data_(5) {}
+ int operator()(int i) noexcept
+ {
+ return i - 1;
+ }
+
+ int mem1() noexcept {return 3;}
+ int mem2() const noexcept {return 4;}
+ int data_;
+};
+
+void
+test_int_1_noexcept()
+{
+ // function
+ {
+ std::reference_wrapper<int (int) noexcept> r1(f_int_1_noexcept);
+ int i = 2;
+ assert(r1(i) == 3);
+ INVOKE_NOEXCEPT(true, r1(i));
+ }
+ // function pointer
+ {
+ int (*fp)(int) noexcept = f_int_1_noexcept;
+ std::reference_wrapper<int (*)(int) noexcept> r1(fp);
+ int i = 3;
+ assert(r1(i) == 4);
+ INVOKE_NOEXCEPT(true, r1(i));
+ }
+ // functor
+ {
+ A_int_1_noexcept a0;
+ std::reference_wrapper<A_int_1_noexcept> r1(a0);
+ int i = 4;
+ assert(r1(i) == 3);
+ INVOKE_NOEXCEPT(true, r1(i));
+ }
+ // member function pointer
+ {
+ int (A_int_1_noexcept::*fp)() noexcept = &A_int_1_noexcept::mem1;
+ std::reference_wrapper<int (A_int_1_noexcept::*)() noexcept> r1(fp);
+ A_int_1_noexcept a;
+ assert(r1(a) == 3);
+ INVOKE_NOEXCEPT(true, r1(a));
+ A_int_1_noexcept* ap = &a;
+ assert(r1(ap) == 3);
+ INVOKE_NOEXCEPT(true, r1(ap));
+ }
+ // const member function pointer
+ {
+ int (A_int_1_noexcept::*fp)() const noexcept = &A_int_1_noexcept::mem2;
+ std::reference_wrapper<int (A_int_1_noexcept::*)() const noexcept> r1(fp);
+ A_int_1_noexcept a;
+ assert(r1(a) == 4);
+ INVOKE_NOEXCEPT(true, r1(a));
+ A_int_1_noexcept* ap = &a;
+ assert(r1(ap) == 4);
+ INVOKE_NOEXCEPT(true, r1(ap));
+ }
+ // member data pointer
+ {
+ int A_int_1_noexcept::*fp = &A_int_1_noexcept::data_;
+ std::reference_wrapper<int A_int_1_noexcept::*> r1(fp);
+ A_int_1_noexcept a;
+ assert(r1(a) == 5);
+ INVOKE_NOEXCEPT(true, r1(a));
+ r1(a) = 6;
+ assert(r1(a) == 6);
+ A_int_1_noexcept* ap = &a;
+ assert(r1(ap) == 6);
+ r1(ap) = 7;
+ assert(r1(ap) == 7);
+ INVOKE_NOEXCEPT(true, r1(ap));
+ }
+}
+
+// 2 arg, return void, noexcept
+
+void f_void_2_noexcept(int i, int j) noexcept
+{
+ count += i+j;
+}
+
+struct A_void_2_noexcept
+{
+ void operator()(int i, int j) noexcept
+ {
+ count += i+j;
+ }
+
+ void mem1(int i) noexcept {count += i;}
+ void mem2(int i) const noexcept {count += i;}
+};
+
+void
+test_void_2_noexcept()
+{
+ int save_count = count;
+ // function
+ {
+ std::reference_wrapper<void (int, int) noexcept> r1(f_void_2_noexcept);
+ int i = 2;
+ int j = 3;
+ r1(i, j);
+ INVOKE_NOEXCEPT(true, r1(i, j));
+ assert(count == save_count+5);
+ save_count = count;
+ }
+ // function pointer
+ {
+ void (*fp)(int, int) noexcept = f_void_2_noexcept;
+ std::reference_wrapper<void (*)(int, int) noexcept> r1(fp);
+ int i = 3;
+ int j = 4;
+ r1(i, j);
+ INVOKE_NOEXCEPT(true, r1(i, j));
+ assert(count == save_count+7);
+ save_count = count;
+ }
+ // functor
+ {
+ A_void_2_noexcept a0;
+ std::reference_wrapper<A_void_2_noexcept> r1(a0);
+ int i = 4;
+ int j = 5;
+ r1(i, j);
+ INVOKE_NOEXCEPT(true, r1(i, j));
+ assert(count == save_count+9);
+ save_count = count;
+ }
+ // member function pointer
+ {
+ void (A_void_2_noexcept::*fp)(int) noexcept = &A_void_2_noexcept::mem1;
+ std::reference_wrapper<void (A_void_2_noexcept::*)(int) noexcept> r1(fp);
+ A_void_2_noexcept a;
+ int i = 3;
+ r1(a, i);
+ assert(count == save_count+3);
+ save_count = count;
+ A_void_2_noexcept* ap = &a;
+ r1(ap, i);
+ INVOKE_NOEXCEPT(true, r1(ap, i));
+ assert(count == save_count+3);
+ save_count = count;
+ }
+ // const member function pointer
+ {
+ void (A_void_2_noexcept::*fp)(int) const noexcept = &A_void_2_noexcept::mem2;
+ std::reference_wrapper<void (A_void_2_noexcept::*)(int) const noexcept> r1(fp);
+ A_void_2_noexcept a;
+ int i = 4;
+ r1(a, i);
+ INVOKE_NOEXCEPT(true, r1(a, i));
+ assert(count == save_count+4);
+ save_count = count;
+ A_void_2_noexcept* ap = &a;
+ r1(ap, i);
+ INVOKE_NOEXCEPT(true, r1(ap, i));
+ assert(count == save_count+4);
+ save_count = count;
+ }
+}
+
+// 2 arg, return int, noexcept
+
+int f_int_2_noexcept(int i, int j) noexcept
+{
+ return i+j;
+}
+
+struct A_int_2_noexcept
+{
+ int operator()(int i, int j) noexcept
+ {
+ return i+j;
+ }
+
+ int mem1(int i) noexcept {return i+1;}
+ int mem2(int i) const noexcept {return i+2;}
+};
+
+void
+test_int_2_noexcept()
+{
+ // function
+ {
+ std::reference_wrapper<int (int, int) noexcept> r1(f_int_2_noexcept);
+ int i = 2;
+ int j = 3;
+ assert(r1(i, j) == i+j);
+ INVOKE_NOEXCEPT(true, r1(i, j));
+ }
+ // function pointer
+ {
+ int (*fp)(int, int) noexcept = f_int_2_noexcept;
+ std::reference_wrapper<int (*)(int, int) noexcept> r1(fp);
+ int i = 3;
+ int j = 4;
+ assert(r1(i, j) == i+j);
+ INVOKE_NOEXCEPT(true, r1(i, j));
+ }
+ // functor
+ {
+ A_int_2_noexcept a0;
+ std::reference_wrapper<A_int_2_noexcept> r1(a0);
+ int i = 4;
+ int j = 5;
+ assert(r1(i, j) == i+j);
+ INVOKE_NOEXCEPT(true, r1(i, j));
+ }
+ // member function pointer
+ {
+ int(A_int_2_noexcept::*fp)(int) noexcept = &A_int_2_noexcept::mem1;
+ std::reference_wrapper<int (A_int_2_noexcept::*)(int) noexcept> r1(fp);
+ A_int_2_noexcept a;
+ int i = 3;
+ assert(r1(a, i) == i+1);
+ INVOKE_NOEXCEPT(true, r1(a, i));
+ A_int_2_noexcept* ap = &a;
+ assert(r1(ap, i) == i+1);
+ INVOKE_NOEXCEPT(true, r1(ap, i));
+ }
+ // const member function pointer
+ {
+ int (A_int_2_noexcept::*fp)(int) const noexcept = &A_int_2_noexcept::mem2;
+ std::reference_wrapper<int (A_int_2_noexcept::*)(int) const noexcept> r1(fp);
+ A_int_2_noexcept a;
+ int i = 4;
+ assert(r1(a, i) == i+2);
+ INVOKE_NOEXCEPT(true, r1(a, i));
+ A_int_2_noexcept* ap = &a;
+ assert(r1(ap, i) == i+2);
+ INVOKE_NOEXCEPT(true, r1(ap, i));
+ }
+}
+
+#endif // TEST_STD_VER >= 11
+
int main(int, char**)
{
test_void_1();
test_int_1();
test_void_2();
- testint_2();
+ test_int_2();
+#if TEST_STD_VER >= 11
+ test_void_1_noexcept();
+ test_int_1_noexcept();
+ test_void_2_noexcept();
+ test_int_2_noexcept();
+#endif // TEST_STD_VER >= 11
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
index 2e36b4c..4401bc1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
@@ -19,7 +19,7 @@
int main(int, char**)
{
X x;
- size_t h = std::hash<X>{} ( x );
+ std::size_t h = std::hash<X>{} ( x );
return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
index 6dd14dc..54e9f25 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
@@ -23,7 +23,7 @@
enum class Cardinals { zero, one, two, three, five=5 };
enum class LongColors : short { red, orange, yellow, green, blue, indigo, violet };
enum class ShortColors : long { red, orange, yellow, green, blue, indigo, violet };
-enum class EightBitColors : uint8_t { red, orange, yellow, green, blue, indigo, violet };
+enum class EightBitColors : std::uint8_t { red, orange, yellow, green, blue, indigo, violet };
enum Fruits { apple, pear, grape, mango, cantaloupe };
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
index 2cfed3e..4d6bc17 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -44,7 +44,7 @@
if (small)
{
const std::size_t result = h(t);
- LIBCPP_ASSERT(result == static_cast<size_t>(t));
+ LIBCPP_ASSERT(result == static_cast<std::size_t>(t));
((void)result); // Prevent unused warning
}
}
@@ -72,43 +72,43 @@
// LWG #2119
test<std::ptrdiff_t>();
- test<size_t>();
+ test<std::size_t>();
- test<int8_t>();
- test<int16_t>();
- test<int32_t>();
- test<int64_t>();
+ test<std::int8_t>();
+ test<std::int16_t>();
+ test<std::int32_t>();
+ test<std::int64_t>();
- test<int_fast8_t>();
- test<int_fast16_t>();
- test<int_fast32_t>();
- test<int_fast64_t>();
+ test<std::int_fast8_t>();
+ test<std::int_fast16_t>();
+ test<std::int_fast32_t>();
+ test<std::int_fast64_t>();
- test<int_least8_t>();
- test<int_least16_t>();
- test<int_least32_t>();
- test<int_least64_t>();
+ test<std::int_least8_t>();
+ test<std::int_least16_t>();
+ test<std::int_least32_t>();
+ test<std::int_least64_t>();
- test<intmax_t>();
- test<intptr_t>();
+ test<std::intmax_t>();
+ test<std::intptr_t>();
- test<uint8_t>();
- test<uint16_t>();
- test<uint32_t>();
- test<uint64_t>();
+ test<std::uint8_t>();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
- test<uint_fast8_t>();
- test<uint_fast16_t>();
- test<uint_fast32_t>();
- test<uint_fast64_t>();
+ test<std::uint_fast8_t>();
+ test<std::uint_fast16_t>();
+ test<std::uint_fast32_t>();
+ test<std::uint_fast64_t>();
- test<uint_least8_t>();
- test<uint_least16_t>();
- test<uint_least32_t>();
- test<uint_least64_t>();
+ test<std::uint_least8_t>();
+ test<std::uint_least16_t>();
+ test<std::uint_least32_t>();
+ test<std::uint_least64_t>();
- test<uintmax_t>();
- test<uintptr_t>();
+ test<std::uintmax_t>();
+ test<std::uintptr_t>();
#ifndef TEST_HAS_NO_INT128
test<__int128_t>();
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
index f607da7..10a30dc 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
@@ -27,9 +27,9 @@
{
// Make a couple of sequences
using int3 = std::make_integer_sequence<int, 3>; // generates int: 0,1,2
- using size7 = std::make_integer_sequence<size_t, 7>; // generates size_t: 0,1,2,3,4,5,6
+ using size7 = std::make_integer_sequence<std::size_t, 7>; // generates size_t: 0,1,2,3,4,5,6
using size4 = std::make_index_sequence<4>; // generates size_t: 0,1,2,3
- using size2 = std::index_sequence_for<int, size_t>; // generates size_t: 0,1
+ using size2 = std::index_sequence_for<int, std::size_t>; // generates size_t: 0,1
using intmix = std::integer_sequence<int, 9, 8, 7, 2>; // generates int: 9,8,7,2
using sizemix = std::index_sequence<1, 1, 2, 3, 5>; // generates size_t: 1,1,2,3,5
@@ -37,19 +37,19 @@
static_assert ( std::is_same<int3::value_type, int>::value, "int3 type wrong" );
static_assert ( int3::size () == 3, "int3 size wrong" );
- static_assert ( std::is_same<size7::value_type, size_t>::value, "size7 type wrong" );
+ static_assert ( std::is_same<size7::value_type, std::size_t>::value, "size7 type wrong" );
static_assert ( size7::size () == 7, "size7 size wrong" );
- static_assert ( std::is_same<size4::value_type, size_t>::value, "size4 type wrong" );
+ static_assert ( std::is_same<size4::value_type, std::size_t>::value, "size4 type wrong" );
static_assert ( size4::size () == 4, "size4 size wrong" );
- static_assert ( std::is_same<size2::value_type, size_t>::value, "size2 type wrong" );
+ static_assert ( std::is_same<size2::value_type, std::size_t>::value, "size2 type wrong" );
static_assert ( size2::size () == 2, "size2 size wrong" );
static_assert ( std::is_same<intmix::value_type, int>::value, "intmix type wrong" );
static_assert ( intmix::size () == 4, "intmix size wrong" );
- static_assert ( std::is_same<sizemix::value_type, size_t>::value, "sizemix type wrong" );
+ static_assert ( std::is_same<sizemix::value_type, std::size_t>::value, "sizemix type wrong" );
static_assert ( sizemix::size () == 5, "sizemix size wrong" );
auto tup = std::make_tuple ( 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 );
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.pass.cpp
index e22bec1..c117744 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++03
+
// <memory>
// struct allocator_arg_t { explicit allocator_arg_t() = default; };
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
index c8e2394..ad9a238 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
@@ -27,8 +27,8 @@
using value_type = T;
T t;
- constexpr T* allocate(size_t) { return &t; }
- constexpr void deallocate(T*, size_t) {}
+ constexpr T* allocate(std::size_t) { return &t; }
+ constexpr void deallocate(T*, std::size_t) {}
};
template <class T>
@@ -37,9 +37,9 @@
T t1;
T t2;
- constexpr T* allocate(size_t) { return &t1; }
- constexpr void deallocate(T*, size_t) {}
- constexpr std::allocation_result<T*> allocate_at_least(size_t) {
+ constexpr T* allocate(std::size_t) { return &t1; }
+ constexpr void deallocate(T*, std::size_t) {}
+ constexpr std::allocation_result<T*> allocate_at_least(std::size_t) {
return {&t2, 2};
}
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
index 7e3c41c..adb4d69 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
@@ -17,36 +17,18 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-#include <cassert>
#include <cstddef>
-#include <cstdint>
#include <memory>
-#include "test_macros.h"
-
template <class T>
-struct A
-{
+struct A {
typedef T value_type;
-
- value_type* allocate(std::size_t n)
- {
- assert(n == 12);
- return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xEEADBEEF));
- }
- value_type* allocate(std::size_t n, const void* p)
- {
- assert(n == 11);
- assert(p == 0);
- return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xFEADBEEF));
- }
+ value_type* allocate(std::size_t n);
+ value_type* allocate(std::size_t n, const void* p);
};
-int main(int, char**)
-{
+void f() {
A<int> a;
std::allocator_traits<A<int> >::allocate(a, 10); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
std::allocator_traits<A<int> >::allocate(a, 10, nullptr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
index 301078e..3ede16a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
@@ -36,7 +36,7 @@
{
typedef T value_type;
- TEST_CONSTEXPR_CXX20 size_t max_size() const
+ TEST_CONSTEXPR_CXX20 std::size_t max_size() const
{
return 100;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp
index d9d4fc3..5d200a4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp
@@ -12,6 +12,7 @@
#include <memory>
#include <vector>
+#include <type_traits>
#include "test_macros.h"
@@ -42,7 +43,9 @@
test()
{
static_assert((std::uses_allocator<T, A>::value == Expected), "");
+ static_assert(std::is_base_of<std::integral_constant<bool, Expected>, std::uses_allocator<T, A> >::value, "");
#if TEST_STD_VER > 14
+ ASSERT_SAME_TYPE(decltype(std::uses_allocator_v<T, A>), const bool);
static_assert((std::uses_allocator_v<T, A> == Expected), "");
#endif
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
index 717ba0d..67ee2d8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
@@ -13,7 +13,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-#include <cassert>
#include <cstddef>
#include <memory>
@@ -27,15 +26,13 @@
A a;
TEST_IGNORE_NODISCARD a.allocate(AT::max_size(a) + 1); // just barely too large
TEST_IGNORE_NODISCARD a.allocate(AT::max_size(a) * 2); // significantly too large
- TEST_IGNORE_NODISCARD a.allocate(((size_t) -1) / sizeof(T) + 1); // multiply will overflow
- TEST_IGNORE_NODISCARD a.allocate((size_t) -1); // way too large
+ TEST_IGNORE_NODISCARD a.allocate(((std::size_t) -1) / sizeof(T) + 1); // multiply will overflow
+ TEST_IGNORE_NODISCARD a.allocate((std::size_t) -1); // way too large
return true;
}
-int main(int, char**)
-{
+void f() {
static_assert(test<double>()); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
LIBCPP_STATIC_ASSERT(test<const double>()); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
index 49c7a0b..244e980 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
@@ -26,15 +26,15 @@
#endif
#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+static const std::size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
#else
-static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+static const std::size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
#endif
-static const size_t OverAligned = MaxAligned * 2;
+static const std::size_t OverAligned = MaxAligned * 2;
-template <size_t Align>
+template <std::size_t Align>
struct TEST_ALIGNAS(Align) AlignedType {
char data;
static int constructed;
@@ -42,11 +42,11 @@
AlignedType(AlignedType const&) { ++constructed; }
~AlignedType() { --constructed; }
};
-template <size_t Align>
+template <std::size_t Align>
int AlignedType<Align>::constructed = 0;
-template <size_t Align>
+template <std::size_t Align>
void test_aligned() {
typedef AlignedType<Align> T;
T::constructed = 0;
@@ -78,7 +78,7 @@
}
#if TEST_STD_VER > 17
-template <size_t Align>
+template <std::size_t Align>
constexpr bool test_aligned_constexpr() {
typedef AlignedType<Align> T;
std::allocator<T> a;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
index 3622b7c..1913a0e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
@@ -19,7 +19,7 @@
#include "test_macros.h"
template <typename T>
-void test_max(size_t count)
+void test_max(std::size_t count)
{
std::allocator<T> a;
try {
@@ -38,8 +38,8 @@
A a;
test_max<T> (AT::max_size(a) + 1); // just barely too large
test_max<T> (AT::max_size(a) * 2); // significantly too large
- test_max<T> (((size_t) -1) / sizeof(T) + 1); // multiply will overflow
- test_max<T> ((size_t) -1); // way too large
+ test_max<T> (((std::size_t) -1) / sizeof(T) + 1); // multiply will overflow
+ test_max<T> ((std::size_t) -1); // way too large
}
int main(int, char**)
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
index c19710a..b2b6f51 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
@@ -14,14 +14,8 @@
// T* allocate(size_t n);
#include <memory>
-#include <cassert>
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
std::allocator<int> a;
a.allocate(3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
index 6ac63a4..05c66b0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
@@ -25,14 +25,14 @@
#endif
#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+static const std::size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
#else
-static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+static const std::size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
#endif
-static const size_t OverAligned = MaxAligned * 2;
+static const std::size_t OverAligned = MaxAligned * 2;
-template <size_t Align>
+template <std::size_t Align>
struct alignas(Align) AlignedType {
char data;
static int constructed;
@@ -40,11 +40,11 @@
AlignedType(AlignedType const&) { ++constructed; }
~AlignedType() { --constructed; }
};
-template <size_t Align>
+template <std::size_t Align>
int AlignedType<Align>::constructed = 0;
-template <size_t Align>
+template <std::size_t Align>
void test_aligned() {
typedef AlignedType<Align> T;
T::constructed = 0;
@@ -76,7 +76,7 @@
}
}
-template <size_t Align>
+template <std::size_t Align>
constexpr bool test_aligned_constexpr() {
typedef AlignedType<Align> T;
std::allocator<T> a;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
index 901f047..9174929 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
@@ -27,7 +27,7 @@
#include <memory>
-int main(int, char**) {
+void f() {
{
typedef std::allocator<char>::pointer Pointer; // expected-warning {{'pointer' is deprecated}}
typedef std::allocator<char>::const_pointer ConstPointer; // expected-warning {{'const_pointer' is deprecated}}
@@ -48,5 +48,4 @@
// reference and const_reference are not provided by std::allocator<void>
typedef std::allocator<void>::rebind<int>::other Rebind; // expected-warning {{'rebind<int>' is deprecated}}
}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
index 1d91a02..2fb7a60 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
@@ -26,7 +26,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
#include <memory>
-#include "test_macros.h"
template <typename T>
void check()
@@ -38,10 +37,8 @@
typedef typename std::allocator<T>::template rebind<int>::other ARO; // expected-error 3 {{no member named 'rebind'}}
}
-int main(int, char**)
-{
+void f() {
check<char>();
check<char const>();
check<void>();
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
index 013db78..097f88d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
@@ -33,9 +33,9 @@
// libc++-specific.
LIBCPP_STATIC_ASSERT(std::is_class_v<decltype(std::ranges::uninitialized_copy_n)>);
-static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, size_t, long*, long*>);
+static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, std::size_t, long*, long*>);
struct NotConvertibleFromInt {};
-static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, size_t, NotConvertibleFromInt*,
+static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, std::size_t, NotConvertibleFromInt*,
NotConvertibleFromInt*>);
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
index a905507..0e8846e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
@@ -33,7 +33,7 @@
LIBCPP_STATIC_ASSERT(std::is_class_v<decltype(std::ranges::uninitialized_fill_n)>);
struct NotConvertibleFromInt {};
-static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_fill_n), NotConvertibleFromInt*, size_t, int>);
+static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_fill_n), NotConvertibleFromInt*, std::size_t, int>);
int main(int, char**) {
constexpr int value = 42;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
index 09bdcf4..df79987 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
@@ -34,9 +34,9 @@
// libc++-specific.
LIBCPP_STATIC_ASSERT(std::is_class_v<decltype(std::ranges::uninitialized_move_n)>);
-static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, size_t, long*, long*>);
+static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, std::size_t, long*, long*>);
struct NotConvertibleFromInt {};
-static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, size_t, NotConvertibleFromInt*,
+static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, std::size_t, NotConvertibleFromInt*,
NotConvertibleFromInt*>);
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
index a4f534e..019a6aa 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
@@ -11,7 +11,7 @@
// Aligned allocations are not supported on macOS < 10.13
// Note: use 'unsupported' instead of 'xfail' to ensure
// we won't pass prior to c++17.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
@@ -40,7 +40,7 @@
{
std::pair<A*, std::ptrdiff_t> ip = std::get_temporary_buffer<A>(5);
assert(!(ip.first == nullptr) ^ (ip.second == 0));
- assert(reinterpret_cast<uintptr_t>(ip.first) % alignof(A) == 0);
+ assert(reinterpret_cast<std::uintptr_t>(ip.first) % alignof(A) == 0);
std::return_temporary_buffer(ip.first);
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
index fc1500f..707038e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
@@ -48,8 +48,8 @@
}
template <class T>
-struct std::hash<min_pointer<T, std::integral_constant<size_t, 1>>> {
- size_t operator()(min_pointer<T, std::integral_constant<size_t, 1>> p) const TEST_NOEXCEPT_FALSE {
+struct std::hash<min_pointer<T, std::integral_constant<std::size_t, 1>>> {
+ std::size_t operator()(min_pointer<T, std::integral_constant<size_t, 1>> p) const TEST_NOEXCEPT_FALSE {
if (!p) return 0;
return std::hash<T*>{}(std::addressof(*p));
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
index 35671c4..b5abcb6 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
@@ -55,6 +55,16 @@
}
};
+// https://llvm.org/PR53368
+// Bogus unique_ptr-to-shared_ptr conversions should be forbidden
+#if TEST_STD_VER >= 17
+static_assert( std::is_assignable<std::shared_ptr<A>&, std::unique_ptr<A>&&>::value, "");
+static_assert( std::is_assignable<std::shared_ptr<A[]>&, std::unique_ptr<A[]>&&>::value, "");
+static_assert(!std::is_assignable<std::shared_ptr<A>&, std::unique_ptr<A[]>&&>::value, "");
+static_assert(!std::is_assignable<std::shared_ptr<B[]>&, std::unique_ptr<A[]>&&>::value, "");
+static_assert(!std::is_assignable<std::shared_ptr<B>&, std::unique_ptr<A[]>&&>::value, "");
+#endif
+
int main(int, char**)
{
{
@@ -126,40 +136,6 @@
assert(B::count == 0);
assert(A::count == 0);
-#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
- {
- std::unique_ptr<A[]> ptr(new A[8]);
- A* raw_ptr = ptr.get();
- std::shared_ptr<B> p;
- p = std::move(ptr);
- assert(A::count == 8);
- assert(B::count == 8);
- assert(p.use_count() == 1);
- assert(p.get() == raw_ptr);
- assert(ptr.get() == 0);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-
- {
- std::unique_ptr<A[]> ptr(new A[8]);
- A* raw_ptr = ptr.get();
- std::shared_ptr<A> p;
- p = std::move(ptr);
- assert(A::count == 8);
- assert(p.use_count() == 1);
- assert(p.get() == raw_ptr);
- assert(ptr.get() == 0);
- }
- assert(A::count == 0);
-
- {
- std::unique_ptr<int[]> ptr(new int[8]);
- std::shared_ptr<int> p;
- p = std::move(ptr);
- }
-#endif // _LIBCPP_VERSION
-
#if TEST_STD_VER > 14
{
StatefulArrayDeleter<A> d;
@@ -172,22 +148,6 @@
assert(A::count == 0);
assert(B::count == 0);
-#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
- {
- std::unique_ptr<A[]> ptr(new A[8]);
- A* raw_ptr = ptr.get();
- std::shared_ptr<B[]> p;
- p = std::move(ptr);
- assert(A::count == 8);
- assert(B::count == 8);
- assert(p.use_count() == 1);
- assert(p.get() == raw_ptr);
- assert(ptr.get() == 0);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-#endif // _LIBCPP_VERSION
-
{
std::unique_ptr<A[]> ptr(new A[8]);
A* raw_ptr = ptr.get();
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp
index ef3270e..87b0cbd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp
@@ -10,8 +10,9 @@
// template<class Y> explicit shared_ptr(Y* p);
-#include <memory>
#include <cassert>
+#include <memory>
+#include <type_traits>
#include "test_macros.h"
@@ -26,6 +27,25 @@
int A::count = 0;
+struct Derived : A {};
+
+// https://llvm.org/PR60258
+// Invalid constructor SFINAE for std::shared_ptr's array ctors
+static_assert( std::is_constructible<std::shared_ptr<int>, int*>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<A>, Derived*>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, int*>::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert( std::is_constructible<std::shared_ptr<int[]>, int*>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, int(*)[]>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<int[5]>, int*>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, int(*)[5]>::value, "");
+#endif
+
+// Test explicit
+static_assert(std::is_constructible<std::shared_ptr<int>, int*>::value, "");
+static_assert(!std::is_convertible<int*, std::shared_ptr<int> >::value, "");
+
int main(int, char**)
{
{
@@ -71,11 +91,18 @@
}
{
- assert(A::count == 0);
+ assert(A::count == 0);
std::shared_ptr<const A[]> pA(new A[8]);
assert(pA.use_count() == 1);
assert(A::count == 8);
}
+
+ {
+ assert(A::count == 0);
+ std::shared_ptr<A> pA(new Derived);
+ assert(pA.use_count() == 1);
+ assert(A::count == 1);
+ }
#endif
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
index b3580e2..4631307 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
@@ -60,6 +60,22 @@
void operator()(T *ptr) { delete ptr; }
};
+// https://llvm.org/PR60258
+// Invalid constructor SFINAE for std::shared_ptr's array ctors
+static_assert( std::is_constructible<std::shared_ptr<int>, int*, test_deleter<int> >::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int>, int*, bad_deleter>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<Base>, Derived*, test_deleter<Base> >::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, int*, test_deleter<A> >::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert( std::is_constructible<std::shared_ptr<int[]>, int*, test_deleter<int>>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, int*, bad_deleter>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, int(*)[], test_deleter<int>>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<int[5]>, int*, test_deleter<int>>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, int*, bad_deleter>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, int(*)[5], test_deleter<int>>::value, "");
+#endif
+
int main(int, char**)
{
{
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
index 2fc2528..6d66e05 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
@@ -60,6 +60,23 @@
void operator()(T *ptr) { delete ptr; }
};
+// https://llvm.org/PR60258
+// Invalid constructor SFINAE for std::shared_ptr's array ctors
+static_assert( std::is_constructible<std::shared_ptr<int>, int*, test_deleter<int>, test_allocator<int> >::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int>, int*, bad_deleter, test_allocator<int> >::value, "");
+static_assert( std::is_constructible<std::shared_ptr<Base>, Derived*, test_deleter<Base>, test_allocator<Base> >::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, int*, test_deleter<A>, test_allocator<A> >::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert( std::is_constructible<std::shared_ptr<int[]>, int*, test_deleter<int>, test_allocator<int>>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, int*, bad_deleter, test_allocator<int>>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, int(*)[], test_deleter<int>, test_allocator<int>>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<int[5]>, int*, test_deleter<int>, test_allocator<int>>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, int*, bad_deleter, test_allocator<int>>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, int(*)[5], test_deleter<int>, test_allocator<int>>::value, "");
+#endif
+
+
int main(int, char**)
{
{
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp
index 26f381c..0681730 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp
@@ -74,6 +74,23 @@
}
};
+// https://llvm.org/PR60258
+// Invalid constructor SFINAE for std::shared_ptr's array ctors
+static_assert(!std::is_constructible<std::shared_ptr<int>, const std::shared_ptr<long>&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<B>, const std::shared_ptr<A>&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<const A>, const std::shared_ptr<A>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, const std::shared_ptr<const A>&>::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert(!std::is_constructible<std::shared_ptr<int>, const std::shared_ptr<int[]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int>, const std::shared_ptr<int[5]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, const std::shared_ptr<int>&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<int[]>, const std::shared_ptr<int[5]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, const std::shared_ptr<int>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, const std::shared_ptr<int[]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[7]>, const std::shared_ptr<int[5]>&>::value, "");
+#endif
+
int main(int, char**)
{
static_assert(( std::is_convertible<std::shared_ptr<A>, std::shared_ptr<B> >::value), "");
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
index 84ec26e..10ccbc4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
@@ -55,6 +55,23 @@
int C::count = 0;
+// https://llvm.org/PR60258
+// Invalid constructor SFINAE for std::shared_ptr's array ctors
+static_assert(!std::is_constructible<std::shared_ptr<int>, std::shared_ptr<long>&&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<B>, std::shared_ptr<A>&&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<const A>, std::shared_ptr<A>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, std::shared_ptr<const A>&&>::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert(!std::is_constructible<std::shared_ptr<int>, std::shared_ptr<int[]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int>, std::shared_ptr<int[5]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, std::shared_ptr<int>&&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<int[]>, std::shared_ptr<int[5]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, std::shared_ptr<int>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, std::shared_ptr<int[]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[7]>, std::shared_ptr<int[5]>&&>::value, "");
+#endif
+
int main(int, char**)
{
static_assert(( std::is_convertible<std::shared_ptr<A>, std::shared_ptr<B> >::value), "");
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
index 871aac6..9308bb3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
@@ -90,6 +90,16 @@
int *moves_;
};
+// https://llvm.org/PR53368
+// Bogus unique_ptr-to-shared_ptr conversions should be forbidden
+#if TEST_STD_VER >= 17
+static_assert( std::is_constructible<std::shared_ptr<A>, std::unique_ptr<A>&&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<A[]>, std::unique_ptr<A[]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, std::unique_ptr<A[]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<B[]>, std::unique_ptr<A[]>&&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<B>, std::unique_ptr<A[]>&&>::value, "");
+#endif
+
int main(int, char**)
{
{
@@ -169,36 +179,6 @@
}
assert(A::count == 0);
-#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
- {
- std::unique_ptr<A[]> ptr(new A[8]);
- A* raw_ptr = ptr.get();
- std::shared_ptr<B> p(std::move(ptr));
- assert(A::count == 8);
- assert(B::count == 8);
- assert(p.use_count() == 1);
- assert(p.get() == raw_ptr);
- assert(ptr.get() == 0);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-
- {
- std::unique_ptr<A[]> ptr(new A[8]);
- A* raw_ptr = ptr.get();
- std::shared_ptr<A> p(std::move(ptr));
- assert(A::count == 8);
- assert(p.use_count() == 1);
- assert(p.get() == raw_ptr);
- assert(ptr.get() == 0);
- }
- assert(A::count == 0);
-
- {
- std::unique_ptr<int[]> ptr(new int[8]);
- std::shared_ptr<int> p(std::move(ptr));
- }
-#endif // _LIBCPP_VERSION
#if TEST_STD_VER > 14
{
@@ -211,21 +191,6 @@
assert(A::count == 0);
assert(B::count == 0);
-#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
- {
- std::unique_ptr<A[]> ptr(new A[8]);
- A* raw_ptr = ptr.get();
- std::shared_ptr<B[]> p(std::move(ptr));
- assert(A::count == 8);
- assert(B::count == 8);
- assert(p.use_count() == 1);
- assert(p.get() == raw_ptr);
- assert(ptr.get() == 0);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-#endif // _LIBCPP_VERSION
-
{
std::unique_ptr<A[]> ptr(new A[8]);
A* raw_ptr = ptr.get();
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
index 57d7cc5..f591813 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
@@ -12,8 +12,9 @@
// template<class Y> explicit shared_ptr(const weak_ptr<Y>& r);
-#include <memory>
#include <cassert>
+#include <memory>
+#include <type_traits>
#include "test_macros.h"
@@ -40,6 +41,23 @@
int A::count = 0;
+// https://llvm.org/PR60258
+// Invalid constructor SFINAE for std::shared_ptr's array ctors
+static_assert(!std::is_constructible<std::shared_ptr<int>, const std::weak_ptr<long>&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<B>, const std::weak_ptr<A>&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<const A>, const std::weak_ptr<A>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<A>, const std::weak_ptr<const A>&>::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert(!std::is_constructible<std::shared_ptr<int>, const std::weak_ptr<int[]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int>, const std::weak_ptr<int[5]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[]>, const std::weak_ptr<int>&>::value, "");
+static_assert( std::is_constructible<std::shared_ptr<int[]>, const std::weak_ptr<int[5]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, const std::weak_ptr<int>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[5]>, const std::weak_ptr<int[]>&>::value, "");
+static_assert(!std::is_constructible<std::shared_ptr<int[7]>, const std::weak_ptr<int[5]>&>::value, "");
+#endif
+
int main(int, char**)
{
#ifndef TEST_HAS_NO_EXCEPTIONS
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.bounded.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.bounded.pass.cpp
index 06e767f..79558cf 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.bounded.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.bounded.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// Aligned deallocation isn't provided before macOS 10.14, and some tests for overaligned types
-// below require that feature.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13}}
+// This test requires support for aligned allocation to test overaligned types.
+// XFAIL: availability-aligned_allocation-missing
// <memory>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.unbounded.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.unbounded.pass.cpp
index 5842c47..f6e0f4e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.unbounded.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.array.unbounded.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// Aligned deallocation isn't provided before macOS 10.14, and some tests for overaligned types
-// below require that feature.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13}}
+// This test requires support for aligned allocation to test overaligned types.
+// XFAIL: availability-aligned_allocation-missing
// <memory>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
index 3fa4ce7..4281cc1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
@@ -122,8 +122,8 @@
std::max_align_t y;
};
-void test_aligned(void* p, size_t align) {
- assert(reinterpret_cast<uintptr_t>(p) % align == 0);
+void test_aligned(void* p, std::size_t align) {
+ assert(reinterpret_cast<std::uintptr_t>(p) % align == 0);
}
int main(int, char**) {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp
index e69adee..27ff3cd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp
@@ -94,37 +94,62 @@
testDefaultConstructor<bare_allocator<WithDefaultCtor>>();
}
+struct CountDestructions {
+ int* destructions_;
+ constexpr CountDestructions() = default;
+ constexpr CountDestructions(int* d) : destructions_(d) { }
+ constexpr ~CountDestructions() { ++*destructions_; }
+};
+
void testAllocatorOperationsCalled() {
// single
{
test_allocator_statistics alloc_stats;
+ int destructions = 0;
{
- [[maybe_unused]] std::same_as<std::shared_ptr<int>> auto ptr =
- std::allocate_shared_for_overwrite<int>(test_allocator<void>{&alloc_stats});
+ [[maybe_unused]] std::same_as<std::shared_ptr<CountDestructions>> auto ptr =
+ std::allocate_shared_for_overwrite<CountDestructions>(test_allocator<void>{&alloc_stats});
+ std::construct_at<CountDestructions>(ptr.get(), &destructions);
assert(alloc_stats.alloc_count == 1);
+ assert(alloc_stats.construct_count == 0);
}
+ assert(destructions == 1);
+ assert(alloc_stats.destroy_count == 0);
assert(alloc_stats.alloc_count == 0);
}
// bounded array
{
test_allocator_statistics alloc_stats;
+ int destructions = 0;
{
- [[maybe_unused]] std::same_as<std::shared_ptr<int[2]>> auto ptr =
- std::allocate_shared_for_overwrite<int[2]>(test_allocator<void>{&alloc_stats});
+ [[maybe_unused]] std::same_as<std::shared_ptr<CountDestructions[2]>> auto ptr =
+ std::allocate_shared_for_overwrite<CountDestructions[2]>(test_allocator<void>{&alloc_stats});
+ std::construct_at<CountDestructions>(ptr.get() + 0, &destructions);
+ std::construct_at<CountDestructions>(ptr.get() + 1, &destructions);
assert(alloc_stats.alloc_count == 1);
+ assert(alloc_stats.construct_count == 0);
}
+ assert(destructions == 2);
+ assert(alloc_stats.destroy_count == 0);
assert(alloc_stats.alloc_count == 0);
}
// unbounded array
{
test_allocator_statistics alloc_stats;
+ int destructions = 0;
{
- [[maybe_unused]] std::same_as<std::shared_ptr<int[]>> auto ptr =
- std::allocate_shared_for_overwrite<int[]>(test_allocator<void>{&alloc_stats}, 3);
+ [[maybe_unused]] std::same_as<std::shared_ptr<CountDestructions[]>> auto ptr =
+ std::allocate_shared_for_overwrite<CountDestructions[]>(test_allocator<void>{&alloc_stats}, 3);
+ std::construct_at<CountDestructions>(ptr.get() + 0, &destructions);
+ std::construct_at<CountDestructions>(ptr.get() + 1, &destructions);
+ std::construct_at<CountDestructions>(ptr.get() + 2, &destructions);
assert(alloc_stats.alloc_count == 1);
+ assert(alloc_stats.construct_count == 0);
}
+ assert(destructions == 3);
+ assert(alloc_stats.destroy_count == 0);
assert(alloc_stats.alloc_count == 0);
}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.bounded.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.bounded.pass.cpp
index 20fa508..60fb9bb 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.bounded.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.bounded.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// Aligned deallocation isn't provided before macOS 10.14, and some tests for overaligned types
-// below require that feature.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13}}
+// This test requires support for aligned allocation to test overaligned types.
+// XFAIL: availability-aligned_allocation-missing
// <memory>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.unbounded.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.unbounded.pass.cpp
index 44365b0..01681cd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.unbounded.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.array.unbounded.pass.cpp
@@ -8,9 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// Aligned deallocation isn't provided before macOS 10.14, and some tests for overaligned types
-// below require that feature.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13}}
+// This test requires support for aligned allocation to test overaligned types.
+// XFAIL: availability-aligned_allocation-missing
// <memory>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
index 690a334..21e1786 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
@@ -17,9 +17,9 @@
#include <cassert>
#include <concepts>
+#include <cstdlib>
#include <cstring>
#include <memory>
-#include <stdlib.h>
#include <utility>
#include "test_macros.h"
@@ -40,26 +40,26 @@
// bounded array
static_assert(HasMakeSharedForOverwrite<int[2]>);
-static_assert(!HasMakeSharedForOverwrite<int[2], size_t>);
+static_assert(!HasMakeSharedForOverwrite<int[2], std::size_t>);
static_assert(!HasMakeSharedForOverwrite<int[2], int>);
static_assert(!HasMakeSharedForOverwrite<int[2], int, int>);
static_assert(HasMakeSharedForOverwrite<Foo[2]>);
-static_assert(!HasMakeSharedForOverwrite<Foo[2], size_t>);
+static_assert(!HasMakeSharedForOverwrite<Foo[2], std::size_t>);
static_assert(!HasMakeSharedForOverwrite<Foo[2], int>);
static_assert(!HasMakeSharedForOverwrite<Foo[2], int, int>);
// unbounded array
-static_assert(HasMakeSharedForOverwrite<int[], size_t>);
-static_assert(HasMakeSharedForOverwrite<Foo[], size_t>);
+static_assert(HasMakeSharedForOverwrite<int[], std::size_t>);
+static_assert(HasMakeSharedForOverwrite<Foo[], std::size_t>);
static_assert(!HasMakeSharedForOverwrite<int[]>);
static_assert(!HasMakeSharedForOverwrite<Foo[]>);
-static_assert(!HasMakeSharedForOverwrite<int[], size_t, int>);
-static_assert(!HasMakeSharedForOverwrite<Foo[], size_t, int>);
+static_assert(!HasMakeSharedForOverwrite<int[], std::size_t, int>);
+static_assert(!HasMakeSharedForOverwrite<Foo[], std::size_t, int>);
constexpr char pattern = 0xDE;
void* operator new(std::size_t count) {
- void* ptr = malloc(count);
+ void* ptr = std::malloc(count);
for (std::size_t i = 0; i < count; ++i) {
*(reinterpret_cast<char*>(ptr) + i) = pattern;
}
@@ -68,7 +68,7 @@
void* operator new[](std::size_t count) { return ::operator new(count); }
-void operator delete(void* ptr) noexcept { free(ptr); }
+void operator delete(void* ptr) noexcept { std::free(ptr); }
void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_helper.h b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_helper.h
new file mode 100644
index 0000000..27d7264
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_helper.h
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+#ifndef TEST_STD_SHARED_PTR_RESET_H
+#define TEST_STD_SHARED_PTR_RESET_H
+
+#include <memory>
+#include <type_traits>
+
+template <class T, class... Args>
+std::false_type test_has_reset(...);
+
+template <class T, class... Args>
+typename std::enable_if<std::is_same<decltype(std::declval<T>().reset(std::declval<Args>()...)), void>::value,
+ std::true_type>::type
+test_has_reset(int);
+
+template <class T, class... Args>
+using HasReset = decltype(test_has_reset<T, Args...>(0));
+
+#endif // TEST_STD_SHARED_PTR_RESET_H
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp
index d764e8a..d1d19e4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp
@@ -15,6 +15,7 @@
#include <memory>
#include <cassert>
+#include "reset_helper.h"
#include "test_macros.h"
struct B
@@ -40,6 +41,19 @@
int A::count = 0;
+struct Derived : A {};
+
+static_assert( HasReset<std::shared_ptr<int>, int*>::value, "");
+static_assert( HasReset<std::shared_ptr<A>, Derived*>::value, "");
+static_assert(!HasReset<std::shared_ptr<A>, int*>::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert( HasReset<std::shared_ptr<int[]>, int*>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[]>, int(*)[]>::value, "");
+static_assert( HasReset<std::shared_ptr<int[5]>, int*>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[5]>, int(*)[5]>::value, "");
+#endif
+
int main(int, char**)
{
{
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp
index 14c336b..d0375d3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp
@@ -12,10 +12,11 @@
// template<class Y, class D> void reset(Y* p, D d);
-#include <memory>
#include <cassert>
-#include "test_macros.h"
+#include <memory>
#include "deleter_types.h"
+#include "reset_helper.h"
+#include "test_macros.h"
struct B
{
@@ -40,6 +41,29 @@
int A::count = 0;
+struct bad_ty { };
+struct bad_deleter
+{
+ void operator()(bad_ty) { }
+};
+
+struct Base { };
+struct Derived : Base { };
+
+static_assert( HasReset<std::shared_ptr<int>, int*, test_deleter<int> >::value, "");
+static_assert(!HasReset<std::shared_ptr<int>, int*, bad_deleter>::value, "");
+static_assert( HasReset<std::shared_ptr<Base>, Derived*, test_deleter<Base> >::value, "");
+static_assert(!HasReset<std::shared_ptr<A>, int*, test_deleter<A> >::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert( HasReset<std::shared_ptr<int[]>, int*, test_deleter<int>>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[]>, int*, bad_deleter>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[]>, int(*)[], test_deleter<int>>::value, "");
+static_assert( HasReset<std::shared_ptr<int[5]>, int*, test_deleter<int>>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[5]>, int*, bad_deleter>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[5]>, int(*)[5], test_deleter<int>>::value, "");
+#endif
+
int main(int, char**)
{
{
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp
index a6ea07e..1cd42c0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp
@@ -12,10 +12,11 @@
// template<class Y, class D, class A> void reset(Y* p, D d, A a);
-#include <memory>
#include <cassert>
+#include <memory>
#include "test_macros.h"
#include "deleter_types.h"
+#include "reset_helper.h"
#include "test_allocator.h"
struct B
@@ -41,6 +42,30 @@
int A::count = 0;
+struct bad_ty { };
+
+struct bad_deleter
+{
+ void operator()(bad_ty) { }
+};
+
+struct Base { };
+struct Derived : Base { };
+
+static_assert( HasReset<std::shared_ptr<int>, int*, test_deleter<int>, test_allocator<int> >::value, "");
+static_assert(!HasReset<std::shared_ptr<int>, int*, bad_deleter, test_allocator<int> >::value, "");
+static_assert( HasReset<std::shared_ptr<Base>, Derived*, test_deleter<Base>, test_allocator<Base> >::value, "");
+static_assert(!HasReset<std::shared_ptr<A>, int*, test_deleter<A>, test_allocator<A> >::value, "");
+
+#if TEST_STD_VER >= 17
+static_assert( HasReset<std::shared_ptr<int[]>, int*, test_deleter<int>, test_allocator<int>>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[]>, int*, bad_deleter, test_allocator<int>>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[]>, int(*)[], test_deleter<int>, test_allocator<int>>::value, "");
+static_assert( HasReset<std::shared_ptr<int[5]>, int*, test_deleter<int>, test_allocator<int>>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[5]>, int*, bad_deleter, test_allocator<int>>::value, "");
+static_assert(!HasReset<std::shared_ptr<int[5]>, int(*)[5], test_deleter<int>, test_allocator<int>>::value, "");
+#endif
+
int main(int, char**)
{
test_allocator_statistics alloc_stats;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
index 35d1160..51fe5dc 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
@@ -274,7 +274,7 @@
static_assert(std::is_trivial<T1>::value, "");
static_assert(std::is_standard_layout<T1>::value, "");
#if TEST_STD_VER >= 11
- const size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
+ const std::size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
16 : TEST_ALIGNOF(std::max_align_t);
static_assert(std::alignment_of<T1>::value == alignment, "");
#else
@@ -292,7 +292,7 @@
static_assert(std::is_trivial<T1>::value, "");
static_assert(std::is_standard_layout<T1>::value, "");
#if TEST_STD_VER >= 11
- const size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
+ const std::size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
16 : TEST_ALIGNOF(std::max_align_t);
static_assert(std::alignment_of<T1>::value == alignment, "");
static_assert(sizeof(T1) == 16 + alignment, "");
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
index 643d530..9332865 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
@@ -217,5 +217,3 @@
static_assert(!has_type<std::common_reference<std::pair<int, X2>, std::pair<float, Z2>>>);
static_assert(!has_type<std::common_reference<std::pair<int, X2>, int, X2>>);
#endif
-
-int main(int, char**) { return 0; }
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/objc_support.compile.pass.mm b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/objc_support.compile.pass.mm
new file mode 100644
index 0000000..e1fb119
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.trans/objc_support.compile.pass.mm
@@ -0,0 +1,106 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: objective-c++
+
+// Simple test to check that type traits support Objective-C types.
+
+#include <type_traits>
+#include "test_macros.h"
+
+@interface I;
+@end
+
+// add_pointer
+static_assert(std::is_same<std::add_pointer<id>::type, id*>::value, "");
+static_assert(std::is_same<std::add_pointer<I>::type, I*>::value, "");
+
+// add_lvalue_reference
+static_assert(std::is_same<std::add_lvalue_reference<id>::type, id&>::value, "");
+static_assert(std::is_same<std::add_lvalue_reference<I>::type, I&>::value, "");
+
+// add_rvalue_reference
+static_assert(std::is_same<std::add_rvalue_reference<id>::type, id&&>::value, "");
+static_assert(std::is_same<std::add_rvalue_reference<I>::type, I&&>::value, "");
+
+// decay
+static_assert(std::is_same<std::decay<id>::type, id>::value, "");
+static_assert(std::is_same<std::decay<I>::type, I>::value, "");
+static_assert(std::is_same<std::decay<id(&)[5]>::type, id*>::value, "");
+
+// __libcpp_is_referenceable
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<id>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<id*>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<id&>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<id&&>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<I>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<I*>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<I&>::value, "");
+LIBCPP_STATIC_ASSERT(std::__libcpp_is_referenceable<I&&>::value, "");
+
+// remove_all_extents
+static_assert(std::is_same<std::remove_all_extents<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_all_extents<id[5]>::type, id>::value, "");
+static_assert(std::is_same<std::remove_all_extents<id[5][10]>::type, id>::value, "");
+static_assert(std::is_same<std::remove_all_extents<I>::type, I>::value, "");
+
+// remove_const
+static_assert(std::is_same<std::remove_const<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_const<const id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_const<I>::type, I>::value, "");
+static_assert(std::is_same<std::remove_const<const I>::type, I>::value, "");
+
+// remove_cv
+static_assert(std::is_same<std::remove_cv<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_cv<const volatile id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_cv<I>::type, I>::value, "");
+static_assert(std::is_same<std::remove_cv<const volatile I>::type, I>::value, "");
+
+#if TEST_STD_VER >= 20
+// remove_cvref
+static_assert(std::is_same<std::remove_cvref<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_cvref<const volatile id&>::type, id>::value, "");
+static_assert(std::is_same<std::remove_cvref<const volatile id&&>::type, id>::value, "");
+static_assert(std::is_same<std::remove_cvref<I>::type, I>::value, "");
+static_assert(std::is_same<std::remove_cvref<const volatile I&>::type, I>::value, "");
+static_assert(std::is_same<std::remove_cvref<const volatile I&&>::type, I>::value, "");
+#endif
+
+// remove_extent
+static_assert(std::is_same<std::remove_all_extents<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_all_extents<id[5]>::type, id>::value, "");
+static_assert(std::is_same<std::remove_all_extents<I>::type, I>::value, "");
+
+// remove_pointer
+static_assert(!std::is_same<std::remove_pointer<id>::type, id>::value, "");
+// The result of removing and re-adding pointer to `id` should be still `id`.
+static_assert(std::is_same<std::remove_pointer<id>::type*, id>::value, "");
+static_assert(std::is_same<std::add_pointer<std::remove_pointer<id>::type>::type, id>::value, "");
+static_assert(std::is_same<std::remove_pointer<std::add_pointer<id>::type>::type, id>::value, "");
+
+// remove_reference
+static_assert(std::is_same<std::remove_reference<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_reference<id&>::type, id>::value, "");
+static_assert(std::is_same<std::remove_reference<const id&>::type, const id>::value, "");
+static_assert(std::is_same<std::remove_reference<id&&>::type, id>::value, "");
+static_assert(std::is_same<std::remove_reference<const id&&>::type, const id>::value, "");
+static_assert(std::is_same<std::remove_reference<I>::type, I>::value, "");
+static_assert(std::is_same<std::remove_reference<I&>::type, I>::value, "");
+static_assert(std::is_same<std::remove_reference<const I&>::type, const I>::value, "");
+static_assert(std::is_same<std::remove_reference<I&&>::type, I>::value, "");
+static_assert(std::is_same<std::remove_reference<const I&&>::type, const I>::value, "");
+
+// remove_volatile
+static_assert(std::is_same<std::remove_volatile<id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_volatile<volatile id>::type, id>::value, "");
+static_assert(std::is_same<std::remove_volatile<I>::type, I>::value, "");
+static_assert(std::is_same<std::remove_volatile<volatile I>::type, I>::value, "");
+
+int main(int, char**) {
+ return 0;
+}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
index a1c24b7..6631895 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
@@ -43,8 +43,8 @@
{
test_alignment_of<int&, 4>();
test_alignment_of<Class, 1>();
- test_alignment_of<int*, sizeof(intptr_t)>();
- test_alignment_of<const int*, sizeof(intptr_t)>();
+ test_alignment_of<int*, sizeof(std::intptr_t)>();
+ test_alignment_of<const int*, sizeof(std::intptr_t)>();
test_alignment_of<char[3], 1>();
test_alignment_of<int, 4>();
test_alignment_of<double, TEST_ALIGNOF(double)>();
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
index 7f0439b..ab01a74 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
@@ -7,9 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-bad_optional_access-missing
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
index ad1112f..954f399 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
@@ -7,9 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-bad_optional_access-missing
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
index bb8a319..cb23e03 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
@@ -27,7 +27,7 @@
template <>
struct hash<B> {
- size_t operator()(B const&) noexcept(false) { return 0; }
+ std::size_t operator()(B const&) noexcept(false) { return 0; }
};
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
index a627abd..375820a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
index 11783af..79a8cfc 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
index 3a627a2..17a1e94 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -40,6 +40,8 @@
static bool dtor_called;
Y() = default;
Y(int) { TEST_THROW(6);}
+ Y(const Y&) = default;
+ Y& operator=(const Y&) = default;
~Y() {dtor_called = true;}
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
index 2323acf..0581fa3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -31,6 +31,8 @@
constexpr X(int i, bool& dtor_called) : i_(i), dtor_called_(&dtor_called) {}
constexpr X(std::initializer_list<int> il, bool& dtor_called)
: i_(il.begin()[0]), j_(il.begin()[1]), dtor_called_(&dtor_called) {}
+ X(const X&) = default;
+ X& operator=(const X&) = default;
TEST_CONSTEXPR_CXX20 ~X() {*dtor_called_ = true;}
friend constexpr bool operator==(const X& x, const X& y)
@@ -60,6 +62,8 @@
Z(int i) : i_(i) {}
Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
{ TEST_THROW(6);}
+ Z(const Z&) = default;
+ Z& operator=(const Z&) = default;
~Z() {dtor_called = true;}
friend bool operator==(const Z& x, const Z& y)
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
index e99c872..60e589b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
@@ -8,8 +8,7 @@
//
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
index ddfc491..32334a0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
@@ -8,8 +8,7 @@
//
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
index e4918f7..41b5633 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
index dddd8fa..d301212 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
@@ -8,8 +8,7 @@
//
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
index be127a6..c004427 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
@@ -29,6 +29,8 @@
public:
static bool dtor_called;
X() = default;
+ X(const X&) = default;
+ X& operator=(const X&) = default;
~X() {dtor_called = true;}
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
index 22544c9..112ee21 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
@@ -23,6 +23,9 @@
struct X
{
static bool dtor_called;
+ X() = default;
+ X(const X&) = default;
+ X& operator=(const X&) = default;
~X() {dtor_called = true;}
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
index 8cd9bcb..d4c0e8f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
index 103a631..9349f1d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
index 7402e98..2831816 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
index 2885699..dabeced 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
@@ -9,8 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// <optional>
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// constexpr T& optional<T>::value() &&;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp
index 1bd688b..d6c770f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_optional_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_optional_access-missing && !no-exceptions
// <optional>
//
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
index d125eb0..46506e5 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
@@ -13,13 +13,12 @@
// test op*()
#include <memory>
-#include <cassert>
-int main(int, char**) {
+#include "test_macros.h"
+
+void f() {
std::unique_ptr<int[]> p(new int(3));
const std::unique_ptr<int[]>& cp = p;
TEST_IGNORE_NODISCARD(*p); // expected-error-re {{indirection requires pointer operand ('std::unique_ptr<int{{[ ]*}}[]>' invalid)}}
TEST_IGNORE_NODISCARD(*cp); // expected-error-re {{indirection requires pointer operand ('const std::unique_ptr<int{{[ ]*}}[]>' invalid)}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
index 3d1a5e0..5361c1f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
@@ -13,13 +13,12 @@
// test op->()
#include <memory>
-#include <cassert>
struct V {
int member;
};
-int main(int, char**) {
+void f() {
std::unique_ptr<V[]> p;
std::unique_ptr<V[]> const& cp = p;
@@ -28,6 +27,4 @@
cp->member; // expected-error-re {{member reference type 'const std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}}
// expected-error@-1 {{no member named 'member'}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp
index 5f4fbd4..8011a37 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp
@@ -20,13 +20,13 @@
#include <cassert>
#include <concepts>
#include <cstddef>
+#include <cstdlib>
#include <memory>
-#include <stdlib.h>
constexpr char pattern = 0xDE;
void* operator new(std::size_t count) {
- void* ptr = malloc(count);
+ void* ptr = std::malloc(count);
for (std::size_t i = 0; i < count; ++i) {
*(reinterpret_cast<char*>(ptr) + i) = pattern;
}
@@ -35,7 +35,7 @@
void* operator new[](std::size_t count) { return ::operator new(count); }
-void operator delete(void* ptr) noexcept { free(ptr); }
+void operator delete(void* ptr) noexcept { std::free(ptr); }
void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
index 3f86904..06367fe 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
@@ -42,21 +42,21 @@
// template<class T>
// constexpr unique_ptr<T> make_unique_for_overwrite(size_t n);
-static_assert(HasMakeUniqueForOverwrite<int[], size_t>);
-static_assert(HasMakeUniqueForOverwrite<Foo[], size_t>);
+static_assert(HasMakeUniqueForOverwrite<int[], std::size_t>);
+static_assert(HasMakeUniqueForOverwrite<Foo[], std::size_t>);
static_assert(!HasMakeUniqueForOverwrite<int[]>);
static_assert(!HasMakeUniqueForOverwrite<Foo[]>);
-static_assert(!HasMakeUniqueForOverwrite<int[], size_t, int>);
-static_assert(!HasMakeUniqueForOverwrite<Foo[], size_t, int>);
+static_assert(!HasMakeUniqueForOverwrite<int[], std::size_t, int>);
+static_assert(!HasMakeUniqueForOverwrite<Foo[], std::size_t, int>);
// template<class T, class... Args>
// unspecified make_unique_for_overwrite(Args&&...) = delete;
static_assert(!HasMakeUniqueForOverwrite<int[2]>);
-static_assert(!HasMakeUniqueForOverwrite<int[2], size_t>);
+static_assert(!HasMakeUniqueForOverwrite<int[2], std::size_t>);
static_assert(!HasMakeUniqueForOverwrite<int[2], int>);
static_assert(!HasMakeUniqueForOverwrite<int[2], int, int>);
static_assert(!HasMakeUniqueForOverwrite<Foo[2]>);
-static_assert(!HasMakeUniqueForOverwrite<Foo[2], size_t>);
+static_assert(!HasMakeUniqueForOverwrite<Foo[2], std::size_t>);
static_assert(!HasMakeUniqueForOverwrite<Foo[2], int>);
static_assert(!HasMakeUniqueForOverwrite<Foo[2], int, int>);
@@ -108,13 +108,13 @@
inline static bool customNewCalled = false;
inline static bool customNewArrCalled = false;
- static void* operator new(size_t n) {
+ static void* operator new(std::size_t n) {
customNewCalled = true;
return ::operator new(n);
;
}
- static void* operator new[](size_t n) {
+ static void* operator new[](std::size_t n) {
customNewArrCalled = true;
return ::operator new[](n);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
index 327765b..2a80e2d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
@@ -8,11 +8,12 @@
// bitset(string, pos, n, zero, one); // constexpr since C++23
-#include <bitset>
#include <algorithm> // for 'min' and 'max'
+#include <bitset>
#include <cassert>
#include <stdexcept> // for 'invalid_argument'
#include <string>
+#include <type_traits>
#include "test_macros.h"
@@ -75,7 +76,7 @@
// since it may not be well formed and can cause an error in the
// non-immediate context.
static_assert(!std::is_constructible<std::bitset<3>, Nonsense*>::value, "");
- static_assert(!std::is_constructible<std::bitset<3>, Nonsense*, size_t, Nonsense&, Nonsense&>::value, "");
+ static_assert(!std::is_constructible<std::bitset<3>, Nonsense*, std::size_t, Nonsense&, Nonsense&>::value, "");
}
TEST_CONSTEXPR_CXX23 bool test() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
index 957bb67..e3a2114 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
@@ -43,7 +43,7 @@
TypeID const* arg_types;
};
-template <class Tp, size_t N>
+template <class Tp, std::size_t N>
struct ConstructibleFromTuple<std::array<Tp, N>> {
template <class ...Args>
explicit ConstructibleFromTuple(Args&&... xargs)
@@ -61,12 +61,6 @@
return std::make_from_tuple<Tp>(std::forward<Tuple>(tup)).args == tup;
}
-// Needed by do_forwarding_test() since it compares pairs of different types.
-template <class T1, class T2, class U1, class U2>
-inline bool operator==(const std::pair<T1, T2>& lhs, const std::pair<U1, U2>& rhs) {
- return lhs.first == rhs.first && lhs.second == rhs.second;
-}
-
template <class ...ExpectTypes, class Tuple>
bool do_forwarding_test(Tuple&& tup) {
using RawTuple = std::decay_t<Tuple>;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
index 339361a..df10df8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
@@ -15,7 +15,7 @@
#include <cassert>
#include <utility>
-template <size_t... I>
+template <std::size_t... I>
constexpr void CreateTuple(std::index_sequence<I...>) {
std::tuple<decltype(I)...> tuple(I...);
assert(std::get<0>(tuple) == 0);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
index 2236b6d..c92ad4b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
@@ -24,7 +24,7 @@
#include "test_macros.h"
-template <class T, std::size_t N, class U, size_t idx>
+template <class T, std::size_t N, class U, std::size_t idx>
void test()
{
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.ranges.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.ranges.pass.cpp
index 36f7745..716acbf 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.ranges.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.ranges.pass.cpp
@@ -22,8 +22,8 @@
class SizedSentinel {
public:
constexpr bool operator==(int*) const;
- friend constexpr ptrdiff_t operator-(const SizedSentinel&, int*);
- friend constexpr ptrdiff_t operator-(int*, const SizedSentinel&);
+ friend constexpr std::ptrdiff_t operator-(const SizedSentinel&, int*);
+ friend constexpr std::ptrdiff_t operator-(int*, const SizedSentinel&);
};
static_assert(std::sized_sentinel_for<SizedSentinel, Iterator>);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
index 458e4ff..243f162 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
@@ -23,7 +23,7 @@
#include "test_macros.h"
-template <class T, std::size_t N, class U, size_t idx>
+template <class T, std::size_t N, class U, std::size_t idx>
void test()
{
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
index cde87e1..a2a65e0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
@@ -27,7 +27,7 @@
template <>
struct std::tuple_size<Dummy1> {
public:
- static size_t value;
+ static std::size_t value;
};
template <>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
index c0ec0ca..cb8d3e7 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
@@ -22,7 +22,7 @@
#include "test_macros.h"
-template <class T, size_t Size = sizeof(std::tuple_size<T>)>
+template <class T, std::size_t Size = sizeof(std::tuple_size<T>)>
constexpr bool is_complete(int) { static_assert(Size > 0, ""); return true; }
template <class> constexpr bool is_complete(long) { return false; }
template <class T> constexpr bool is_complete() { return is_complete<T>(0); }
@@ -31,7 +31,7 @@
struct Dummy2 {};
namespace std {
-template <> struct tuple_size<Dummy1> : public integral_constant<size_t, 0> {};
+template <> struct tuple_size<Dummy1> : public integral_constant<std::size_t, 0> {};
}
template <class T>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
index eb87e0b..937d47a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
@@ -113,7 +113,7 @@
int x;
};
-template <size_t N>
+template <std::size_t N>
int get(Test const&) { static_assert(N == 0, ""); return -1; }
template <>
@@ -130,7 +130,7 @@
template <>
struct std::tuple_size<Test> {
public:
- static const size_t value = 1;
+ static const std::size_t value = 1;
};
void test_after_tuple_size_specialization() {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
index 02a02c9..df1f270 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
index 1f58228..fd69706 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
index f291489..2a99883 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
index 96742fc..6f10c60 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
index ece7594..f6063b0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
@@ -29,7 +28,7 @@
#include "test_macros.h"
#include "test_std_memory_resource.h"
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
void testForSizeAndAlign() {
struct T {
alignas(Align) std::byte buf[S];
@@ -48,7 +47,7 @@
}
#ifndef TEST_HAS_NO_EXCEPTIONS
-template <size_t S>
+template <std::size_t S>
void testAllocForSizeThrows() {
struct T {
std::byte buf[S];
@@ -60,8 +59,8 @@
Alloc a(&R);
// Test that allocating exactly the max size does not throw.
- size_t maxSize = Traits::max_size(a);
- size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
+ std::size_t maxSize = Traits::max_size(a);
+ std::size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
if (maxSize != sizeTypeMax) {
// Test that allocating size_t(~0) throws bad alloc.
try {
@@ -71,7 +70,7 @@
}
// Test that allocating even one more than the max size does throw.
- size_t overSize = maxSize + 1;
+ std::size_t overSize = maxSize + 1;
try {
(void)a.allocate(overSize);
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
index a4db295..4bddd56 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
@@ -27,8 +26,8 @@
template <class T>
void test() {
- size_t last_size = 0;
- size_t last_alignment = 0;
+ std::size_t last_size = 0;
+ std::size_t last_alignment = 0;
TrackingMemRes resource(&last_size, &last_alignment);
std::pmr::polymorphic_allocator<T> allocator(&resource);
@@ -38,10 +37,10 @@
auto ptr = static_cast<char*>(allocation);
std::fill(ptr, ptr + 13, '0');
assert(last_size == 13);
- assert(last_alignment == alignof(max_align_t));
+ assert(last_alignment == alignof(std::max_align_t));
allocator.deallocate_bytes(allocation, 13);
assert(last_size == 13);
- assert(last_alignment == alignof(max_align_t));
+ assert(last_alignment == alignof(std::max_align_t));
}
{
void* allocation = allocator.allocate_bytes(13, 64);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
index b061afb..ddf6541 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
@@ -27,8 +26,8 @@
template <class T>
void test() {
- size_t last_size = 0;
- size_t last_alignment = 0;
+ std::size_t last_size = 0;
+ std::size_t last_alignment = 0;
TrackingMemRes resource(&last_size, &last_alignment);
std::pmr::polymorphic_allocator<T> allocator(&resource);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
index 4f56b74..eafbc46 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -26,20 +25,38 @@
int constructed = 0;
+template <int>
struct default_constructible {
default_constructible() : x(42) { ++constructed; }
int x = 0;
};
int main(int, char**) {
- // pair<default_constructible, default_constructible> as T()
+ // pair<default_constructible, default_constructible>
{
- typedef default_constructible T;
+ typedef default_constructible<0> T;
typedef std::pair<T, T> P;
typedef std::pmr::polymorphic_allocator<void> A;
alignas(P) char buffer[sizeof(P)];
P* ptr = reinterpret_cast<P*>(buffer);
A a;
+ constructed = 0;
+ a.construct(ptr);
+ assert(constructed == 2);
+ assert(ptr->first.x == 42);
+ assert(ptr->second.x == 42);
+ }
+
+ // pair<default_constructible<0>, default_constructible<1>>
+ {
+ typedef default_constructible<0> T;
+ typedef default_constructible<1> U;
+ typedef std::pair<T, U> P;
+ typedef std::pmr::polymorphic_allocator<void> A;
+ alignas(P) char buffer[sizeof(P)];
+ P* ptr = reinterpret_cast<P*>(buffer);
+ A a;
+ constructed = 0;
a.construct(ptr);
assert(constructed == 2);
assert(ptr->first.x == 42);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
index 522f962..ed2f541 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
index 00bb667..a8ac09c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
index 6d39a7e..e8a3c62 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
index 619c554..d75a94a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
index 30b4374..88e1632 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
index 8b79616..15c4629 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
index e7884c9..3ad5d44 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
@@ -26,7 +25,7 @@
#include "test_macros.h"
#include "test_std_memory_resource.h"
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
void testForSizeAndAlign() {
struct T {
alignas(Align) std::byte buf[S];
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/default_type.compile.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/default_type.compile.pass.cpp
index 67d552c..0e5175c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/default_type.compile.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/default_type.compile.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
index 985dda2..0c2605b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
index 463a815..c4fcca1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
@@ -27,8 +26,8 @@
template <class T>
void test() {
- size_t last_size = 0;
- size_t last_alignment = 0;
+ std::size_t last_size = 0;
+ std::size_t last_alignment = 0;
TrackingMemRes resource(&last_size, &last_alignment);
std::pmr::polymorphic_allocator<T> allocator(&resource);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
index a6ed1f5..dc5f6ef 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
index 5b2551e..b3aa171 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
index d0b9eab..e78d988 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
@@ -9,23 +9,24 @@
#ifndef TRACKING_MEM_RES_H
#define TRACKING_MEM_RES_H
+#include <cstddef>
#include <memory_resource>
class TrackingMemRes : public std::pmr::memory_resource {
public:
- TrackingMemRes(size_t* last_size, size_t* last_alginment) : last_size_(last_size), last_alginment_(last_alginment) {}
+ TrackingMemRes(std::size_t* last_size, size_t* last_alginment) : last_size_(last_size), last_alginment_(last_alginment) {}
private:
- size_t* last_size_;
- size_t* last_alginment_;
- void* do_allocate(size_t size, size_t alignment) override {
+ std::size_t* last_size_;
+ std::size_t* last_alginment_;
+ void* do_allocate(std::size_t size, size_t alignment) override {
*last_size_ = size;
*last_alginment_ = alignment;
return std::pmr::new_delete_resource()->allocate(size, alignment);
}
- void do_deallocate(void* ptr, size_t size, size_t alignment) override {
+ void do_deallocate(void* ptr, std::size_t size, size_t alignment) override {
*last_size_ = size;
*last_alginment_ = alignment;
std::pmr::new_delete_resource()->deallocate(ptr, size, alignment);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
index 3fe8a45..c7f4946 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <deque>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
index e96b21e..8eacb29 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <deque>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
index 2a09354..7947ec4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <forward_list>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
index 9adabd4..32a5838 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <list>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
index fef4cb2..069cb44 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <list>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
index 0ba22fc..2633c8f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <map>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
index 452f922..07a2219 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <map>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
index 1414108..b2284ef 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-localization
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <regex>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
index 7b0a6aa..ec0db98 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <set>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
index b63677e..7dae37c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <set>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
index 9ae4b67..71f4de8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <string>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
index 2f70806..22c4369 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <string>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
index 0f660b5..b0dab6e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
index 8117539..2fd284f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <unordered_map>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
index 7f34fb2..3f70709 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
index 36cd6bf..a8f0c48 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <unordered_set>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
index 0caca07..df7543d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <vector>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
index 330f4be..037a25b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <vector>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
index 1c46f5b..66f23b5 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
index bd8b8e9..898cbf0 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -22,12 +21,12 @@
#include "test_macros.h"
class assert_on_compare : public std::pmr::memory_resource {
- void* do_allocate(size_t, size_t) override {
+ void* do_allocate(std::size_t, size_t) override {
assert(false);
return nullptr;
}
- void do_deallocate(void*, size_t, size_t) override { assert(false); }
+ void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
index fdaa398..aa2be02 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -24,12 +23,12 @@
#include "test_macros.h"
struct assert_on_compare : public std::pmr::memory_resource {
- void* do_allocate(size_t, size_t) override {
+ void* do_allocate(std::size_t, size_t) override {
assert(false);
return nullptr;
}
- void do_deallocate(void*, size_t, size_t) override { assert(false); }
+ void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
index ff93f82..463b0ee 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
index 8adebb7..f1c75e6 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
index f75198a..f7312fe 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
index d8f8dac..9ef6275 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-exceptions
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -27,9 +26,9 @@
explicit repointable_resource(std::pmr::memory_resource* res) : which(res) {}
private:
- void* do_allocate(size_t size, size_t align) override { return which->allocate(size, align); }
+ void* do_allocate(std::size_t size, size_t align) override { return which->allocate(size, align); }
- void do_deallocate(void* p, size_t size, size_t align) override { return which->deallocate(p, size, align); }
+ void do_deallocate(void* p, std::size_t size, size_t align) override { return which->deallocate(p, size, align); }
bool do_is_equal(std::pmr::memory_resource const& rhs) const noexcept override { return which->is_equal(rhs); }
};
@@ -49,7 +48,7 @@
assert(res != buffer);
assert(globalMemCounter.checkNewCalledEq(1));
assert(globalMemCounter.checkDeleteCalledEq(0));
- const size_t last_new_size = globalMemCounter.last_new_size;
+ const std::size_t last_new_size = globalMemCounter.last_new_size;
upstream.which = std::pmr::null_memory_resource();
try {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
index 446030e..549b487 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
index acd4ca5..6d2760b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
index ffe17d1..dbac78d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -30,7 +29,7 @@
std::pmr::memory_resource& r1 = mono1;
assert(globalMemCounter.checkNewCalledEq(0));
- size_t next_buffer_size = 100;
+ std::size_t next_buffer_size = 100;
void* ret = r1.allocate(10, 1);
assert(ret != nullptr);
assert(globalMemCounter.checkNewCalledEq(1));
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
index d2b8454..6e894a4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -25,7 +24,7 @@
auto mono1 = std::pmr::monotonic_buffer_resource(1024, std::pmr::new_delete_resource());
std::pmr::memory_resource& r1 = mono1;
- constexpr size_t big_alignment = 8 * alignof(std::max_align_t);
+ constexpr std::size_t big_alignment = 8 * alignof(std::max_align_t);
static_assert(big_alignment > 4);
void* ret = r1.allocate(2048, big_alignment);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
index 15b3336..8adc667 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -20,7 +19,7 @@
#include "count_new.h"
#include "test_macros.h"
-void test(size_t initial_buffer_size) {
+void test(std::size_t initial_buffer_size) {
globalMemCounter.reset();
auto mono1 = std::pmr::monotonic_buffer_resource(initial_buffer_size, std::pmr::new_delete_resource());
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
index 4263310..cae2545 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -19,12 +18,12 @@
#include <cstddef> // size_t
struct assert_on_compare : public std::pmr::memory_resource {
- void* do_allocate(size_t, size_t) override {
+ void* do_allocate(std::size_t, size_t) override {
assert(false);
return nullptr;
}
- void do_deallocate(void*, size_t, size_t) override { assert(false); }
+ void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
index 323bc43..fad096d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
index 6597768..9cb5de8 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
index 72a4bd9..a314f5f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
index 39f0a11..5ef7e3d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -23,12 +22,12 @@
#include "count_new.h"
class assert_on_compare : public std::pmr::memory_resource {
- void* do_allocate(size_t, size_t) override {
+ void* do_allocate(std::size_t, size_t) override {
assert(false);
return nullptr;
}
- void do_deallocate(void*, size_t, size_t) override { assert(false); }
+ void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
assert(false);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
index fb90553..2e0dbf1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
index d962d7f..08b8be4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -21,9 +20,9 @@
#include "count_new.h"
#include "test_macros.h"
-bool is_aligned_to(void* p, size_t alignment) {
+bool is_aligned_to(void* p, std::size_t alignment) {
void* p2 = p;
- size_t space = 1;
+ std::size_t space = 1;
void* result = std::align(alignment, 1, p2, space);
return (result == p);
}
@@ -34,7 +33,7 @@
std::pmr::synchronized_pool_resource sync1(opts, std::pmr::new_delete_resource());
std::pmr::memory_resource& r1 = sync1;
- constexpr size_t big_alignment = 8 * alignof(std::max_align_t);
+ constexpr std::size_t big_alignment = 8 * alignof(std::max_align_t);
static_assert(big_alignment > 4);
assert(globalMemCounter.checkNewCalledEq(0));
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
index 1fbc2b0..f52f07c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -21,9 +20,9 @@
#include "count_new.h"
#include "test_macros.h"
-static bool is_aligned_to(void* p, size_t alignment) {
+static bool is_aligned_to(void* p, std::size_t alignment) {
void* p2 = p;
- size_t space = 1;
+ std::size_t space = 1;
void* result = std::align(alignment, 1, p2, space);
return (result == p);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
index 26101d8..3742c37 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: no-exceptions
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -22,9 +21,9 @@
#include <vector>
struct allocation_record {
- size_t bytes;
- size_t align;
- explicit allocation_record(size_t b, size_t a) : bytes(b), align(a) {}
+ std::size_t bytes;
+ std::size_t align;
+ explicit allocation_record(std::size_t b, size_t a) : bytes(b), align(a) {}
bool operator==(const allocation_record& rhs) const { return (bytes == rhs.bytes) && (align == rhs.align); }
bool operator<(const allocation_record& rhs) const {
if (bytes != rhs.bytes)
@@ -34,12 +33,12 @@
};
class test_resource : public std::pmr::memory_resource {
- void* do_allocate(size_t bytes, size_t align) override {
+ void* do_allocate(std::size_t bytes, size_t align) override {
void* result = std::pmr::new_delete_resource()->allocate(bytes, align);
successful_allocations.emplace_back(bytes, align);
return result;
}
- void do_deallocate(void* p, size_t bytes, size_t align) override {
+ void do_deallocate(void* p, std::size_t bytes, size_t align) override {
deallocations.emplace_back(bytes, align);
return std::pmr::new_delete_resource()->deallocate(p, bytes, align);
}
@@ -70,7 +69,7 @@
tr.deallocations.end()));
}
-template <size_t Bytes, size_t Align>
+template <std::size_t Bytes, size_t Align>
auto foo() {
return [=](auto& mr) {
void* p = mr.allocate(Bytes, Align);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
index 69d4f2e..730fb09 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
index a316750..c4b501c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -21,9 +20,9 @@
#include "count_new.h"
#include "test_macros.h"
-bool is_aligned_to(void* p, size_t alignment) {
+bool is_aligned_to(void* p, std::size_t alignment) {
void* p2 = p;
- size_t space = 1;
+ std::size_t space = 1;
void* result = std::align(alignment, 1, p2, space);
return (result == p);
}
@@ -34,7 +33,7 @@
auto unsync1 = std::pmr::unsynchronized_pool_resource(opts, std::pmr::new_delete_resource());
std::pmr::memory_resource& r1 = unsync1;
- constexpr size_t big_alignment = 8 * alignof(std::max_align_t);
+ constexpr std::size_t big_alignment = 8 * alignof(std::max_align_t);
static_assert(big_alignment > 4);
assert(globalMemCounter.checkNewCalledEq(0));
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
index 72087e8..cb6fc18 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -21,9 +20,9 @@
#include "count_new.h"
#include "test_macros.h"
-static bool is_aligned_to(void* p, size_t alignment) {
+static bool is_aligned_to(void* p, std::size_t alignment) {
void* p2 = p;
- size_t space = 1;
+ std::size_t space = 1;
void* result = std::align(alignment, 1, p2, space);
return (result == p);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
index 2863cba..5cbe3a4 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: no-exceptions
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// <memory_resource>
@@ -22,9 +21,9 @@
#include <vector>
struct allocation_record {
- size_t bytes;
- size_t align;
- explicit allocation_record(size_t b, size_t a) : bytes(b), align(a) {}
+ std::size_t bytes;
+ std::size_t align;
+ explicit allocation_record(std::size_t b, size_t a) : bytes(b), align(a) {}
bool operator==(const allocation_record& rhs) const { return (bytes == rhs.bytes) && (align == rhs.align); }
bool operator<(const allocation_record& rhs) const {
if (bytes != rhs.bytes)
@@ -34,12 +33,12 @@
};
class test_resource : public std::pmr::memory_resource {
- void* do_allocate(size_t bytes, size_t align) override {
+ void* do_allocate(std::size_t bytes, size_t align) override {
void* result = std::pmr::new_delete_resource()->allocate(bytes, align);
successful_allocations.emplace_back(bytes, align);
return result;
}
- void do_deallocate(void* p, size_t bytes, size_t align) override {
+ void do_deallocate(void* p, std::size_t bytes, size_t align) override {
deallocations.emplace_back(bytes, align);
return std::pmr::new_delete_resource()->deallocate(p, bytes, align);
}
@@ -70,7 +69,7 @@
tr.deallocations.end()));
}
-template <size_t Bytes, size_t Align>
+template <std::size_t Bytes, size_t Align>
auto foo() {
return [=](auto& mr) {
void* p = mr.allocate(Bytes, Align);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
index d31cfda..9d60e35 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
index 5444d62..c8b9f1c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
index dde8faa..6008baf 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
index 1f1b2f8..f9ffa90 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
index 4e2bd7c..0dd35f5 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
index 0844294..7034ceb 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.verify.cpp
similarity index 71%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.verify.cpp
index e186514..a920c69 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.verify.cpp
@@ -15,17 +15,9 @@
// get(const pair<T1, T2>&);
#include <utility>
-#include <cassert>
-int main(int, char**)
-{
- {
- typedef std::pair<int, short> P;
- const P p(3, 4);
- assert(std::get<0>(p) == 3);
- assert(std::get<1>(p) == 4);
- std::get<0>(p) = 5;
- }
-
- return 0;
+void f() {
+ typedef std::pair<int, short> P;
+ const P p(3, 4);
+ std::get<0>(p) = 5; // expected-error {{cannot assign to return value}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.compile.fail.cpp
deleted file mode 100644
index 931ec31..0000000
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.compile.fail.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-#include <utility>
-#include <complex>
-
-#include <cassert>
-
-int main(int, char**)
-{
- typedef std::complex<float> cf;
- auto t1 = std::make_pair<int, double> ( 42, 3.4 );
- assert (( std::get<cf>(t1) == cf {1,2} )); // no such type
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.verify.cpp
similarity index 70%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.verify.cpp
index 559ff3c..cae19a1 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.verify.cpp
@@ -7,16 +7,12 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
+
#include <utility>
#include <complex>
-#include <cassert>
-
-int main(int, char**)
-{
- typedef std::unique_ptr<int> upint;
- std::pair<upint, int> t(upint(new int(4)), 23);
- upint p = std::get<upint>(t);
-
- return 0;
+void f() {
+ typedef std::complex<float> cf;
+ auto t1 = std::make_pair<int, double>(42, 3.4);
+ (void)std::get<cf>(t1); // expected-error {{no matching function for call to 'get'}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.compile.fail.cpp
deleted file mode 100644
index aa6eaaa..0000000
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.compile.fail.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-#include <utility>
-#include <complex>
-
-#include <cassert>
-
-int main(int, char**)
-{
- typedef std::complex<float> cf;
- auto t1 = std::make_pair<int, int> ( 42, 43 );
- assert ( std::get<int>(t1) == 42 ); // two ints
-
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.verify.cpp
similarity index 70%
copy from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp
copy to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.verify.cpp
index 559ff3c..1ba894b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.verify.cpp
@@ -7,16 +7,12 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
+
#include <utility>
#include <complex>
-#include <cassert>
-
-int main(int, char**)
-{
- typedef std::unique_ptr<int> upint;
- std::pair<upint, int> t(upint(new int(4)), 23);
- upint p = std::get<upint>(t);
-
- return 0;
+void f() {
+ typedef std::complex<float> cf;
+ auto t1 = std::make_pair<int, int> ( 42, 43 );
+ (void)std::get<int>(t1); // expected-error {{call to 'get' is ambiguous}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.verify.cpp
similarity index 66%
copy from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp
copy to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.verify.cpp
index 559ff3c..d2d9b67 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.compile.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.verify.cpp
@@ -7,16 +7,12 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
+
+#include <memory>
#include <utility>
-#include <complex>
-#include <cassert>
-
-int main(int, char**)
-{
- typedef std::unique_ptr<int> upint;
- std::pair<upint, int> t(upint(new int(4)), 23);
- upint p = std::get<upint>(t);
-
- return 0;
+void f() {
+ typedef std::unique_ptr<int> Ptr;
+ std::pair<Ptr, int> t(Ptr(new int(4)), 23);
+ Ptr p = std::get<Ptr>(t); // expected-error {{call to implicitly-deleted copy constructor of 'Ptr'}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.verify.cpp
similarity index 70%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.verify.cpp
index a9a16a4..4f70e9f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.astuple/tuple_element.verify.cpp
@@ -14,10 +14,7 @@
#include <utility>
-int main(int, char**)
-{
- typedef std::pair<int, short> T;
- std::tuple_element<2, T>::type foo; // expected-error@*:* {{Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
-
- return 0;
+void f() {
+ typedef std::pair<int, short> T;
+ std::tuple_element<2, T>::type foo; // expected-error@*:* {{Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
similarity index 94%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
index 3a7af09..a72a99d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
@@ -17,9 +17,4 @@
#include <utility>
-
std::piecewise_construct_t f() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.U_V.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.U_V.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.const_first_const_second.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.const_first_const_second.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second_cxx03.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.const_first_const_second_cxx03.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second_cxx03.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.const_first_const_second_cxx03.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.copy.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.copy.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.copy_move_trivial.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.copy_move_trivial.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default.explicit.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
similarity index 96%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default.explicit.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
index 2c4106f..50a4eb7 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default.explicit.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
@@ -32,7 +32,3 @@
std::pair<ExplicitlyDefaultConstructible, ImplicitlyDefaultConstructible> test2() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
std::pair<ExplicitlyDefaultConstructible, ExplicitlyDefaultConstructible> test3() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
std::pair<ImplicitlyDefaultConstructible, ImplicitlyDefaultConstructible> test4() { return {}; }
-
-int main(int, char**) {
- return 0;
-}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default-sfinae.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.sfinae_LWG2367.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/default-sfinae.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.sfinae_LWG2367.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.move.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.move.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.not_constexpr_cxx11.verify.cpp
similarity index 85%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.not_constexpr_cxx11.verify.cpp
index 88d0f96..e994734 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.not_constexpr_cxx11.verify.cpp
@@ -16,19 +16,18 @@
#include <cassert>
struct ExplicitT {
- constexpr explicit ExplicitT(int x) : value(x) {}
- constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {}
- int value;
+ constexpr explicit ExplicitT(int x) : value(x) {}
+ constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {}
+ int value;
};
struct ImplicitT {
- constexpr ImplicitT(int x) : value(x) {}
- constexpr ImplicitT(ImplicitT const& o) : value(o.value) {}
- int value;
+ constexpr ImplicitT(int x) : value(x) {}
+ constexpr ImplicitT(ImplicitT const& o) : value(o.value) {}
+ int value;
};
-int main(int, char**)
-{
+void f() {
{
using P = std::pair<int, int>;
constexpr int x = 42;
@@ -53,6 +52,4 @@
constexpr P U_V = {42, 101}; // expected-error {{must be initialized by a constant expression}}
constexpr P pair_U_V = other; // expected-error {{must be initialized by a constant expression}}
}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor_pair_U_V_const_move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_move.pass.cpp
similarity index 99%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor_pair_U_V_const_move.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_move.pass.cpp
index d3fbf6f..63f409b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor_pair_U_V_const_move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_move.pass.cpp
@@ -11,6 +11,7 @@
// <utility>
// template <class T1, class T2> struct pair
+
// template <class U1, class U2>
// constexpr explicit(see below) pair(const pair<U1, U2>&& p);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V_cxx03.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_ref.cxx03.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V_cxx03.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_ref.cxx03.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_ref.pass.cpp
similarity index 98%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_ref.pass.cpp
index 42ddb4e..3a1e9ad 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_const_ref.pass.cpp
@@ -12,7 +12,8 @@
// template <class T1, class T2> struct pair
-// template <class U, class V> EXPLICIT constexpr pair(const pair<U, V>& p);
+// template <class U, class V>
+// explicit(see-below) constexpr pair(const pair<U, V>& p);
#include <utility>
#include <cassert>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_move.pass.cpp
similarity index 98%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_move.pass.cpp
index 593df90..3b2d093 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_move.pass.cpp
@@ -12,7 +12,8 @@
// template <class T1, class T2> struct pair
-// template <class U, class V> pair(pair<U, V>&& p);
+// template <class U, class V>
+// constexpr explicit(see below) pair(pair<U, V>&& p);
#include <utility>
#include <memory>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor_pair_U_V_ref.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_ref.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor_pair_U_V_ref.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_U_V_ref.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.piecewise_construct.pass.cpp
similarity index 100%
rename from third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp
rename to third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.piecewise_construct.pass.cpp
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
index 76c1509..76f9771 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
@@ -10,12 +10,12 @@
// template <class T1, class T2> struct pair
-// template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&);
+// template <class T1, class T2, class U1, class U2> bool operator==(const pair<T1,T2>&, const pair<U1,U2>&);
+// template <class T1, class T2, class U1, class U2> bool operator!=(const pair<T1,T2>&, const pair<U1,U2>&);
+// template <class T1, class T2, class U1, class U2> bool operator< (const pair<T1,T2>&, const pair<U1,U2>&);
+// template <class T1, class T2, class U1, class U2> bool operator> (const pair<T1,T2>&, const pair<U1,U2>&);
+// template <class T1, class T2, class U1, class U2> bool operator>=(const pair<T1,T2>&, const pair<U1,U2>&);
+// template <class T1, class T2, class U1, class U2> bool operator<=(const pair<T1,T2>&, const pair<U1,U2>&);
#include <utility>
#include <cassert>
@@ -25,6 +25,18 @@
int main(int, char**)
{
{
+ typedef std::pair<int, short> P1;
+ typedef std::pair<long, long> P2;
+ P1 p1(3, static_cast<short>(4));
+ P2 p2(3, 4);
+ assert( (p1 == p2));
+ assert(!(p1 != p2));
+ assert(!(p1 < p2));
+ assert( (p1 <= p2));
+ assert(!(p1 > p2));
+ assert( (p1 >= p2));
+ }
+ {
typedef std::pair<int, short> P;
P p1(3, static_cast<short>(4));
P p2(3, static_cast<short>(4));
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/three_way_comparison.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/three_way_comparison.pass.cpp
index bd93d3f..5aa6efb 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/three_way_comparison.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/pairs/pairs.spec/three_way_comparison.pass.cpp
@@ -10,7 +10,9 @@
// template <class T1, class T2> struct pair
-// template <class T1, class T2> bool operator<=>(const pair<T1,T2>&, const pair<T1,T2>&);
+// template <class T1, class T2, class U1, class U2>
+// constexpr common_comparison_category_t<synth-three-way-result<T1, U1>,synth-three-way-result<T2, U2>>
+// operator<=>(const pair<T1,T2>&, const pair<U1,U2>&);
// UNSUPPORTED: c++03, c++11, c++14, c++17
@@ -19,15 +21,38 @@
#include <limits>
#include <type_traits> // std::is_constant_evaluated
#include <utility>
+#include <string>
#include "test_macros.h"
-template<class T> concept HasEqual = requires(T t) { t == t; };
-template<class T> concept HasLess = requires(T t) { t < t; };
-template<class T> concept HasSpaceship = requires(T t) { t <=> t; };
+template <class T>
+concept HasEqual = requires(T t) { t == t; };
+template <class T>
+concept HasLess = requires(T t) { t < t; };
+template <class T, class U = T>
+concept HasSpaceship = requires(T t, U u) { t <=> u; };
constexpr bool test() {
{
+ // Pairs of different types should compare with strong ordering.
+ using P1 = std::pair<int, int>;
+ using P2 = std::pair<long long, long long>;
+ ASSERT_SAME_TYPE(decltype(P1() <=> P2()), std::strong_ordering);
+ assert((P1(1, 1) <=> P2(1, 2)) == std::strong_ordering::less);
+ assert((P1(2, 1) <=> P2(1, 2)) == std::strong_ordering::greater);
+ assert((P1(0, 0) <=> P2(0, 0)) == std::strong_ordering::equal);
+ }
+ {
+ // Pairs of different types should compare with partial ordering.
+ using P1 = std::pair<int, int>;
+ using P2 = std::pair<double, double>;
+ ASSERT_SAME_TYPE(decltype(P1() <=> P2()), std::partial_ordering);
+ assert((P1(1, 1) <=> P2(1.0, 2.0)) == std::partial_ordering::less);
+ assert((P1(2, 1) <=> P2(1.0, 2.0)) == std::partial_ordering::greater);
+ assert((P1(0, 0) <=> P2(0.0, 0.0)) == std::partial_ordering::equivalent);
+ }
+ { static_assert(!HasSpaceship<std::pair<int, int>, std::pair<std::string, int>>); }
+ {
// Pairs of types that both have strong ordering should compare with strong ordering.
using P = std::pair<int, int>;
ASSERT_SAME_TYPE(decltype(P() <=> P()), std::strong_ordering);
@@ -50,7 +75,7 @@
}
{
// Pairs of int (strongly ordered) and double (partially ordered) should compare with partial ordering.
- using P = std::pair<int, double>;
+ using P = std::pair<int, double>;
constexpr double nan = std::numeric_limits<double>::quiet_NaN();
ASSERT_SAME_TYPE(decltype(P() <=> P()), std::partial_ordering);
assert((P(1, 1.0) <=> P(1, 2.0)) == std::partial_ordering::less);
@@ -62,7 +87,7 @@
assert((P(1, nan) <=> P(1, nan)) == std::partial_ordering::unordered);
}
{
- using P = std::pair<double, int>;
+ using P = std::pair<double, int>;
constexpr double nan = std::numeric_limits<double>::quiet_NaN();
ASSERT_SAME_TYPE(decltype(P() <=> P()), std::partial_ordering);
assert((P(2.0, 1) <=> P(1.0, 2)) == std::partial_ordering::greater);
@@ -93,12 +118,12 @@
#endif
{
{
- using P = std::pair<int, double>;
+ using P = std::pair<int, double>;
constexpr double nan = std::numeric_limits<double>::quiet_NaN();
assert((P(1, 2.0) <=> P(1, nan)) == std::partial_ordering::unordered);
}
{
- using P = std::pair<double, int>;
+ using P = std::pair<double, int>;
constexpr double nan = std::numeric_limits<double>::quiet_NaN();
assert((P(1.0, 1) <=> P(nan, 2)) == std::partial_ordering::unordered);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
index 8a1afe2..79a9f5f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
@@ -61,12 +61,12 @@
{
using T1 = std::in_place_index_t<0>;
using T2 = std::in_place_index_t<1>;
- using T3 = std::in_place_index_t<static_cast<size_t>(-1)>;
+ using T3 = std::in_place_index_t<static_cast<std::size_t>(-1)>;
static_assert(!std::is_same<T1, T2>::value && !std::is_same<T1, T3>::value);
static_assert(!std::is_same<T2, T3>::value);
static_assert(check_tag<T1>(std::in_place_index<0>));
static_assert(check_tag<T2>(std::in_place_index<1>));
- static_assert(check_tag<T3>(std::in_place_index<static_cast<size_t>(-1)>));
+ static_assert(check_tag<T3>(std::in_place_index<static_cast<std::size_t>(-1)>));
}
return 0;
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp
index 1efa3d9..847cee2 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp
@@ -47,14 +47,14 @@
}
constexpr void test_in_range() {
- constexpr Tuple<uint8_t> utup8;
- constexpr Tuple<int8_t> stup8;
- assert(!std::in_range<int8_t>(utup8.max));
+ constexpr Tuple<std::uint8_t> utup8;
+ constexpr Tuple<std::int8_t> stup8;
+ assert(!std::in_range<std::int8_t>(utup8.max));
assert(std::in_range<short>(utup8.max));
- assert(!std::in_range<uint8_t>(stup8.min));
- assert(std::in_range<int8_t>(utup8.mid));
- assert(!std::in_range<uint8_t>(stup8.mid));
- assert(!std::in_range<uint8_t>(-1));
+ assert(!std::in_range<std::uint8_t>(stup8.min));
+ assert(std::in_range<std::int8_t>(utup8.mid));
+ assert(!std::in_range<std::uint8_t>(stup8.mid));
+ assert(!std::in_range<std::uint8_t>(-1));
}
template <class... Ts>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
index b1b2881..9236d6e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
@@ -16,9 +16,7 @@
struct S {};
-int main(int, char**) {
+void f() {
std::to_underlying(125); // expected-error {{no matching function for call}}
std::to_underlying(S{}); // expected-error {{no matching function for call}}
-
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp
index cfb3606..f571c1e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// REQUIRES: has-unix-headers
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
// Make sure that reaching std::unreachable() with assertions enabled triggers an assertion.
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
index 0db55cf..aa9c925 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
@@ -7,9 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: availability-bad_variant_access-missing
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
index b18d94f..47aed9a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -234,7 +233,7 @@
#endif
}
-template <std::size_t I> using Idx = std::integral_constant<size_t, I>;
+template <std::size_t I> using Idx = std::integral_constant<std::size_t, I>;
void test_throws_for_all_value_categories() {
#ifndef TEST_HAS_NO_EXCEPTIONS
@@ -245,8 +244,8 @@
V v1(42l);
const V &cv1 = v1;
assert(v1.index() == 1);
- std::integral_constant<size_t, 0> zero;
- std::integral_constant<size_t, 1> one;
+ std::integral_constant<std::size_t, 0> zero;
+ std::integral_constant<std::size_t, 1> one;
auto test = [](auto idx, auto &&v) {
using Idx = decltype(idx);
try {
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
index dc938d1..734fe1b 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
index 770bbec..f472144 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
@@ -24,7 +24,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
namespace std {
template <> struct hash<::MakeEmptyT> {
- size_t operator()(const ::MakeEmptyT &) const {
+ std::size_t operator()(const ::MakeEmptyT &) const {
assert(false);
return 0;
}
@@ -127,7 +127,7 @@
template <>
struct hash<B> {
- size_t operator()(B const&) const {
+ std::size_t operator()(B const&) const {
return 0;
}
};
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
index f5e1e3d..be1a0c9 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
@@ -27,7 +27,7 @@
#include "test_macros.h"
#include "variant_test_helpers.h"
-template <class V, size_t I, class E> void test() {
+template <class V, std::size_t I, class E> void test() {
static_assert(
std::is_same_v<typename std::variant_alternative<I, V>::type, E>, "");
static_assert(
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
index 8c5b70d..1ee0c32 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
@@ -23,7 +23,7 @@
#include "test_macros.h"
-template <class V, size_t E> void test() {
+template <class V, std::size_t E> void test() {
static_assert(std::variant_size<V>::value == E, "");
static_assert(std::variant_size<const V>::value == E, "");
static_assert(std::variant_size<volatile V>::value == E, "");
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
index bc52c9c..7596855 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
index 46ccd44..a0b6684 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -322,7 +321,7 @@
#endif // TEST_HAS_NO_EXCEPTIONS
}
-template <typename T> struct Result { size_t index; T value; };
+template <typename T> struct Result { std::size_t index; T value; };
void test_copy_assignment_same_index() {
{
@@ -550,7 +549,7 @@
}
}
-template <size_t NewIdx, class ValueType>
+template <std::size_t NewIdx, class ValueType>
constexpr bool test_constexpr_assign_imp(
std::variant<long, void*, int>&& v, ValueType&& new_value)
{
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
index 775330f..f62b5be 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -291,7 +290,7 @@
#endif // TEST_HAS_NO_EXCEPTIONS
}
-template <typename T> struct Result { size_t index; T value; };
+template <typename T> struct Result { std::size_t index; T value; };
void test_move_assignment_same_index() {
{
@@ -464,7 +463,7 @@
}
}
-template <size_t NewIdx, class ValueType>
+template <std::size_t NewIdx, class ValueType>
constexpr bool test_constexpr_assign_imp(
std::variant<long, void*, int>&& v, ValueType&& new_value)
{
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
index 015c64c..108f92d 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
index b328ba4..3a487c7 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -223,7 +222,7 @@
#endif // TEST_HAS_NO_EXCEPTIONS
}
-template <size_t Idx>
+template <std::size_t Idx>
constexpr bool test_constexpr_copy_ctor_imp(std::variant<long, void*, const int> const& v) {
auto v2 = v;
return v2.index() == v.index() &&
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
index 17b7242..fd490a3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
index 4e96e59..56d8585 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
index 25eed24..8b4c0cd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
index 2635b5c..dbee67f 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp
index 3571505..ea05d90 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
index 1c67f02..308461e 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -161,7 +160,7 @@
}
template <typename T>
-struct Result { size_t index; T value; };
+struct Result { std::size_t index; T value; };
void test_move_ctor_basic() {
{
@@ -292,7 +291,7 @@
#endif // TEST_HAS_NO_EXCEPTIONS
}
-template <size_t Idx>
+template <std::size_t Idx>
constexpr bool test_constexpr_ctor_imp(std::variant<long, void*, const int> const& v) {
auto copy = v;
auto v2 = std::move(copy);
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
index 37a1849..21a02c2 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -28,18 +27,18 @@
#include "test_macros.h"
#include "variant_test_helpers.h"
-template <class Var, size_t I, class... Args>
+template <class Var, std::size_t I, class... Args>
constexpr auto test_emplace_exists_imp(int) -> decltype(
std::declval<Var>().template emplace<I>(std::declval<Args>()...), true) {
return true;
}
-template <class, size_t, class...>
+template <class, std::size_t, class...>
constexpr auto test_emplace_exists_imp(long) -> bool {
return false;
}
-template <class Var, size_t I, class... Args> constexpr bool emplace_exists() {
+template <class Var, std::size_t I, class... Args> constexpr bool emplace_exists() {
return test_emplace_exists_imp<Var, I, Args...>(0);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
index 3080678..efbe6bd 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
@@ -39,18 +38,18 @@
: size(il.size()), value(v) {}
};
-template <class Var, size_t I, class... Args>
+template <class Var, std::size_t I, class... Args>
constexpr auto test_emplace_exists_imp(int) -> decltype(
std::declval<Var>().template emplace<I>(std::declval<Args>()...), true) {
return true;
}
-template <class, size_t, class...>
+template <class, std::size_t, class...>
constexpr auto test_emplace_exists_imp(long) -> bool {
return false;
}
-template <class Var, size_t I, class... Args> constexpr bool emplace_exists() {
+template <class Var, std::size_t I, class... Args> constexpr bool emplace_exists() {
return test_emplace_exists_imp<Var, I, Args...>(0);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
index eae070e..45c891c 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
index af30e73..9f96166 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
index b61f508..64e65ac 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/robust_against_adl.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/robust_against_adl.pass.cpp
index 4a651f3..f4b191a 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/robust_against_adl.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/robust_against_adl.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
// template <class Visitor, class... Variants>
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
index 1e29073..26a44b3 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
// template <class Visitor, class... Variants>
@@ -347,7 +346,7 @@
struct MyVariant : std::variant<short, long, float> {};
namespace std {
-template <size_t Index>
+template <std::size_t Index>
void get(const MyVariant&) {
assert(false);
}
diff --git a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit_return_type.pass.cpp b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit_return_type.pass.cpp
index 3ae5372..3a848ca 100644
--- a/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit_return_type.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/std/utilities/variant/variant.visit/visit_return_type.pass.cpp
@@ -8,8 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// Throwing bad_variant_access is supported starting in macosx10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+// XFAIL: availability-bad_variant_access-missing && !no-exceptions
// <variant>
// template <class R, class Visitor, class... Variants>
diff --git a/third_party/llvm-project/libcxx/test/support/Counter.h b/third_party/llvm-project/libcxx/test/support/Counter.h
index 8dbdaeb..6a51cc9 100644
--- a/third_party/llvm-project/libcxx/test/support/Counter.h
+++ b/third_party/llvm-project/libcxx/test/support/Counter.h
@@ -25,7 +25,7 @@
Counter& operator=(const Counter& rhs) { data_ = rhs.data_; return *this; }
#if TEST_STD_VER >= 11
Counter(Counter&& rhs) : data_(std::move(rhs.data_)) { ++gConstructed; }
- Counter& operator=(Counter&& rhs) { ++gConstructed; data_ = std::move(rhs.data_); return *this; }
+ Counter& operator=(Counter&& rhs) { data_ = std::move(rhs.data_); return *this; }
#endif
~Counter() { --gConstructed; }
diff --git a/third_party/llvm-project/libcxx/test/support/MoveOnly.h b/third_party/llvm-project/libcxx/test/support/MoveOnly.h
index 0795cac..4a1c1fc 100644
--- a/third_party/llvm-project/libcxx/test/support/MoveOnly.h
+++ b/third_party/llvm-project/libcxx/test/support/MoveOnly.h
@@ -61,8 +61,8 @@
struct std::hash<MoveOnly>
{
typedef MoveOnly argument_type;
- typedef size_t result_type;
- TEST_CONSTEXPR size_t operator()(const MoveOnly& x) const {return static_cast<size_t>(x.get());}
+ typedef std::size_t result_type;
+ TEST_CONSTEXPR std::size_t operator()(const MoveOnly& x) const {return static_cast<size_t>(x.get());}
};
#endif // MOVEONLY_H
diff --git a/third_party/llvm-project/libcxx/test/support/allocators.h b/third_party/llvm-project/libcxx/test/support/allocators.h
index 0cdaacb..2b987ad 100644
--- a/third_party/llvm-project/libcxx/test/support/allocators.h
+++ b/third_party/llvm-project/libcxx/test/support/allocators.h
@@ -9,6 +9,7 @@
#ifndef ALLOCATORS_H
#define ALLOCATORS_H
+#include <cstddef>
#include <memory>
#include <new>
#include <type_traits>
diff --git a/third_party/llvm-project/libcxx/test/support/almost_satisfies_types.h b/third_party/llvm-project/libcxx/test/support/almost_satisfies_types.h
index 2a60c22..296dbb6 100644
--- a/third_party/llvm-project/libcxx/test/support/almost_satisfies_types.h
+++ b/third_party/llvm-project/libcxx/test/support/almost_satisfies_types.h
@@ -25,17 +25,22 @@
static_assert(std::ranges::contiguous_range<UncheckedRange<int*, int*>>);
// almost an input_iterator
-class InputIteratorNotDerivedFrom {
+template <class T>
+class InputIteratorNotDerivedFromGeneric {
public:
using difference_type = long;
- using value_type = int;
+ using value_type = T;
using iterator_category = void;
- InputIteratorNotDerivedFrom& operator++();
+ InputIteratorNotDerivedFromGeneric& operator++();
void operator++(int);
- const int& operator*() const;
+ const T& operator*() const;
};
+using InputIteratorNotDerivedFrom = InputIteratorNotDerivedFromGeneric<int>;
+
+template <class T>
+using InputRangeNotDerivedFromGeneric = UncheckedRange<InputIteratorNotDerivedFromGeneric<T>>;
using InputRangeNotDerivedFrom = UncheckedRange<InputIteratorNotDerivedFrom>;
static_assert(std::input_or_output_iterator<InputIteratorNotDerivedFrom>);
@@ -58,7 +63,7 @@
static_assert(std::input_or_output_iterator<InputIteratorNotIndirectlyReadable>);
static_assert(!std::indirectly_readable<InputIteratorNotIndirectlyReadable>);
static_assert(!std::input_iterator<InputIteratorNotIndirectlyReadable>);
-static_assert(!std::ranges::input_range<InputIteratorNotIndirectlyReadable>);
+static_assert(!std::ranges::input_range<InputRangeNotIndirectlyReadable>);
class InputIteratorNotInputOrOutputIterator {
public:
@@ -287,7 +292,7 @@
static_assert(!std::input_or_output_iterator<OutputIteratorNotInputOrOutputIterator>);
static_assert(std::indirectly_writable<OutputIteratorNotInputOrOutputIterator, int>);
static_assert(!std::output_iterator<OutputIteratorNotInputOrOutputIterator, int>);
-static_assert(!std::ranges::input_range<OutputRangeNotInputOrOutputIterator>);
+static_assert(!std::ranges::output_range<OutputRangeNotInputOrOutputIterator, int>);
class OutputIteratorNotIndirectlyWritable {
public:
@@ -389,6 +394,39 @@
using RandomAccessRangeBadIndex = UncheckedRange<RandomAccessIteratorBadIndex>;
+class RandomAccessIteratorBadDifferenceType {
+ using Self = RandomAccessIteratorBadDifferenceType;
+
+public:
+ using value_type = int;
+ // Deliberately use a non-integer `difference_type`
+ using difference_type = double;
+ using pointer = double*;
+ using reference = double&;
+ using iterator_category = std::random_access_iterator_tag;
+
+ reference operator*() const;
+ reference operator[](difference_type) const;
+
+ Self& operator++();
+ Self& operator--();
+ Self operator++(int);
+ Self operator--(int);
+
+ Self& operator+=(difference_type);
+ Self& operator-=(difference_type);
+ friend Self operator+(Self, difference_type);
+ friend Self operator+(difference_type, Self);
+ friend Self operator-(Self, difference_type);
+ friend difference_type operator-(Self, Self);
+
+ auto operator<=>(const Self&) const = default;
+};
+
+static_assert(std::regular<RandomAccessIteratorBadDifferenceType>);
+static_assert(!std::weakly_incrementable<RandomAccessIteratorBadDifferenceType>);
+static_assert(!std::random_access_iterator<RandomAccessIteratorBadDifferenceType>);
+
template <class Iter>
class ComparatorNotCopyable {
public:
diff --git a/third_party/llvm-project/libcxx/test/support/assert_macros.h b/third_party/llvm-project/libcxx/test/support/assert_macros.h
index 5d5d810..bf382e1 100644
--- a/third_party/llvm-project/libcxx/test/support/assert_macros.h
+++ b/third_party/llvm-project/libcxx/test/support/assert_macros.h
@@ -29,78 +29,124 @@
#include <cstdio>
#include <cstdlib>
-#ifndef TEST_HAS_NO_LOCALIZATION
-# include <sstream>
-#endif
-
-#if TEST_STD_VER > 17
-
-# ifndef TEST_HAS_NO_LOCALIZATION
-template <class T>
-concept test_char_streamable = requires(T&& value) { std::stringstream{} << std::forward<T>(value); };
-# endif
-
-// If possible concatenates message for the assertion function, else returns a
-// default message. Not being able to stream is not considered and error. For
-// example, streaming to std::wcerr doesn't work properly in the CI. Therefore
-// the formatting tests should only stream to std::string_string.
-template <class... Args>
-std::string test_concat_message([[maybe_unused]] Args&&... args) {
-# ifndef TEST_HAS_NO_LOCALIZATION
- if constexpr ((test_char_streamable<Args> && ...)) {
- std::stringstream sstr;
- ((sstr << std::forward<Args>(args)), ...);
- return sstr.str();
- } else
-# endif
- return "Message discarded since it can't be streamed to std::cerr.\n";
-}
-
-#endif // TEST_STD_VER > 17
-
-// Logs the error and calls exit.
+// This function prints the given arguments to standard error.
//
-// It shows a generic assert like message including a custom message. This
-// message should end with a newline.
-[[noreturn]] void test_log_error(const char* condition, const char* file, int line, std::string&& message) {
+// Keeping this as a separate function is important since it provides a single point for
+// downstreams to customize how errors are printed on exotic targets, if needed.
+template <class ...Args>
+void test_eprintf(char const* fmt, Args const& ...args) {
+ std::fprintf(stderr, fmt, args...);
+}
+
+void test_log(const char* condition, const char* file, int line, const char* message) {
const char* msg = condition ? "Assertion failure: " : "Unconditional failure:";
- std::fprintf(stderr, "%s%s %s %d\n%s", msg, condition, file, line, message.c_str());
- exit(EXIT_FAILURE);
+ test_eprintf("%s%s %s %d\n%s", msg, condition, file, line, message);
}
-inline void test_fail(const char* file, int line, std::string&& message) {
- test_log_error("", file, line, std::move(message));
+template <class F>
+void test_log(const char* condition, const char* file, int line, const F& functor) {
+ test_eprintf("Assertion failure: %s %s %d\n", condition, file, line);
+ functor();
}
-inline void test_require(bool condition, const char* condition_str, const char* file, int line, std::string&& message) {
+template <class Arg>
+[[noreturn]] void test_fail(const char* file, int line, const Arg& arg) {
+ test_log("", file, line, arg);
+ std::abort();
+}
+
+template <class Arg>
+void test_require(bool condition, const char* condition_str, const char* file, int line, const Arg& arg) {
if (condition)
return;
- test_log_error(condition_str, file, line, std::move(message));
-}
-
-inline void test_libcpp_require(
- [[maybe_unused]] bool condition,
- [[maybe_unused]] const char* condition_str,
- [[maybe_unused]] const char* file,
- [[maybe_unused]] int line,
- [[maybe_unused]] std::string&& message) {
-#if defined(_LIBCPP_VERSION)
- test_require(condition, condition_str, file, line, std::move(message));
-#endif
+ test_log(condition_str, file, line, arg);
+ std::abort();
}
// assert(false) replacement
-#define TEST_FAIL(MSG) ::test_fail(__FILE__, __LINE__, MSG)
+// The ARG is either a
+// - c-ctring or std::string, in which case the string is printed to stderr,
+// - an invocable object, which will be invoked.
+#define TEST_FAIL(ARG) ::test_fail(__FILE__, __LINE__, ARG)
// assert replacement.
-#define TEST_REQUIRE(CONDITION, MSG) ::test_require(CONDITION, #CONDITION, __FILE__, __LINE__, MSG)
+// ARG is the same as for TEST_FAIL
+#define TEST_REQUIRE(CONDITION, ARG) ::test_require(CONDITION, #CONDITION, __FILE__, __LINE__, ARG)
// LIBCPP_ASSERT replacement
//
// This requirement is only tested when the test suite is used for libc++.
// This allows checking libc++ specific requirements, for example the error
// messages of exceptions.
-#define TEST_LIBCPP_REQUIRE(CONDITION, MSG) ::test_libcpp_require(CONDITION, #CONDITION, __FILE__, __LINE__, MSG)
+// ARG is the same as for TEST_FAIL
+#if defined(_LIBCPP_VERSION)
+# define TEST_LIBCPP_REQUIRE(CONDITION, ARG) ::test_require(CONDITION, #CONDITION, __FILE__, __LINE__, ARG)
+#else
+# define TEST_LIBCPP_REQUIRE(...) /* DO NOTHING */
+#endif
+
+// Helper macro to test an expression does not throw any exception.
+#ifndef TEST_HAS_NO_EXCEPTIONS
+# define TEST_DOES_NOT_THROW(EXPR) \
+ do { \
+ try { \
+ static_cast<void>(EXPR); \
+ } catch (...) { \
+ ::test_log(#EXPR, __FILE__, __LINE__, "no exception was expected\n"); \
+ ::std::abort(); \
+ } \
+ } while (false) /* */
+
+// Helper macro to test an expression throws an exception of the expected type.
+# define TEST_THROWS_TYPE(TYPE, EXPR) \
+ do { \
+ try { \
+ static_cast<void>(EXPR); \
+ ::test_log(nullptr, \
+ __FILE__, \
+ __LINE__, \
+ "no exception is thrown while an exception of type " #TYPE " was expected\n"); \
+ ::std::abort(); \
+ } catch (const TYPE&) { \
+ /* DO NOTHING */ \
+ } catch (...) { \
+ ::test_log(nullptr, \
+ __FILE__, \
+ __LINE__, \
+ "the type of the exception caught differs from the expected type " #TYPE "\n"); \
+ ::std::abort(); \
+ } \
+ } while (false) /* */
+
+// Helper macro to test an expression throws an exception of the expected type and satisfies a predicate.
+//
+// In order to log additional information the predicate can use log macros.
+// The exception caught is used as argument to the predicate.
+# define TEST_VALIDATE_EXCEPTION(TYPE, PRED, EXPR) \
+ do { \
+ try { \
+ static_cast<void>(EXPR); \
+ ::test_log(nullptr, \
+ __FILE__, \
+ __LINE__, \
+ "no exception is thrown while an exception of type " #TYPE " was expected\n"); \
+ ::std::abort(); \
+ } catch (const TYPE& EXCEPTION) { \
+ PRED(EXCEPTION); \
+ } catch (...) { \
+ ::test_log(nullptr, \
+ __FILE__, \
+ __LINE__, \
+ "the type of the exception caught differs from the expected type " #TYPE "\n"); \
+ ::std::abort(); \
+ } \
+ } while (false) /* */
+
+#else // TEST_HAS_NO_EXCEPTIONS
+# define TEST_DOES_NOT_THROW(EXPR) static_cast<void>(EXPR);
+# define TEST_THROWS_TYPE(...) /* DO NOTHING */
+# define TEST_VALIDATE_EXCEPTION(...) /* DO NOTHING */
+#endif // TEST_HAS_NO_EXCEPTIONS
#endif // TEST_SUPPORT_ASSERT_MACROS_H
diff --git a/third_party/llvm-project/libcxx/test/support/atomic_helpers.h b/third_party/llvm-project/libcxx/test/support/atomic_helpers.h
index dc38b7b..8add02d 100644
--- a/third_party/llvm-project/libcxx/test/support/atomic_helpers.h
+++ b/third_party/llvm-project/libcxx/test/support/atomic_helpers.h
@@ -10,6 +10,7 @@
#define ATOMIC_HELPERS_H
#include <cassert>
+#include <cstdint>
#include "test_macros.h"
@@ -83,14 +84,14 @@
#endif
TestFunctor<char16_t>()();
TestFunctor<char32_t>()();
- TestFunctor<int8_t>()();
- TestFunctor<uint8_t>()();
- TestFunctor<int16_t>()();
- TestFunctor<uint16_t>()();
- TestFunctor<int32_t>()();
- TestFunctor<uint32_t>()();
- TestFunctor<int64_t>()();
- TestFunctor<uint64_t>()();
+ TestFunctor<std::int8_t>()();
+ TestFunctor<std::uint8_t>()();
+ TestFunctor<std::int16_t>()();
+ TestFunctor<std::uint16_t>()();
+ TestFunctor<std::int32_t>()();
+ TestFunctor<std::uint32_t>()();
+ TestFunctor<std::int64_t>()();
+ TestFunctor<std::uint64_t>()();
}
};
diff --git a/third_party/llvm-project/libcxx/test/support/charconv_test_helpers.h b/third_party/llvm-project/libcxx/test/support/charconv_test_helpers.h
index 1ba95e7..f5fbedb 100644
--- a/third_party/llvm-project/libcxx/test/support/charconv_test_helpers.h
+++ b/third_party/llvm-project/libcxx/test/support/charconv_test_helpers.h
@@ -10,12 +10,15 @@
#define SUPPORT_CHARCONV_TEST_HELPERS_H
#include <algorithm>
-#include <charconv>
#include <cassert>
+#include <cerrno>
+#include <charconv>
+#include <cstddef>
#include <limits>
#include <numeric>
#include <string.h>
#include <stdlib.h>
+#include <type_traits>
#include "test_macros.h"
@@ -78,12 +81,12 @@
template <typename X>
struct to_chars_test_base
{
- template <typename T, size_t N, typename... Ts>
+ template <typename T, std::size_t N, typename... Ts>
TEST_CONSTEXPR_CXX23 void test(T v, char const (&expect)[N], Ts... args)
{
std::to_chars_result r;
- constexpr size_t len = N - 1;
+ constexpr std::size_t len = N - 1;
static_assert(len > 0, "expected output won't be empty");
if (!fits_in<X>(v))
@@ -110,7 +113,7 @@
std::iota(buf, buf + sizeof(buf), static_cast<unsigned char>(1));
r = std::to_chars(buf, buf + sizeof(buf), v, args...);
assert(r.ec == std::errc{});
- for (size_t i = r.ptr - buf; i < sizeof(buf); ++i)
+ for (std::size_t i = r.ptr - buf; i < sizeof(buf); ++i)
assert(static_cast<unsigned char>(buf[i]) == i + 1);
*r.ptr = '\0';
diff --git a/third_party/llvm-project/libcxx/test/support/concat_macros.h b/third_party/llvm-project/libcxx/test/support/concat_macros.h
new file mode 100644
index 0000000..d6396a7
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/support/concat_macros.h
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEST_SUPPORT_CONCAT_MACROS_H
+#define TEST_SUPPORT_CONCAT_MACROS_H
+
+#include <cstdio>
+#include <string>
+
+#include "assert_macros.h"
+#include "test_macros.h"
+
+#ifndef TEST_HAS_NO_LOCALIZATION
+# include <sstream>
+#endif
+
+#if TEST_STD_VER > 17
+
+# ifndef TEST_HAS_NO_LOCALIZATION
+template <class T>
+concept test_char_streamable = requires(T&& value) { std::stringstream{} << std::forward<T>(value); };
+# endif
+
+// If possible concatenates message for the assertion function, else returns a
+// default message. Not being able to stream is not considered and error. For
+// example, streaming to std::wcerr doesn't work properly in the CI. Therefore
+// the formatting tests should only stream to std::string.
+//
+// The macro TEST_WRITE_CONCATENATED can be used to evaluate the arguments
+// lazily. This useful when using this function in combination with
+// assert_macros.h.
+template <class... Args>
+std::string test_concat_message([[maybe_unused]] Args&&... args) {
+# ifndef TEST_HAS_NO_LOCALIZATION
+ if constexpr ((test_char_streamable<Args> && ...)) {
+ std::stringstream sstr;
+ ((sstr << std::forward<Args>(args)), ...);
+ return sstr.str();
+ } else
+# endif
+ return "Message discarded since it can't be streamed to std::cerr.\n";
+}
+
+// Writes its arguments to stderr, using the test_concat_message helper.
+# define TEST_WRITE_CONCATENATED(...) [&] { ::test_eprintf("%s", ::test_concat_message(__VA_ARGS__).c_str()); }
+
+#endif // TEST_STD_VER > 17
+
+#endif // TEST_SUPPORT_CONCAT_MACROS_H
diff --git a/third_party/llvm-project/libcxx/test/support/constexpr_char_traits.h b/third_party/llvm-project/libcxx/test/support/constexpr_char_traits.h
index 56c22fe..75380d5 100644
--- a/third_party/llvm-project/libcxx/test/support/constexpr_char_traits.h
+++ b/third_party/llvm-project/libcxx/test/support/constexpr_char_traits.h
@@ -12,6 +12,7 @@
#include <string>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
@@ -35,12 +36,12 @@
static TEST_CONSTEXPR bool lt(char_type c1, char_type c2) TEST_NOEXCEPT
{return c1 < c2;}
- static TEST_CONSTEXPR_CXX14 int compare(const char_type* s1, const char_type* s2, size_t n);
- static TEST_CONSTEXPR_CXX14 size_t length(const char_type* s);
- static TEST_CONSTEXPR_CXX14 const char_type* find(const char_type* s, size_t n, const char_type& a);
- static TEST_CONSTEXPR_CXX14 char_type* move(char_type* s1, const char_type* s2, size_t n);
- static TEST_CONSTEXPR_CXX14 char_type* copy(char_type* s1, const char_type* s2, size_t n);
- static TEST_CONSTEXPR_CXX14 char_type* assign(char_type* s, size_t n, char_type a);
+ static TEST_CONSTEXPR_CXX14 int compare(const char_type* s1, const char_type* s2, std::size_t n);
+ static TEST_CONSTEXPR_CXX14 std::size_t length(const char_type* s);
+ static TEST_CONSTEXPR_CXX14 const char_type* find(const char_type* s, std::size_t n, const char_type& a);
+ static TEST_CONSTEXPR_CXX14 char_type* move(char_type* s1, const char_type* s2, std::size_t n);
+ static TEST_CONSTEXPR_CXX14 char_type* copy(char_type* s1, const char_type* s2, std::size_t n);
+ static TEST_CONSTEXPR_CXX14 char_type* assign(char_type* s, std::size_t n, char_type a);
static TEST_CONSTEXPR int_type not_eof(int_type c) TEST_NOEXCEPT
{return eq_int_type(c, eof()) ? ~eof() : c;}
@@ -61,7 +62,7 @@
template <class CharT>
TEST_CONSTEXPR_CXX14 int
-constexpr_char_traits<CharT>::compare(const char_type* s1, const char_type* s2, size_t n)
+constexpr_char_traits<CharT>::compare(const char_type* s1, const char_type* s2, std::size_t n)
{
for (; n; --n, ++s1, ++s2)
{
@@ -74,10 +75,10 @@
}
template <class CharT>
-TEST_CONSTEXPR_CXX14 size_t
+TEST_CONSTEXPR_CXX14 std::size_t
constexpr_char_traits<CharT>::length(const char_type* s)
{
- size_t len = 0;
+ std::size_t len = 0;
for (; !eq(*s, char_type(0)); ++s)
++len;
return len;
@@ -85,7 +86,7 @@
template <class CharT>
TEST_CONSTEXPR_CXX14 const CharT*
-constexpr_char_traits<CharT>::find(const char_type* s, size_t n, const char_type& a)
+constexpr_char_traits<CharT>::find(const char_type* s, std::size_t n, const char_type& a)
{
for (; n; --n)
{
@@ -98,7 +99,7 @@
template <class CharT>
TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, size_t n)
+constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, std::size_t n)
{
char_type* r = s1;
if (s1 < s2)
@@ -118,7 +119,7 @@
template <class CharT>
TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::copy(char_type* s1, const char_type* s2, size_t n)
+constexpr_char_traits<CharT>::copy(char_type* s1, const char_type* s2, std::size_t n)
{
if (!TEST_IS_CONSTANT_EVALUATED) // fails in constexpr because we might be comparing unrelated pointers
assert(s2 < s1 || s2 >= s1+n);
@@ -130,7 +131,7 @@
template <class CharT>
TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::assign(char_type* s, size_t n, char_type a)
+constexpr_char_traits<CharT>::assign(char_type* s, std::size_t n, char_type a)
{
char_type* r = s;
for (; n; --n, ++s)
diff --git a/third_party/llvm-project/libcxx/test/support/container_test_types.h b/third_party/llvm-project/libcxx/test/support/container_test_types.h
index 96e2e2d..ed26ba5 100644
--- a/third_party/llvm-project/libcxx/test/support/container_test_types.h
+++ b/third_party/llvm-project/libcxx/test/support/container_test_types.h
@@ -86,6 +86,7 @@
*/
#include <cassert>
+#include <cstddef>
#include <functional>
#include <new>
#include <utility>
@@ -428,9 +429,9 @@
template <int ID>
struct hash< ::CopyInsertable<ID> > {
typedef ::CopyInsertable<ID> argument_type;
- typedef size_t result_type;
+ typedef std::size_t result_type;
- size_t operator()(argument_type const& arg) const {
+ std::size_t operator()(argument_type const& arg) const {
return arg.data;
}
};
diff --git a/third_party/llvm-project/libcxx/test/support/controlled_allocators.h b/third_party/llvm-project/libcxx/test/support/controlled_allocators.h
index 1144ae4..be517d6 100644
--- a/third_party/llvm-project/libcxx/test/support/controlled_allocators.h
+++ b/third_party/llvm-project/libcxx/test/support/controlled_allocators.h
@@ -29,7 +29,7 @@
// 'AllocController' is a concrete type that instruments and controls the
// behavior of test allocators.
-template <class T, size_t ID = 0>
+template <class T, std::size_t ID = 0>
class CountingAllocator;
// 'CountingAllocator' is an basic implementation of the 'Allocator'
// requirements that use the 'AllocController' interface.
@@ -97,7 +97,7 @@
AllocController() = default;
- void countAlloc(void* p, size_t s, size_t a) {
+ void countAlloc(void* p, std::size_t s, size_t a) {
++alive;
++alloc_count;
alive_size += s;
@@ -107,7 +107,7 @@
last_align = last_alloc_align = a;
}
- void countDealloc(void* p, size_t s, size_t a) {
+ void countDealloc(void* p, std::size_t s, size_t a) {
--alive;
++dealloc_count;
alive_size -= s;
@@ -144,35 +144,35 @@
last_destroy_pointer = nullptr;
}
public:
- bool checkAlloc(void* p, size_t s, size_t a) const {
+ bool checkAlloc(void* p, std::size_t s, size_t a) const {
return p == last_alloc_pointer &&
s == last_alloc_size &&
a == last_alloc_align;
}
- bool checkAlloc(void* p, size_t s) const {
+ bool checkAlloc(void* p, std::size_t s) const {
return p == last_alloc_pointer &&
s == last_alloc_size;
}
- bool checkAllocAtLeast(void* p, size_t s, size_t a) const {
+ bool checkAllocAtLeast(void* p, std::size_t s, size_t a) const {
return p == last_alloc_pointer &&
s <= last_alloc_size &&
a <= last_alloc_align;
}
- bool checkAllocAtLeast(void* p, size_t s) const {
+ bool checkAllocAtLeast(void* p, std::size_t s) const {
return p == last_alloc_pointer &&
s <= last_alloc_size;
}
- bool checkDealloc(void* p, size_t s, size_t a) const {
+ bool checkDealloc(void* p, std::size_t s, size_t a) const {
return p == last_dealloc_pointer &&
s == last_dealloc_size &&
a == last_dealloc_align;
}
- bool checkDealloc(void* p, size_t s) const {
+ bool checkDealloc(void* p, std::size_t s) const {
return p == last_dealloc_pointer &&
s == last_dealloc_size;
}
@@ -222,7 +222,7 @@
DISALLOW_COPY(AllocController);
};
-template <class T, size_t ID>
+template <class T, std::size_t ID>
class CountingAllocator
{
public:
@@ -282,12 +282,12 @@
AllocController& getController() const { return *P; }
private:
- template <class Tp, size_t XID> friend class CountingAllocator;
+ template <class Tp, std::size_t XID> friend class CountingAllocator;
AllocController *P;
};
-template <size_t ID>
+template <std::size_t ID>
class CountingAllocator<void, ID>
{
public:
@@ -325,17 +325,17 @@
AllocController& getController() const { return *P; }
private:
- template <class Tp, size_t> friend class CountingAllocator;
+ template <class Tp, std::size_t> friend class CountingAllocator;
AllocController *P;
};
-template <class T, class U, size_t ID>
+template <class T, class U, std::size_t ID>
inline bool operator==(CountingAllocator<T, ID> const& x,
CountingAllocator<U, ID> const& y) {
return &x.getController() == &y.getController();
}
-template <class T, class U, size_t ID>
+template <class T, class U, std::size_t ID>
inline bool operator!=(CountingAllocator<T, ID> const& x,
CountingAllocator<U, ID> const& y) {
return !(x == y);
diff --git a/third_party/llvm-project/libcxx/test/support/counting_predicates.h b/third_party/llvm-project/libcxx/test/support/counting_predicates.h
index ef3c293..7bf58b2 100644
--- a/third_party/llvm-project/libcxx/test/support/counting_predicates.h
+++ b/third_party/llvm-project/libcxx/test/support/counting_predicates.h
@@ -23,12 +23,12 @@
~unary_counting_predicate() {}
bool operator () (const Arg &a) const { ++count_; return p_(a); }
- size_t count() const { return count_; }
+ std::size_t count() const { return count_; }
void reset() { count_ = 0; }
private:
Predicate p_;
- mutable size_t count_;
+ mutable std::size_t count_;
};
@@ -43,12 +43,12 @@
~binary_counting_predicate() {}
bool operator () (const Arg1 &a1, const Arg2 &a2) const { ++count_; return p_(a1, a2); }
- size_t count() const { return count_; }
+ std::size_t count() const { return count_; }
void reset() { count_ = 0; }
private:
Predicate p_;
- mutable size_t count_;
+ mutable std::size_t count_;
};
#if TEST_STD_VER > 14
diff --git a/third_party/llvm-project/libcxx/test/support/deduction_guides_sfinae_checks.h b/third_party/llvm-project/libcxx/test/support/deduction_guides_sfinae_checks.h
index 767ff02..5ada5ac 100644
--- a/third_party/llvm-project/libcxx/test/support/deduction_guides_sfinae_checks.h
+++ b/third_party/llvm-project/libcxx/test/support/deduction_guides_sfinae_checks.h
@@ -9,6 +9,7 @@
#ifndef TEST_SUPPORT_DEDUCTION_GUIDES_SFINAE_CHECKS_H
#define TEST_SUPPORT_DEDUCTION_GUIDES_SFINAE_CHECKS_H
+#include <cstddef>
#include <functional>
#include <initializer_list>
#include <iterator>
@@ -178,30 +179,30 @@
// (iter, iter, buckets)
//
// Cannot deduce from (BAD_iter, BAD_iter, buckets)
- static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t>);
- LIBCPP_STATIC_ASSERT(SFINAEs_away<Container, OutputIter, OutputIter, size_t>);
+ static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t>);
+ LIBCPP_STATIC_ASSERT(SFINAEs_away<Container, OutputIter, OutputIter, std::size_t>);
// (iter, iter, buckets, hash)
//
// Cannot deduce from (BAD_iter, BAD_iter, buckets, hash)
- static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Hash>);
+ static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash>);
LIBCPP_STATIC_ASSERT(
- SFINAEs_away<Container, OutputIter, OutputIter, size_t, Hash>);
+ SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Hash>);
// Cannot deduce from (iter, iter, buckets, BAD_hash)
- static_assert(SFINAEs_away<Container, Iter, Iter, size_t, BadHash>);
+ static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash>);
// Note: (iter, iter, buckets, ALLOC_as_hash) is allowed -- it just calls
// (iter, iter, buckets, alloc)
// (iter, iter, buckets, hash, pred)
//
// Cannot deduce from (BAD_iter, BAD_iter, buckets, hash, pred)
- static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Hash, Pred>);
+ static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash, Pred>);
LIBCPP_STATIC_ASSERT(
- SFINAEs_away<Container, OutputIter, OutputIter, size_t, Hash, Pred>);
+ SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Hash, Pred>);
// Cannot deduce from (iter, iter, buckets, BAD_hash, pred)
- static_assert(SFINAEs_away<Container, Iter, Iter, size_t, BadHash, Pred>);
+ static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash, Pred>);
// Cannot deduce from (iter, iter, buckets, ALLOC_as_hash, pred)
- static_assert(SFINAEs_away<Container, Iter, Iter, size_t, AllocAsHash, Pred>);
+ static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, AllocAsHash, Pred>);
// Note: (iter, iter, buckets, hash, ALLOC_as_pred) is allowed -- it just
// calls (iter, iter, buckets, hash, alloc)
@@ -209,28 +210,28 @@
//
// Cannot deduce from (BAD_iter, BAD_iter, buckets, hash, pred, alloc)
static_assert(
- SFINAEs_away<Container, BadIter, BadIter, size_t, Hash, Pred, Alloc>);
+ SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash, Pred, Alloc>);
LIBCPP_STATIC_ASSERT(SFINAEs_away<Container, OutputIter, OutputIter,
- size_t, Hash, Pred, Alloc>);
+ std::size_t, Hash, Pred, Alloc>);
// Cannot deduce from (iter, iter, buckets, BAD_hash, pred, alloc)
static_assert(
- SFINAEs_away<Container, Iter, Iter, size_t, BadHash, Pred, Alloc>);
+ SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash, Pred, Alloc>);
// Cannot deduce from (iter, iter, buckets, ALLOC_as_hash, pred, alloc)
static_assert(
- SFINAEs_away<Container, Iter, Iter, size_t, AllocAsHash, Pred, Alloc>);
+ SFINAEs_away<Container, Iter, Iter, std::size_t, AllocAsHash, Pred, Alloc>);
// Cannot deduce from (iter, iter, buckets, hash, ALLOC_as_pred, alloc)
static_assert(
- SFINAEs_away<Container, Iter, Iter, size_t, Hash, AllocAsPred, Alloc>);
+ SFINAEs_away<Container, Iter, Iter, std::size_t, Hash, AllocAsPred, Alloc>);
// Cannot deduce from (iter, iter, buckets, hash, pred, BAD_alloc)
static_assert(
- SFINAEs_away<Container, Iter, Iter, size_t, Hash, Pred, BadAlloc>);
+ SFINAEs_away<Container, Iter, Iter, std::size_t, Hash, Pred, BadAlloc>);
// (iter, iter, buckets, alloc)
//
// Cannot deduce from (BAD_iter, BAD_iter, buckets, alloc)
- static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Alloc>);
+ static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Alloc>);
LIBCPP_STATIC_ASSERT(
- SFINAEs_away<Container, OutputIter, OutputIter, size_t, Alloc>);
+ SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Alloc>);
// Note: (iter, iter, buckets, BAD_alloc) is interpreted as (iter, iter,
// buckets, hash), which is valid because the only requirement for the hash
// parameter is that it's not integral.
@@ -246,14 +247,14 @@
// (iter, iter, buckets, hash, alloc)
//
// Cannot deduce from (BAD_iter, BAD_iter, buckets, hash, alloc)
- static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Hash, Alloc>);
+ static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash, Alloc>);
LIBCPP_STATIC_ASSERT(
- SFINAEs_away<Container, OutputIter, OutputIter, size_t, Hash, Alloc>);
+ SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Hash, Alloc>);
// Cannot deduce from (iter, iter, buckets, BAD_hash, alloc)
- static_assert(SFINAEs_away<Container, Iter, Iter, size_t, BadHash, Alloc>);
+ static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash, Alloc>);
// Cannot deduce from (iter, iter, buckets, ALLOC_as_hash, alloc)
static_assert(
- SFINAEs_away<Container, Iter, Iter, size_t, AllocAsHash, Alloc>);
+ SFINAEs_away<Container, Iter, Iter, std::size_t, AllocAsHash, Alloc>);
// Note: (iter, iter, buckets, hash, BAD_alloc) is interpreted as (iter, iter,
// buckets, hash, pred), which is valid because there are no requirements for
// the predicate.
@@ -261,16 +262,16 @@
// (init_list, buckets, hash)
//
// Cannot deduce from (init_list, buckets, BAD_hash)
- static_assert(SFINAEs_away<Container, InitList, size_t, BadHash>);
+ static_assert(SFINAEs_away<Container, InitList, std::size_t, BadHash>);
// Note: (init_list, buckets, ALLOC_as_hash) is interpreted as (init_list,
// buckets, alloc), which is valid.
// (init_list, buckets, hash, pred)
//
// Cannot deduce from (init_list, buckets, BAD_hash, pred)
- static_assert(SFINAEs_away<Container, InitList, size_t, BadHash, Pred>);
+ static_assert(SFINAEs_away<Container, InitList, std::size_t, BadHash, Pred>);
// Cannot deduce from (init_list, buckets, ALLOC_as_hash, pred)
- static_assert(SFINAEs_away<Container, InitList, size_t, AllocAsHash, Pred>);
+ static_assert(SFINAEs_away<Container, InitList, std::size_t, AllocAsHash, Pred>);
// Note: (init_list, buckets, hash, ALLOC_as_pred) is interpreted as
// (init_list, buckets, hash, alloc), which is valid.
@@ -278,16 +279,16 @@
//
// Cannot deduce from (init_list, buckets, BAD_hash, pred, alloc)
static_assert(
- SFINAEs_away<Container, InitList, size_t, BadHash, Pred, Alloc>);
+ SFINAEs_away<Container, InitList, std::size_t, BadHash, Pred, Alloc>);
// Cannot deduce from (init_list, buckets, ALLOC_as_hash, pred, alloc)
static_assert(
- SFINAEs_away<Container, InitList, size_t, AllocAsHash, Pred, Alloc>);
+ SFINAEs_away<Container, InitList, std::size_t, AllocAsHash, Pred, Alloc>);
// Cannot deduce from (init_list, buckets, hash, ALLOC_as_pred, alloc)
static_assert(
- SFINAEs_away<Container, InitList, size_t, Hash, AllocAsPred, Alloc>);
+ SFINAEs_away<Container, InitList, std::size_t, Hash, AllocAsPred, Alloc>);
// Cannot deduce from (init_list, buckets, hash, pred, BAD_alloc)
static_assert(
- SFINAEs_away<Container, InitList, size_t, Hash, Pred, BadAlloc>);
+ SFINAEs_away<Container, InitList, std::size_t, Hash, Pred, BadAlloc>);
// (init_list, buckets, alloc)
//
@@ -298,9 +299,9 @@
// (init_list, buckets, hash, alloc)
//
// Cannot deduce from (init_list, buckets, BAD_hash, alloc)
- static_assert(SFINAEs_away<Container, InitList, size_t, BadHash, Alloc>);
+ static_assert(SFINAEs_away<Container, InitList, std::size_t, BadHash, Alloc>);
// Cannot deduce from (init_list, buckets, ALLOC_as_hash, alloc)
- static_assert(SFINAEs_away<Container, InitList, size_t, AllocAsHash, Alloc>);
+ static_assert(SFINAEs_away<Container, InitList, std::size_t, AllocAsHash, Alloc>);
// (init_list, alloc)
//
diff --git a/third_party/llvm-project/libcxx/test/support/deleter_types.h b/third_party/llvm-project/libcxx/test/support/deleter_types.h
index c568002..2afb9b3 100644
--- a/third_party/llvm-project/libcxx/test/support/deleter_types.h
+++ b/third_party/llvm-project/libcxx/test/support/deleter_types.h
@@ -15,6 +15,7 @@
#ifndef SUPPORT_DELETER_TYPES_H
#define SUPPORT_DELETER_TYPES_H
+#include <cstddef>
#include <type_traits>
#include <utility>
#include <cassert>
@@ -385,13 +386,13 @@
#if TEST_STD_VER >= 11
-template <class T, size_t ID = 0>
+template <class T, std::size_t ID = 0>
class PointerDeleter {
PointerDeleter(const PointerDeleter&);
PointerDeleter& operator=(const PointerDeleter&);
public:
- typedef min_pointer<T, std::integral_constant<size_t, ID>> pointer;
+ typedef min_pointer<T, std::integral_constant<std::size_t, ID>> pointer;
TEST_CONSTEXPR_CXX23 PointerDeleter() = default;
TEST_CONSTEXPR_CXX23 PointerDeleter(PointerDeleter&&) = default;
@@ -413,13 +414,13 @@
PointerDeleter(const PointerDeleter<U, ID>&, typename std::enable_if<!std::is_same<U, T>::value>::type* = 0);
};
-template <class T, size_t ID>
+template <class T, std::size_t ID>
class PointerDeleter<T[], ID> {
PointerDeleter(const PointerDeleter&);
PointerDeleter& operator=(const PointerDeleter&);
public:
- typedef min_pointer<T, std::integral_constant<size_t, ID> > pointer;
+ typedef min_pointer<T, std::integral_constant<std::size_t, ID> > pointer;
TEST_CONSTEXPR_CXX23 PointerDeleter() = default;
TEST_CONSTEXPR_CXX23 PointerDeleter(PointerDeleter&&) = default;
diff --git a/third_party/llvm-project/libcxx/test/support/filesystem_test_helper.h b/third_party/llvm-project/libcxx/test/support/filesystem_test_helper.h
index d09b37e..c7a5470 100644
--- a/third_party/llvm-project/libcxx/test/support/filesystem_test_helper.h
+++ b/third_party/llvm-project/libcxx/test/support/filesystem_test_helper.h
@@ -14,16 +14,18 @@
#endif
#include <cassert>
+#include <cerrno>
#include <chrono>
#include <cstdint>
#include <cstdio> // for printf
#include <string>
#include <system_error>
+#include <type_traits>
#include <vector>
+#include "assert_macros.h"
#include "make_string.h"
#include "test_macros.h"
-#include "rapid-cxx-test.h"
#include "format_string.h"
// For creating socket files
@@ -101,7 +103,7 @@
// N.B. libc might define some of the foo[64] identifiers using macros from
// foo64 -> foo or vice versa.
#if defined(_WIN32)
- using off64_t = int64_t;
+ using off64_t = std::int64_t;
#elif defined(__MVS__) || defined(__LP64__)
using off64_t = ::off_t;
#else
@@ -214,7 +216,7 @@
// but the caller is not (std::filesystem also uses uintmax_t rather than
// off_t). On a 32-bit system this allows us to create a file larger than
// 2GB.
- std::string create_file(fs::path filename_path, uintmax_t size = 0) {
+ std::string create_file(fs::path filename_path, std::uintmax_t size = 0) {
std::string filename = sanitize_path(filename_path.string());
if (size >
@@ -335,7 +337,7 @@
fs::path const cwd = utils::getcwd();
fs::path const tmp = fs::temp_directory_path();
std::string base = cwd.filename().string();
- size_t i = std::hash<std::string>()(cwd.string());
+ std::size_t i = std::hash<std::string>()(cwd.string());
fs::path p = tmp / (base + "-static_env." + std::to_string(i));
while (utils::exists(p.string())) {
p = tmp / (base + "-static_env." + std::to_string(++i));
@@ -672,9 +674,9 @@
num_paths(2), func_name(fun_name), opt_message(opt_msg) {}
void operator()(fs::filesystem_error const& Err) {
- TEST_CHECK(ErrorIsImp(Err.code(), {expected_err}));
- TEST_CHECK(Err.path1() == expected_path1);
- TEST_CHECK(Err.path2() == expected_path2);
+ assert(ErrorIsImp(Err.code(), {expected_err}));
+ assert(Err.path1() == expected_path1);
+ assert(Err.path2() == expected_path2);
LIBCPP_ONLY(check_libcxx_string(Err));
}
@@ -703,11 +705,11 @@
transform_path(expected_path1).c_str(),
transform_path(expected_path2).c_str());
default:
- TEST_CHECK(false && "unexpected case");
+ TEST_FAIL("unexpected case");
return "";
}
}();
- TEST_CHECK(format == Err.what());
+ assert(format == Err.what());
if (format != Err.what()) {
fprintf(stderr,
"filesystem_error::what() does not match expected output:\n");
diff --git a/third_party/llvm-project/libcxx/test/support/format.functions.common.h b/third_party/llvm-project/libcxx/test/support/format.functions.common.h
index 769b1af..e5f6bbb 100644
--- a/third_party/llvm-project/libcxx/test/support/format.functions.common.h
+++ b/third_party/llvm-project/libcxx/test/support/format.functions.common.h
@@ -11,6 +11,8 @@
// Contains the common part of the formatter tests for different papers.
#include <algorithm>
+#include <cctype>
+#include <cstddef>
#include <charconv>
#include <format>
#include <ranges>
@@ -43,16 +45,22 @@
using context_t = typename context<T>::type;
// A user-defined type used to test the handle formatter.
-enum class status : uint16_t { foo = 0xAAAA, bar = 0x5555, foobar = 0xAA55 };
+enum class status : std::uint16_t { foo = 0xAAAA, bar = 0x5555, foobar = 0xAA55 };
// The formatter for a user-defined type used to test the handle formatter.
template <class CharT>
struct std::formatter<status, CharT> {
- int type = 0;
+ // During the 2023 Issaquah meeting LEWG made it clear a formatter is
+ // required to call its parse function. LWG3892 Adds the wording for that
+ // requirement. Therefore this formatter is initialized in an invalid state.
+ // A call to parse sets it in a valid state and a call to format validates
+ // the state.
+ int type = -1;
constexpr auto parse(basic_format_parse_context<CharT>& parse_ctx) -> decltype(parse_ctx.begin()) {
auto begin = parse_ctx.begin();
- auto end = parse_ctx.end();
+ auto end = parse_ctx.end();
+ type = 0;
if (begin == end)
return begin;
@@ -85,11 +93,14 @@
const char* begin = names[0];
const char* end = names[0];
switch (type) {
+ case -1:
+ throw_format_error("The formatter's parse function has not been called.");
+
case 0:
begin = buffer;
buffer[0] = '0';
buffer[1] = 'x';
- end = std::to_chars(&buffer[2], std::end(buffer), static_cast<uint16_t>(s), 16).ptr;
+ end = std::to_chars(&buffer[2], std::end(buffer), static_cast<std::uint16_t>(s), 16).ptr;
buffer[6] = '\0';
break;
@@ -97,7 +108,7 @@
begin = buffer;
buffer[0] = '0';
buffer[1] = 'X';
- end = std::to_chars(&buffer[2], std::end(buffer), static_cast<uint16_t>(s), 16).ptr;
+ end = std::to_chars(&buffer[2], std::end(buffer), static_cast<std::uint16_t>(s), 16).ptr;
std::transform(static_cast<const char*>(&buffer[2]), end, &buffer[2], [](char c) {
return static_cast<char>(std::toupper(c)); });
buffer[6] = '\0';
@@ -123,7 +134,7 @@
}
private:
- void throw_format_error(const char* s) {
+ void throw_format_error(const char* s) const {
#ifndef TEST_HAS_NO_EXCEPTIONS
throw std::format_error(s);
#else
@@ -133,6 +144,52 @@
}
};
+struct parse_call_validator {
+ struct parse_function_not_called {};
+
+ friend constexpr auto operator<=>(const parse_call_validator& lhs, const parse_call_validator& rhs) {
+ return &lhs <=> &rhs;
+ }
+};
+
+// The formatter for a user-defined type used to test the handle formatter.
+//
+// Like std::formatter<status, CharT> this formatter validates that parse is
+// called. This formatter is intended to be used when the formatter's parse is
+// called directly and not with format. In that case the format-spec does not
+// require a terminating }. The tests must be written in a fashion where this
+// formatter is always called with an empty format-spec. This requirement
+// allows testing of certain code paths that are never reached by using a
+// well-formed format-string in the format functions.
+template <class CharT>
+struct std::formatter<parse_call_validator, CharT> {
+ bool parse_called{false};
+
+ constexpr auto parse(basic_format_parse_context<CharT>& parse_ctx) -> decltype(parse_ctx.begin()) {
+ auto begin = parse_ctx.begin();
+ auto end = parse_ctx.end();
+ assert(begin == end);
+ parse_called = true;
+ return begin;
+ }
+
+ auto format(parse_call_validator, auto& ctx) const -> decltype(ctx.out()) {
+ if (!parse_called)
+ throw_error<parse_call_validator::parse_function_not_called>();
+ return ctx.out();
+ }
+
+private:
+ template <class T>
+ [[noreturn]] void throw_error() const {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ throw T{};
+#else
+ std::abort();
+#endif
+ }
+};
+
// Creates format string for the invalid types.
//
// valid contains a list of types that are valid.
@@ -142,7 +199,7 @@
// The return value is a collection of basic_strings, instead of
// basic_string_views since the values are temporaries.
namespace detail {
-template <class CharT, size_t N>
+template <class CharT, std::size_t N>
std::basic_string<CharT> get_colons() {
static std::basic_string<CharT> result(N, CharT(':'));
return result;
diff --git a/third_party/llvm-project/libcxx/test/support/make_string.h b/third_party/llvm-project/libcxx/test/support/make_string.h
index 728b654..50dd609 100644
--- a/third_party/llvm-project/libcxx/test/support/make_string.h
+++ b/third_party/llvm-project/libcxx/test/support/make_string.h
@@ -47,18 +47,18 @@
#define MKSTR_LEN(CharT, Str) MKSTR(Str).length((const CharT*)0)
struct MultiStringType {
- MKSTR_WCHAR_ONLY(const wchar_t* w_; size_t wn_; )
- MKSTR_CHAR8_ONLY(const char8_t* u8_; size_t u8n_; )
- MKSTR_CXX11_ONLY(const char16_t* u16_; size_t u16n_; )
- MKSTR_CXX11_ONLY(const char32_t* u32_; size_t u32n_; )
- const char* s_; size_t sn_;
+ MKSTR_WCHAR_ONLY(const wchar_t* w_; std::size_t wn_; )
+ MKSTR_CHAR8_ONLY(const char8_t* u8_; std::size_t u8n_; )
+ MKSTR_CXX11_ONLY(const char16_t* u16_; std::size_t u16n_; )
+ MKSTR_CXX11_ONLY(const char32_t* u32_; std::size_t u32n_; )
+ const char* s_; std::size_t sn_;
TEST_CONSTEXPR MultiStringType(
- MKSTR_WCHAR_ONLY(const wchar_t *w, size_t wn,)
- MKSTR_CHAR8_ONLY(const char8_t *u8, size_t u8n,)
- MKSTR_CXX11_ONLY(const char16_t *u16, size_t u16n,)
- MKSTR_CXX11_ONLY(const char32_t *u32, size_t u32n,)
- const char *s, size_t sn)
+ MKSTR_WCHAR_ONLY(const wchar_t *w, std::size_t wn,)
+ MKSTR_CHAR8_ONLY(const char8_t *u8, std::size_t u8n,)
+ MKSTR_CXX11_ONLY(const char16_t *u16, std::size_t u16n,)
+ MKSTR_CXX11_ONLY(const char32_t *u32, std::size_t u32n,)
+ const char *s, std::size_t sn)
: MKSTR_WCHAR_ONLY(w_(w), wn_(wn),)
MKSTR_CHAR8_ONLY(u8_(u8), u8n_(u8n),)
MKSTR_CXX11_ONLY(u16_(u16), u16n_(u16n),)
@@ -71,11 +71,11 @@
MKSTR_CXX11_ONLY(constexpr const char16_t *as_ptr(const char16_t*) const { return u16_; })
MKSTR_CXX11_ONLY(constexpr const char32_t *as_ptr(const char32_t*) const { return u32_; })
- TEST_CONSTEXPR size_t length(const char*) const { return sn_; }
- MKSTR_WCHAR_ONLY(TEST_CONSTEXPR size_t length(const wchar_t*) const { return wn_; })
- MKSTR_CHAR8_ONLY(constexpr size_t length(const char8_t*) const { return u8n_; })
- MKSTR_CXX11_ONLY(constexpr size_t length(const char16_t*) const { return u16n_; })
- MKSTR_CXX11_ONLY(constexpr size_t length(const char32_t*) const { return u32n_; })
+ TEST_CONSTEXPR std::size_t length(const char*) const { return sn_; }
+ MKSTR_WCHAR_ONLY(TEST_CONSTEXPR std::size_t length(const wchar_t*) const { return wn_; })
+ MKSTR_CHAR8_ONLY(constexpr std::size_t length(const char8_t*) const { return u8n_; })
+ MKSTR_CXX11_ONLY(constexpr std::size_t length(const char16_t*) const { return u16n_; })
+ MKSTR_CXX11_ONLY(constexpr std::size_t length(const char32_t*) const { return u32n_; })
// These implicit conversions are used by some tests. TODO: maybe eliminate them?
TEST_CONSTEXPR operator const char*() const { return s_; }
diff --git a/third_party/llvm-project/libcxx/test/support/min_allocator.h b/third_party/llvm-project/libcxx/test/support/min_allocator.h
index f27ac80..1b3727a 100644
--- a/third_party/llvm-project/libcxx/test/support/min_allocator.h
+++ b/third_party/llvm-project/libcxx/test/support/min_allocator.h
@@ -17,6 +17,7 @@
#include <memory>
#include <new>
#include <type_traits>
+#include <cstring>
#include "test_macros.h"
@@ -84,12 +85,12 @@
};
struct malloc_allocator_base {
- static size_t outstanding_bytes;
- static size_t alloc_count;
- static size_t dealloc_count;
+ static std::size_t outstanding_bytes;
+ static std::size_t alloc_count;
+ static std::size_t dealloc_count;
static bool disable_default_constructor;
- static size_t outstanding_alloc() {
+ static std::size_t outstanding_alloc() {
assert(alloc_count >= dealloc_count);
return (alloc_count - dealloc_count);
}
@@ -122,7 +123,7 @@
T* allocate(std::size_t n)
{
- const size_t nbytes = n*sizeof(T);
+ const std::size_t nbytes = n*sizeof(T);
++alloc_count;
outstanding_bytes += nbytes;
return static_cast<T*>(std::malloc(nbytes));
@@ -130,7 +131,7 @@
void deallocate(T* p, std::size_t n)
{
- const size_t nbytes = n*sizeof(T);
+ const std::size_t nbytes = n*sizeof(T);
++dealloc_count;
outstanding_bytes -= nbytes;
std::free(static_cast<void*>(p));
@@ -193,7 +194,7 @@
};
template <class T> bool cpp03_overload_allocator<T>::construct_called = false;
-template <class T, class = std::integral_constant<size_t, 0> > class min_pointer;
+template <class T, class = std::integral_constant<std::size_t, 0> > class min_pointer;
template <class T, class ID> class min_pointer<const T, ID>;
template <class ID> class min_pointer<void, ID>;
template <class ID> class min_pointer<const void, ID>;
@@ -432,4 +433,51 @@
TEST_CONSTEXPR_CXX20 friend bool operator!=(explicit_allocator x, explicit_allocator y) {return !(x == y);}
};
+template <class T>
+class unaligned_allocator {
+public:
+ static_assert(TEST_ALIGNOF(T) == 1, "Type T cannot be created on unaligned address (UB)");
+ typedef T value_type;
+
+ TEST_CONSTEXPR_CXX20 unaligned_allocator() TEST_NOEXCEPT {}
+
+ template <class U>
+ TEST_CONSTEXPR_CXX20 explicit unaligned_allocator(unaligned_allocator<U>) TEST_NOEXCEPT {}
+
+ TEST_CONSTEXPR_CXX20 T* allocate(std::size_t n) { return std::allocator<T>().allocate(n + 1) + 1; }
+
+ TEST_CONSTEXPR_CXX20 void deallocate(T* p, std::size_t n) { std::allocator<T>().deallocate(p - 1, n + 1); }
+
+ TEST_CONSTEXPR_CXX20 friend bool operator==(unaligned_allocator, unaligned_allocator) { return true; }
+ TEST_CONSTEXPR_CXX20 friend bool operator!=(unaligned_allocator x, unaligned_allocator y) { return !(x == y); }
+};
+
+template <class T>
+class safe_allocator {
+public:
+ typedef T value_type;
+
+ TEST_CONSTEXPR_CXX20 safe_allocator() TEST_NOEXCEPT {}
+
+ template <class U>
+ TEST_CONSTEXPR_CXX20 safe_allocator(safe_allocator<U>) TEST_NOEXCEPT {}
+
+ TEST_CONSTEXPR_CXX20 T* allocate(std::size_t n) {
+ T* memory = std::allocator<T>().allocate(n);
+ if (!std::__libcpp_is_constant_evaluated())
+ std::memset(memory, 0, sizeof(T) * n);
+
+ return memory;
+ }
+
+ TEST_CONSTEXPR_CXX20 void deallocate(T* p, std::size_t n) {
+ if (!std::__libcpp_is_constant_evaluated())
+ DoNotOptimize(std::memset(p, 0, sizeof(T) * n));
+ std::allocator<T>().deallocate(p, n);
+ }
+
+ TEST_CONSTEXPR_CXX20 friend bool operator==(safe_allocator, safe_allocator) { return true; }
+ TEST_CONSTEXPR_CXX20 friend bool operator!=(safe_allocator x, safe_allocator y) { return !(x == y); }
+};
+
#endif // MIN_ALLOCATOR_H
diff --git a/third_party/llvm-project/libcxx/test/support/nasty_containers.h b/third_party/llvm-project/libcxx/test/support/nasty_containers.h
index 0b56a27..18a424b 100644
--- a/third_party/llvm-project/libcxx/test/support/nasty_containers.h
+++ b/third_party/llvm-project/libcxx/test/support/nasty_containers.h
@@ -10,6 +10,7 @@
#define NASTY_CONTAINERS_H
#include <cassert>
+#include <cstddef>
#include <vector>
#include <list>
diff --git a/third_party/llvm-project/libcxx/test/support/nasty_string.h b/third_party/llvm-project/libcxx/test/support/nasty_string.h
new file mode 100644
index 0000000..672c3cb
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/support/nasty_string.h
@@ -0,0 +1,185 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEST_SUPPORT_NASTY_STRING_H
+#define TEST_SUPPORT_NASTY_STRING_H
+
+#include <algorithm>
+#include <cstddef>
+#include <string>
+#include <type_traits>
+
+#include "make_string.h"
+#include "test_macros.h"
+
+// This defines a nasty_string similar to nasty_containers. This string's
+// value_type does operator hijacking, which allows us to ensure that the
+// library uses the provided `CharTraits` instead of using operations on
+// the value_type directly.
+
+
+// When using the code during constant evaluation it relies on
+// P2647R1 Permitting static constexpr variables in constexpr functions
+// This is a C++23 feature, which is not supported by all compilers yet.
+// * GCC >= 13
+// * Clang >= 16
+// * MSVC no support yet
+//
+// TODO After there is proper compiler support use TEST_STD_VER >= 23 instead
+// of this macro in the tests.
+#if TEST_STD_VER < 23 || __cpp_constexpr < 202211L
+# define TEST_HAS_NO_NASTY_STRING
+#endif
+
+#ifndef TEST_HAS_NO_NASTY_STRING
+// Make sure the char-like operations in strings do not depend on the char-like type.
+struct nasty_char {
+ template <typename T>
+ friend auto operator<=>(T, T) = delete;
+
+ template <typename T>
+ friend void operator+(T&&) = delete;
+
+ template <typename T>
+ friend void operator-(T&&) = delete;
+
+ template <typename T>
+ friend void operator&(T&&) = delete;
+
+ char c;
+};
+
+static_assert(std::is_trivial<nasty_char>::value, "");
+static_assert(std::is_standard_layout<nasty_char>::value, "");
+
+// These traits are based on the constexpr_traits test class.
+struct nasty_char_traits {
+ typedef nasty_char char_type;
+ typedef int int_type;
+ typedef std::streamoff off_type;
+ typedef std::streampos pos_type;
+ typedef std::mbstate_t state_type;
+ // The comparison_category is omitted so the class will have weak_ordering
+ // in C++20. This is intentional.
+
+ static constexpr void assign(char_type& c1, const char_type& c2) noexcept { c1 = c2; }
+
+ static constexpr bool eq(char_type c1, char_type c2) noexcept { return c1.c == c2.c; }
+
+ static constexpr bool lt(char_type c1, char_type c2) noexcept { return c1.c < c2.c; }
+
+ static constexpr int compare(const char_type* s1, const char_type* s2, std::size_t n);
+ static constexpr std::size_t length(const char_type* s);
+ static constexpr const char_type* find(const char_type* s, std::size_t n, const char_type& a);
+ static constexpr char_type* move(char_type* s1, const char_type* s2, std::size_t n);
+ static constexpr char_type* copy(char_type* s1, const char_type* s2, std::size_t n);
+ static constexpr char_type* assign(char_type* s, std::size_t n, char_type a);
+
+ static constexpr int_type not_eof(int_type c) noexcept { return eq_int_type(c, eof()) ? ~eof() : c; }
+
+ static constexpr char_type to_char_type(int_type c) noexcept { return char_type(c); }
+
+ static constexpr int_type to_int_type(char_type c) noexcept { return int_type(c.c); }
+
+ static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept { return c1 == c2; }
+
+ static constexpr int_type eof() noexcept { return int_type(EOF); }
+};
+
+constexpr int nasty_char_traits::compare(const nasty_char* s1, const nasty_char* s2, std::size_t n) {
+ for (; n; --n, ++s1, ++s2) {
+ if (lt(*s1, *s2))
+ return -1;
+ if (lt(*s2, *s1))
+ return 1;
+ }
+ return 0;
+}
+
+constexpr std::size_t nasty_char_traits::length(const nasty_char* s) {
+ std::size_t len = 0;
+ for (; !eq(*s, nasty_char(0)); ++s)
+ ++len;
+ return len;
+}
+
+constexpr const nasty_char* nasty_char_traits::find(const nasty_char* s, std::size_t n, const nasty_char& a) {
+ for (; n; --n) {
+ if (eq(*s, a))
+ return s;
+ ++s;
+ }
+ return 0;
+}
+
+constexpr nasty_char* nasty_char_traits::move(nasty_char* s1, const nasty_char* s2, std::size_t n) {
+ nasty_char* r = s1;
+ if (s1 < s2) {
+ for (; n; --n, ++s1, ++s2)
+ assign(*s1, *s2);
+ } else if (s2 < s1) {
+ s1 += n;
+ s2 += n;
+ for (; n; --n)
+ assign(*--s1, *--s2);
+ }
+ return r;
+}
+
+constexpr nasty_char* nasty_char_traits::copy(nasty_char* s1, const nasty_char* s2, std::size_t n) {
+ if (!std::is_constant_evaluated()) // fails in constexpr because we might be comparing unrelated pointers
+ assert(s2 < s1 || s2 >= s1 + n);
+ nasty_char* r = s1;
+ for (; n; --n, ++s1, ++s2)
+ assign(*s1, *s2);
+ return r;
+}
+
+constexpr nasty_char* nasty_char_traits::assign(nasty_char* s, std::size_t n, nasty_char a) {
+ nasty_char* r = s;
+ for (; n; --n, ++s)
+ assign(*s, a);
+ return r;
+}
+
+using nasty_string = std::basic_string<nasty_char, nasty_char_traits>;
+
+template <std::size_t N>
+struct ToNastyChar {
+ constexpr ToNastyChar(const char (&r)[N]) {
+ std::transform(r, r + N, std::addressof(text[0]), [](char c) { return nasty_char{c}; });
+ }
+ nasty_char text[N];
+};
+
+template <std::size_t N>
+ToNastyChar(const char (&)[N]) -> ToNastyChar<N>;
+
+template <ToNastyChar t>
+constexpr auto to_nasty_char() {
+ return t;
+}
+
+// A macro like MAKE_CSTRING
+//
+// The difference is this macro can convert the nasty_char too.
+//
+// The lambda is a template, so the 'if constexpr' false branch is not evaluated for the nasty_char.
+# define CONVERT_TO_CSTRING(CHAR, STR) \
+ []<class CharT> { \
+ if constexpr (std::is_same_v<CharT, nasty_char>) { \
+ static constexpr auto result = to_nasty_char<STR>(); \
+ return result.text; \
+ } else \
+ return MAKE_CSTRING(CharT, STR); \
+ }.template operator()<CHAR>() /* */
+#else // TEST_HAS_NO_NASTY_STRING
+# define CONVERT_TO_CSTRING(CharT, STR) MAKE_CSTRING(CharT, STR)
+#endif // TEST_HAS_NO_NASTY_STRING
+
+#endif // TEST_SUPPORT_NASTY_STRING_H
diff --git a/third_party/llvm-project/libcxx/test/support/operator_hijacker.h b/third_party/llvm-project/libcxx/test/support/operator_hijacker.h
index 34be330..a2569da 100644
--- a/third_party/llvm-project/libcxx/test/support/operator_hijacker.h
+++ b/third_party/llvm-project/libcxx/test/support/operator_hijacker.h
@@ -31,9 +31,16 @@
friend void operator||(T&&, U&&) = delete;
};
+static_assert(std::is_trivially_copyable<operator_hijacker>::value && //
+ std::is_copy_constructible<operator_hijacker>::value && //
+ std::is_move_constructible<operator_hijacker>::value && //
+ std::is_copy_assignable<operator_hijacker>::value && //
+ std::is_move_assignable<operator_hijacker>::value, //
+ "does not satisfy the requirements for atomic<operator_hijacker>");
+
template <>
struct std::hash<operator_hijacker> {
- size_t operator()(const operator_hijacker&) const { return 0; }
+ std::size_t operator()(const operator_hijacker&) const { return 0; }
};
#endif // SUPPORT_OPERATOR_HIJACKER_H
diff --git a/third_party/llvm-project/libcxx/test/support/platform_support.h b/third_party/llvm-project/libcxx/test/support/platform_support.h
index 88ddf84..ba14b32 100644
--- a/third_party/llvm-project/libcxx/test/support/platform_support.h
+++ b/third_party/llvm-project/libcxx/test/support/platform_support.h
@@ -87,7 +87,7 @@
inline bool glibc_version_less_than(char const* version) {
std::string test_version = std::string("glibc ") + version;
- size_t n = confstr(_CS_GNU_LIBC_VERSION, nullptr, (size_t)0);
+ std::size_t n = confstr(_CS_GNU_LIBC_VERSION, nullptr, (size_t)0);
char *current_version = new char[n];
confstr(_CS_GNU_LIBC_VERSION, current_version, n);
diff --git a/third_party/llvm-project/libcxx/test/support/poisoned_hash_helper.h b/third_party/llvm-project/libcxx/test/support/poisoned_hash_helper.h
index d37f3b3..000b08c 100644
--- a/third_party/llvm-project/libcxx/test/support/poisoned_hash_helper.h
+++ b/third_party/llvm-project/libcxx/test/support/poisoned_hash_helper.h
@@ -11,6 +11,7 @@
#define SUPPORT_POISONED_HASH_HELPER_H
#include <cassert>
+#include <cstddef>
#include <type_traits>
#include <utility>
@@ -117,7 +118,7 @@
template <class Hasher, class Key, class Res = decltype(std::declval<Hasher&>()(std::declval<Key>()))>
constexpr bool can_hash(int) {
- return std::is_same<Res, size_t>::value;
+ return std::is_same<Res, std::size_t>::value;
}
template <class, class>
constexpr bool can_hash(long) {
diff --git a/third_party/llvm-project/libcxx/test/support/rapid-cxx-test.h b/third_party/llvm-project/libcxx/test/support/rapid-cxx-test.h
deleted file mode 100644
index 0f3dcd8..0000000
--- a/third_party/llvm-project/libcxx/test/support/rapid-cxx-test.h
+++ /dev/null
@@ -1,866 +0,0 @@
-#ifndef RAPID_CXX_TEST_H
-#define RAPID_CXX_TEST_H
-
-# include <cstddef>
-# include <cstdlib>
-# include <cstdio>
-# include <cstring>
-# include <cassert>
-
-#include "test_macros.h"
-
-#if !defined(RAPID_CXX_TEST_NO_SYSTEM_HEADER) || !defined(__GNUC__)
-#pragma GCC system_header
-#endif
-
-# define RAPID_CXX_TEST_PP_CAT(x, y) RAPID_CXX_TEST_PP_CAT_2(x, y)
-# define RAPID_CXX_TEST_PP_CAT_2(x, y) x##y
-
-# define RAPID_CXX_TEST_PP_STR(...) RAPID_CXX_TEST_PP_STR_2(__VA_ARGS__)
-# define RAPID_CXX_TEST_PP_STR_2(...) #__VA_ARGS__
-
-# if defined(__GNUC__)
-# define TEST_FUNC_NAME() __PRETTY_FUNCTION__
-# define RAPID_CXX_TEST_UNUSED __attribute__((unused))
-# else
-# define TEST_FUNC_NAME() __func__
-# define RAPID_CXX_TEST_UNUSED
-# endif
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_SUITE
-////////////////////////////////////////////////////////////////////////////////
-# define TEST_SUITE(Name) \
-namespace Name \
-{ \
- inline ::rapid_cxx_test::test_suite & get_test_suite() \
- { \
- static ::rapid_cxx_test::test_suite m_suite(#Name); \
- return m_suite; \
- } \
- \
- inline int unit_test_main(int, char**) \
- { \
- ::rapid_cxx_test::test_runner runner(get_test_suite()); \
- return runner.run(); \
- } \
-} \
-int main(int argc, char **argv) \
-{ \
- return Name::unit_test_main(argc, argv); \
-} \
-namespace Name \
-{ /* namespace closed in TEST_SUITE_END */
-#
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_SUITE_END
-////////////////////////////////////////////////////////////////////////////////
-# define TEST_SUITE_END() \
-} /* namespace opened in TEST_SUITE(...) */
-#
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_CASE
-////////////////////////////////////////////////////////////////////////////////
-
-# if !defined(__clang__)
-#
-# define TEST_CASE(Name) \
- void Name(); \
- static void RAPID_CXX_TEST_PP_CAT(Name, _invoker)() \
- { \
- Name(); \
- } \
- static ::rapid_cxx_test::registrar \
- RAPID_CXX_TEST_PP_CAT(rapid_cxx_test_registrar_, Name)( \
- get_test_suite() \
- , ::rapid_cxx_test::test_case(__FILE__, #Name, __LINE__, & RAPID_CXX_TEST_PP_CAT(Name, _invoker)) \
- ); \
- void Name()
-#
-# else /* __clang__ */
-#
-# define TEST_CASE(Name) \
- void Name(); \
- static void RAPID_CXX_TEST_PP_CAT(Name, _invoker)() \
- { \
- Name(); \
- } \
- _Pragma("clang diagnostic push") \
- _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \
- static ::rapid_cxx_test::registrar \
- RAPID_CXX_TEST_PP_CAT(rapid_cxx_test_registrar_, Name)( \
- get_test_suite() \
- , ::rapid_cxx_test::test_case(__FILE__, #Name, __LINE__, & RAPID_CXX_TEST_PP_CAT(Name, _invoker)) \
- ); \
- _Pragma("clang diagnostic pop") \
- void Name()
-#
-# endif /* !defined(__clang__) */
-
-
-# define TEST_SET_CHECKPOINT() ::rapid_cxx_test::set_checkpoint(__FILE__, TEST_FUNC_NAME(), __LINE__)
-
-#define RAPID_CXX_TEST_OUTCOME()
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_UNSUPPORTED
-////////////////////////////////////////////////////////////////////////////////
-# define TEST_UNSUPPORTED() \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::unsupported, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "", "" \
- ); \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- return; \
- } while (false)
-#
-
-
-////////////////////////////////////////////////////////////////////////////////
-// BASIC ASSERTIONS
-////////////////////////////////////////////////////////////////////////////////
-# define TEST_WARN(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_WARN(" #__VA_ARGS__ ")", "" \
- ); \
- if (not (__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::warn; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-# define TEST_CHECK(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_CHECK(" #__VA_ARGS__ ")", "" \
- ); \
- if (not (__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::check; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-# define TEST_REQUIRE(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_REQUIRE(" #__VA_ARGS__ ")", "" \
- ); \
- if (not (__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::require; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- return; \
- } \
- } while (false)
-#
-
-# define TEST_ASSERT(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_ASSERT(" #__VA_ARGS__ ")", "" \
- ); \
- if (not (__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::assert; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- std::abort(); \
- } \
- } while (false)
-#
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_CHECK_NO_THROW / TEST_CHECK_THROW
-////////////////////////////////////////////////////////////////////////////////
-#ifndef TEST_HAS_NO_EXCEPTIONS
-
-# define TEST_CHECK_NO_THROW(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_CHECK_NO_THROW(" #__VA_ARGS__ ")", "" \
- ); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- } catch (...) { \
- m_f.type = ::rapid_cxx_test::failure_type::check; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-# define TEST_CHECK_THROW(Except, ...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_CHECK_THROW(" #Except "," #__VA_ARGS__ ")", "" \
- ); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- m_f.type = ::rapid_cxx_test::failure_type::check; \
- } catch (Except const &) {} \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-#define TEST_CHECK_THROW_RESULT(Except, Checker, ...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f(::rapid_cxx_test::failure_type::none, \
- __FILE__, TEST_FUNC_NAME(), __LINE__, \
- "TEST_CHECK_THROW_RESULT(" #Except \
- "," #Checker "," #__VA_ARGS__ ")", \
- ""); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- m_f.type = ::rapid_cxx_test::failure_type::check; \
- } catch (Except const& Caught) { \
- Checker(Caught); \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-#else // TEST_HAS_NO_EXCEPTIONS
-
-# define TEST_CHECK_NO_THROW(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_CHECK_NO_THROW(" #__VA_ARGS__ ")", "" \
- ); \
- (static_cast<void>(__VA_ARGS__)); \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-#define TEST_CHECK_THROW(Except, ...) ((void)0)
-#define TEST_CHECK_THROW_RESULT(Except, Checker, ...) ((void)0)
-
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_REQUIRE_NO_THROW / TEST_REQUIRE_THROWs
-////////////////////////////////////////////////////////////////////////////////
-#ifndef TEST_HAS_NO_EXCEPTIONS
-
-# define TEST_REQUIRE_NO_THROW(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_REQUIRE_NO_THROW(" #__VA_ARGS__ ")", "" \
- ); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- } catch (...) { \
- m_f.type = ::rapid_cxx_test::failure_type::require; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- return; \
- } \
- } while (false)
-#
-
-# define TEST_REQUIRE_THROW(Except, ...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_REQUIRE_THROW(" #Except "," #__VA_ARGS__ ")", "" \
- ); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- m_f.type = ::rapid_cxx_test::failure_type::require; \
- } catch (Except const &) {} \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- return; \
- } \
- } while (false)
-#
-
-#else // TEST_HAS_NO_EXCEPTIONS
-
-# define TEST_REQUIRE_NO_THROW(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_REQUIRE_NO_THROW(" #__VA_ARGS__ ")", "" \
- ); \
- (static_cast<void>(__VA_ARGS__)); \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-#define TEST_REQUIRE_THROW(Except, ...) ((void)0)
-
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-////////////////////////////////////////////////////////////////////////////////
-// TEST_ASSERT_NO_THROW / TEST_ASSERT_THROW
-////////////////////////////////////////////////////////////////////////////////
-#ifndef TEST_HAS_NO_EXCEPTIONS
-
-# define TEST_ASSERT_NO_THROW(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_ASSERT_NO_THROW(" #__VA_ARGS__ ")", "" \
- ); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- } catch (...) { \
- m_f.type = ::rapid_cxx_test::failure_type::assert; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- std::abort(); \
- } \
- } while (false)
-#
-
-# define TEST_ASSERT_THROW(Except, ...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_ASSERT_THROW(" #Except "," #__VA_ARGS__ ")", "" \
- ); \
- try { \
- (static_cast<void>(__VA_ARGS__)); \
- m_f.type = ::rapid_cxx_test::failure_type::assert; \
- } catch (Except const &) {} \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- std::abort(); \
- } \
- } while (false)
-#
-
-#else // TEST_HAS_NO_EXCEPTIONS
-
-# define TEST_ASSERT_NO_THROW(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_ASSERT_NO_THROW(" #__VA_ARGS__ ")", "" \
- ); \
- (static_cast<void>(__VA_ARGS__)); \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-#define TEST_ASSERT_THROW(Except, ...) ((void)0)
-
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-////////////////////////////////////////////////////////////////////////////////
-//
-////////////////////////////////////////////////////////////////////////////////
-
-# define TEST_WARN_EQUAL_COLLECTIONS(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_WARN_EQUAL_COLLECTIONS(" #__VA_ARGS__ ")", "" \
- ); \
- if (not ::rapid_cxx_test::detail::check_equal_collections_impl(__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::warn; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-# define TEST_CHECK_EQUAL_COLLECTIONS(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_CHECK_EQUAL_COLLECTIONS(" #__VA_ARGS__ ")", "" \
- ); \
- if (not ::rapid_cxx_test::detail::check_equal_collections_impl(__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::check; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- } while (false)
-#
-
-# define TEST_REQUIRE_EQUAL_COLLECTIONS(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_REQUIRE_EQUAL_COLLECTIONS(" #__VA_ARGS__ ")", "" \
- ); \
- if (not ::rapid_cxx_test::detail::check_equal_collections_impl(__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::require; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- return; \
- } \
- } while (false)
-#
-
-# define TEST_ASSERT_EQUAL_COLLECTIONS(...) \
- do { \
- TEST_SET_CHECKPOINT(); \
- ::rapid_cxx_test::test_outcome m_f( \
- ::rapid_cxx_test::failure_type::none, __FILE__, TEST_FUNC_NAME(), __LINE__ \
- , "TEST_ASSERT_EQUAL_COLLECTIONS(" #__VA_ARGS__ ")", "" \
- ); \
- if (not ::rapid_cxx_test::detail::check_equal_collections_impl(__VA_ARGS__)) { \
- m_f.type = ::rapid_cxx_test::failure_type::assert; \
- } \
- ::rapid_cxx_test::get_reporter().report(m_f); \
- if (m_f.type != ::rapid_cxx_test::failure_type::none) { \
- ::std::abort(); \
- } \
- } while (false)
-#
-
-namespace rapid_cxx_test
-{
- typedef void (*invoker_t)();
-
- ////////////////////////////////////////////////////////////////////////////
- struct test_case
- {
- test_case()
- : file(""), func(""), line(0), invoke(NULL)
- {}
-
- test_case(const char* file1, const char* func1, std::size_t line1,
- invoker_t invoke1)
- : file(file1), func(func1), line(line1), invoke(invoke1)
- {}
-
- const char *file;
- const char *func;
- std::size_t line;
- invoker_t invoke;
- };
-
- ////////////////////////////////////////////////////////////////////////////
- struct failure_type
- {
- enum enum_type {
- none,
- unsupported,
- warn,
- check,
- require,
- assert,
- uncaught_exception
- };
- };
-
- typedef failure_type::enum_type failure_type_t;
-
- ////////////////////////////////////////////////////////////////////////////
- struct test_outcome
- {
- test_outcome()
- : type(failure_type::none),
- file(""), func(""), line(0),
- expression(""), message("")
- {}
-
- test_outcome(failure_type_t type1, const char* file1, const char* func1,
- std::size_t line1, const char* expression1,
- const char* message1)
- : type(type1), file(file1), func(func1), line(line1),
- expression(expression1), message(message1)
- {
- trim_func_string();
- }
-
- failure_type_t type;
- const char *file;
- const char *func;
- std::size_t line;
- const char *expression;
- const char *message;
-
- private:
- void trim_file_string() {
- const char* f_start = file;
- const char* prev_start = f_start;
- const char* last_start = f_start;
- char last;
- while ((last = *f_start) != '\0') {
- ++f_start;
- if (last == '/' && *f_start) {
- prev_start = last_start;
- last_start = f_start;
- }
- }
- file = prev_start;
- }
- void trim_func_string() {
- const char* void_loc = ::strstr(func, "void ");
- if (void_loc == func) {
- func += strlen("void ");
- }
- const char* namespace_loc = ::strstr(func, "::");
- if (namespace_loc) {
- func = namespace_loc + 2;
- }
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////
- struct checkpoint
- {
- const char *file;
- const char *func;
- std::size_t line;
- };
-
- namespace detail
- {
- inline checkpoint & global_checkpoint()
- {
- static checkpoint cp = {"", "", 0};
- return cp;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////
- inline void set_checkpoint(const char* file, const char* func, std::size_t line)
- {
- checkpoint& cp = detail::global_checkpoint();
- cp.file = file;
- cp.func = func;
- cp.line = line;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- inline checkpoint const & get_checkpoint()
- {
- return detail::global_checkpoint();
- }
-
- ////////////////////////////////////////////////////////////////////////////
- class test_suite
- {
- public:
- typedef test_case const* iterator;
- typedef iterator const_iterator;
-
- public:
- test_suite(const char *xname)
- : m_name(xname), m_tests(), m_size(0)
- {
- assert(xname);
- }
-
- public:
- const char *name() const { return m_name; }
-
- std::size_t size() const { return m_size; }
-
- test_case const & operator[](std::size_t i) const
- {
- assert(i < m_size);
- return m_tests[i];
- }
-
- const_iterator begin() const
- { return m_tests; }
-
- const_iterator end() const
- {
- return m_tests + m_size;
- }
-
- public:
- std::size_t register_test(test_case tc)
- {
- static std::size_t test_case_max = sizeof(m_tests) / sizeof(test_case);
- assert(m_size < test_case_max);
- m_tests[m_size] = tc;
- return m_size++;
- }
-
- private:
- test_suite(test_suite const &);
- test_suite & operator=(test_suite const &);
-
- private:
- const char* m_name;
- // Since fast compile times in a priority, we use simple containers
- // with hard limits.
- test_case m_tests[256];
- std::size_t m_size;
- };
-
- ////////////////////////////////////////////////////////////////////////////
- class registrar
- {
- public:
- registrar(test_suite & st, test_case tc)
- {
- st.register_test(tc);
- }
- };
-
- ////////////////////////////////////////////////////////////////////////////
- class test_reporter
- {
- public:
- test_reporter()
- : m_testcases(0), m_testcase_failures(0), m_unsupported(0),
- m_assertions(0), m_warning_failures(0), m_check_failures(0),
- m_require_failures(0), m_uncaught_exceptions(0), m_failure()
- {
- }
-
- void test_case_begin()
- {
- ++m_testcases;
- clear_failure();
- }
-
- void test_case_end()
- {
- if (m_failure.type != failure_type::none
- && m_failure.type != failure_type::unsupported) {
- ++m_testcase_failures;
- }
- }
-
-# if defined(__GNUC__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wswitch-default"
-# endif
- // Each assertion and failure is reported through this function.
- void report(test_outcome o)
- {
- ++m_assertions;
- switch (o.type)
- {
- case failure_type::none:
- break;
- case failure_type::unsupported:
- ++m_unsupported;
- m_failure = o;
- break;
- case failure_type::warn:
- ++m_warning_failures;
- report_error(o);
- break;
- case failure_type::check:
- ++m_check_failures;
- report_error(o);
- m_failure = o;
- break;
- case failure_type::require:
- ++m_require_failures;
- report_error(o);
- m_failure = o;
- break;
- case failure_type::assert:
- report_error(o);
- break;
- case failure_type::uncaught_exception:
- ++m_uncaught_exceptions;
- std::fprintf(stderr
- , "Test case FAILED with uncaught exception:\n"
- " last checkpoint near %s::%lu %s\n\n"
- , o.file, o.line, o.func
- );
- m_failure = o;
- break;
- }
- }
-# if defined(__GNUC__)
-# pragma GCC diagnostic pop
-# endif
-
- test_outcome current_failure() const
- {
- return m_failure;
- }
-
- void clear_failure()
- {
- m_failure.type = failure_type::none;
- m_failure.file = "";
- m_failure.func = "";
- m_failure.line = 0;
- m_failure.expression = "";
- m_failure.message = "";
- }
-
- std::size_t test_case_count() const
- { return m_testcases; }
-
- std::size_t test_case_failure_count() const
- { return m_testcase_failures; }
-
- std::size_t unsupported_count() const
- { return m_unsupported; }
-
- std::size_t assertion_count() const
- { return m_assertions; }
-
- std::size_t warning_failure_count() const
- { return m_warning_failures; }
-
- std::size_t check_failure_count() const
- { return m_check_failures; }
-
- std::size_t require_failure_count() const
- { return m_require_failures; }
-
- std::size_t failure_count() const
- { return m_check_failures + m_require_failures + m_uncaught_exceptions; }
-
- // Print a summary of what was run and the outcome.
- void print_summary(const char* suitename) const
- {
- FILE* out = failure_count() ? stderr : stdout;
- std::size_t testcases_run = m_testcases - m_unsupported;
- std::fprintf(out, "Summary for testsuite %s:\n", suitename);
- std::fprintf(out, " %lu of %lu test cases passed.\n", testcases_run - m_testcase_failures, testcases_run);
- std::fprintf(out, " %lu of %lu assertions passed.\n", m_assertions - (m_warning_failures + m_check_failures + m_require_failures), m_assertions);
- std::fprintf(out, " %lu unsupported test case%s.\n", m_unsupported, (m_unsupported != 1 ? "s" : ""));
- }
-
- private:
- test_reporter(test_reporter const &);
- test_reporter const & operator=(test_reporter const &);
-
- void report_error(test_outcome o) const
- {
- std::fprintf(stderr, "In %s:%lu Assertion %s failed.\n in file: %s\n %s\n"
- , o.func, o.line, o.expression, o.file, o.message ? o.message : ""
- );
- }
-
- private:
- // counts of testcases, failed testcases, and unsupported testcases.
- std::size_t m_testcases;
- std::size_t m_testcase_failures;
- std::size_t m_unsupported;
-
- // counts of assertions and assertion failures.
- std::size_t m_assertions;
- std::size_t m_warning_failures;
- std::size_t m_check_failures;
- std::size_t m_require_failures;
- std::size_t m_uncaught_exceptions;
-
- // The last failure. This is cleared between testcases.
- test_outcome m_failure;
- };
-
- ////////////////////////////////////////////////////////////////////////////
- inline test_reporter & get_reporter()
- {
- static test_reporter o;
- return o;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- class test_runner
- {
- public:
- test_runner(test_suite & ts)
- : m_ts(ts)
- {}
-
- public:
- int run()
- {
- // for each testcase
- for (test_suite::const_iterator b = m_ts.begin(), e = m_ts.end();
- b != e; ++b)
- {
- test_case const& tc = *b;
- set_checkpoint(tc.file, tc.func, tc.line);
- get_reporter().test_case_begin();
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
-#endif
- tc.invoke();
-#ifndef TEST_HAS_NO_EXCEPTIONS
- } catch (...) {
- test_outcome o;
- o.type = failure_type::uncaught_exception;
- o.file = get_checkpoint().file;
- o.func = get_checkpoint().func;
- o.line = get_checkpoint().line;
- o.expression = "";
- o.message = "";
- get_reporter().report(o);
- }
-#endif
- get_reporter().test_case_end();
- }
- auto exit_code = get_reporter().failure_count() ? EXIT_FAILURE : EXIT_SUCCESS;
- if (exit_code == EXIT_FAILURE || get_reporter().unsupported_count())
- get_reporter().print_summary(m_ts.name());
- return exit_code;
- }
-
- private:
- test_runner(test_runner const &);
- test_runner operator=(test_runner const &);
-
- test_suite & m_ts;
- };
-
- namespace detail
- {
- template <class Iter1, class Iter2>
- bool check_equal_collections_impl(
- Iter1 start1, Iter1 const end1
- , Iter2 start2, Iter2 const end2
- )
- {
- while (start1 != end1 && start2 != end2) {
- if (*start1 != *start2) {
- return false;
- }
- ++start1; ++start2;
- }
- return (start1 == end1 && start2 == end2);
- }
- } // namespace detail
-
-} // namespace rapid_cxx_test
-
-
-# if defined(__GNUC__)
-# pragma GCC diagnostic pop
-# endif
-
-#endif /* RAPID_CXX_TEST_H */
diff --git a/third_party/llvm-project/libcxx/test/support/test.support/test_check_assertion.pass.cpp b/third_party/llvm-project/libcxx/test/support/test.support/test_check_assertion.pass.cpp
index cd09445..5612bec 100644
--- a/third_party/llvm-project/libcxx/test/support/test.support/test_check_assertion.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/support/test.support/test_check_assertion.pass.cpp
@@ -8,7 +8,7 @@
// REQUIRES: has-unix-headers
// UNSUPPORTED: c++03
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: availability-verbose_abort-missing
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
#include <cassert>
diff --git a/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp b/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
index cc156e2..efdf1c0 100644
--- a/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
@@ -17,7 +17,6 @@
# error "TEST_HAS_NO_EXCEPTIONS should be defined"
#endif
-int main(int, char**) {
+void f() {
try { (void)0; } catch (...) { } // expected-error {{exceptions disabled}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp b/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp
index a7f3557..8790c73 100644
--- a/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp
+++ b/third_party/llvm-project/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp
@@ -20,8 +20,7 @@
struct A { virtual ~A() { } };
struct B : A { };
-int main(int, char**) {
+void f() {
A* ptr = new B;
(void)dynamic_cast<B*>(ptr); // expected-error{{use of dynamic_cast requires -frtti}}
- return 0;
}
diff --git a/third_party/llvm-project/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp b/third_party/llvm-project/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
index f204fc3..8145074 100644
--- a/third_party/llvm-project/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
@@ -17,7 +17,7 @@
#include "test_macros.h"
-template <class T, size_t = sizeof(T)>
+template <class T, std::size_t = sizeof(T)>
constexpr bool is_complete_imp(int) { return true; }
template <class> constexpr bool is_complete_imp(long) { return false; }
template <class T> constexpr bool is_complete() { return is_complete_imp<T>(0); }
diff --git a/third_party/llvm-project/libcxx/test/support/test.support/type_algorithms.pass.cpp b/third_party/llvm-project/libcxx/test/support/test.support/type_algorithms.pass.cpp
index f94487d..cf6144d 100644
--- a/third_party/llvm-project/libcxx/test/support/test.support/type_algorithms.pass.cpp
+++ b/third_party/llvm-project/libcxx/test/support/test.support/type_algorithms.pass.cpp
@@ -14,14 +14,14 @@
#include "type_algorithms.h"
// concatenate
-static_assert(std::is_same<meta::concatenate_t<meta::type_list<> >, meta::type_list<> >::value, "");
-static_assert(std::is_same<meta::concatenate_t<meta::type_list<int> >, meta::type_list<int> >::value, "");
+static_assert(std::is_same<types::concatenate_t<types::type_list<> >, types::type_list<> >::value, "");
+static_assert(std::is_same<types::concatenate_t<types::type_list<int> >, types::type_list<int> >::value, "");
static_assert(
- std::is_same<meta::concatenate_t<meta::type_list<int>, meta::type_list<long> >, meta::type_list<int, long> >::value,
+ std::is_same<types::concatenate_t<types::type_list<int>, types::type_list<long> >, types::type_list<int, long> >::value,
"");
static_assert(
- std::is_same<meta::concatenate_t<meta::type_list<int>, meta::type_list<long>, meta::type_list<long long> >,
- meta::type_list<int, long, long long> >::value,
+ std::is_same<types::concatenate_t<types::type_list<int>, types::type_list<long>, types::type_list<long long> >,
+ types::type_list<int, long, long long> >::value,
"");
// apply_all
@@ -57,7 +57,7 @@
TEST_CONSTEXPR_CXX20 void test_for_each() {
bool is_called_array[3] = {};
- meta::for_each(meta::type_list<NumT<0>, NumT<1>, NumT<2> >(), ApplyAllTest(is_called_array));
+ types::for_each(types::type_list<NumT<0>, NumT<1>, NumT<2> >(), ApplyAllTest(is_called_array));
assert(std::all_of(is_called_array, is_called_array + 3, Identity()));
}
diff --git a/third_party/llvm-project/libcxx/test/support/test_allocator.h b/third_party/llvm-project/libcxx/test/support/test_allocator.h
index 3b9676e..9330150 100644
--- a/third_party/llvm-project/libcxx/test/support/test_allocator.h
+++ b/third_party/llvm-project/libcxx/test/support/test_allocator.h
@@ -31,6 +31,8 @@
int throw_after = INT_MAX;
int count = 0;
int alloc_count = 0;
+ int construct_count = 0; // the number of times that ::construct was called
+ int destroy_count = 0; // the number of times that ::destroy was called
int copied = 0;
int moved = 0;
int converted = 0;
@@ -40,6 +42,8 @@
count = 0;
time_to_throw = 0;
alloc_count = 0;
+ construct_count = 0;
+ destroy_count = 0;
throw_after = INT_MAX;
clear_ctor_counters();
}
@@ -144,7 +148,7 @@
TEST_CONSTEXPR pointer address(reference x) const { return &x; }
TEST_CONSTEXPR const_pointer address(const_reference x) const { return &x; }
- TEST_CONSTEXPR_CXX14 pointer allocate(size_type n, const void* = 0) {
+ TEST_CONSTEXPR_CXX14 pointer allocate(size_type n, const void* = nullptr) {
assert(data_ != test_alloc_base::destructed_value);
if (stats_ != nullptr) {
if (stats_->time_to_throw >= stats_->throw_after)
@@ -166,6 +170,8 @@
template <class U>
TEST_CONSTEXPR_CXX20 void construct(pointer p, U&& val) {
+ if (stats_ != nullptr)
+ ++stats_->construct_count;
#if TEST_STD_VER > 17
std::construct_at(std::to_address(p), std::forward<U>(val));
#else
@@ -173,7 +179,11 @@
#endif
}
- TEST_CONSTEXPR_CXX14 void destroy(pointer p) { p->~T(); }
+ TEST_CONSTEXPR_CXX14 void destroy(pointer p) {
+ if (stats_ != nullptr)
+ ++stats_->destroy_count;
+ p->~T();
+ }
TEST_CONSTEXPR friend bool operator==(const test_allocator& x, const test_allocator& y) { return x.data_ == y.data_; }
TEST_CONSTEXPR friend bool operator!=(const test_allocator& x, const test_allocator& y) { return !(x == y); }
@@ -181,88 +191,6 @@
TEST_CONSTEXPR int get_id() const { return id_; }
};
-template <class T>
-class non_default_test_allocator {
- int data_ = 0;
- test_allocator_statistics* stats_ = nullptr;
-
- template <class U>
- friend class non_default_test_allocator;
-
-public:
- typedef unsigned size_type;
- typedef int difference_type;
- typedef T value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef typename std::add_lvalue_reference<value_type>::type reference;
- typedef typename std::add_lvalue_reference<const value_type>::type const_reference;
-
- template <class U>
- struct rebind {
- typedef non_default_test_allocator<U> other;
- };
-
- TEST_CONSTEXPR_CXX14
- explicit non_default_test_allocator(int i, test_allocator_statistics* stats = nullptr) TEST_NOEXCEPT
- : data_(i), stats_(stats) {
- if (stats_ != nullptr) {
- ++stats_->count;
- }
- }
-
- TEST_CONSTEXPR_CXX14
- non_default_test_allocator(const non_default_test_allocator& a) TEST_NOEXCEPT : data_(a.data_), stats_(a.stats_) {
- if (stats_ != nullptr)
- ++stats_->count;
- }
-
- template <class U>
- TEST_CONSTEXPR_CXX14 non_default_test_allocator(const non_default_test_allocator<U>& a) TEST_NOEXCEPT
- : data_(a.data_), stats_(a.stats_) {
- if (stats_ != nullptr)
- ++stats_->count;
- }
-
- TEST_CONSTEXPR_CXX20 ~non_default_test_allocator() TEST_NOEXCEPT {
- assert(data_ != test_alloc_base::destructed_value);
- if (stats_ != nullptr)
- --stats_->count;
- data_ = test_alloc_base::destructed_value;
- }
-
- TEST_CONSTEXPR pointer address(reference x) const { return &x; }
- TEST_CONSTEXPR const_pointer address(const_reference x) const { return &x; }
-
- TEST_CONSTEXPR_CXX20 pointer allocate(size_type n, const void* = nullptr) {
- assert(data_ != test_alloc_base::destructed_value);
- if (stats_ != nullptr) {
- if (stats_->time_to_throw >= stats_->throw_after)
- TEST_THROW(std::bad_alloc());
- ++stats_->time_to_throw;
- ++stats_->alloc_count;
- }
- return std::allocator<value_type>().allocate(n);
- }
-
- TEST_CONSTEXPR_CXX20 void deallocate(pointer p, size_type n) {
- assert(data_ != test_alloc_base::destructed_value);
- if (stats_ != nullptr)
- --stats_->alloc_count;
- std::allocator<value_type>().deallocate(p, n);
- }
-
- TEST_CONSTEXPR size_type max_size() const TEST_NOEXCEPT { return UINT_MAX / sizeof(T); }
-
- TEST_CONSTEXPR friend bool operator==(const non_default_test_allocator& x, const non_default_test_allocator& y) {
- return x.data_ == y.data_;
- }
-
- TEST_CONSTEXPR friend bool operator!=(const non_default_test_allocator& x, const non_default_test_allocator& y) {
- return !(x == y);
- }
-};
-
template <>
class test_allocator<void> {
int data_ = 0;
@@ -477,7 +405,7 @@
struct control_block {
template <class... Args>
TEST_CONSTEXPR control_block(Args... args) : content(std::forward<Args>(args)...) {}
- size_t ref_count = 1;
+ std::size_t ref_count = 1;
T content;
};
diff --git a/third_party/llvm-project/libcxx/test/support/test_comparisons.h b/third_party/llvm-project/libcxx/test/support/test_comparisons.h
index 8187a7c..c54e877 100644
--- a/third_party/llvm-project/libcxx/test/support/test_comparisons.h
+++ b/third_party/llvm-project/libcxx/test/support/test_comparisons.h
@@ -24,7 +24,9 @@
#define TEST_COMPARISONS_H
#include <cassert>
+#include <compare>
#include <concepts>
+#include <limits>
#include <type_traits>
#include <utility>
@@ -238,4 +240,33 @@
return lhs.value == rhs.value;
}
};
+
+#if TEST_STD_VER > 17
+struct StrongOrder {
+ int value;
+ constexpr StrongOrder(int v) : value(v) {}
+ friend std::strong_ordering operator<=>(StrongOrder, StrongOrder) = default;
+};
+
+struct WeakOrder {
+ int value;
+ constexpr WeakOrder(int v) : value(v) {}
+ friend std::weak_ordering operator<=>(WeakOrder, WeakOrder) = default;
+};
+
+struct PartialOrder {
+ int value;
+ constexpr PartialOrder(int v) : value(v) {}
+ friend constexpr std::partial_ordering operator<=>(PartialOrder lhs, PartialOrder rhs) {
+ if (lhs.value == std::numeric_limits<int>::min() || rhs.value == std::numeric_limits<int>::min())
+ return std::partial_ordering::unordered;
+ return lhs.value <=> rhs.value;
+ }
+ friend constexpr bool operator==(PartialOrder lhs, PartialOrder rhs) {
+ return (lhs <=> rhs) == std::partial_ordering::equivalent;
+ }
+};
+
+#endif
+
#endif // TEST_COMPARISONS_H
diff --git a/third_party/llvm-project/libcxx/test/support/test_constexpr_container.h b/third_party/llvm-project/libcxx/test/support/test_constexpr_container.h
index 092f8b6..ca553be 100644
--- a/third_party/llvm-project/libcxx/test/support/test_constexpr_container.h
+++ b/third_party/llvm-project/libcxx/test/support/test_constexpr_container.h
@@ -14,6 +14,7 @@
#include <algorithm>
#include <cassert>
+#include <cstddef>
#include <utility>
#include "test_macros.h"
@@ -34,7 +35,7 @@
constexpr iterator end() { return data_ + size_; }
constexpr const_iterator begin() const { return data_; }
constexpr const_iterator end() const { return data_ + size_; }
- constexpr size_t size() const { return size_; }
+ constexpr std::size_t size() const { return size_; }
constexpr const T& front() const { assert(size_ >= 1); return data_[0]; }
constexpr const T& back() const { assert(size_ >= 1); return data_[size_-1]; }
diff --git a/third_party/llvm-project/libcxx/test/support/test_container_comparisons.h b/third_party/llvm-project/libcxx/test/support/test_container_comparisons.h
new file mode 100644
index 0000000..561275c
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/support/test_container_comparisons.h
@@ -0,0 +1,208 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+// Utility functions to test comparisons on containers.
+
+#ifndef TEST_CONTAINER_COMPARISONS
+#define TEST_CONTAINER_COMPARISONS
+
+#include "test_comparisons.h"
+
+// Implementation detail of `test_sequence_container_spaceship`
+template <template <typename...> typename Container, typename Elem, typename Order>
+constexpr void test_sequence_container_spaceship_with_type() {
+ // Empty containers
+ {
+ Container<Elem> l1;
+ Container<Elem> l2;
+ assert(testOrder(l1, l2, Order::equivalent));
+ }
+ // Identical contents
+ {
+ Container<Elem> l1{1, 1};
+ Container<Elem> l2{1, 1};
+ assert(testOrder(l1, l2, Order::equivalent));
+ }
+ // Less, due to contained values
+ {
+ Container<Elem> l1{1, 1};
+ Container<Elem> l2{1, 2};
+ assert(testOrder(l1, l2, Order::less));
+ }
+ // Greater, due to contained values
+ {
+ Container<Elem> l1{1, 3};
+ Container<Elem> l2{1, 2};
+ assert(testOrder(l1, l2, Order::greater));
+ }
+ // Shorter list
+ {
+ Container<Elem> l1{1};
+ Container<Elem> l2{1, 2};
+ assert(testOrder(l1, l2, Order::less));
+ }
+ // Longer list
+ {
+ Container<Elem> l1{1, 2};
+ Container<Elem> l2{1};
+ assert(testOrder(l1, l2, Order::greater));
+ }
+ // Unordered
+ if constexpr (std::is_same_v<Elem, PartialOrder>) {
+ Container<Elem> l1{1, std::numeric_limits<int>::min()};
+ Container<Elem> l2{1, 2};
+ assert(testOrder(l1, l2, Order::unordered));
+ }
+}
+
+// Tests the `operator<=>` on sequence containers
+template <template <typename...> typename Container>
+constexpr bool test_sequence_container_spaceship() {
+ // The container should fulfil `std::three_way_comparable`
+ static_assert(std::three_way_comparable<Container<int>>);
+
+ // Test different comparison categories
+ test_sequence_container_spaceship_with_type<Container, int, std::strong_ordering>();
+ test_sequence_container_spaceship_with_type<Container, StrongOrder, std::strong_ordering>();
+ test_sequence_container_spaceship_with_type<Container, WeakOrder, std::weak_ordering>();
+ test_sequence_container_spaceship_with_type<Container, PartialOrder, std::partial_ordering>();
+
+ // `LessAndEqComp` does not have `operator<=>`. ordering is sythesized based on `operator<`
+ test_sequence_container_spaceship_with_type<Container, LessAndEqComp, std::weak_ordering>();
+
+ // Thanks to SFINAE, the following is not a compiler error but returns `false`
+ struct NonComparable {};
+ static_assert(!std::three_way_comparable<Container<NonComparable>>);
+
+ return true;
+}
+
+// Implementation detail of `test_ordered_map_container_spaceship`
+template <template <typename...> typename Container, typename Key, typename Val, typename Order>
+constexpr void test_ordered_map_container_spaceship_with_type() {
+ // Empty containers
+ {
+ Container<Key, Val> l1;
+ Container<Key, Val> l2;
+ assert(testOrder(l1, l2, Order::equivalent));
+ }
+ // Identical contents
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 1}};
+ Container<Key, Val> l2{{1, 1}, {2, 1}};
+ assert(testOrder(l1, l2, Order::equivalent));
+ }
+ // Less, due to contained values
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 1}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}};
+ assert(testOrder(l1, l2, Order::less));
+ }
+ // Greater, due to contained values
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 3}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}};
+ assert(testOrder(l1, l2, Order::greater));
+ }
+ // Shorter list
+ {
+ Container<Key, Val> l1{{1, 1}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}};
+ assert(testOrder(l1, l2, Order::less));
+ }
+ // Longer list
+ {
+ Container<Key, Val> l1{{1, 2}, {2, 2}};
+ Container<Key, Val> l2{{1, 1}};
+ assert(testOrder(l1, l2, Order::greater));
+ }
+ // Unordered
+ if constexpr (std::is_same_v<Val, PartialOrder>) {
+ Container<Key, Val> l1{{1, 1}, {2, std::numeric_limits<int>::min()}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}};
+ assert(testOrder(l1, l2, Order::unordered));
+ }
+
+ // Identical contents
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 1}, {2, 2}};
+ Container<Key, Val> l2{{1, 1}, {2, 1}, {2, 2}};
+ assert(testOrder(l1, l2, Order::equivalent));
+ Container<Key, Val> l3{{1, 1}, {2, 1}, {2, 2}};
+ Container<Key, Val> l4{{2, 1}, {2, 2}, {1, 1}};
+ assert(testOrder(l3, l4, Order::equivalent));
+ }
+ // Less, due to contained values
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 1}, {2, 1}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}, {2, 2}};
+ assert(testOrder(l1, l2, Order::less));
+ Container<Key, Val> l3{{1, 1}, {2, 1}, {2, 1}};
+ Container<Key, Val> l4{{2, 2}, {2, 2}, {1, 1}};
+ assert(testOrder(l3, l4, Order::less));
+ }
+ // Greater, due to contained values
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 3}, {2, 3}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}, {2, 2}};
+ assert(testOrder(l1, l2, Order::greater));
+ Container<Key, Val> l3{{1, 1}, {2, 3}, {2, 3}};
+ Container<Key, Val> l4{{2, 2}, {2, 2}, {1, 1}};
+ assert(testOrder(l3, l4, Order::greater));
+ }
+ // Shorter list
+ {
+ Container<Key, Val> l1{{1, 1}, {2, 2}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}, {2, 2}, {3, 1}};
+ assert(testOrder(l1, l2, Order::less));
+ Container<Key, Val> l3{{1, 1}, {2, 2}};
+ Container<Key, Val> l4{{3, 1}, {2, 2}, {2, 2}, {1, 1}};
+ assert(testOrder(l3, l4, Order::less));
+ }
+ // Longer list
+ {
+ Container<Key, Val> l1{{1, 2}, {2, 2}, {2, 2}, {3, 1}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}};
+ assert(testOrder(l1, l2, Order::greater));
+ Container<Key, Val> l3{{1, 2}, {2, 2}, {2, 2}, {3, 1}};
+ Container<Key, Val> l4{{2, 2}, {1, 1}};
+ assert(testOrder(l3, l4, Order::greater));
+ }
+ // Unordered
+ if constexpr (std::is_same_v<Val, PartialOrder>) {
+ Container<Key, Val> l1{{1, 1}, {2, std::numeric_limits<int>::min()}, {2, 3}};
+ Container<Key, Val> l2{{1, 1}, {2, 2}, {2, 3}};
+ assert(testOrder(l1, l2, Order::unordered));
+ Container<Key, Val> l3{{1, 1}, {2, std::numeric_limits<int>::min()}, {2, 3}};
+ Container<Key, Val> l4{{2, 3}, {2, 2}, {1, 1}};
+ assert(testOrder(l3, l4, Order::unordered));
+ }
+}
+
+// Tests the `operator<=>` on ordered containers
+template <template <typename...> typename Container>
+constexpr bool test_ordered_map_container_spaceship() {
+ // The container should fulfil `std::three_way_comparable`
+ static_assert(std::three_way_comparable<Container<int, int>>);
+
+ // Test different comparison categories
+ test_ordered_map_container_spaceship_with_type<Container, int, int, std::strong_ordering>();
+ test_ordered_map_container_spaceship_with_type<Container, int, StrongOrder, std::strong_ordering>();
+ test_ordered_map_container_spaceship_with_type<Container, int, WeakOrder, std::weak_ordering>();
+ test_ordered_map_container_spaceship_with_type<Container, int, PartialOrder, std::partial_ordering>();
+
+ // `LessAndEqComp` does not have `operator<=>`. ordering is sythesized based on `operator<`
+ test_ordered_map_container_spaceship_with_type<Container, int, LessAndEqComp, std::weak_ordering>();
+
+ // Thanks to SFINAE, the following is not a compiler error but returns `false`
+ struct NonComparable {};
+ static_assert(!std::three_way_comparable<Container<int, NonComparable>>);
+
+ return true;
+}
+
+#endif
diff --git a/third_party/llvm-project/libcxx/test/support/test_iterators.h b/third_party/llvm-project/libcxx/test/support/test_iterators.h
index 588a24f..f0e19fc 100644
--- a/third_party/llvm-project/libcxx/test/support/test_iterators.h
+++ b/third_party/llvm-project/libcxx/test/support/test_iterators.h
@@ -455,7 +455,7 @@
template <typename T>
struct ThrowingIterator {
typedef std::bidirectional_iterator_tag iterator_category;
- typedef ptrdiff_t difference_type;
+ typedef std::ptrdiff_t difference_type;
typedef const T value_type;
typedef const T * pointer;
typedef const T & reference;
@@ -566,7 +566,7 @@
template <typename T>
struct NonThrowingIterator {
typedef std::bidirectional_iterator_tag iterator_category;
- typedef ptrdiff_t difference_type;
+ typedef std::ptrdiff_t difference_type;
typedef const T value_type;
typedef const T * pointer;
typedef const T & reference;
@@ -916,7 +916,7 @@
public:
using value_type = int;
using reference = int&;
- using difference_type = ptrdiff_t;
+ using difference_type = std::ptrdiff_t;
private:
value_type* ptr_ = nullptr;
@@ -1418,23 +1418,33 @@
requires std::ranges::viewable_range<R&&>
ProxyRange(R&&) -> ProxyRange<std::views::all_t<R&&>>;
-namespace meta {
+#endif // TEST_STD_VER > 17
+
+namespace types {
template <class Ptr>
-using random_access_iterator_list = type_list<Ptr, contiguous_iterator<Ptr>, random_access_iterator<Ptr>>;
+using random_access_iterator_list =
+ type_list<Ptr,
+#if TEST_STD_VER >= 20
+ contiguous_iterator<Ptr>,
+#endif
+ random_access_iterator<Ptr> >;
template <class Ptr>
using bidirectional_iterator_list =
- concatenate_t<random_access_iterator_list<Ptr>, type_list<bidirectional_iterator<Ptr>>>;
+ concatenate_t<random_access_iterator_list<Ptr>, type_list<bidirectional_iterator<Ptr> > >;
template <class Ptr>
-using forward_iterator_list = concatenate_t<bidirectional_iterator_list<Ptr>, type_list<forward_iterator<Ptr>>>;
+using forward_iterator_list = concatenate_t<bidirectional_iterator_list<Ptr>, type_list<forward_iterator<Ptr> > >;
template <class Ptr>
+using cpp17_input_iterator_list = concatenate_t<forward_iterator_list<Ptr>, type_list<cpp17_input_iterator<Ptr> > >;
+
+#if TEST_STD_VER >= 20
+template <class Ptr>
using cpp20_input_iterator_list =
concatenate_t<forward_iterator_list<Ptr>, type_list<cpp20_input_iterator<Ptr>, cpp17_input_iterator<Ptr>>>;
+#endif
+} // namespace types
-} // namespace meta
-
-#endif // TEST_STD_VER > 17
#endif // SUPPORT_TEST_ITERATORS_H
diff --git a/third_party/llvm-project/libcxx/test/support/test_macros.h b/third_party/llvm-project/libcxx/test/support/test_macros.h
index 573c8d8..210bbf0 100644
--- a/third_party/llvm-project/libcxx/test/support/test_macros.h
+++ b/third_party/llvm-project/libcxx/test/support/test_macros.h
@@ -78,7 +78,8 @@
#endif
#if defined(__apple_build_version__)
-#define TEST_APPLE_CLANG_VER (__clang_major__ * 100) + __clang_minor__
+// Given AppleClang XX.Y.Z, TEST_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403)
+#define TEST_APPLE_CLANG_VER (__apple_build_version__ / 10000)
#elif defined(__clang_major__)
#define TEST_CLANG_VER (__clang_major__ * 100) + __clang_minor__
#elif defined(__GNUC__)
diff --git a/third_party/llvm-project/libcxx/test/support/test_memory_resource.h b/third_party/llvm-project/libcxx/test/support/test_memory_resource.h
index 1a0d722..280cdae 100644
--- a/third_party/llvm-project/libcxx/test/support/test_memory_resource.h
+++ b/third_party/llvm-project/libcxx/test/support/test_memory_resource.h
@@ -113,8 +113,8 @@
struct NullProvider {
NullProvider() {}
- void* allocate(size_t, size_t) { return nullptr; }
- void deallocate(void*, size_t, size_t) {}
+ void* allocate(std::size_t, size_t) { return nullptr; }
+ void deallocate(void*, std::size_t, size_t) {}
void reset() {}
private:
DISALLOW_COPY(NullProvider);
@@ -122,22 +122,22 @@
struct NewDeleteProvider {
NewDeleteProvider() {}
- void* allocate(size_t s, size_t) { return ::operator new(s); }
- void deallocate(void* p, size_t, size_t) { ::operator delete(p); }
+ void* allocate(std::size_t s, size_t) { return ::operator new(s); }
+ void deallocate(void* p, std::size_t, size_t) { ::operator delete(p); }
void reset() {}
private:
DISALLOW_COPY(NewDeleteProvider);
};
-template <size_t Size = 4096 * 10> // 10 pages worth of memory.
+template <std::size_t Size = 4096 * 10> // 10 pages worth of memory.
struct BufferProvider {
char buffer[Size];
void* next = &buffer;
- size_t space = Size;
+ std::size_t space = Size;
BufferProvider() {}
- void* allocate(size_t s, size_t a) {
+ void* allocate(std::size_t s, size_t a) {
void* ret = std::align(s, a, next, space);
if (ret == nullptr) {
#ifndef TEST_HAS_NO_EXCEPTIONS
@@ -150,7 +150,7 @@
return ret;
}
- void deallocate(void*, size_t, size_t) {}
+ void deallocate(void*, std::size_t, size_t) {}
void reset() {
next = &buffer;
diff --git a/third_party/llvm-project/libcxx/test/support/test_std_memory_resource.h b/third_party/llvm-project/libcxx/test/support/test_std_memory_resource.h
index b372c27..f3923ae 100644
--- a/third_party/llvm-project/libcxx/test/support/test_std_memory_resource.h
+++ b/third_party/llvm-project/libcxx/test/support/test_std_memory_resource.h
@@ -105,14 +105,14 @@
struct NullProvider {
NullProvider() {}
- void* allocate(size_t, size_t) {
+ void* allocate(std::size_t, size_t) {
#ifndef TEST_HAS_NO_EXCEPTIONS
throw std::runtime_error("");
#else
std::abort();
#endif
}
- void deallocate(void*, size_t, size_t) {}
+ void deallocate(void*, std::size_t, size_t) {}
void reset() {}
private:
@@ -121,23 +121,23 @@
struct NewDeleteProvider {
NewDeleteProvider() {}
- void* allocate(size_t s, size_t) { return ::operator new(s); }
- void deallocate(void* p, size_t, size_t) { ::operator delete(p); }
+ void* allocate(std::size_t s, size_t) { return ::operator new(s); }
+ void deallocate(void* p, std::size_t, size_t) { ::operator delete(p); }
void reset() {}
private:
DISALLOW_COPY(NewDeleteProvider);
};
-template <size_t Size = 4096 * 10> // 10 pages worth of memory.
+template <std::size_t Size = 4096 * 10> // 10 pages worth of memory.
struct BufferProvider {
char buffer[Size];
void* next = &buffer;
- size_t space = Size;
+ std::size_t space = Size;
BufferProvider() {}
- void* allocate(size_t s, size_t a) {
+ void* allocate(std::size_t s, size_t a) {
void* ret = std::align(a, s, next, space);
if (ret == nullptr) {
#ifndef TEST_HAS_NO_EXCEPTIONS
@@ -150,7 +150,7 @@
return ret;
}
- void deallocate(void*, size_t, size_t) {}
+ void deallocate(void*, std::size_t, size_t) {}
void reset() {
next = &buffer;
diff --git a/third_party/llvm-project/libcxx/test/support/type_algorithms.h b/third_party/llvm-project/libcxx/test/support/type_algorithms.h
index 823978b..95a282b 100644
--- a/third_party/llvm-project/libcxx/test/support/type_algorithms.h
+++ b/third_party/llvm-project/libcxx/test/support/type_algorithms.h
@@ -13,7 +13,7 @@
#include "test_macros.h"
-namespace meta {
+namespace types {
template <class... Types>
struct type_list {};
@@ -100,6 +100,20 @@
using floating_point_types = type_list<float, double, long double>;
using arithmetic_types = concatenate_t<integral_types, floating_point_types>;
-} // namespace meta
+
+template <class T>
+using cv_qualified_versions = type_list<T, const T, volatile T, const volatile T>;
+
+template <class T>
+struct type_list_as_pointers;
+
+template <class... Types>
+struct type_list_as_pointers<type_list<Types...> > {
+ using type = type_list<Types*...>;
+};
+
+template <class T>
+using as_pointers = typename type_list_as_pointers<T>::type;
+} // namespace types
#endif // TEST_SUPPORT_TYPE_ALGORITHMS_H
diff --git a/third_party/llvm-project/libcxx/test/support/uses_alloc_types.h b/third_party/llvm-project/libcxx/test/support/uses_alloc_types.h
index 9403572..d4489ff 100644
--- a/third_party/llvm-project/libcxx/test/support/uses_alloc_types.h
+++ b/third_party/llvm-project/libcxx/test/support/uses_alloc_types.h
@@ -101,7 +101,7 @@
////////////////////////////////////////////////////////////////////////////////
namespace detail {
-template <bool IsZero, size_t N, class ArgList, class ...Args>
+template <bool IsZero, std::size_t N, class ArgList, class ...Args>
struct TakeNImp;
template <class ArgList, class ...Args>
@@ -109,11 +109,11 @@
typedef ArgList type;
};
-template <size_t N, class ...A1, class F, class ...R>
+template <std::size_t N, class ...A1, class F, class ...R>
struct TakeNImp<false, N, ArgumentListID<A1...>, F, R...>
: TakeNImp<N-1 == 0, N - 1, ArgumentListID<A1..., F>, R...> {};
-template <size_t N, class ...Args>
+template <std::size_t N, class ...Args>
struct TakeNArgs : TakeNImp<N == 0, N, ArgumentListID<>, Args...> {};
template <class T>
@@ -263,7 +263,7 @@
UsesAllocatorTestBaseStorage<CtorAlloc> alloc_store;
};
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
class UsesAllocatorV1 : public UsesAllocatorTestBase<UsesAllocatorV1<Alloc, Arity>, Alloc>
{
public:
@@ -297,7 +297,7 @@
};
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
class UsesAllocatorV2 : public UsesAllocatorTestBase<UsesAllocatorV2<Alloc, Arity>, Alloc>
{
public:
@@ -323,7 +323,7 @@
{}
};
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
class UsesAllocatorV3 : public UsesAllocatorTestBase<UsesAllocatorV3<Alloc, Arity>, Alloc>
{
public:
@@ -355,7 +355,7 @@
{}
};
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
class NotUsesAllocator : public UsesAllocatorTestBase<NotUsesAllocator<Alloc, Arity>, Alloc>
{
public:
diff --git a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
index adceee2..bd1611f 100644
--- a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
+++ b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
@@ -3,13 +3,24 @@
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
+# The find_package changes these variables. This leaves the build in an odd
+# state. Calling cmake a second time tries to write site config information in
+# the system's libc++. Restoring these setting after testing fixes this issue.
+set(LLVM_DIR_SAVE ${LLVM_DIR})
+set(Clang_DIR_SAVE ${Clang_DIR})
+
find_package(Clang 16)
+if (NOT Clang_FOUND)
+ find_package(Clang 17)
+endif()
set(SOURCES
abi_tag_on_virtual.cpp
hide_from_abi.cpp
- robust_against_adl.cpp
+ proper_version_checks.cpp
qualify_declval.cpp
+ robust_against_adl.cpp
+ uglify_attributes.cpp
libcpp_module.cpp
)
@@ -20,6 +31,9 @@
return()
endif()
+set(LLVM_DIR "${LLVM_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for LLVM." FORCE)
+set(Clang_DIR "${Clang_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for Clang." FORCE)
+
message(STATUS "Found system-installed LLVM ${LLVM_PACKAGE_VERSION} with headers in ${LLVM_INCLUDE_DIRS}")
set(CMAKE_CXX_STANDARD 20)
@@ -32,7 +46,16 @@
${CLANG_INCLUDE_DIRS}
${LLVM_INCLUDE_DIRS}
)
-target_compile_options(clangTidy INTERFACE -fno-rtti)
+target_compile_options(clangTidy INTERFACE
+ -fno-rtti
+ -fno-sanitize=address,hwaddress,undefined,thread,leak # ignore any sanitizers
+ )
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ target_compile_options(clangTidy INTERFACE
+ -fno-sanitize=memory,dataflow
+ )
+endif()
add_library(cxx-tidy MODULE ${SOURCES})
target_link_libraries(cxx-tidy clangTidy)
diff --git a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp
index f1dfbf5..9ecb41e 100644
--- a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp
+++ b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp
@@ -11,8 +11,10 @@
#include "abi_tag_on_virtual.hpp"
#include "hide_from_abi.hpp"
-#include "robust_against_adl.hpp"
+#include "proper_version_checks.hpp"
#include "qualify_declval.hpp"
+#include "robust_against_adl.hpp"
+#include "uglify_attributes.hpp"
namespace {
class LibcxxTestModule : public clang::tidy::ClangTidyModule {
@@ -20,7 +22,9 @@
void addCheckFactories(clang::tidy::ClangTidyCheckFactories& check_factories) override {
check_factories.registerCheck<libcpp::abi_tag_on_virtual>("libcpp-avoid-abi-tag-on-virtual");
check_factories.registerCheck<libcpp::hide_from_abi>("libcpp-hide-from-abi");
+ check_factories.registerCheck<libcpp::proper_version_checks>("libcpp-cpp-version-check");
check_factories.registerCheck<libcpp::robust_against_adl_check>("libcpp-robust-against-adl");
+ check_factories.registerCheck<libcpp::uglify_attributes>("libcpp-uglify-attributes");
check_factories.registerCheck<libcpp::qualify_declval>("libcpp-qualify-declval");
}
};
diff --git a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp
new file mode 100644
index 0000000..2abc5ce
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "proper_version_checks.hpp"
+
+#include <clang/Lex/Lexer.h>
+#include <clang/Lex/PPCallbacks.h>
+#include <clang/Lex/Preprocessor.h>
+
+namespace libcpp {
+namespace {
+class proper_version_checks_callbacks : public clang::PPCallbacks {
+public:
+ proper_version_checks_callbacks(clang::Preprocessor& preprocessor, clang::tidy::ClangTidyCheck& check)
+ : preprocessor_(preprocessor), check_(check) {}
+
+ void If(clang::SourceLocation location, clang::SourceRange condition_range, ConditionValueKind) override {
+ check_condition(location, condition_range);
+ }
+
+ void Elif(clang::SourceLocation location,
+ clang::SourceRange condition_range,
+ ConditionValueKind,
+ clang::SourceLocation if_location) override {
+ check_condition(location, condition_range);
+ }
+
+private:
+ void check_condition(clang::SourceLocation location, clang::SourceRange condition_range) {
+ std::string_view condition = clang::Lexer::getSourceText(
+ clang::CharSourceRange::getTokenRange(condition_range),
+ preprocessor_.getSourceManager(),
+ preprocessor_.getLangOpts());
+ if (preprocessor_.getSourceManager().isInMainFile(location))
+ return;
+
+ if (condition.starts_with("_LIBCPP_STD_VER") && condition.find(">") != std::string_view::npos &&
+ condition.find(">=") == std::string_view::npos)
+ check_.diag(location, "_LIBCPP_STD_VER >= version should be used instead of _LIBCPP_STD_VER > prev_version");
+
+ else if (condition.starts_with("__cplusplus"))
+ check_.diag(location, "Use _LIBCPP_STD_VER instead of __cplusplus to constrain based on the C++ version");
+
+ else if (condition == "_LIBCPP_STD_VER >= 11")
+ check_.diag(location, "_LIBCPP_STD_VER >= 11 is always true. Did you mean '#ifndef _LIBCPP_CXX03_LANG'?");
+
+ else if (condition.starts_with("_LIBCPP_STD_VER >= ") &&
+ std::ranges::none_of(std::array{"14", "17", "20", "23"}, [&](auto val) {
+ return condition.find(val) != std::string_view::npos;
+ }))
+ check_.diag(location, "Not a valid value for _LIBCPP_STD_VER. Use 14, 17, 20 or 23");
+ }
+
+ clang::Preprocessor& preprocessor_;
+ clang::tidy::ClangTidyCheck& check_;
+};
+} // namespace
+
+proper_version_checks::proper_version_checks(llvm::StringRef name, clang::tidy::ClangTidyContext* context)
+ : clang::tidy::ClangTidyCheck(name, context) {}
+
+void proper_version_checks::registerPPCallbacks(
+ const clang::SourceManager& source_manager,
+ clang::Preprocessor* preprocessor,
+ clang::Preprocessor* module_expander) {
+ preprocessor->addPPCallbacks(std::make_unique<proper_version_checks_callbacks>(*preprocessor, *this));
+}
+
+} // namespace libcpp
diff --git a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/proper_version_checks.hpp b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/proper_version_checks.hpp
new file mode 100644
index 0000000..5c33b95
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/proper_version_checks.hpp
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang-tidy/ClangTidyCheck.h"
+
+namespace libcpp {
+class proper_version_checks : public clang::tidy::ClangTidyCheck {
+public:
+ proper_version_checks(llvm::StringRef, clang::tidy::ClangTidyContext*);
+ void registerPPCallbacks(const clang::SourceManager& source_manager,
+ clang::Preprocessor* preprocessor,
+ clang::Preprocessor* module_expander) override;
+};
+} // namespace libcpp
diff --git a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp
new file mode 100644
index 0000000..038788d
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang-tidy/ClangTidyCheck.h"
+#include "clang-tidy/ClangTidyModuleRegistry.h"
+
+#include "uglify_attributes.hpp"
+
+#include <algorithm>
+#include <array>
+#include <span>
+#include <string_view>
+
+namespace {
+bool isUgly(std::string_view str) {
+ if (str.size() < 2)
+ return false;
+ if (str[0] == '_' && str[1] >= 'A' && str[1] <= 'Z')
+ return true;
+ return str.find("__") != std::string_view::npos;
+}
+
+std::vector<const char*> get_standard_attributes(const clang::LangOptions& lang_opts) {
+ std::vector<const char*> attributes = {"noreturn", "carries_dependency"};
+
+ if (lang_opts.CPlusPlus14)
+ attributes.emplace_back("deprecated");
+
+ if (lang_opts.CPlusPlus17) {
+ attributes.emplace_back("fallthrough");
+ attributes.emplace_back("nodiscard");
+ attributes.emplace_back("maybe_unused");
+ }
+
+ if (lang_opts.CPlusPlus20) {
+ attributes.emplace_back("likely");
+ attributes.emplace_back("unlikely");
+ attributes.emplace_back("no_unique_address");
+ }
+
+ if (lang_opts.CPlusPlus2b) {
+ attributes.emplace_back("assume");
+ }
+
+ return attributes;
+}
+
+AST_MATCHER(clang::Attr, isPretty) {
+ if (Node.isKeywordAttribute())
+ return false;
+ if (Node.isCXX11Attribute() && !Node.hasScope()) {
+ if (isUgly(Node.getAttrName()->getName()))
+ return false;
+ return !llvm::is_contained(
+ get_standard_attributes(Finder->getASTContext().getLangOpts()), Node.getAttrName()->getName());
+ }
+ if (Node.hasScope())
+ if (!isUgly(Node.getScopeName()->getName()))
+ return true;
+ if (Node.getAttrName())
+ return !isUgly(Node.getAttrName()->getName());
+
+ return false;
+}
+
+std::optional<std::string> getUglyfiedCXX11Attr(const clang::Attr& attr) {
+ // TODO: Don't emit FixItHints for attributes with `using` in them or emit correct fixes.
+
+ std::string attr_string;
+ if (attr.isClangScope())
+ attr_string += "_Clang::";
+ else if (attr.isGNUScope())
+ attr_string += "__gnu__::";
+
+ if (!attr.getAttrName()->getName().starts_with("__")) {
+ attr_string += "__";
+ attr_string += attr.getAttrName()->getName();
+ attr_string += "__";
+ } else {
+ attr_string += attr.getAttrName()->getName();
+ }
+ return std::move(attr_string);
+}
+
+std::optional<std::string> getUglyfiedGNUAttr(const clang::Attr& attr) {
+ return "__" + attr.getAttrName()->getName().str() + "__";
+}
+
+std::optional<std::string> getUglified(const clang::Attr& attr) {
+ if (attr.isCXX11Attribute()) {
+ return getUglyfiedCXX11Attr(attr);
+ } else if (attr.isGNUAttribute()) {
+ return getUglyfiedGNUAttr(attr);
+ }
+
+ return std::nullopt;
+}
+} // namespace
+
+namespace libcpp {
+uglify_attributes::uglify_attributes(llvm::StringRef name, clang::tidy::ClangTidyContext* context)
+ : clang::tidy::ClangTidyCheck(name, context) {}
+
+void uglify_attributes::registerMatchers(clang::ast_matchers::MatchFinder* finder) {
+ using namespace clang::ast_matchers;
+ finder->addMatcher(attr(isPretty()).bind("normal_attribute"), this);
+}
+
+void uglify_attributes::check(const clang::ast_matchers::MatchFinder::MatchResult& result) {
+ if (const auto* attr = result.Nodes.getNodeAs<clang::Attr>("normal_attribute"); attr != nullptr) {
+ auto diagnostic = diag(attr->getLoc(), "Non-standard attributes should use the _Ugly spelling");
+ auto uglified = getUglified(*attr);
+ if (uglified.has_value()) {
+ diagnostic << clang::FixItHint::CreateReplacement(attr->getRange(), *uglified);
+ }
+ }
+}
+} // namespace libcpp
diff --git a/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/uglify_attributes.hpp b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/uglify_attributes.hpp
new file mode 100644
index 0000000..a3a06e6
--- /dev/null
+++ b/third_party/llvm-project/libcxx/test/tools/clang_tidy_checks/uglify_attributes.hpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang-tidy/ClangTidyCheck.h"
+
+namespace libcpp {
+class uglify_attributes : public clang::tidy::ClangTidyCheck {
+public:
+ uglify_attributes(llvm::StringRef, clang::tidy::ClangTidyContext*);
+ void registerMatchers(clang::ast_matchers::MatchFinder*) override;
+ void check(const clang::ast_matchers::MatchFinder::MatchResult&) override;
+};
+} // namespace libcpp
diff --git a/third_party/llvm-project/libcxx/utils/ci/Dockerfile b/third_party/llvm-project/libcxx/utils/ci/Dockerfile
index 2a2e8e5..85d0ff1 100644
--- a/third_party/llvm-project/libcxx/utils/ci/Dockerfile
+++ b/third_party/llvm-project/libcxx/utils/ci/Dockerfile
@@ -15,7 +15,9 @@
# $ docker run --env-file <secrets> -it $(docker build -q libcxx/utils/ci)
#
# The environment variables in `<secrets>` should be the ones necessary
-# to run a BuildKite agent.
+# to run a BuildKite agent:
+#
+# BUILDKITE_AGENT_TOKEN=<token>
#
# If you're only looking to run the Docker image locally for debugging a
# build bot, see the `run-buildbot-container` script located in this directory.
@@ -36,7 +38,13 @@
RUN apt-get update && apt-get install -y bash curl
# Install various tools used by the build or the test suite
-RUN apt-get update && apt-get install -y ninja-build python3 python3-sphinx python3-distutils python3-psutil git gdb
+#RUN apt-get update && apt-get install -y ninja-build python3 python3-sphinx python3-distutils python3-psutil git gdb
+# TODO add ninja-build once 1.11 is available in Ubuntu, also remove the manual installation.
+RUN apt-get update && apt-get install -y python3 python3-sphinx python3-distutils python3-psutil git gdb
+RUN apt-get update && apt-get install -y wget && \
+ wget -qO /usr/local/bin/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip && \
+ gunzip /usr/local/bin/ninja.gz && \
+ chmod a+x /usr/local/bin/ninja
# Install dependencies required to run the LLDB data formatter tests
RUN apt-get update && apt-get install -y python3 python3-dev libpython3-dev uuid-dev libncurses5-dev swig3.0 libxml2-dev libedit-dev
@@ -58,7 +66,7 @@
# LLVM 15, we still need to have Clang 12 in this Docker image because the LLVM
# 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12,
# though.
-ENV LLVM_HEAD_VERSION=16
+ENV LLVM_HEAD_VERSION=17
RUN apt-get update && apt-get install -y lsb-release wget software-properties-common
RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
RUN bash /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 3)) # for CI transitions
@@ -66,41 +74,41 @@
RUN bash /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 1)) # latest release
RUN bash /tmp/llvm.sh $LLVM_HEAD_VERSION # current ToT
-# Make the latest version of Clang the "default" compiler on the system
-# TODO: After branching for LLVM 16, all jobs will be using an
-# explicitly-versioned version of Clang instead, so we can get rid of
-# these symlinks.
-RUN ln -fs /usr/bin/clang++-14 /usr/bin/c++ && [ -e $(readlink /usr/bin/c++) ]
-RUN ln -fs /usr/bin/clang-14 /usr/bin/cc && [ -e $(readlink /usr/bin/cc) ]
+# Install clang-scan-deps, which is required to build modules; always all supported versions.
+RUN apt-get update && apt-get install -y clang-tools-$(($LLVM_HEAD_VERSION - 3)) \
+ clang-tools-$(($LLVM_HEAD_VERSION - 2)) \
+ clang-tools-$(($LLVM_HEAD_VERSION - 1)) \
+ clang-tools-$LLVM_HEAD_VERSION
# Install clang-format; always use the lastest stable branch.
-# TODO LLVM 16 remove hard-coded version 14 and the symlinks
RUN apt-get update && apt-get install -y clang-format-$(($LLVM_HEAD_VERSION - 2)) clang-format-$(($LLVM_HEAD_VERSION - 1))
-RUN ln -s /usr/bin/clang-format-14 /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ]
-RUN ln -s /usr/bin/git-clang-format-14 /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ]
# Install clang-tidy
-# TODO LLVM 16 remove hard-coded version 14 and the symlink
-RUN apt-get update && apt-get install -y clang-tidy-$(($LLVM_HEAD_VERSION - 1)) clang-tidy-$LLVM_HEAD_VERSION clang-tidy-14
-RUN ln -s /usr/bin/clang-tidy-14 /usr/bin/clang-tidy && [ -e $(readlink /usr/bin/clang-tidy) ]
+RUN apt-get update && apt-get install -y clang-tidy-$(($LLVM_HEAD_VERSION - 2)) clang-tidy-$((LLVM_HEAD_VERSION - 1))
# Install llvm-dev and libclang-dev to compile custom clang-tidy checks
RUN apt-get update && apt-get install -y llvm-$(($LLVM_HEAD_VERSION - 1))-dev llvm-$(($LLVM_HEAD_VERSION - 2))-dev \
libclang-$(($LLVM_HEAD_VERSION - 1))-dev libclang-$(($LLVM_HEAD_VERSION - 2))-dev
-# TODO LLVM16 Don't install llvm-16-dev explicitly
-RUN apt-get update && apt-get install -y llvm-16-dev libclang-16-dev
-
# Install the most recent GCC, like clang install the previous version as a transition.
ENV GCC_LATEST_VERSION=12
RUN apt-get update && apt install -y gcc-$((GCC_LATEST_VERSION - 1)) g++-$((GCC_LATEST_VERSION - 1))
RUN apt-get update && apt install -y gcc-$GCC_LATEST_VERSION g++-$GCC_LATEST_VERSION
+# Remove all, no longer needed, apt data
+RUN rm -rf /var/lib/apt/lists/*
+
# Install a recent CMake
RUN wget https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.sh -O /tmp/install-cmake.sh
RUN bash /tmp/install-cmake.sh --prefix=/usr --exclude-subdir --skip-license
RUN rm /tmp/install-cmake.sh
+# Install a newer CMake for modules
+# TODO Remove the duplicated installation when all runtimes can be build with CMake 3.26.
+RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.1/cmake-3.26.1-linux-x86_64.sh -O /tmp/install-cmake.sh
+RUN bash /tmp/install-cmake.sh --prefix=/opt --exclude-subdir --skip-license
+RUN rm /tmp/install-cmake.sh
+
# Change the user to a non-root user, since some of the libc++ tests
# (e.g. filesystem) require running as non-root. Also setup passwordless sudo.
RUN apt-get update && apt-get install -y sudo
diff --git a/third_party/llvm-project/libcxx/utils/ci/apple-install-libcxx.sh b/third_party/llvm-project/libcxx/utils/ci/apple-install-libcxx.sh
index dd34915..15504f5 100755
--- a/third_party/llvm-project/libcxx/utils/ci/apple-install-libcxx.sh
+++ b/third_party/llvm-project/libcxx/utils/ci/apple-install-libcxx.sh
@@ -108,6 +108,12 @@
}
for arch in ${architectures}; do
+ # Construct the target-triple that we're testing for. Otherwise, the target triple is currently detected
+ # as <arch>-apple-darwin<version> instead of <arch>-apple-macosx<version>, which trips up the test suite.
+ # TODO: This shouldn't be necessary anymore if `clang -print-target-triple` behaved properly, see https://llvm.org/PR61762.
+ # Then LLVM would guess the LLVM_DEFAULT_TARGET_TRIPLE properly and we wouldn't have to specify it.
+ target=$(xcrun clang -arch ${arch} -xc - -### 2>&1 | grep --only-matching -E '"-triple" ".+?"' | grep --only-matching -E '"[^ ]+-apple-[^ ]+?"' | tr -d '"')
+
step "Building libc++.dylib and libc++abi.dylib for architecture ${arch}"
mkdir -p "${build_dir}/${arch}"
xcrun cmake -S "${llvm_root}/runtimes" \
@@ -119,7 +125,11 @@
-DCMAKE_INSTALL_PREFIX="${build_dir}/${arch}-install" \
-DCMAKE_INSTALL_NAME_DIR="/usr/lib" \
-DCMAKE_OSX_ARCHITECTURES="${arch}" \
- -DLIBCXXABI_LIBRARY_VERSION="${version}"
+ -DLIBCXXABI_LIBRARY_VERSION="${version}" \
+ -DLIBCXX_LIBRARY_VERSION="${version}" \
+ -DLIBCXX_TEST_PARAMS="target_triple=${target}" \
+ -DLIBCXXABI_TEST_PARAMS="target_triple=${target}" \
+ -DLIBUNWIND_TEST_PARAMS="target_triple=${target}"
if [ "$headers_only" = true ]; then
xcrun cmake --build "${build_dir}/${arch}" --target install-cxx-headers install-cxxabi-headers -- -v
@@ -150,6 +160,9 @@
universal_dylib libc++.1.dylib
universal_dylib libc++abi.dylib
(cd "${install_dir}/usr/lib" && ln -s "libc++.1.dylib" libc++.dylib)
+
+ experimental_libs=$(for arch in ${architectures}; do echo "${build_dir}/${arch}-install/lib/libc++experimental.a"; done)
+ xcrun lipo -create ${experimental_libs} -output "${install_dir}/usr/lib/libc++experimental.a"
fi
# Install the headers by copying the headers from one of the built architectures
diff --git a/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline-clang.yml b/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline-clang.yml
index b8ad2c1..7ed5874 100644
--- a/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline-clang.yml
+++ b/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline-clang.yml
@@ -14,7 +14,7 @@
# in various configurations.
#
env:
- LLVM_HEAD_VERSION: "16"
+ LLVM_HEAD_VERSION: "17"
steps:
- label: "Building clang"
commands:
diff --git a/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline.yml b/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline.yml
index c6339e4..474138d 100644
--- a/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/third_party/llvm-project/libcxx/utils/ci/buildkite-pipeline.yml
@@ -23,8 +23,8 @@
# Theses numbers are available in all runners, making it easier to update the
# version number.
env:
- LLVM_STABLE_VERSION: "15"
- LLVM_HEAD_VERSION: "16"
+ LLVM_STABLE_VERSION: "16"
+ LLVM_HEAD_VERSION: "17"
GCC_STABLE_VERSION: "12"
steps:
#
@@ -36,7 +36,9 @@
artifact_paths:
- "**/clang-format.patch"
env:
- GIT_CLANG_FORMAT: "/usr/bin/git-clang-format-${LLVM_STABLE_VERSION}"
+ GIT_CLANG_FORMAT: "/usr/bin/git-clang-format-${LLVM_STABLE_VERSION} --binary clang-format-${LLVM_STABLE_VERSION}"
+ CC: "clang-${LLVM_HEAD_VERSION}"
+ CXX: "clang++-${LLVM_HEAD_VERSION}"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -44,8 +46,6 @@
automatic:
- exit_status: -1 # Agent was lost
limit: 2
- soft_fail:
- - exit_status: 1
timeout_in_minutes: 120
- label: "Generated output"
@@ -53,6 +53,10 @@
artifact_paths:
- "**/generated_output.patch"
- "**/generated_output.status"
+ env:
+ CC: "clang-${LLVM_HEAD_VERSION}"
+ CXX: "clang++-${LLVM_HEAD_VERSION}"
+ CLANG_FORMAT: "/usr/bin/clang-format-${LLVM_STABLE_VERSION}"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -66,6 +70,9 @@
command: "libcxx/utils/ci/run-buildbot documentation"
artifact_paths:
- "**/test-results.xml"
+ env:
+ CC: "clang-${LLVM_HEAD_VERSION}"
+ CXX: "clang++-${LLVM_HEAD_VERSION}"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -90,6 +97,7 @@
env:
CC: "gcc-${GCC_STABLE_VERSION}"
CXX: "g++-${GCC_STABLE_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -125,6 +133,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -238,23 +247,7 @@
env:
CC: "gcc-${GCC_STABLE_VERSION}"
CXX: "g++-${GCC_STABLE_VERSION}"
- agents:
- queue: "libcxx-builders"
- os: "linux"
- retry:
- automatic:
- - exit_status: -1 # Agent was lost
- limit: 2
- timeout_in_minutes: 120
-
- - label: "Clang 14"
- command: "libcxx/utils/ci/run-buildbot generic-cxx2b"
- artifact_paths:
- - "**/test-results.xml"
- - "**/*.abilist"
- env:
- CC: "clang-14"
- CXX: "clang++-14"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -272,6 +265,26 @@
env:
CC: "clang-15"
CXX: "clang++-15"
+ # TODO LLVM18: Enable clang-tidy
+ # ENABLE_CLANG_TIDY: "On"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ timeout_in_minutes: 120
+
+ - label: "Clang 16"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx2b"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ env:
+ CC: "clang-16"
+ CXX: "clang++-16"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -292,6 +305,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -309,6 +323,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -326,6 +341,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -343,6 +359,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -382,6 +399,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -399,6 +417,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -416,6 +435,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -433,6 +453,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -450,6 +471,25 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ timeout_in_minutes: 120
+
+ - label: "Modular build with Local Submodule Visibility"
+ command: "libcxx/utils/ci/run-buildbot generic-modules-lsv"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ env:
+ CC: "clang-${LLVM_HEAD_VERSION}"
+ CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -469,6 +509,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -486,6 +527,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -503,6 +545,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -520,6 +563,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -537,6 +581,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -554,6 +599,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -571,6 +617,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -588,6 +635,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -605,6 +653,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -622,6 +671,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -640,6 +690,7 @@
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
+ ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@@ -732,7 +783,7 @@
- group: ":apple: Apple"
steps:
- label: "MacOS x86_64"
- command: "libcxx/utils/ci/run-buildbot apple-cxx20"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx20"
artifact_paths:
- "**/test-results.xml"
- "**/*.abilist"
@@ -747,7 +798,7 @@
timeout_in_minutes: 120
- label: "MacOS arm64"
- command: "libcxx/utils/ci/run-buildbot apple-cxx20"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx20"
artifact_paths:
- "**/test-results.xml"
- "**/*.abilist"
@@ -761,6 +812,20 @@
limit: 2
timeout_in_minutes: 120
+ - label: "MacOS with Modules"
+ command: "libcxx/utils/ci/run-buildbot generic-modules"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ agents:
+ queue: "libcxx-builders"
+ os: "macos"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ timeout_in_minutes: 120
+
# Build with the configuration we use to generate libc++.dylib on Apple platforms
- label: "Apple system"
command: "libcxx/utils/ci/run-buildbot apple-system"
@@ -960,3 +1025,22 @@
- exit_status: -1 # Agent was lost
limit: 2
timeout_in_minutes: 120
+
+ - group: "FreeBSD"
+ steps:
+ - label: "FreeBSD 13 amd64"
+ command: "libcxx/utils/ci/run-buildbot generic-cxx2b"
+ artifact_paths:
+ - "**/test-results.xml"
+ - "**/*.abilist"
+ env:
+ CC: "clang15"
+ CXX: "clang++15"
+ agents:
+ queue: "libcxx-builders"
+ os: "freebsd"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ timeout_in_minutes: 120
diff --git a/third_party/llvm-project/libcxx/utils/ci/run-buildbot b/third_party/llvm-project/libcxx/utils/ci/run-buildbot
index 8ec401c..15b8688 100755
--- a/third_party/llvm-project/libcxx/utils/ci/run-buildbot
+++ b/third_party/llvm-project/libcxx/utils/ci/run-buildbot
@@ -38,13 +38,16 @@
CXX The C++ compiler to use, this value is used by CMake. This
variable is optional.
+CLANG_FORMAT The clang-format binary to use when generating the format
+ ignore list.
+
GIT_CLANG_FORMAT The git-clang-format binary to use in the 'format' builder.
When the value is omitted, it defaults to
'git-clang-format'. This variable or its fallback must work
when running the 'format' builder.
ENABLE_CLANG_TIDY Whether to compile and run clang-tidy checks. This variable
- is optional
+ is optional.
EOF
}
@@ -184,10 +187,8 @@
fi
${GIT_CLANG_FORMAT} \
--diff \
- --extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 \
- -- \
- libcxx/{benchmarks,include,src,test} \
- libcxxabi/{fuzz,include,src,test} \
+ --extensions ',h,hpp,c,cpp,inc,ipp' HEAD~1 \
+ -- $(find libcxx/{benchmarks,include,src}/ -type f | grep -vf libcxx/utils/data/ignore_format.txt) \
| tee ${BUILD_DIR}/clang-format.patch
# Check if the diff is empty, fail otherwise.
! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch
@@ -211,6 +212,18 @@
false
fi
+ ${MONOREPO_ROOT}/libcxx/utils/generate_ignore_format.sh
+ git diff | tee ${BUILD_DIR}/generated_output.patch
+ git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
+ ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
+ if [ -s ${BUILD_DIR}/generated_output.status ]; then
+ echo "It looks like the list of not formatted files has changed."
+ echo "If a file is now properly formatted with clang-format, remove the file name from "
+ echo "libcxx/utils/data/ignore_format.txt. Otherwise you have to fix the"
+ echo "formatting of some of the changed files."
+ false
+ fi
+
# Reject patches that introduce non-ASCII characters or hard tabs.
# Depends on LC_COLLATE set at the top of this script.
! grep -rn '[^ -~]' libcxx/include libcxx/src libcxx/test libcxx/benchmarks \
@@ -371,6 +384,12 @@
check-runtimes
check-abi-list
;;
+generic-modules-lsv)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules-lsv.cmake"
+ check-runtimes
+ check-abi-list
+;;
#
# Parts removed
#
@@ -417,8 +436,7 @@
;;
generic-noexceptions)
clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
- -DLIBCXX_ENABLE_CLANG_TIDY=ON
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake"
check-runtimes
check-abi-list
;;
@@ -430,12 +448,6 @@
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
check-runtimes
;;
-apple-cxx20)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
- check-runtimes
- check-abi-list
-;;
apple-system)
clean
@@ -478,11 +490,7 @@
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
- PARAMS+=";use_system_cxx_lib=True"
PARAMS+=";enable_assertions=True"
- # TODO: Enable experimental features during back-deployment -- right now some of the availability
- # annotations are incorrect, leading to test failures that could be avoided.
- PARAMS+=";enable_experimental=False"
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
@@ -520,10 +528,6 @@
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
- PARAMS+=";use_system_cxx_lib=True"
- # TODO: Enable experimental features during back-deployment -- right now some of the availability
- # annotations are incorrect, leading to test failures that could be avoided.
- PARAMS+=";enable_experimental=False"
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
diff --git a/third_party/llvm-project/libcxx/utils/data/ignore_format.txt b/third_party/llvm-project/libcxx/utils/data/ignore_format.txt
new file mode 100644
index 0000000..ed596ab
--- /dev/null
+++ b/third_party/llvm-project/libcxx/utils/data/ignore_format.txt
@@ -0,0 +1,838 @@
+libcxx/benchmarks/CartesianBenchmarks.h
+libcxx/benchmarks/ContainerBenchmarks.h
+libcxx/benchmarks/GenerateInput.h
+libcxx/benchmarks/Utilities.h
+libcxx/benchmarks/VariantBenchmarks.h
+libcxx/benchmarks/algorithms/common.h
+libcxx/benchmarks/algorithms/lower_bound.bench.cpp
+libcxx/benchmarks/algorithms/make_heap.bench.cpp
+libcxx/benchmarks/algorithms/make_heap_then_sort_heap.bench.cpp
+libcxx/benchmarks/algorithms.partition_point.bench.cpp
+libcxx/benchmarks/algorithms/pop_heap.bench.cpp
+libcxx/benchmarks/algorithms/push_heap.bench.cpp
+libcxx/benchmarks/algorithms/ranges_make_heap.bench.cpp
+libcxx/benchmarks/algorithms/ranges_make_heap_then_sort_heap.bench.cpp
+libcxx/benchmarks/algorithms/ranges_pop_heap.bench.cpp
+libcxx/benchmarks/algorithms/ranges_push_heap.bench.cpp
+libcxx/benchmarks/algorithms/ranges_sort.bench.cpp
+libcxx/benchmarks/algorithms/ranges_sort_heap.bench.cpp
+libcxx/benchmarks/algorithms/ranges_stable_sort.bench.cpp
+libcxx/benchmarks/algorithms/sort.bench.cpp
+libcxx/benchmarks/algorithms/sort_heap.bench.cpp
+libcxx/benchmarks/algorithms/stable_sort.bench.cpp
+libcxx/benchmarks/allocation.bench.cpp
+libcxx/benchmarks/deque.bench.cpp
+libcxx/benchmarks/filesystem.bench.cpp
+libcxx/benchmarks/formatter_float.bench.cpp
+libcxx/benchmarks/formatter_int.bench.cpp
+libcxx/benchmarks/format_to.bench.cpp
+libcxx/benchmarks/format_to_n.bench.cpp
+libcxx/benchmarks/function.bench.cpp
+libcxx/benchmarks/map.bench.cpp
+libcxx/benchmarks/ordered_set.bench.cpp
+libcxx/benchmarks/random.bench.cpp
+libcxx/benchmarks/string.bench.cpp
+libcxx/benchmarks/stringstream.bench.cpp
+libcxx/benchmarks/unordered_set_operations.bench.cpp
+libcxx/benchmarks/vector_operations.bench.cpp
+libcxx/include/__algorithm/binary_search.h
+libcxx/include/__algorithm/clamp.h
+libcxx/include/__algorithm/comp.h
+libcxx/include/__algorithm/comp_ref_type.h
+libcxx/include/__algorithm/copy_backward.h
+libcxx/include/__algorithm/copy.h
+libcxx/include/__algorithm/copy_if.h
+libcxx/include/__algorithm/copy_move_common.h
+libcxx/include/__algorithm/copy_n.h
+libcxx/include/__algorithm/equal.h
+libcxx/include/__algorithm/equal_range.h
+libcxx/include/__algorithm/fill.h
+libcxx/include/__algorithm/fill_n.h
+libcxx/include/__algorithm/find_end.h
+libcxx/include/__algorithm/find_first_of.h
+libcxx/include/__algorithm/for_each.h
+libcxx/include/__algorithm/for_each_n.h
+libcxx/include/__algorithm/generate.h
+libcxx/include/__algorithm/generate_n.h
+libcxx/include/__algorithm/half_positive.h
+libcxx/include/__algorithm/includes.h
+libcxx/include/__algorithm/in_found_result.h
+libcxx/include/__algorithm/in_fun_result.h
+libcxx/include/__algorithm/in_in_out_result.h
+libcxx/include/__algorithm/in_in_result.h
+libcxx/include/__algorithm/in_out_out_result.h
+libcxx/include/__algorithm/in_out_result.h
+libcxx/include/__algorithm/inplace_merge.h
+libcxx/include/__algorithm/is_heap.h
+libcxx/include/__algorithm/is_heap_until.h
+libcxx/include/__algorithm/is_partitioned.h
+libcxx/include/__algorithm/is_permutation.h
+libcxx/include/__algorithm/is_sorted.h
+libcxx/include/__algorithm/is_sorted_until.h
+libcxx/include/__algorithm/iterator_operations.h
+libcxx/include/__algorithm/iter_swap.h
+libcxx/include/__algorithm/lexicographical_compare.h
+libcxx/include/__algorithm/lower_bound.h
+libcxx/include/__algorithm/make_heap.h
+libcxx/include/__algorithm/make_projected.h
+libcxx/include/__algorithm/max_element.h
+libcxx/include/__algorithm/max.h
+libcxx/include/__algorithm/merge.h
+libcxx/include/__algorithm/min_element.h
+libcxx/include/__algorithm/min.h
+libcxx/include/__algorithm/minmax_element.h
+libcxx/include/__algorithm/minmax.h
+libcxx/include/__algorithm/min_max_result.h
+libcxx/include/__algorithm/mismatch.h
+libcxx/include/__algorithm/move_backward.h
+libcxx/include/__algorithm/move.h
+libcxx/include/__algorithm/next_permutation.h
+libcxx/include/__algorithm/nth_element.h
+libcxx/include/__algorithm/partial_sort_copy.h
+libcxx/include/__algorithm/partial_sort.h
+libcxx/include/__algorithm/partition_copy.h
+libcxx/include/__algorithm/partition.h
+libcxx/include/__algorithm/partition_point.h
+libcxx/include/__algorithm/pop_heap.h
+libcxx/include/__algorithm/prev_permutation.h
+libcxx/include/__algorithm/push_heap.h
+libcxx/include/__algorithm/ranges_adjacent_find.h
+libcxx/include/__algorithm/ranges_all_of.h
+libcxx/include/__algorithm/ranges_any_of.h
+libcxx/include/__algorithm/ranges_binary_search.h
+libcxx/include/__algorithm/ranges_clamp.h
+libcxx/include/__algorithm/ranges_copy_backward.h
+libcxx/include/__algorithm/ranges_copy.h
+libcxx/include/__algorithm/ranges_copy_if.h
+libcxx/include/__algorithm/ranges_copy_n.h
+libcxx/include/__algorithm/ranges_count.h
+libcxx/include/__algorithm/ranges_count_if.h
+libcxx/include/__algorithm/ranges_equal.h
+libcxx/include/__algorithm/ranges_equal_range.h
+libcxx/include/__algorithm/ranges_fill.h
+libcxx/include/__algorithm/ranges_fill_n.h
+libcxx/include/__algorithm/ranges_find_end.h
+libcxx/include/__algorithm/ranges_find_first_of.h
+libcxx/include/__algorithm/ranges_find.h
+libcxx/include/__algorithm/ranges_find_if.h
+libcxx/include/__algorithm/ranges_find_if_not.h
+libcxx/include/__algorithm/ranges_for_each.h
+libcxx/include/__algorithm/ranges_for_each_n.h
+libcxx/include/__algorithm/ranges_generate.h
+libcxx/include/__algorithm/ranges_generate_n.h
+libcxx/include/__algorithm/ranges_includes.h
+libcxx/include/__algorithm/ranges_inplace_merge.h
+libcxx/include/__algorithm/ranges_is_heap.h
+libcxx/include/__algorithm/ranges_is_heap_until.h
+libcxx/include/__algorithm/ranges_is_partitioned.h
+libcxx/include/__algorithm/ranges_is_permutation.h
+libcxx/include/__algorithm/ranges_is_sorted.h
+libcxx/include/__algorithm/ranges_is_sorted_until.h
+libcxx/include/__algorithm/ranges_lexicographical_compare.h
+libcxx/include/__algorithm/ranges_lower_bound.h
+libcxx/include/__algorithm/ranges_make_heap.h
+libcxx/include/__algorithm/ranges_max_element.h
+libcxx/include/__algorithm/ranges_max.h
+libcxx/include/__algorithm/ranges_merge.h
+libcxx/include/__algorithm/ranges_min_element.h
+libcxx/include/__algorithm/ranges_min.h
+libcxx/include/__algorithm/ranges_minmax_element.h
+libcxx/include/__algorithm/ranges_minmax.h
+libcxx/include/__algorithm/ranges_mismatch.h
+libcxx/include/__algorithm/ranges_move_backward.h
+libcxx/include/__algorithm/ranges_move.h
+libcxx/include/__algorithm/ranges_none_of.h
+libcxx/include/__algorithm/ranges_nth_element.h
+libcxx/include/__algorithm/ranges_partial_sort_copy.h
+libcxx/include/__algorithm/ranges_partial_sort.h
+libcxx/include/__algorithm/ranges_partition_copy.h
+libcxx/include/__algorithm/ranges_partition.h
+libcxx/include/__algorithm/ranges_partition_point.h
+libcxx/include/__algorithm/ranges_pop_heap.h
+libcxx/include/__algorithm/ranges_prev_permutation.h
+libcxx/include/__algorithm/ranges_push_heap.h
+libcxx/include/__algorithm/ranges_remove_copy.h
+libcxx/include/__algorithm/ranges_remove_copy_if.h
+libcxx/include/__algorithm/ranges_remove.h
+libcxx/include/__algorithm/ranges_remove_if.h
+libcxx/include/__algorithm/ranges_replace_copy.h
+libcxx/include/__algorithm/ranges_replace_copy_if.h
+libcxx/include/__algorithm/ranges_replace.h
+libcxx/include/__algorithm/ranges_replace_if.h
+libcxx/include/__algorithm/ranges_reverse_copy.h
+libcxx/include/__algorithm/ranges_reverse.h
+libcxx/include/__algorithm/ranges_rotate_copy.h
+libcxx/include/__algorithm/ranges_rotate.h
+libcxx/include/__algorithm/ranges_sample.h
+libcxx/include/__algorithm/ranges_search.h
+libcxx/include/__algorithm/ranges_search_n.h
+libcxx/include/__algorithm/ranges_set_difference.h
+libcxx/include/__algorithm/ranges_set_intersection.h
+libcxx/include/__algorithm/ranges_set_symmetric_difference.h
+libcxx/include/__algorithm/ranges_set_union.h
+libcxx/include/__algorithm/ranges_shuffle.h
+libcxx/include/__algorithm/ranges_sort.h
+libcxx/include/__algorithm/ranges_sort_heap.h
+libcxx/include/__algorithm/ranges_stable_partition.h
+libcxx/include/__algorithm/ranges_stable_sort.h
+libcxx/include/__algorithm/ranges_swap_ranges.h
+libcxx/include/__algorithm/ranges_transform.h
+libcxx/include/__algorithm/ranges_unique_copy.h
+libcxx/include/__algorithm/ranges_unique.h
+libcxx/include/__algorithm/ranges_upper_bound.h
+libcxx/include/__algorithm/remove_copy.h
+libcxx/include/__algorithm/remove_copy_if.h
+libcxx/include/__algorithm/remove.h
+libcxx/include/__algorithm/remove_if.h
+libcxx/include/__algorithm/replace_copy.h
+libcxx/include/__algorithm/replace_copy_if.h
+libcxx/include/__algorithm/replace.h
+libcxx/include/__algorithm/replace_if.h
+libcxx/include/__algorithm/reverse_copy.h
+libcxx/include/__algorithm/reverse.h
+libcxx/include/__algorithm/rotate_copy.h
+libcxx/include/__algorithm/rotate.h
+libcxx/include/__algorithm/sample.h
+libcxx/include/__algorithm/search.h
+libcxx/include/__algorithm/search_n.h
+libcxx/include/__algorithm/set_difference.h
+libcxx/include/__algorithm/shift_left.h
+libcxx/include/__algorithm/shift_right.h
+libcxx/include/__algorithm/shuffle.h
+libcxx/include/__algorithm/sift_down.h
+libcxx/include/__algorithm/sort.h
+libcxx/include/__algorithm/sort_heap.h
+libcxx/include/__algorithm/stable_partition.h
+libcxx/include/__algorithm/stable_sort.h
+libcxx/include/__algorithm/swap_ranges.h
+libcxx/include/__algorithm/transform.h
+libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
+libcxx/include/__algorithm/unwrap_iter.h
+libcxx/include/__algorithm/unwrap_range.h
+libcxx/include/__algorithm/upper_bound.h
+libcxx/include/any
+libcxx/include/array
+libcxx/include/__atomic/atomic_base.h
+libcxx/include/__atomic/atomic_flag.h
+libcxx/include/__atomic/atomic.h
+libcxx/include/__atomic/atomic_init.h
+libcxx/include/__atomic/atomic_lock_free.h
+libcxx/include/__atomic/atomic_sync.h
+libcxx/include/__atomic/check_memory_order.h
+libcxx/include/__atomic/contention_t.h
+libcxx/include/__atomic/cxx_atomic_impl.h
+libcxx/include/__atomic/fence.h
+libcxx/include/__atomic/kill_dependency.h
+libcxx/include/__atomic/memory_order.h
+libcxx/include/__availability
+libcxx/include/barrier
+libcxx/include/__bit/bit_cast.h
+libcxx/include/__bit/bit_ceil.h
+libcxx/include/__bit/byteswap.h
+libcxx/include/__bit/countl.h
+libcxx/include/__bit/countr.h
+libcxx/include/__bit/endian.h
+libcxx/include/__bit/popcount.h
+libcxx/include/__bit_reference
+libcxx/include/__bit/rotate.h
+libcxx/include/bitset
+libcxx/include/__bsd_locale_defaults.h
+libcxx/include/__bsd_locale_fallbacks.h
+libcxx/include/cctype
+libcxx/include/chrono
+libcxx/include/__chrono/calendar.h
+libcxx/include/__chrono/convert_to_timespec.h
+libcxx/include/__chrono/day.h
+libcxx/include/__chrono/duration.h
+libcxx/include/__chrono/file_clock.h
+libcxx/include/__chrono/formatter.h
+libcxx/include/__chrono/hh_mm_ss.h
+libcxx/include/__chrono/high_resolution_clock.h
+libcxx/include/__chrono/literals.h
+libcxx/include/__chrono/monthday.h
+libcxx/include/__chrono/month.h
+libcxx/include/__chrono/month_weekday.h
+libcxx/include/__chrono/steady_clock.h
+libcxx/include/__chrono/system_clock.h
+libcxx/include/__chrono/time_point.h
+libcxx/include/__chrono/weekday.h
+libcxx/include/__chrono/year.h
+libcxx/include/__chrono/year_month_day.h
+libcxx/include/__chrono/year_month.h
+libcxx/include/__chrono/year_month_weekday.h
+libcxx/include/cmath
+libcxx/include/codecvt
+libcxx/include/__compare/common_comparison_category.h
+libcxx/include/__compare/compare_partial_order_fallback.h
+libcxx/include/__compare/compare_strong_order_fallback.h
+libcxx/include/__compare/compare_three_way.h
+libcxx/include/__compare/compare_three_way_result.h
+libcxx/include/__compare/compare_weak_order_fallback.h
+libcxx/include/__compare/ordering.h
+libcxx/include/__compare/partial_order.h
+libcxx/include/__compare/strong_order.h
+libcxx/include/__compare/three_way_comparable.h
+libcxx/include/__compare/weak_order.h
+libcxx/include/complex
+libcxx/include/__concepts/arithmetic.h
+libcxx/include/__concepts/assignable.h
+libcxx/include/__concepts/boolean_testable.h
+libcxx/include/__concepts/class_or_enum.h
+libcxx/include/__concepts/common_reference_with.h
+libcxx/include/__concepts/common_with.h
+libcxx/include/__concepts/constructible.h
+libcxx/include/__concepts/convertible_to.h
+libcxx/include/__concepts/copyable.h
+libcxx/include/__concepts/derived_from.h
+libcxx/include/__concepts/destructible.h
+libcxx/include/__concepts/different_from.h
+libcxx/include/__concepts/equality_comparable.h
+libcxx/include/__concepts/invocable.h
+libcxx/include/__concepts/movable.h
+libcxx/include/__concepts/predicate.h
+libcxx/include/__concepts/regular.h
+libcxx/include/__concepts/relation.h
+libcxx/include/__concepts/same_as.h
+libcxx/include/__concepts/semiregular.h
+libcxx/include/__concepts/swappable.h
+libcxx/include/__concepts/totally_ordered.h
+libcxx/include/condition_variable
+libcxx/include/__config
+libcxx/include/__coroutine/coroutine_handle.h
+libcxx/include/__coroutine/coroutine_traits.h
+libcxx/include/__coroutine/noop_coroutine_handle.h
+libcxx/include/__coroutine/trivial_awaitables.h
+libcxx/include/cstddef
+libcxx/include/ctype.h
+libcxx/include/cuchar
+libcxx/include/__debug
+libcxx/include/__debug_utils/randomize_range.h
+libcxx/include/deque
+libcxx/include/errno.h
+libcxx/include/execution
+libcxx/include/expected
+libcxx/include/__expected/expected.h
+libcxx/include/experimental/__config
+libcxx/include/experimental/iterator
+libcxx/include/experimental/map
+libcxx/include/experimental/__memory
+libcxx/include/experimental/memory_resource
+libcxx/include/experimental/propagate_const
+libcxx/include/experimental/regex
+libcxx/include/experimental/set
+libcxx/include/experimental/simd
+libcxx/include/experimental/string
+libcxx/include/experimental/type_traits
+libcxx/include/experimental/unordered_map
+libcxx/include/experimental/unordered_set
+libcxx/include/experimental/utility
+libcxx/include/ext/__hash
+libcxx/include/ext/hash_map
+libcxx/include/ext/hash_set
+libcxx/include/fenv.h
+libcxx/include/filesystem
+libcxx/include/__filesystem/copy_options.h
+libcxx/include/__filesystem/directory_entry.h
+libcxx/include/__filesystem/directory_iterator.h
+libcxx/include/__filesystem/directory_options.h
+libcxx/include/__filesystem/file_status.h
+libcxx/include/__filesystem/filesystem_error.h
+libcxx/include/__filesystem/file_type.h
+libcxx/include/__filesystem/operations.h
+libcxx/include/__filesystem/path.h
+libcxx/include/__filesystem/path_iterator.h
+libcxx/include/__filesystem/perm_options.h
+libcxx/include/__filesystem/perms.h
+libcxx/include/__filesystem/recursive_directory_iterator.h
+libcxx/include/__filesystem/u8path.h
+libcxx/include/float.h
+libcxx/include/format
+libcxx/include/__format/buffer.h
+libcxx/include/__format/concepts.h
+libcxx/include/__format/escaped_output_table.h
+libcxx/include/__format/extended_grapheme_cluster_table.h
+libcxx/include/__format/format_arg.h
+libcxx/include/__format/format_args.h
+libcxx/include/__format/format_arg_store.h
+libcxx/include/__format/format_context.h
+libcxx/include/__format/format_error.h
+libcxx/include/__format/format_functions.h
+libcxx/include/__format/format_parse_context.h
+libcxx/include/__format/format_string.h
+libcxx/include/__format/formatter_bool.h
+libcxx/include/__format/formatter_char.h
+libcxx/include/__format/formatter_floating_point.h
+libcxx/include/__format/formatter.h
+libcxx/include/__format/formatter_integer.h
+libcxx/include/__format/formatter_integral.h
+libcxx/include/__format/formatter_output.h
+libcxx/include/__format/formatter_pointer.h
+libcxx/include/__format/formatter_string.h
+libcxx/include/__format/parser_std_format_spec.h
+libcxx/include/__format/unicode.h
+libcxx/include/forward_list
+libcxx/include/fstream
+libcxx/include/__functional/binary_function.h
+libcxx/include/__functional/binary_negate.h
+libcxx/include/__functional/bind_back.h
+libcxx/include/__functional/binder1st.h
+libcxx/include/__functional/binder2nd.h
+libcxx/include/__functional/bind_front.h
+libcxx/include/__functional/bind.h
+libcxx/include/__functional/boyer_moore_searcher.h
+libcxx/include/__functional/compose.h
+libcxx/include/__functional/default_searcher.h
+libcxx/include/__functional/function.h
+libcxx/include/__functional/hash.h
+libcxx/include/__functional/identity.h
+libcxx/include/__functional/invoke.h
+libcxx/include/__functional/is_transparent.h
+libcxx/include/__functional/mem_fn.h
+libcxx/include/__functional/mem_fun_ref.h
+libcxx/include/__functional/not_fn.h
+libcxx/include/__functional/operations.h
+libcxx/include/__functional/perfect_forward.h
+libcxx/include/__functional/pointer_to_binary_function.h
+libcxx/include/__functional/pointer_to_unary_function.h
+libcxx/include/__functional/ranges_operations.h
+libcxx/include/__functional/reference_wrapper.h
+libcxx/include/__functional/unary_function.h
+libcxx/include/__functional/unary_negate.h
+libcxx/include/__functional/unwrap_ref.h
+libcxx/include/__functional/weak_result_type.h
+libcxx/include/future
+libcxx/include/__fwd/get.h
+libcxx/include/__fwd/span.h
+libcxx/include/__fwd/string_view.h
+libcxx/include/__fwd/subrange.h
+libcxx/include/__hash_table
+libcxx/include/initializer_list
+libcxx/include/inttypes.h
+libcxx/include/iomanip
+libcxx/include/ios
+libcxx/include/__ios/fpos.h
+libcxx/include/iosfwd
+libcxx/include/istream
+libcxx/include/__iterator/access.h
+libcxx/include/__iterator/advance.h
+libcxx/include/__iterator/back_insert_iterator.h
+libcxx/include/__iterator/common_iterator.h
+libcxx/include/__iterator/concepts.h
+libcxx/include/__iterator/counted_iterator.h
+libcxx/include/__iterator/data.h
+libcxx/include/__iterator/default_sentinel.h
+libcxx/include/__iterator/distance.h
+libcxx/include/__iterator/empty.h
+libcxx/include/__iterator/erase_if_container.h
+libcxx/include/__iterator/front_insert_iterator.h
+libcxx/include/__iterator/incrementable_traits.h
+libcxx/include/__iterator/indirectly_comparable.h
+libcxx/include/__iterator/insert_iterator.h
+libcxx/include/__iterator/istreambuf_iterator.h
+libcxx/include/__iterator/istream_iterator.h
+libcxx/include/__iterator/iterator.h
+libcxx/include/__iterator/iterator_traits.h
+libcxx/include/__iterator/iter_move.h
+libcxx/include/__iterator/iter_swap.h
+libcxx/include/__iterator/mergeable.h
+libcxx/include/__iterator/move_iterator.h
+libcxx/include/__iterator/move_sentinel.h
+libcxx/include/__iterator/next.h
+libcxx/include/__iterator/ostreambuf_iterator.h
+libcxx/include/__iterator/ostream_iterator.h
+libcxx/include/__iterator/permutable.h
+libcxx/include/__iterator/prev.h
+libcxx/include/__iterator/projected.h
+libcxx/include/__iterator/readable_traits.h
+libcxx/include/__iterator/reverse_access.h
+libcxx/include/__iterator/reverse_iterator.h
+libcxx/include/__iterator/size.h
+libcxx/include/__iterator/sortable.h
+libcxx/include/__iterator/unreachable_sentinel.h
+libcxx/include/__iterator/wrap_iter.h
+libcxx/include/latch
+libcxx/include/limits
+libcxx/include/limits.h
+libcxx/include/list
+libcxx/include/__locale
+libcxx/include/locale
+libcxx/include/locale.h
+libcxx/include/map
+libcxx/include/math.h
+libcxx/include/__mbstate_t.h
+libcxx/include/memory
+libcxx/include/__memory/addressof.h
+libcxx/include/__memory/aligned_alloc.h
+libcxx/include/__memory/allocate_at_least.h
+libcxx/include/__memory/allocation_guard.h
+libcxx/include/__memory/allocator_arg_t.h
+libcxx/include/__memory/allocator_destructor.h
+libcxx/include/__memory/allocator.h
+libcxx/include/__memory/allocator_traits.h
+libcxx/include/__memory/assume_aligned.h
+libcxx/include/__memory/auto_ptr.h
+libcxx/include/__memory/builtin_new_allocator.h
+libcxx/include/__memory/compressed_pair.h
+libcxx/include/__memory/concepts.h
+libcxx/include/__memory/construct_at.h
+libcxx/include/__memory/destruct_n.h
+libcxx/include/__memory/pointer_traits.h
+libcxx/include/__memory/ranges_construct_at.h
+libcxx/include/__memory/ranges_uninitialized_algorithms.h
+libcxx/include/__memory/raw_storage_iterator.h
+libcxx/include/__memory/shared_ptr.h
+libcxx/include/__memory/temporary_buffer.h
+libcxx/include/__memory/temp_value.h
+libcxx/include/__memory/uninitialized_algorithms.h
+libcxx/include/__memory/unique_ptr.h
+libcxx/include/__memory/uses_allocator.h
+libcxx/include/mutex
+libcxx/include/new
+libcxx/include/__node_handle
+libcxx/include/numbers
+libcxx/include/numeric
+libcxx/include/__numeric/accumulate.h
+libcxx/include/__numeric/adjacent_difference.h
+libcxx/include/__numeric/exclusive_scan.h
+libcxx/include/__numeric/gcd_lcm.h
+libcxx/include/__numeric/inclusive_scan.h
+libcxx/include/__numeric/inner_product.h
+libcxx/include/__numeric/iota.h
+libcxx/include/__numeric/midpoint.h
+libcxx/include/__numeric/partial_sum.h
+libcxx/include/__numeric/reduce.h
+libcxx/include/__numeric/transform_exclusive_scan.h
+libcxx/include/__numeric/transform_inclusive_scan.h
+libcxx/include/__numeric/transform_reduce.h
+libcxx/include/optional
+libcxx/include/ostream
+libcxx/include/queue
+libcxx/include/__random/bernoulli_distribution.h
+libcxx/include/__random/binomial_distribution.h
+libcxx/include/__random/cauchy_distribution.h
+libcxx/include/__random/chi_squared_distribution.h
+libcxx/include/__random/clamp_to_integral.h
+libcxx/include/__random/discard_block_engine.h
+libcxx/include/__random/discrete_distribution.h
+libcxx/include/__random/exponential_distribution.h
+libcxx/include/__random/extreme_value_distribution.h
+libcxx/include/__random/fisher_f_distribution.h
+libcxx/include/__random/gamma_distribution.h
+libcxx/include/__random/generate_canonical.h
+libcxx/include/__random/geometric_distribution.h
+libcxx/include/__random/independent_bits_engine.h
+libcxx/include/__random/is_seed_sequence.h
+libcxx/include/__random/is_valid.h
+libcxx/include/__random/linear_congruential_engine.h
+libcxx/include/__random/log2.h
+libcxx/include/__random/lognormal_distribution.h
+libcxx/include/__random/mersenne_twister_engine.h
+libcxx/include/__random/negative_binomial_distribution.h
+libcxx/include/__random/normal_distribution.h
+libcxx/include/__random/piecewise_constant_distribution.h
+libcxx/include/__random/piecewise_linear_distribution.h
+libcxx/include/__random/poisson_distribution.h
+libcxx/include/__random/random_device.h
+libcxx/include/__random/ranlux.h
+libcxx/include/__random/seed_seq.h
+libcxx/include/__random/shuffle_order_engine.h
+libcxx/include/__random/student_t_distribution.h
+libcxx/include/__random/subtract_with_carry_engine.h
+libcxx/include/__random/uniform_int_distribution.h
+libcxx/include/__random/uniform_random_bit_generator.h
+libcxx/include/__random/uniform_real_distribution.h
+libcxx/include/__random/weibull_distribution.h
+libcxx/include/ranges
+libcxx/include/__ranges/access.h
+libcxx/include/__ranges/all.h
+libcxx/include/__ranges/common_view.h
+libcxx/include/__ranges/concepts.h
+libcxx/include/__ranges/copyable_box.h
+libcxx/include/__ranges/counted.h
+libcxx/include/__ranges/data.h
+libcxx/include/__ranges/drop_view.h
+libcxx/include/__ranges/empty.h
+libcxx/include/__ranges/empty_view.h
+libcxx/include/__ranges/enable_view.h
+libcxx/include/__ranges/filter_view.h
+libcxx/include/__ranges/iota_view.h
+libcxx/include/__ranges/istream_view.h
+libcxx/include/__ranges/join_view.h
+libcxx/include/__ranges/lazy_split_view.h
+libcxx/include/__ranges/non_propagating_cache.h
+libcxx/include/__ranges/owning_view.h
+libcxx/include/__ranges/range_adaptor.h
+libcxx/include/__ranges/rbegin.h
+libcxx/include/__ranges/ref_view.h
+libcxx/include/__ranges/rend.h
+libcxx/include/__ranges/reverse_view.h
+libcxx/include/__ranges/single_view.h
+libcxx/include/__ranges/size.h
+libcxx/include/__ranges/subrange.h
+libcxx/include/__ranges/take_view.h
+libcxx/include/__ranges/transform_view.h
+libcxx/include/__ranges/view_interface.h
+libcxx/include/__ranges/views.h
+libcxx/include/__ranges/zip_view.h
+libcxx/include/ratio
+libcxx/include/regex
+libcxx/include/scoped_allocator
+libcxx/include/semaphore
+libcxx/include/set
+libcxx/include/setjmp.h
+libcxx/include/shared_mutex
+libcxx/include/span
+libcxx/include/__split_buffer
+libcxx/include/sstream
+libcxx/include/stack
+libcxx/include/stdatomic.h
+libcxx/include/stdbool.h
+libcxx/include/stddef.h
+libcxx/include/stdexcept
+libcxx/include/stdint.h
+libcxx/include/stdio.h
+libcxx/include/stdlib.h
+libcxx/include/streambuf
+libcxx/include/string
+libcxx/include/__string/char_traits.h
+libcxx/include/__string/extern_template_lists.h
+libcxx/include/string.h
+libcxx/include/string_view
+libcxx/include/strstream
+libcxx/include/__support/android/locale_bionic.h
+libcxx/include/__support/fuchsia/xlocale.h
+libcxx/include/__support/ibm/gettod_zos.h
+libcxx/include/__support/ibm/locale_mgmt_zos.h
+libcxx/include/__support/ibm/nanosleep.h
+libcxx/include/__support/ibm/xlocale.h
+libcxx/include/__support/newlib/xlocale.h
+libcxx/include/__support/solaris/xlocale.h
+libcxx/include/__support/win32/locale_win32.h
+libcxx/include/__support/xlocale/__nop_locale_mgmt.h
+libcxx/include/__system_error/errc.h
+libcxx/include/thread
+libcxx/include/__threading_support
+libcxx/include/__thread/poll_with_backoff.h
+libcxx/include/__thread/timed_backoff_policy.h
+libcxx/include/__tree
+libcxx/include/tuple
+libcxx/include/__tuple/apply_cv.h
+libcxx/include/__tuple/make_tuple_types.h
+libcxx/include/__tuple/sfinae_helpers.h
+libcxx/include/__tuple/tuple_element.h
+libcxx/include/__tuple/tuple_indices.h
+libcxx/include/__tuple/tuple_like_ext.h
+libcxx/include/__tuple/tuple_size.h
+libcxx/include/__tuple/tuple_types.h
+libcxx/include/typeindex
+libcxx/include/typeinfo
+libcxx/include/__type_traits/add_const.h
+libcxx/include/__type_traits/add_cv.h
+libcxx/include/__type_traits/add_lvalue_reference.h
+libcxx/include/__type_traits/add_pointer.h
+libcxx/include/__type_traits/add_volatile.h
+libcxx/include/__type_traits/aligned_storage.h
+libcxx/include/__type_traits/aligned_union.h
+libcxx/include/__type_traits/alignment_of.h
+libcxx/include/__type_traits/apply_cv.h
+libcxx/include/__type_traits/can_extract_key.h
+libcxx/include/__type_traits/common_reference.h
+libcxx/include/__type_traits/common_type.h
+libcxx/include/__type_traits/copy_cv.h
+libcxx/include/__type_traits/copy_cvref.h
+libcxx/include/__type_traits/decay.h
+libcxx/include/__type_traits/enable_if.h
+libcxx/include/__type_traits/extent.h
+libcxx/include/__type_traits/has_unique_object_representation.h
+libcxx/include/__type_traits/has_virtual_destructor.h
+libcxx/include/__type_traits/integral_constant.h
+libcxx/include/__type_traits/is_abstract.h
+libcxx/include/__type_traits/is_aggregate.h
+libcxx/include/__type_traits/is_allocator.h
+libcxx/include/__type_traits/is_always_bitcastable.h
+libcxx/include/__type_traits/is_arithmetic.h
+libcxx/include/__type_traits/is_array.h
+libcxx/include/__type_traits/is_assignable.h
+libcxx/include/__type_traits/is_base_of.h
+libcxx/include/__type_traits/is_bounded_array.h
+libcxx/include/__type_traits/is_callable.h
+libcxx/include/__type_traits/is_class.h
+libcxx/include/__type_traits/is_compound.h
+libcxx/include/__type_traits/is_constant_evaluated.h
+libcxx/include/__type_traits/is_const.h
+libcxx/include/__type_traits/is_constructible.h
+libcxx/include/__type_traits/is_convertible.h
+libcxx/include/__type_traits/is_copy_assignable.h
+libcxx/include/__type_traits/is_copy_constructible.h
+libcxx/include/__type_traits/is_core_convertible.h
+libcxx/include/__type_traits/is_default_constructible.h
+libcxx/include/__type_traits/is_destructible.h
+libcxx/include/__type_traits/is_empty.h
+libcxx/include/__type_traits/is_enum.h
+libcxx/include/__type_traits/is_final.h
+libcxx/include/__type_traits/is_floating_point.h
+libcxx/include/__type_traits/is_fundamental.h
+libcxx/include/__type_traits/is_implicitly_default_constructible.h
+libcxx/include/__type_traits/is_integral.h
+libcxx/include/__type_traits/is_literal_type.h
+libcxx/include/__type_traits/is_member_function_pointer.h
+libcxx/include/__type_traits/is_member_object_pointer.h
+libcxx/include/__type_traits/is_member_pointer.h
+libcxx/include/__type_traits/is_move_assignable.h
+libcxx/include/__type_traits/is_move_constructible.h
+libcxx/include/__type_traits/is_nothrow_assignable.h
+libcxx/include/__type_traits/is_nothrow_constructible.h
+libcxx/include/__type_traits/is_nothrow_convertible.h
+libcxx/include/__type_traits/is_nothrow_copy_assignable.h
+libcxx/include/__type_traits/is_nothrow_copy_constructible.h
+libcxx/include/__type_traits/is_nothrow_default_constructible.h
+libcxx/include/__type_traits/is_nothrow_destructible.h
+libcxx/include/__type_traits/is_nothrow_move_assignable.h
+libcxx/include/__type_traits/is_nothrow_move_constructible.h
+libcxx/include/__type_traits/is_null_pointer.h
+libcxx/include/__type_traits/is_object.h
+libcxx/include/__type_traits/is_pod.h
+libcxx/include/__type_traits/is_pointer.h
+libcxx/include/__type_traits/is_polymorphic.h
+libcxx/include/__type_traits/is_primary_template.h
+libcxx/include/__type_traits/is_reference.h
+libcxx/include/__type_traits/is_reference_wrapper.h
+libcxx/include/__type_traits/is_same.h
+libcxx/include/__type_traits/is_scalar.h
+libcxx/include/__type_traits/is_scoped_enum.h
+libcxx/include/__type_traits/is_signed.h
+libcxx/include/__type_traits/is_signed_integer.h
+libcxx/include/__type_traits/is_standard_layout.h
+libcxx/include/__type_traits/is_swappable.h
+libcxx/include/__type_traits/is_trivial.h
+libcxx/include/__type_traits/is_trivially_assignable.h
+libcxx/include/__type_traits/is_trivially_constructible.h
+libcxx/include/__type_traits/is_trivially_copyable.h
+libcxx/include/__type_traits/is_trivially_copy_assignable.h
+libcxx/include/__type_traits/is_trivially_copy_constructible.h
+libcxx/include/__type_traits/is_trivially_default_constructible.h
+libcxx/include/__type_traits/is_trivially_destructible.h
+libcxx/include/__type_traits/is_unbounded_array.h
+libcxx/include/__type_traits/is_union.h
+libcxx/include/__type_traits/is_unsigned.h
+libcxx/include/__type_traits/is_unsigned_integer.h
+libcxx/include/__type_traits/is_valid_expansion.h
+libcxx/include/__type_traits/is_void.h
+libcxx/include/__type_traits/is_volatile.h
+libcxx/include/__type_traits/lazy.h
+libcxx/include/__type_traits/make_32_64_or_128_bit.h
+libcxx/include/__type_traits/make_const_lvalue_ref.h
+libcxx/include/__type_traits/make_signed.h
+libcxx/include/__type_traits/make_unsigned.h
+libcxx/include/__type_traits/maybe_const.h
+libcxx/include/__type_traits/nat.h
+libcxx/include/__type_traits/negation.h
+libcxx/include/__type_traits/noexcept_move_assign_container.h
+libcxx/include/__type_traits/promote.h
+libcxx/include/__type_traits/rank.h
+libcxx/include/__type_traits/remove_all_extents.h
+libcxx/include/__type_traits/remove_const.h
+libcxx/include/__type_traits/remove_cv.h
+libcxx/include/__type_traits/remove_cvref.h
+libcxx/include/__type_traits/remove_extent.h
+libcxx/include/__type_traits/remove_pointer.h
+libcxx/include/__type_traits/remove_reference.h
+libcxx/include/__type_traits/remove_volatile.h
+libcxx/include/__type_traits/result_of.h
+libcxx/include/__type_traits/strip_signature.h
+libcxx/include/__type_traits/type_identity.h
+libcxx/include/__type_traits/type_list.h
+libcxx/include/__type_traits/underlying_type.h
+libcxx/include/__type_traits/void_t.h
+libcxx/include/uchar.h
+libcxx/include/unordered_map
+libcxx/include/unordered_set
+libcxx/include/__utility/as_const.h
+libcxx/include/__utility/cmp.h
+libcxx/include/__utility/convert_to_integral.h
+libcxx/include/__utility/exchange.h
+libcxx/include/__utility/in_place.h
+libcxx/include/__utility/integer_sequence.h
+libcxx/include/__utility/pair.h
+libcxx/include/__utility/piecewise_construct.h
+libcxx/include/__utility/priority_tag.h
+libcxx/include/__utility/rel_ops.h
+libcxx/include/__utility/to_underlying.h
+libcxx/include/__utility/unreachable.h
+libcxx/include/valarray
+libcxx/include/variant
+libcxx/include/__variant/monostate.h
+libcxx/include/vector
+libcxx/include/__verbose_abort
+libcxx/include/wchar.h
+libcxx/include/wctype.h
+libcxx/src/any.cpp
+libcxx/src/atomic.cpp
+libcxx/src/barrier.cpp
+libcxx/src/bind.cpp
+libcxx/src/charconv.cpp
+libcxx/src/chrono.cpp
+libcxx/src/condition_variable.cpp
+libcxx/src/condition_variable_destructor.cpp
+libcxx/src/debug.cpp
+libcxx/src/exception.cpp
+libcxx/src/experimental/memory_resource.cpp
+libcxx/src/filesystem/directory_iterator.cpp
+libcxx/src/filesystem/filesystem_common.h
+libcxx/src/filesystem/int128_builtins.cpp
+libcxx/src/filesystem/operations.cpp
+libcxx/src/filesystem/posix_compat.h
+libcxx/src/functional.cpp
+libcxx/src/future.cpp
+libcxx/src/hash.cpp
+libcxx/src/include/apple_availability.h
+libcxx/src/include/atomic_support.h
+libcxx/src/include/config_elast.h
+libcxx/src/include/refstring.h
+libcxx/src/include/ryu/ryu.h
+libcxx/src/include/sso_allocator.h
+libcxx/src/ios.cpp
+libcxx/src/iostream.cpp
+libcxx/src/legacy_debug_handler.cpp
+libcxx/src/locale.cpp
+libcxx/src/memory.cpp
+libcxx/src/mutex.cpp
+libcxx/src/mutex_destructor.cpp
+libcxx/src/new.cpp
+libcxx/src/optional.cpp
+libcxx/src/random.cpp
+libcxx/src/random_shuffle.cpp
+libcxx/src/regex.cpp
+libcxx/src/shared_mutex.cpp
+libcxx/src/stdexcept.cpp
+libcxx/src/std_stream.h
+libcxx/src/string.cpp
+libcxx/src/strstream.cpp
+libcxx/src/support/ibm/mbsnrtowcs.cpp
+libcxx/src/support/ibm/wcsnrtombs.cpp
+libcxx/src/support/ibm/xlocale_zos.cpp
+libcxx/src/support/runtime/exception_fallback.ipp
+libcxx/src/support/runtime/exception_glibcxx.ipp
+libcxx/src/support/runtime/exception_libcxxabi.ipp
+libcxx/src/support/runtime/exception_libcxxrt.ipp
+libcxx/src/support/runtime/exception_msvc.ipp
+libcxx/src/support/runtime/exception_pointer_cxxabi.ipp
+libcxx/src/support/runtime/exception_pointer_glibcxx.ipp
+libcxx/src/support/runtime/exception_pointer_msvc.ipp
+libcxx/src/support/runtime/exception_pointer_unimplemented.ipp
+libcxx/src/support/runtime/new_handler_fallback.ipp
+libcxx/src/support/runtime/stdexcept_default.ipp
+libcxx/src/support/runtime/stdexcept_vcruntime.ipp
+libcxx/src/support/solaris/mbsnrtowcs.inc
+libcxx/src/support/solaris/wcsnrtombs.inc
+libcxx/src/support/solaris/xlocale.cpp
+libcxx/src/support/win32/locale_win32.cpp
+libcxx/src/support/win32/support.cpp
+libcxx/src/support/win32/thread_win32.cpp
+libcxx/src/system_error.cpp
+libcxx/src/thread.cpp
+libcxx/src/typeinfo.cpp
+libcxx/src/valarray.cpp
+libcxx/src/variant.cpp
+libcxx/src/vector.cpp
+libcxx/src/verbose_abort.cpp
diff --git a/third_party/llvm-project/libcxx/utils/generate_escaped_output_table.py b/third_party/llvm-project/libcxx/utils/generate_escaped_output_table.py
index cc0b1dd..09e186c 100755
--- a/third_party/llvm-project/libcxx/utils/generate_escaped_output_table.py
+++ b/third_party/llvm-project/libcxx/utils/generate_escaped_output_table.py
@@ -228,13 +228,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
namespace __escaped_output_table {{
{content}
}} // namespace __escaped_output_table
-#endif //_LIBCPP_STD_VER > 20
+#endif //_LIBCPP_STD_VER >= 23
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_table.py b/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_table.py
index 2762c01..0050998 100755
--- a/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_table.py
+++ b/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_table.py
@@ -222,13 +222,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
namespace __extended_grapheme_custer_property_boundary {{
{content}
}} // namespace __extended_grapheme_custer_property_boundary
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
diff --git a/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_test.py b/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_test.py
index 5061c80..6714b22 100755
--- a/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_test.py
+++ b/third_party/llvm-project/libcxx/utils/generate_extended_grapheme_cluster_test.py
@@ -99,7 +99,7 @@
//===----------------------------------------------------------------------===//
// WARNING, this entire header is generated by
-// utiles/generate_extended_grapheme_cluster_test.py
+// utils/generate_extended_grapheme_cluster_test.py
// DO NOT MODIFY!
// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
@@ -169,7 +169,7 @@
/// The offset of the last code units of the extended grapheme clusters in the input.
///
/// The vector has the same number of entries as \\ref code_points.
- std::vector<size_t> breaks;
+ std::vector<std::size_t> breaks;
}};
/// The data for UTF-8.
diff --git a/third_party/llvm-project/libcxx/utils/generate_feature_test_macro_components.py b/third_party/llvm-project/libcxx/utils/generate_feature_test_macro_components.py
index 69cb942..fb59395 100755
--- a/third_party/llvm-project/libcxx/utils/generate_feature_test_macro_components.py
+++ b/third_party/llvm-project/libcxx/utils/generate_feature_test_macro_components.py
@@ -48,9 +48,7 @@
# just libc++. It may depend on
# * macros defined by the compiler itself, or
# * macros generated by CMake.
-# In some cases we add
-# `&& !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM_...)`
-# in order to make libc++ pass the tests on OSX; see D94983.
+# In some cases we add also depend on macros defined in <__availability>.
# libcxx_guard An optional string field. When this field is provided,
# `test_suite_guard` must also be provided. This field is used
# only to guard the feature-test macro in <version>. It may
@@ -138,14 +136,14 @@
"name": "__cpp_lib_atomic_wait",
"values": { "c++20": 201907 },
"headers": ["atomic"],
- "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)",
- "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait)",
+ "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
+ "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
}, {
"name": "__cpp_lib_barrier",
"values": { "c++20": 201907 },
"headers": ["barrier"],
- "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)",
- "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier)",
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
}, {
"name": "__cpp_lib_bind_back",
"values": { "c++2b": 202202 },
@@ -267,7 +265,6 @@
"name": "__cpp_lib_constexpr_typeinfo",
"values": { "c++2b": 202106 },
"headers": ["typeinfo"],
- "unimplemented": True,
}, {
"name": "__cpp_lib_constexpr_utility",
"values": { "c++20": 201811 },
@@ -285,7 +282,7 @@
"values": { "c++20": 201806 },
"headers": ["new"],
"test_suite_guard": "TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
- "libcxx_guard": "_LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
+ "libcxx_guard": "_LIBCPP_STD_VER >= 20 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
}, {
"name": "__cpp_lib_enable_shared_from_this",
"values": { "c++17": 201603 },
@@ -315,8 +312,8 @@
"name": "__cpp_lib_filesystem",
"values": { "c++17": 201703 },
"headers": ["filesystem"],
- "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)",
- "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem)"
+ "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)",
+ "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_FILESYSTEM)"
}, {
"name": "__cpp_lib_format",
"values": {
@@ -327,8 +324,21 @@
# "c++23": 202207, Not implemented P2419R2 Clarify handling of encodings in localized formatting of chrono types
},
"headers": ["format"],
- "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
- "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
+ "unimplemented": True,
+ }, {
+ "name": "__cpp_lib_format_ranges",
+ "values": { "c++2b": 202207 },
+ "headers": ["format"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
+ }, {
+ "name": "__cpp_lib_formatters",
+ "values": { "c++2b": 202302 },
+ "headers": ["stacktrace", "thread"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)",
"unimplemented": True,
}, {
"name": "__cpp_lib_forward_like",
@@ -392,7 +402,6 @@
"name": "__cpp_lib_invoke_r",
"values": { "c++2b": 202106 },
"headers": ["functional"],
- "unimplemented": True,
}, {
"name": "__cpp_lib_is_aggregate",
"values": { "c++17": 201703 },
@@ -446,8 +455,8 @@
"name": "__cpp_lib_latch",
"values": { "c++20": 201907 },
"headers": ["latch"],
- "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)",
- "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch)",
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
}, {
"name": "__cpp_lib_launder",
"values": { "c++17": 201606 },
@@ -490,6 +499,10 @@
"values": { "c++17": 201603 },
"headers": ["memory_resource"],
}, {
+ "name": "__cpp_lib_move_iterator_concept",
+ "values": { "c++20": 202207 },
+ "headers": ["iterator"],
+ }, {
"name": "__cpp_lib_move_only_function",
"values": { "c++2b": 202110 },
"headers": ["functional"],
@@ -537,6 +550,10 @@
"values": { "c++20": 202106 },
"headers": ["algorithm", "functional", "iterator", "memory", "ranges"],
}, {
+ "name": "__cpp_lib_ranges_as_rvalue",
+ "values": { "c++2b": 202207 },
+ "headers": ["ranges"],
+ }, {
"name": "__cpp_lib_ranges_chunk",
"values": { "c++2b": 202202 },
"headers": ["ranges"],
@@ -609,14 +626,14 @@
"name": "__cpp_lib_semaphore",
"values": { "c++20": 201907 },
"headers": ["semaphore"],
- "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)",
- "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore)",
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)",
}, {
"name": "__cpp_lib_shared_mutex",
"values": { "c++17": 201505 },
"headers": ["shared_mutex"],
- "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)",
- "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex)",
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)",
}, {
"name": "__cpp_lib_shared_ptr_arrays",
"values": { "c++17": 201611, "c++20": 201707 },
@@ -629,8 +646,8 @@
"name": "__cpp_lib_shared_timed_mutex",
"values": { "c++14": 201402 },
"headers": ["shared_mutex"],
- "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)",
- "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex)",
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SHARED_MUTEX)",
}, {
"name": "__cpp_lib_shift",
"values": { "c++20": 201806 },
@@ -644,8 +661,8 @@
"name": "__cpp_lib_source_location",
"values": { "c++20": 201907 },
"headers": ["source_location"],
- "test_suite_guard": "__has_builtin(__builtin_source_location)",
- "libcxx_guard": "__has_builtin(__builtin_source_location)",
+ "test_suite_guard": "__has_builtin(__builtin_source_location) && !(defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER <= 1403)",
+ "libcxx_guard": "__has_builtin(__builtin_source_location) && !(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER <= 1403)",
}, {
"name": "__cpp_lib_span",
"values": { "c++20": 202002 },
@@ -875,17 +892,15 @@
return result.strip()
def produce_macros_definitions():
- macro_definition_template = """#if _LIBCPP_STD_VER > {previous_std_number}
+ macro_definition_template = """#if _LIBCPP_STD_VER >= {std_number}
{macro_definition}
#endif"""
macros_definitions = []
- previous_std_number = '11'
for std in get_std_dialects():
macros_definitions.append(
- macro_definition_template.format(previous_std_number=previous_std_number,
+ macro_definition_template.format(std_number=get_std_number(std).replace('2b', '23'),
macro_definition=produce_macros_definition_for_std(std)))
- previous_std_number = get_std_number(std)
return '\n\n'.join(macros_definitions)
diff --git a/third_party/llvm-project/libcxx/utils/generate_header_tests.py b/third_party/llvm-project/libcxx/utils/generate_header_tests.py
index 2981963..f9f9ddc 100755
--- a/third_party/llvm-project/libcxx/utils/generate_header_tests.py
+++ b/third_party/llvm-project/libcxx/utils/generate_header_tests.py
@@ -43,7 +43,6 @@
"wchar.h": "!defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)",
"experimental/algorithm": "__cplusplus >= 201103L",
- "experimental/coroutine": "__cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)",
"experimental/deque": "__cplusplus >= 201103L",
"experimental/forward_list": "__cplusplus >= 201103L",
"experimental/functional": "__cplusplus >= 201103L",
diff --git a/third_party/llvm-project/libcxx/utils/generate_ignore_format.sh b/third_party/llvm-project/libcxx/utils/generate_ignore_format.sh
new file mode 100755
index 0000000..c07b76d
--- /dev/null
+++ b/third_party/llvm-project/libcxx/utils/generate_ignore_format.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Generate a list of headers that aren't formatted yet
+
+if [ -z "${CLANG_FORMAT}" ]; then
+ CLANG_FORMAT=clang-format
+fi
+
+rm libcxx/utils/data/ignore_format.txt
+# This uses the same matches as the check-format CI step.
+#
+# Since it's hard to match empty extensions the following
+# method is used, remove all files with an extension, then
+# add the list of extensions that should be formatted.
+for file in $(find libcxx/{benchmarks,include,src}/ -type f -not -name '*.*' -or \( \
+ -name "*.h" -or -name "*.hpp" -or \
+ -name "*.c" -or -name "*.cpp" -or \
+ -name "*.inc" -or -name "*.ipp" \
+ \) ); do
+
+ ${CLANG_FORMAT} --Werror --dry-run ${file} >& /dev/null
+ if [ $? != 0 ]; then
+ echo ${file} >> libcxx/utils/data/ignore_format.txt
+ fi
+done
+
+# Force sorting not to depend on the system's locale.
+LC_ALL=C sort libcxx/utils/data/ignore_format.txt -d -o libcxx/utils/data/ignore_format.txt
diff --git a/third_party/llvm-project/libcxx/utils/generate_iwyu_mapping.py b/third_party/llvm-project/libcxx/utils/generate_iwyu_mapping.py
index 1e0242b..16db78d 100644
--- a/third_party/llvm-project/libcxx/utils/generate_iwyu_mapping.py
+++ b/third_party/llvm-project/libcxx/utils/generate_iwyu_mapping.py
@@ -30,7 +30,7 @@
c_headers.append(i.name)
result = []
- temporary_mappings = {'__tuple_dir': 'tuple'}
+ temporary_mappings = {}
for i in detail_directories:
public_header = temporary_mappings.get(i, i.lstrip('_'))
result.append(f'{generate(f"@<{i}/.*>", public_header)},')
@@ -53,7 +53,6 @@
elif i == '__mutex_base': continue
elif i == '__node_handle': public = ['map', 'set', 'unordered_map', 'unordered_set']
elif i == '__split_buffer': public = ['deque', 'vector']
- elif i == '__std_stream': public = ['iostream']
elif i == '__threading_support': public = ['atomic', 'mutex', 'semaphore', 'thread']
elif i == '__tree': public = ['map', 'set']
elif i == '__undef_macros': continue
diff --git a/third_party/llvm-project/libcxx/utils/libcxx/test/newconfig.py b/third_party/llvm-project/libcxx/utils/libcxx/test/config.py
similarity index 100%
rename from third_party/llvm-project/libcxx/utils/libcxx/test/newconfig.py
rename to third_party/llvm-project/libcxx/utils/libcxx/test/config.py
diff --git a/third_party/llvm-project/libcxx/utils/libcxx/test/features.py b/third_party/llvm-project/libcxx/utils/libcxx/test/features.py
index c2745b9..dd5163f 100644
--- a/third_party/llvm-project/libcxx/utils/libcxx/test/features.py
+++ b/third_party/llvm-project/libcxx/utils/libcxx/test/features.py
@@ -7,10 +7,11 @@
#===----------------------------------------------------------------------===##
from libcxx.test.dsl import *
+from lit.BooleanExpression import BooleanExpression
import re
import shutil
-import sys
import subprocess
+import sys
_isClang = lambda cfg: '__clang__' in compilerMacros(cfg) and '__apple_build_version__' not in compilerMacros(cfg)
_isAppleClang = lambda cfg: '__apple_build_version__' in compilerMacros(cfg)
@@ -35,11 +36,6 @@
return None
DEFAULT_FEATURES = [
- Feature(name='fcoroutines-ts',
- when=lambda cfg: hasCompileFlag(cfg, '-fcoroutines-ts') and
- featureTestMacros(cfg, flags='-fcoroutines-ts').get('__cpp_coroutines', 0) >= 201703,
- actions=[AddCompileFlag('-fcoroutines-ts')]),
-
Feature(name='thread-safety',
when=lambda cfg: hasCompileFlag(cfg, '-Werror=thread-safety'),
actions=[AddCompileFlag('-Werror=thread-safety')]),
@@ -244,7 +240,10 @@
DEFAULT_FEATURES += [
Feature(name='darwin', when=lambda cfg: '__APPLE__' in compilerMacros(cfg)),
Feature(name='windows', when=lambda cfg: '_WIN32' in compilerMacros(cfg)),
- Feature(name='windows-dll', when=lambda cfg: '_WIN32' in compilerMacros(cfg) and programSucceeds(cfg, """
+ Feature(name='windows-dll', when=lambda cfg: '_WIN32' in compilerMacros(cfg) and sourceBuilds(cfg, """
+ #include <iostream>
+ int main(int, char**) { return 0; }
+ """) and programSucceeds(cfg, """
#include <iostream>
#include <windows.h>
#include <winnt.h>
@@ -323,3 +322,63 @@
actions=[AddSubstitution('%{gdb}', lambda cfg: shutil.which('gdb'))]
)
]
+
+# Define features for back-deployment testing.
+#
+# These features can be used to XFAIL tests that fail when deployed on (or compiled
+# for) an older system. For example, if a test exhibits a bug in the libc on a
+# particular system version, or if it uses a symbol that is not available on an
+# older version of the dylib, it can be marked as XFAIL with these features.
+#
+# It is sometimes useful to check that a test fails specifically when compiled for a
+# given deployment target. For example, this is the case when testing availability
+# markup, where we want to make sure that using the annotated facility on a deployment
+# target that doesn't support it will fail at compile time, not at runtime. This can
+# be achieved by creating a `.verify.cpp` test that checks for the right errors, and
+# mark that test as requiring `stdlib=<vendor>-libc++ && target=<target>`.
+DEFAULT_FEATURES += [
+ # Tests that require std::to_chars(floating-point) in the built library
+ Feature(name='availability-fp_to_chars-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}', cfg.available_features)),
+
+ # Tests that require https://wg21.link/P0482 support in the built library
+ Feature(name='availability-char8_t_support-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0)(.0)?}}', cfg.available_features)),
+
+ # Tests that require __libcpp_verbose_abort support in the built library
+ Feature(name='availability-verbose_abort-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}', cfg.available_features)),
+
+ # Tests that require std::bad_variant_access in the built library
+ Feature(name='availability-bad_variant_access-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11|12)(.0)?}}', cfg.available_features)),
+
+ # Tests that require std::bad_optional_access in the built library
+ Feature(name='availability-bad_optional_access-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11|12)(.0)?}}', cfg.available_features)),
+
+ # Tests that require std::bad_any_cast in the built library
+ Feature(name='availability-bad_any_cast-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11|12)(.0)?}}', cfg.available_features)),
+
+ # Tests that require std::pmr support in the built library
+ Feature(name='availability-pmr-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0)(.0)?}}', cfg.available_features)),
+
+ # Tests that require std::filesystem support in the built library
+ Feature(name='availability-filesystem-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11|12|13|14)(.0)?}}', cfg.available_features)),
+
+ # Tests that require the C++20 synchronization library (P1135R6 implemented by https://llvm.org/D68480) in the built library
+ Feature(name='availability-synchronization_library-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11|12|13|14|15)(.0)?}}', cfg.available_features)),
+
+ # Tests that require support for std::shared_mutex and std::shared_timed_mutex in the built library
+ Feature(name='availability-shared_mutex-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11)(.0)?}}', cfg.available_features)),
+
+ # Tests that require support for aligned allocation in the built library. This is about `operator new(..., std::align_val_t, ...)` specifically,
+ # not other forms of aligned allocation.
+ Feature(name='availability-aligned_allocation-missing',
+ when=lambda cfg: BooleanExpression.evaluate('stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(9|10|11|12)(.0)?}}', cfg.available_features)),
+]
diff --git a/third_party/llvm-project/libcxx/utils/libcxx/test/format.py b/third_party/llvm-project/libcxx/utils/libcxx/test/format.py
index 6860f8d..4d3466d 100644
--- a/third_party/llvm-project/libcxx/utils/libcxx/test/format.py
+++ b/third_party/llvm-project/libcxx/utils/libcxx/test/format.py
@@ -115,9 +115,11 @@
FOO.pass.mm - Same as .pass.cpp, but for Objective-C++
FOO.compile.pass.cpp - Compiles successfully, link and run not attempted
+ FOO.compile.pass.mm - Same as .compile.pass.cpp, but for Objective-C++
FOO.compile.fail.cpp - Does not compile successfully
FOO.link.pass.cpp - Compiles and links successfully, run not attempted
+ FOO.link.pass.mm - Same as .link.pass.cpp, but for Objective-C++
FOO.link.fail.cpp - Compiles successfully, but fails to link
FOO.sh.<anything> - A builtin Lit Shell test
@@ -187,8 +189,10 @@
"""
def getTestsInDirectory(self, testSuite, pathInSuite, litConfig, localConfig):
SUPPORTED_SUFFIXES = ['[.]pass[.]cpp$', '[.]pass[.]mm$',
- '[.]compile[.]pass[.]cpp$', '[.]compile[.]fail[.]cpp$',
- '[.]link[.]pass[.]cpp$', '[.]link[.]fail[.]cpp$',
+ '[.]compile[.]pass[.]cpp$', '[.]compile[.]pass[.]mm$',
+ '[.]compile[.]fail[.]cpp$',
+ '[.]link[.]pass[.]cpp$', '[.]link[.]pass[.]mm$',
+ '[.]link[.]fail[.]cpp$',
'[.]sh[.][^.]+$',
'[.]verify[.]cpp$',
'[.]fail[.]cpp$']
@@ -211,7 +215,7 @@
if re.search('[.]sh[.][^.]+$', filename):
steps = [ ] # The steps are already in the script
return self._executeShTest(test, litConfig, steps)
- elif filename.endswith('.compile.pass.cpp'):
+ elif filename.endswith('.compile.pass.cpp') or filename.endswith('.compile.pass.mm'):
steps = [
"%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
]
@@ -221,7 +225,7 @@
"%dbg(COMPILED WITH) ! %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
]
return self._executeShTest(test, litConfig, steps)
- elif filename.endswith('.link.pass.cpp'):
+ elif filename.endswith('.link.pass.cpp') or filename.endswith('.link.pass.mm'):
steps = [
"%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe"
]
@@ -266,11 +270,6 @@
else:
return lit.Test.Result(lit.Test.UNRESOLVED, "Unknown test suffix for '{}'".format(filename))
- # Utility function to add compile flags in lit.local.cfg files.
- def addCompileFlags(self, config, *flags):
- string = ' '.join(flags)
- config.substitutions = [(s, x + ' ' + string) if s == '%{compile_flags}' else (s, x) for (s, x) in config.substitutions]
-
def _executeShTest(self, test, litConfig, steps):
if test.config.unsupported:
return lit.Test.Result(lit.Test.UNSUPPORTED, 'Test is unsupported')
diff --git a/third_party/llvm-project/libcxx/utils/libcxx/test/params.py b/third_party/llvm-project/libcxx/utils/libcxx/test/params.py
index 74a4ec2..3d0addb 100644
--- a/third_party/llvm-project/libcxx/utils/libcxx/test/params.py
+++ b/third_party/llvm-project/libcxx/utils/libcxx/test/params.py
@@ -17,6 +17,7 @@
'-Wextra',
'-Wshadow',
'-Wundef',
+ '-Wunused-template',
'-Wno-unused-command-line-argument',
'-Wno-attributes',
'-Wno-pessimizing-move',
@@ -94,6 +95,12 @@
AddCompileFlag('-fcxx-modules'), # AppleClang disregards -fmodules entirely when compiling C++. This enables modules for C++.
] if modules else []),
+ Parameter(name='enable_modules_lsv', choices=[True, False], type=bool, default=False,
+ help="Whether to enable Local Submodule Visibility in the Modules build.",
+ actions=lambda lsv: [
+ AddCompileFlag('-Xclang -fmodules-local-submodule-visibility'),
+ ] if lsv else []),
+
Parameter(name='enable_exceptions', choices=[True, False], type=bool, default=True,
help="Whether to enable exceptions when compiling the test suite.",
actions=lambda exceptions: [] if exceptions else [
@@ -118,8 +125,8 @@
The Standard libraries currently supported are:
- llvm-libc++: The 'upstream' libc++ as shipped with LLVM.
- apple-libc++: libc++ as shipped by Apple. This is basically like the LLVM one, but
- there are a few differences like installation paths and the use of
- universal dylibs.
+ there are a few differences like installation paths, the use of
+ universal dylibs and the existence of availability markup.
- libstdc++: The GNU C++ library typically shipped with GCC.
- msvc: The Microsoft implementation of the C++ Standard Library.
""",
@@ -208,38 +215,3 @@
AddCompileFlag('-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES')
]),
]
-
-DEFAULT_PARAMETERS += [
- Parameter(name='use_system_cxx_lib', choices=[True, False], type=bool, default=False,
- help="""
- Whether the test suite is being *run* against the library shipped on the
- target triple in use, as opposed to the trunk library.
-
- When vendor-specific availability annotations are enabled, we add the
- 'use_system_cxx_lib' Lit feature to allow writing XFAIL or UNSUPPORTED
- markup for tests that are known to fail on a particular triple.
-
- That feature can be used to XFAIL a test that fails when deployed on (or is
- compiled for) an older system. For example, if the test exhibits a bug in the
- libc on a particular system version, or if the test uses a symbol that is not
- available on an older version of the dylib, it can be marked as XFAIL with
- the above feature.
-
- It is sometimes useful to check that a test fails specifically when compiled
- for a given deployment target. For example, this is the case when testing
- availability markup, where we want to make sure that using the annotated
- facility on a deployment target that doesn't support it will fail at compile
- time, not at runtime. This can be achieved by creating a `.compile.pass.cpp`
- and XFAILing it for the right deployment target. If the test doesn't fail at
- compile-time like it's supposed to, the test will XPASS. Another option is to
- create a `.verify.cpp` test that checks for the right errors, and mark that
- test as requiring `use_system_cxx_lib && <target>`.
- """,
- actions=lambda useSystem: [
- AddFeature('use_system_cxx_lib')
- ] if useSystem else [
- # If we're testing upstream libc++, disable availability markup,
- # which is not relevant for non-shipped flavors of libc++.
- AddCompileFlag('-D_LIBCPP_DISABLE_AVAILABILITY')
- ])
-]
diff --git a/third_party/llvm-project/libcxxabi/BUILD.gn b/third_party/llvm-project/libcxxabi/BUILD.gn
index bb1ccb7..c014ca0 100644
--- a/third_party/llvm-project/libcxxabi/BUILD.gn
+++ b/third_party/llvm-project/libcxxabi/BUILD.gn
@@ -20,7 +20,7 @@
cflags = [ "-nostdinc" ]
cflags_cc = [
- "-std=c++17",
+ "-std=c++20",
"-nostdinc++",
"-fPIC",
"-frtti",
@@ -69,7 +69,6 @@
#"src/cxa_exception.cpp",
"src/cxa_exception_storage.cpp",
-
"src/cxa_guard.cpp",
"src/cxa_handlers.cpp",
"src/cxa_noexception.cpp",
@@ -91,6 +90,8 @@
]
configs += [ ":cxxabi_config" ]
+ configs -= [ "//starboard/build/config:default_cpp_standard" ]
+
all_dependent_configs = [ ":cxxabi_dependents_config" ]
deps = [ "//third_party/musl:c" ]
diff --git a/third_party/llvm-project/libcxxabi/CMakeLists.txt b/third_party/llvm-project/libcxxabi/CMakeLists.txt
index 8f48d40..9239274 100644
--- a/third_party/llvm-project/libcxxabi/CMakeLists.txt
+++ b/third_party/llvm-project/libcxxabi/CMakeLists.txt
@@ -12,6 +12,7 @@
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../runtimes/cmake/Modules"
"${LLVM_COMMON_CMAKE_UTILS}"
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
)
@@ -43,7 +44,7 @@
"Provide support for exceptions in the runtime.
When disabled, libc++abi does not support stack unwinding and other exceptions-related features." ON)
option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
-option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF)
option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)
@@ -244,12 +245,8 @@
#===============================================================================
# Configure target flags
-if(ZOS)
- add_target_flags_if_supported("-fzos-le-char-mode=ebcdic")
-endif()
-
if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
- add_target_flags_if_supported("-mdefault-visibility-export-mapping=explicit")
+ add_flags_if_supported("-mdefault-visibility-export-mapping=explicit")
set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF)
endif()
add_compile_flags("${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
@@ -282,41 +279,6 @@
# it is being built as part of libcxx.
add_definitions(-D_LIBCPP_BUILDING_LIBRARY)
-add_compile_flags_if_supported(-Werror=return-type)
-
-# Get warning flags
-add_compile_flags_if_supported(-W)
-add_compile_flags_if_supported(-Wall)
-add_compile_flags_if_supported(-Wchar-subscripts)
-add_compile_flags_if_supported(-Wconversion)
-add_compile_flags_if_supported(-Wmismatched-tags)
-add_compile_flags_if_supported(-Wmissing-braces)
-add_compile_flags_if_supported(-Wnewline-eof)
-add_compile_flags_if_supported(-Wunused-function)
-add_compile_flags_if_supported(-Wshadow)
-add_compile_flags_if_supported(-Wshorten-64-to-32)
-add_compile_flags_if_supported(-Wsign-compare)
-add_compile_flags_if_supported(-Wsign-conversion)
-add_compile_flags_if_supported(-Wstrict-aliasing=2)
-add_compile_flags_if_supported(-Wstrict-overflow=4)
-add_compile_flags_if_supported(-Wunused-parameter)
-add_compile_flags_if_supported(-Wunused-variable)
-add_compile_flags_if_supported(-Wwrite-strings)
-add_compile_flags_if_supported(-Wundef)
-
-add_compile_flags_if_supported(-Wno-suggest-override)
-
-if (LIBCXXABI_ENABLE_WERROR)
- add_compile_flags_if_supported(-Werror)
- add_compile_flags_if_supported(-WX)
-else()
- add_compile_flags_if_supported(-Wno-error)
- add_compile_flags_if_supported(-WX-)
-endif()
-if (LIBCXXABI_ENABLE_PEDANTIC)
- add_compile_flags_if_supported(-pedantic)
-endif()
-
# Get feature flags.
add_compile_flags_if_supported(-fstrict-aliasing)
diff --git a/third_party/llvm-project/libcxxabi/METADATA b/third_party/llvm-project/libcxxabi/METADATA
index e1baa1a..28925e4 100644
--- a/third_party/llvm-project/libcxxabi/METADATA
+++ b/third_party/llvm-project/libcxxabi/METADATA
@@ -1,21 +1,26 @@
name: "libcxxabi"
description:
- "Filtered subtree at third_party/llvm-project/libcxxabi."
+ "Subdirectory subtree of llvm-project."
third_party {
identifier {
type: "ChromiumVersion"
- value: "111.0.5563.150" # from https://chromereleases.googleblog.com/2023/03/stable-channel-update-for-chromeos_29.html
+ value: "114.0.5735.351"
}
identifier {
type: "Git"
- value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git"
- version: "d520d582aa710cc0a4635620c02c5dbc187deb4f"
- # from https://chromium.googlesource.com/chromium/src/+/111.0.5563.150/DEPS#466
+ value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project"
+ version: "27f27d15f6c90b026eca23b8ee238fdbf772fd80"
+ # from https://chromium.googlesource.com/chromium/src/+/refs/tags/114.0.5735.351/tools/clang/scripts/update.py#38
+ closest_version: "llvmorg-17-init-8029-g27f27d15"
+ }
+ identifier {
+ type: "UpstreamSubdir"
+ value: "libcxxabi"
}
last_upgrade_date {
- year: 2023
- month: 1
- day: 17
+ year: 2024
+ month: 2
+ day: 21
}
}
diff --git a/third_party/llvm-project/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake b/third_party/llvm-project/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake
index 25d4789..16aed02 100644
--- a/third_party/llvm-project/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake
+++ b/third_party/llvm-project/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake
@@ -5,135 +5,10 @@
# - LIBCXXABI_LIBRARIES: libraries to link libc++abi to.
include(CheckCXXCompilerFlag)
+include(HandleFlags)
unset(add_flag_if_supported)
-# Mangle the name of a compiler flag into a valid CMake identifier.
-# Ex: --std=c++11 -> STD_EQ_CXX11
-macro(mangle_name str output)
- string(STRIP "${str}" strippedStr)
- string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")
- string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}")
- string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}")
- string(REPLACE "-" "_" strippedStr "${strippedStr}")
- string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}")
- string(REPLACE "+" "X" strippedStr "${strippedStr}")
- string(TOUPPER "${strippedStr}" ${output})
-endmacro()
-
-# Remove a list of flags from all CMake variables that affect compile flags.
-# This can be used to remove unwanted flags specified on the command line
-# or added in other parts of LLVM's cmake configuration.
-macro(remove_flags)
- foreach(var ${ARGN})
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS "${CMAKE_SHARED_MODULE_FLAGS}")
- remove_definitions(${var})
- endforeach()
-endmacro(remove_flags)
-
-macro(check_flag_supported flag)
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
-endmacro()
-
-macro(append_flags DEST)
- foreach(value ${ARGN})
- list(APPEND ${DEST} ${value})
- list(APPEND ${DEST} ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then append the specified list of flags to DEST
-macro(append_flags_if condition DEST)
- if (${condition})
- list(APPEND ${DEST} ${ARGN})
- endif()
-endmacro()
-
-# Add each flag in the list specified by DEST if that flag is supported by the current compiler.
-macro(append_flags_if_supported DEST)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag})
- endforeach()
-endmacro()
-
-# Add a macro definition if condition is true.
-macro(define_if condition def)
- if (${condition})
- add_definitions(${def})
- endif()
-endmacro()
-
-# Add a macro definition if condition is not true.
-macro(define_if_not condition def)
- if (NOT ${condition})
- add_definitions(${def})
- endif()
-endmacro()
-
-# Add a macro definition to the __config_site file if the specified condition
-# is 'true'. Note that '-D${def}' is not added. Instead it is expected that
-# the build include the '__config_site' header.
-macro(config_define_if condition def)
- if (${condition})
- set(${def} ON)
- set(LIBCXXABI_NEEDS_SITE_CONFIG ON)
- endif()
-endmacro()
-
-macro(config_define_if_not condition def)
- if (NOT ${condition})
- set(${def} ON)
- set(LIBCXXABI_NEEDS_SITE_CONFIG ON)
- endif()
-endmacro()
-
-macro(config_define value def)
- set(${def} ${value})
- set(LIBCXXABI_NEEDS_SITE_CONFIG ON)
-endmacro()
-
-# Add a list of flags to all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS',
-# 'LIBCXXABI_COMPILE_FLAGS' and 'LIBCXXABI_LINK_FLAGS'.
-macro(add_target_flags)
- foreach(value ${ARGN})
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${value}")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${value}")
- list(APPEND LIBCXXABI_COMPILE_FLAGS ${value})
- list(APPEND LIBCXXABI_LINK_FLAGS ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then add a list of flags to
-# all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXXABI_COMPILE_FLAGS'
-# and 'LIBCXXABI_LINK_FLAGS'.
-macro(add_target_flags_if condition)
- if (${condition})
- add_target_flags(${ARGN})
- endif()
-endmacro()
-
-# Add all the flags supported by the compiler to all of
-# 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXXABI_COMPILE_FLAGS'
-# and 'LIBCXXABI_LINK_FLAGS'.
-macro(add_target_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- add_target_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
# Add a specified list of flags to both 'LIBCXXABI_COMPILE_FLAGS' and
# 'LIBCXXABI_LINK_FLAGS'.
macro(add_flags)
@@ -235,20 +110,3 @@
add_library_flags(${ARGN})
endif()
endmacro()
-
-# Turn a comma separated CMake list into a space separated string.
-macro(split_list listname)
- string(REPLACE ";" " " ${listname} "${${listname}}")
-endmacro()
-
-# For each specified flag, add that compile flag to the provided target.
-# The flags are added with the given visibility, i.e. PUBLIC|PRIVATE|INTERFACE.
-function(target_add_compile_flags_if_supported target visibility)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- if (CXX_SUPPORTS_${flagname}_FLAG)
- target_compile_options(${target} ${visibility} ${flag})
- endif()
- endforeach()
-endfunction()
diff --git a/third_party/llvm-project/libcxxabi/src/CMakeLists.txt b/third_party/llvm-project/libcxxabi/src/CMakeLists.txt
index 58df59a..4c27a25 100644
--- a/third_party/llvm-project/libcxxabi/src/CMakeLists.txt
+++ b/third_party/llvm-project/libcxxabi/src/CMakeLists.txt
@@ -158,8 +158,11 @@
message(STATUS "Could not find ParallelSTL, libc++abi will not attempt to use it but the build may fail if the libc++ in use needs it to be available.")
endif()
+include(WarningFlags)
+
# Build the shared library.
add_library(cxxabi_shared_objects OBJECT EXCLUDE_FROM_ALL ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
+cxx_add_warning_flags(cxxabi_shared_objects ${LIBCXXABI_ENABLE_WERROR} ${LIBCXXABI_ENABLE_PEDANTIC})
if (LIBCXXABI_USE_LLVM_UNWINDER)
if (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY)
target_link_libraries(cxxabi_shared_objects PUBLIC unwind_shared_objects) # propagate usage requirements
@@ -246,6 +249,7 @@
# Build the static library.
add_library(cxxabi_static_objects OBJECT EXCLUDE_FROM_ALL ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
+cxx_add_warning_flags(cxxabi_static_objects ${LIBCXXABI_ENABLE_WERROR} ${LIBCXXABI_ENABLE_PEDANTIC})
if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY)
target_link_libraries(cxxabi_static_objects PUBLIC unwind_static_objects) # propagate usage requirements
target_sources(cxxabi_static_objects PUBLIC $<TARGET_OBJECTS:unwind_static_objects>)
diff --git a/third_party/llvm-project/libcxxabi/src/aix_state_tab_eh.inc b/third_party/llvm-project/libcxxabi/src/aix_state_tab_eh.inc
index 128a0ab..3bb09ed 100644
--- a/third_party/llvm-project/libcxxabi/src/aix_state_tab_eh.inc
+++ b/third_party/llvm-project/libcxxabi/src/aix_state_tab_eh.inc
@@ -14,10 +14,6 @@
#include <stdio.h>
#include <sys/debug.h>
-#if !__has_cpp_attribute(clang::optnone)
-#error This file requires clang::optnone attribute support
-#endif
-
/*
The legacy IBM xlC and xlclang++ compilers use the state table for EH
instead of the range table. Destructors, or addresses of the possible catch
@@ -563,7 +559,8 @@
uintptr_t *currentSP = reinterpret_cast<uintptr_t*>(_Unwind_GetGR(context, 1));
uintptr_t *callersSP = reinterpret_cast<uintptr_t*>(currentSP[0]);
callersSP[3] = reinterpret_cast<uintptr_t>(unwind_exception);
- _LIBCXXABI_TRACE_STATETAB("Handshake: set unwind_exception=%p in stack=%p\n", reinterpret_cast<void*>(unwind_exception), reinterpret_cast<void*>(callersSP));
+ _LIBCXXABI_TRACE_STATETAB("Handshake: save unwind_exception=%p in stack=%p\n",
+ reinterpret_cast<void*>(unwind_exception), reinterpret_cast<void*>(callersSP));
// Jump to the handler.
_Unwind_SetIP(context, results.landingPad);
return _URC_INSTALL_CONTEXT;
@@ -641,38 +638,68 @@
__cxa_throw(newexception, const_cast<std::type_info*>(&typeid(std::bad_exception)), 0);
}
-// force_a_stackframe
-// This function is called by __xlc_exception_handle() to ensure a stack frame
-// is created for __xlc_exception_handle().
-__attribute__((noinline, optnone))
-static void force_a_stackframe() {}
+// skip_non_cxx_eh_aware_frames
+// This function skips non-C++ EH aware stack frames by unwinding from the
+// stack frame pointed by 'Sp' and returns the first C++ EH aware stack frame
+// found. 'Pc' is an instruction address inside the function that owns the
+// stack frame pointed to by 'Sp'.
+static uintptr_t* skip_non_cxx_eh_aware_frames(uint32_t* Pc, uintptr_t* Sp) {
+ uint32_t* currentPc = Pc;
+ uintptr_t* currentStack = Sp;
+
+ // Loop until a C++ EH aware frame is found or the return address is 0,
+ // which is the return address of the startup function '__start'.
+ while (currentPc != 0) {
+ uint32_t* p = currentPc;
+
+ // Keep looking forward until a word of 0 is found. The traceback
+ // table starts at the following word.
+ while (*p)
+ ++p;
+ tbtable* TBTable = reinterpret_cast<tbtable*>(p + 1);
+
+ // A stack frame with a C++ state table is C++ EH aware.
+ if (TBTable->tb.lang == TB_CPLUSPLUS && TBTable->tb.has_ctl)
+ return currentStack;
+
+ // Move up one stack frame.
+ currentStack = reinterpret_cast<uintptr_t*>(currentStack[0]);
+ // Get the value of the LR (saved, prior to incrementing the SP, by the
+ // prolog of the function just inspected) from the frame.
+ currentPc = reinterpret_cast<uint32_t*>(currentStack[2]);
+ }
+ // This should not happen.
+ _LIBCXXABI_TRACE_STATETAB0("skip_non_cxx_eh_aware_frames() reached the end of stack frames, aborting\n");
+ abort();
+}
// __xlc_exception_handle
// This function is for xlclang++. It returns the address of the exception
// object stored in the reserved field in the stack of the caller of the
// function that calls __xlc_exception_handle() (within the link area for the
// call to the latter). The address is stored by the personality routine for
-// xlclang++ compiled code. The implementation of __xlc_exception_handle()
-// assumes a stack frame is created for it. The following ensures this
-// assumption holds true: 1) a call to force_a_stackframe() is made inside
-// __xlc_exception_handle() to make it non-leaf; and 2) optimizations are
-// disabled for this function with attribute 'optnone'. Note: this function
-// may not work as expected if these are changed.
-__attribute__((optnone))
+// xlclang++ compiled code. If __xlc_exception_handle() is called by
+// non-C++ EH aware functions, their frames are skipped until a C++ EH aware
+// frame is found.
+// Note: make sure __xlc_excpetion_handle() is a non-leaf function. Currently
+// it calls skip_non_cxx_eh_aware_frames(), which in turn calls abort().
_LIBCXXABI_FUNC_VIS uintptr_t __xlc_exception_handle() {
- // Make a call to force_a_stackframe() so that the compiler creates a stack
- // frame for this function.
- force_a_stackframe();
-
// Get the SP of this function, i.e., __xlc_exception_handle().
- uintptr_t *lastStack;
- asm("mr %0, 1" : "=r"(lastStack));
- // Get the SP of the caller of __xlc_exception_handle().
- uintptr_t *callerStack = reinterpret_cast<uintptr_t*>(lastStack[0]);
- // Get the SP of the caller of the caller.
- uintptr_t *callerStack2 = reinterpret_cast<uintptr_t*>(callerStack[0]);
- uintptr_t exceptionObject = callerStack2[3];
- _LIBCXXABI_TRACE_STATETAB("Handshake: exceptionObject=%p from stack=%p\n", reinterpret_cast<void*>(exceptionObject), reinterpret_cast<void*>(callerStack2));
+ uintptr_t* lastStack = reinterpret_cast<uintptr_t*>(__builtin_frame_address(0));
+ // Move one frame up to the frame of the caller of __xlc_exception_handle().
+ lastStack = reinterpret_cast<uintptr_t*>(lastStack[0]);
+ // Get the return address of this function, i.e., __xlc_exception_handle().
+ uint32_t* returnAddress = reinterpret_cast<uint32_t*>(__builtin_return_address(0));
+
+ // Skip non-C++ EH aware frames and get the first C++ EH aware frame.
+ uintptr_t* callerStack = skip_non_cxx_eh_aware_frames(returnAddress, lastStack);
+
+ // Get the SP of the caller of the C++ EH aware caller.
+ callerStack = reinterpret_cast<uintptr_t*>(callerStack[0]);
+ // Retrieve the exception object in the stack slot saved by the personality.
+ uintptr_t exceptionObject = callerStack[3];
+ _LIBCXXABI_TRACE_STATETAB("Handshake: retrieve exceptionObject=%p from stack=%p\n",
+ reinterpret_cast<void*>(exceptionObject), reinterpret_cast<void*>(callerStack));
return exceptionObject;
}
diff --git a/third_party/llvm-project/libcxxabi/src/cxa_aux_runtime.cpp b/third_party/llvm-project/libcxxabi/src/cxa_aux_runtime.cpp
index a42990c..5e6040d 100644
--- a/third_party/llvm-project/libcxxabi/src/cxa_aux_runtime.cpp
+++ b/third_party/llvm-project/libcxxabi/src/cxa_aux_runtime.cpp
@@ -10,6 +10,7 @@
//===----------------------------------------------------------------------===//
#include "cxxabi.h"
+#include <exception>
#include <new>
#include <typeinfo>
diff --git a/third_party/llvm-project/libcxxabi/src/demangle/ItaniumDemangle.h b/third_party/llvm-project/libcxxabi/src/demangle/ItaniumDemangle.h
index 66213c6..fd66e95 100644
--- a/third_party/llvm-project/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/third_party/llvm-project/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -19,6 +19,7 @@
#include "DemangleConfig.h"
#include "StringView.h"
#include "Utility.h"
+#include <__cxxabi_config.h>
#include <algorithm>
#include <cassert>
#include <cctype>
@@ -27,8 +28,14 @@
#include <cstring>
#include <limits>
#include <new>
+#include <type_traits>
#include <utility>
+#ifdef _LIBCXXABI_COMPILER_CLANG
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-template"
+#endif
+
DEMANGLE_NAMESPACE_BEGIN
template <class T, size_t N> class PODSmallVector {
@@ -537,6 +544,8 @@
template<typename Fn> void match(Fn F) const { F(Base, Tag); }
+ StringView getBaseName() const override { return Base->getBaseName(); }
+
void printLeft(OutputBuffer &OB) const override {
Base->printLeft(OB);
OB += "[abi:";
@@ -5497,4 +5506,8 @@
DEMANGLE_NAMESPACE_END
+#ifdef _LIBCXXABI_COMPILER_CLANG
+#pragma clang diagnostic pop
+#endif
+
#endif // DEMANGLE_ITANIUMDEMANGLE_H
diff --git a/third_party/llvm-project/libcxxabi/src/demangle/StringView.h b/third_party/llvm-project/libcxxabi/src/demangle/StringView.h
index 90890e3..07b7cf8 100644
--- a/third_party/llvm-project/libcxxabi/src/demangle/StringView.h
+++ b/third_party/llvm-project/libcxxabi/src/demangle/StringView.h
@@ -17,9 +17,16 @@
#define DEMANGLE_STRINGVIEW_H
#include "DemangleConfig.h"
+
+#include <__cxxabi_config.h>
#include <cassert>
#include <cstring>
+#ifdef _LIBCXXABI_COMPILER_CLANG
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-template"
+#endif
+
DEMANGLE_NAMESPACE_BEGIN
class StringView {
@@ -119,4 +126,8 @@
DEMANGLE_NAMESPACE_END
+#ifdef _LIBCXXABI_COMPILER_CLANG
+#pragma clang diagnostic pop
+#endif
+
#endif
diff --git a/third_party/llvm-project/libcxxabi/src/fallback_malloc.cpp b/third_party/llvm-project/libcxxabi/src/fallback_malloc.cpp
index 591efbe..f9fb1bc 100644
--- a/third_party/llvm-project/libcxxabi/src/fallback_malloc.cpp
+++ b/third_party/llvm-project/libcxxabi/src/fallback_malloc.cpp
@@ -15,10 +15,10 @@
#endif
#endif
+#include <__memory/aligned_alloc.h>
#include <assert.h>
#include <stdlib.h> // for malloc, calloc, free
#include <string.h> // for memset
-#include <new> // for std::__libcpp_aligned_{alloc,free}
// A small, simple heap manager based (loosely) on
// the startup heap manager from FreeBSD, optimized for space.
diff --git a/third_party/llvm-project/libcxxabi/src/private_typeinfo.cpp b/third_party/llvm-project/libcxxabi/src/private_typeinfo.cpp
index e108666..83d1f9f 100644
--- a/third_party/llvm-project/libcxxabi/src/private_typeinfo.cpp
+++ b/third_party/llvm-project/libcxxabi/src/private_typeinfo.cpp
@@ -41,6 +41,7 @@
// Defining _LIBCXXABI_FORGIVING_DYNAMIC_CAST does not help since can_catch() calls
// is_equal() with use_strcmp=false so the string names are not compared.
+#include <cstdint>
#include <string.h>
#ifdef _LIBCXXABI_FORGIVING_DYNAMIC_CAST
@@ -656,77 +657,138 @@
// Find out if we can use a giant short cut in the search
if (is_equal(dynamic_type, dst_type, false))
{
- // Using giant short cut. Add that information to info.
- info.number_of_dst_type = 1;
- // Do the search
- dynamic_type->search_above_dst(&info, dynamic_ptr, dynamic_ptr, public_path, false);
-#ifdef _LIBCXXABI_FORGIVING_DYNAMIC_CAST
- // The following if should always be false because we should definitely
- // find (static_ptr, static_type), either on a public or private path
- if (info.path_dst_ptr_to_static_ptr == unknown)
+ // We're downcasting from src_type to the complete object's dynamic
+ // type. This is a really hot path that can be further optimized
+ // with the `src2dst_offset` hint.
+ // In such a case, dynamic_ptr already gives the casting result if the
+ // casting ever succeeds. All we have to do now is to check
+ // static_ptr points to a public base sub-object of dynamic_ptr.
+
+ if (src2dst_offset >= 0)
{
- // We get here only if there is some kind of visibility problem
- // in client code.
- static_assert(std::atomic<size_t>::is_always_lock_free, "");
- static std::atomic<size_t> error_count(0);
- size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
- if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
- syslog(LOG_ERR, "dynamic_cast error 1: Both of the following type_info's "
- "should have public visibility. At least one of them is hidden. %s"
- ", %s.\n", static_type->name(), dynamic_type->name());
- // Redo the search comparing type_info's using strcmp
- info = {dst_type, static_ptr, static_type, src2dst_offset, 0};
- info.number_of_dst_type = 1;
- dynamic_type->search_above_dst(&info, dynamic_ptr, dynamic_ptr, public_path, true);
+ // The static type is a unique public non-virtual base type of
+ // dst_type at offset `src2dst_offset` from the origin of dst.
+ // Note that there might be other non-public static_type bases. The
+ // hint only guarantees that the public base is non-virtual and
+ // unique. So we have to check whether static_ptr points to that
+ // unique public base sub-object.
+ if (offset_to_derived == -src2dst_offset)
+ dst_ptr = dynamic_ptr;
}
+ else if (src2dst_offset == -2)
+ {
+ // static_type is not a public base of dst_type.
+ dst_ptr = nullptr;
+ }
+ else
+ {
+ // If src2dst_offset == -3, then:
+ // src_type is a multiple public base type but never a virtual
+ // base type. We can't conclude that static_ptr points to those
+ // public base sub-objects because there might be other non-
+ // public static_type bases. The search is inevitable.
+
+ // Fallback to the slow path to check that static_type is a public
+ // base type of dynamic_type.
+ // Using giant short cut. Add that information to info.
+ info.number_of_dst_type = 1;
+ // Do the search
+ dynamic_type->search_above_dst(&info, dynamic_ptr, dynamic_ptr, public_path, false);
+#ifdef _LIBCXXABI_FORGIVING_DYNAMIC_CAST
+ // The following if should always be false because we should
+ // definitely find (static_ptr, static_type), either on a public
+ // or private path
+ if (info.path_dst_ptr_to_static_ptr == unknown)
+ {
+ // We get here only if there is some kind of visibility problem
+ // in client code.
+ static_assert(std::atomic<size_t>::is_always_lock_free, "");
+ static std::atomic<size_t> error_count(0);
+ size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
+ if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
+ syslog(LOG_ERR, "dynamic_cast error 1: Both of the following type_info's "
+ "should have public visibility. At least one of them is hidden. %s"
+ ", %s.\n", static_type->name(), dynamic_type->name());
+ // Redo the search comparing type_info's using strcmp
+ info = {dst_type, static_ptr, static_type, src2dst_offset, 0};
+ info.number_of_dst_type = 1;
+ dynamic_type->search_above_dst(&info, dynamic_ptr, dynamic_ptr, public_path, true);
+ }
#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
- // Query the search.
- if (info.path_dst_ptr_to_static_ptr == public_path)
- dst_ptr = dynamic_ptr;
+ // Query the search.
+ if (info.path_dst_ptr_to_static_ptr == public_path)
+ dst_ptr = dynamic_ptr;
+ }
}
else
{
- // Not using giant short cut. Do the search
- dynamic_type->search_below_dst(&info, dynamic_ptr, public_path, false);
- #ifdef _LIBCXXABI_FORGIVING_DYNAMIC_CAST
- // The following if should always be false because we should definitely
- // find (static_ptr, static_type), either on a public or private path
- if (info.path_dst_ptr_to_static_ptr == unknown &&
- info.path_dynamic_ptr_to_static_ptr == unknown)
+ if (src2dst_offset >= 0)
{
- static_assert(std::atomic<size_t>::is_always_lock_free, "");
- static std::atomic<size_t> error_count(0);
- size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
- if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
- syslog(LOG_ERR, "dynamic_cast error 2: One or more of the following type_info's "
- "has hidden visibility or is defined in more than one translation "
- "unit. They should all have public visibility. "
- "%s, %s, %s.\n", static_type->name(), dynamic_type->name(),
- dst_type->name());
- // Redo the search comparing type_info's using strcmp
- info = {dst_type, static_ptr, static_type, src2dst_offset, 0};
- dynamic_type->search_below_dst(&info, dynamic_ptr, public_path, true);
+ // Optimize toward downcasting: dst_type has one unique public
+ // static_type bases. Let's first try to do a downcast before
+ // falling back to the slow path. The downcast succeeds if there
+ // is at least one path regardless of visibility from
+ // dynamic_type to dst_type.
+ const void* dst_ptr_to_static = reinterpret_cast<const char*>(static_ptr) - src2dst_offset;
+ if (reinterpret_cast<std::intptr_t>(dst_ptr_to_static) >= reinterpret_cast<std::intptr_t>(dynamic_ptr))
+ {
+ // Try to search a path from dynamic_type to dst_type.
+ __dynamic_cast_info dynamic_to_dst_info = {dynamic_type, dst_ptr_to_static, dst_type, src2dst_offset};
+ dynamic_to_dst_info.number_of_dst_type = 1;
+ dynamic_type->search_above_dst(&dynamic_to_dst_info, dynamic_ptr, dynamic_ptr, public_path, false);
+ if (dynamic_to_dst_info.path_dst_ptr_to_static_ptr != unknown) {
+ // We have found at least one path from dynamic_ptr to
+ // dst_ptr. The downcast can succeed.
+ dst_ptr = dst_ptr_to_static;
+ }
+ }
}
-#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
- // Query the search.
- switch (info.number_to_static_ptr)
+
+ if (!dst_ptr)
{
- case 0:
- if (info.number_to_dst_ptr == 1 &&
- info.path_dynamic_ptr_to_static_ptr == public_path &&
- info.path_dynamic_ptr_to_dst_ptr == public_path)
- dst_ptr = info.dst_ptr_not_leading_to_static_ptr;
- break;
- case 1:
- if (info.path_dst_ptr_to_static_ptr == public_path ||
- (
- info.number_to_dst_ptr == 0 &&
- info.path_dynamic_ptr_to_static_ptr == public_path &&
- info.path_dynamic_ptr_to_dst_ptr == public_path
- )
- )
- dst_ptr = info.dst_ptr_leading_to_static_ptr;
- break;
+ // Not using giant short cut. Do the search
+ dynamic_type->search_below_dst(&info, dynamic_ptr, public_path, false);
+#ifdef _LIBCXXABI_FORGIVING_DYNAMIC_CAST
+ // The following if should always be false because we should
+ // definitely find (static_ptr, static_type), either on a public
+ // or private path
+ if (info.path_dst_ptr_to_static_ptr == unknown &&
+ info.path_dynamic_ptr_to_static_ptr == unknown)
+ {
+ static_assert(std::atomic<size_t>::is_always_lock_free, "");
+ static std::atomic<size_t> error_count(0);
+ size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
+ if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
+ syslog(LOG_ERR, "dynamic_cast error 2: One or more of the following type_info's "
+ "has hidden visibility or is defined in more than one translation "
+ "unit. They should all have public visibility. "
+ "%s, %s, %s.\n", static_type->name(), dynamic_type->name(),
+ dst_type->name());
+ // Redo the search comparing type_info's using strcmp
+ info = {dst_type, static_ptr, static_type, src2dst_offset, 0};
+ dynamic_type->search_below_dst(&info, dynamic_ptr, public_path, true);
+ }
+#endif // _LIBCXXABI_FORGIVING_DYNAMIC_CAST
+ // Query the search.
+ switch (info.number_to_static_ptr)
+ {
+ case 0:
+ if (info.number_to_dst_ptr == 1 &&
+ info.path_dynamic_ptr_to_static_ptr == public_path &&
+ info.path_dynamic_ptr_to_dst_ptr == public_path)
+ dst_ptr = info.dst_ptr_not_leading_to_static_ptr;
+ break;
+ case 1:
+ if (info.path_dst_ptr_to_static_ptr == public_path ||
+ (
+ info.number_to_dst_ptr == 0 &&
+ info.path_dynamic_ptr_to_static_ptr == public_path &&
+ info.path_dynamic_ptr_to_dst_ptr == public_path
+ )
+ )
+ dst_ptr = info.dst_ptr_leading_to_static_ptr;
+ break;
+ }
}
}
return const_cast<void*>(dst_ptr);
diff --git a/third_party/llvm-project/libcxxabi/src/stdlib_new_delete.cpp b/third_party/llvm-project/libcxxabi/src/stdlib_new_delete.cpp
index 4a664e1..483b9f1 100644
--- a/third_party/llvm-project/libcxxabi/src/stdlib_new_delete.cpp
+++ b/third_party/llvm-project/libcxxabi/src/stdlib_new_delete.cpp
@@ -9,8 +9,9 @@
//===----------------------------------------------------------------------===//
#include "__cxxabi_config.h"
-#include <new>
+#include <__memory/aligned_alloc.h>
#include <cstdlib>
+#include <new>
#if !defined(_THROW_BAD_ALLOC) || !defined(_LIBCXXABI_WEAK)
#error The _THROW_BAD_ALLOC and _LIBCXXABI_WEAK libc++ macros must \
diff --git a/third_party/llvm-project/libcxxabi/test/CMakeLists.txt b/third_party/llvm-project/libcxxabi/test/CMakeLists.txt
index 5da584a..d639292 100644
--- a/third_party/llvm-project/libcxxabi/test/CMakeLists.txt
+++ b/third_party/llvm-project/libcxxabi/test/CMakeLists.txt
@@ -8,7 +8,7 @@
endmacro()
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
-set(LIBCXXABI_EXECUTOR "${Python3_EXECUTABLE} ${LIBCXXABI_LIBCXX_PATH}/utils/run.py" CACHE STRING
+set(LIBCXXABI_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${LIBCXXABI_LIBCXX_PATH}/utils/run.py" CACHE STRING
"Executor to use when running tests.")
if (LIBCXXABI_ENABLE_SHARED)
diff --git a/third_party/llvm-project/libcxxabi/test/catch_function_01.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_function_01.pass.cpp
index 2ac94db..750af34 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_function_01.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_function_01.pass.cpp
@@ -14,7 +14,7 @@
// UNSUPPORTED: no-exceptions
// 65ace9daa360 made it in the dylib in macOS 10.11
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10}}
#include <cassert>
diff --git a/third_party/llvm-project/libcxxabi/test/catch_function_03.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_function_03.pass.cpp
index ec4b7eb..e353d0e 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_function_03.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_function_03.pass.cpp
@@ -11,7 +11,7 @@
// UNSUPPORTED: no-exceptions
// Support for catching a function pointer including noexcept was shipped in macOS 10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
#include <cassert>
diff --git a/third_party/llvm-project/libcxxabi/test/catch_member_data_pointer_01.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_member_data_pointer_01.pass.cpp
index e2ffab5..5e5fb60 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_member_data_pointer_01.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_member_data_pointer_01.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: no-exceptions
// 1b00fc5d8133 made it in the dylib in macOS 10.11
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10}}
#include <cassert>
diff --git a/third_party/llvm-project/libcxxabi/test/catch_member_function_pointer_02.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_member_function_pointer_02.pass.cpp
index a504b35..3236f9a 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_member_function_pointer_02.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_member_function_pointer_02.pass.cpp
@@ -11,7 +11,7 @@
// UNSUPPORTED: no-exceptions
// Support for catching a function pointer including noexcept was shipped in macOS 10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// GCC supports noexcept function types but this test still fails.
// This is likely a bug in their implementation. Investigation needed.
diff --git a/third_party/llvm-project/libcxxabi/test/catch_member_pointer_nullptr.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_member_pointer_nullptr.pass.cpp
index 3aea1f3..70d3afc7 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_member_pointer_nullptr.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_member_pointer_nullptr.pass.cpp
@@ -8,7 +8,7 @@
// Catching an exception thrown as nullptr was not properly handled before
// 2f984cab4fa7, which landed in macOS 10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// UNSUPPORTED: no-exceptions
diff --git a/third_party/llvm-project/libcxxabi/test/catch_multi_level_pointer.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_multi_level_pointer.pass.cpp
index 1e6b18c..00ea66d 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_multi_level_pointer.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_multi_level_pointer.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: no-exceptions
// 1b00fc5d8133 made it in the dylib in macOS 10.11
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10}}
#include <cassert>
#include <cstdio>
diff --git a/third_party/llvm-project/libcxxabi/test/catch_pointer_nullptr.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_pointer_nullptr.pass.cpp
index 24f8432..29398f0 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_pointer_nullptr.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_pointer_nullptr.pass.cpp
@@ -8,7 +8,7 @@
// Catching an exception thrown as nullptr was not properly handled before
// 2f984cab4fa7, which landed in macOS 10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// UNSUPPORTED: c++03
// UNSUPPORTED: no-exceptions
diff --git a/third_party/llvm-project/libcxxabi/test/catch_ptr_02.pass.cpp b/third_party/llvm-project/libcxxabi/test/catch_ptr_02.pass.cpp
index 9149657..c7ef28a 100644
--- a/third_party/llvm-project/libcxxabi/test/catch_ptr_02.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/catch_ptr_02.pass.cpp
@@ -14,9 +14,10 @@
// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
// The fix for PR17222 made it in the dylib for macOS 10.10
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.9
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.9
#include <cassert>
+#include <stdint.h>
#if __cplusplus < 201103L
#define DISABLE_NULLPTR_TESTS
@@ -136,7 +137,7 @@
assert(false);
}
catch (base2 *p) {
- assert ((unsigned long)p == 12+sizeof(base1));
+ assert ((uintptr_t)p == 12+sizeof(base1));
}
catch (...)
{
diff --git a/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
index e94f15c..2e94721 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
@@ -7,7 +7,7 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl
+import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
@@ -55,7 +55,9 @@
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
))
-libcxx.test.newconfig.configure(
+config.stdlib = 'apple-libc++'
+
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-shared.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-shared.cfg.in
index 20298bc..ec0c93b 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-shared.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/apple-libc++abi-shared.cfg.in
@@ -16,10 +16,12 @@
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib} -- '
))
+config.stdlib = 'apple-libc++'
+
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/cmake-bridge.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/cmake-bridge.cfg.in
index d61303a..89b2dca 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/cmake-bridge.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/cmake-bridge.cfg.in
@@ -21,7 +21,7 @@
config.test_source_root = os.path.join('@LIBCXXABI_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
-config.test_exec_root = '@CMAKE_BINARY_DIR@'
+config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
# TODO: This is a non-standard Lit attribute and we should have another way of accessing this.
config.host_triple = '@LLVM_HOST_TRIPLE@'
diff --git a/third_party/llvm-project/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
index 3d1175a..2a9bc90 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
@@ -18,8 +18,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in
index e61c6af..c6fa430 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in
@@ -18,8 +18,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-mingw.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-mingw.cfg.in
index b0e07d5..5e1a5dc 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-mingw.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-mingw.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-clangcl.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-clangcl.cfg.in
index 58d1e87..a375722 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-clangcl.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-clangcl.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-gcc.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-gcc.cfg.in
index 325fcd5..c61654b 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-gcc.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared-gcc.cfg.in
@@ -17,8 +17,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
index f742574..6b69205 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
@@ -18,8 +18,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static-clangcl.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static-clangcl.cfg.in
index 8820c5b7..445ee02 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static-clangcl.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static-clangcl.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static.cfg.in b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static.cfg.in
index c3e7c0a..352e2c3 100644
--- a/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static.cfg.in
+++ b/third_party/llvm-project/libcxxabi/test/configs/llvm-libc++abi-static.cfg.in
@@ -18,8 +18,8 @@
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp b/third_party/llvm-project/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
index 9d75fc1..16239e7 100644
--- a/third_party/llvm-project/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: no-exceptions
// PR41395 isn't fixed until the dylib shipped with macOS 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
#include "cxxabi.h"
#include <new>
diff --git a/third_party/llvm-project/libcxxabi/test/dynamic_cast.pass.cpp b/third_party/llvm-project/libcxxabi/test/dynamic_cast.pass.cpp
index 174c308..6b97afb 100644
--- a/third_party/llvm-project/libcxxabi/test/dynamic_cast.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/dynamic_cast.pass.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
// PR33425 and PR33487 are not fixed until the dylib shipped with macOS 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.14
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.14
// PR33439 isn't fixed until the dylib shipped with macOS 10.14
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
#include <cassert>
diff --git a/third_party/llvm-project/libcxxabi/test/exception_object_alignment.pass.cpp b/third_party/llvm-project/libcxxabi/test/exception_object_alignment.pass.cpp
index f212263..f0d49fa 100644
--- a/third_party/llvm-project/libcxxabi/test/exception_object_alignment.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/exception_object_alignment.pass.cpp
@@ -12,7 +12,7 @@
// before macOS 10.14. The test fails on macOS 10.9 to 10.12, passes on macOS
// 10.13 (no investigation done), and passes afterwards. Just mark all the OSes
// before 10.14 as unsupported.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Check that the pointer __cxa_allocate_exception returns is aligned to the
// default alignment for the target architecture.
diff --git a/third_party/llvm-project/libcxxabi/test/forced_unwind1.pass.cpp b/third_party/llvm-project/libcxxabi/test/forced_unwind1.pass.cpp
index 9083a1d..1788ab5 100644
--- a/third_party/llvm-project/libcxxabi/test/forced_unwind1.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/forced_unwind1.pass.cpp
@@ -12,8 +12,8 @@
// UNSUPPORTED: no-exceptions, c++03
// These tests fail on previously released dylibs, investigation needed.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{11.0|12.0}}
#include <stdlib.h>
#include <string.h>
diff --git a/third_party/llvm-project/libcxxabi/test/forced_unwind2.pass.cpp b/third_party/llvm-project/libcxxabi/test/forced_unwind2.pass.cpp
index a61d397..15923af 100644
--- a/third_party/llvm-project/libcxxabi/test/forced_unwind2.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/forced_unwind2.pass.cpp
@@ -11,8 +11,8 @@
// UNSUPPORTED: no-exceptions, c++03
// These tests fail on previously released dylibs, investigation needed.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11.0|12.0}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{11.0|12.0}}
#include <exception>
#include <stdlib.h>
diff --git a/third_party/llvm-project/libcxxabi/test/incomplete_type.sh.cpp b/third_party/llvm-project/libcxxabi/test/incomplete_type.sh.cpp
index 143c113..fbe6f03 100644
--- a/third_party/llvm-project/libcxxabi/test/incomplete_type.sh.cpp
+++ b/third_party/llvm-project/libcxxabi/test/incomplete_type.sh.cpp
@@ -17,7 +17,7 @@
// UNSUPPORTED: no-rtti
// The fix for PR25898 landed in the system dylibs in macOS 10.13
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// RUN: %{cxx} %{flags} %{compile_flags} -Wno-unreachable-code -c %s -o %t.one.o
// RUN: %{cxx} %{flags} %{compile_flags} -Wno-unreachable-code -c %s -o %t.two.o -DTU_ONE
diff --git a/third_party/llvm-project/libcxxabi/test/test_aux_runtime_op_array_new.pass.cpp b/third_party/llvm-project/libcxxabi/test/test_aux_runtime_op_array_new.pass.cpp
index d558570..f29a64b 100644
--- a/third_party/llvm-project/libcxxabi/test/test_aux_runtime_op_array_new.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/test_aux_runtime_op_array_new.pass.cpp
@@ -10,7 +10,7 @@
// ___cxa_throw_bad_array_new_length is re-exported from libc++ only starting
// in macosx 10.15
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
#include <cxxabi.h>
#include <new>
diff --git a/third_party/llvm-project/libcxxabi/test/test_demangle.pass.cpp b/third_party/llvm-project/libcxxabi/test/test_demangle.pass.cpp
index bbbbdce..471808d 100644
--- a/third_party/llvm-project/libcxxabi/test/test_demangle.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/test_demangle.pass.cpp
@@ -7,18 +7,19 @@
//===----------------------------------------------------------------------===//
// The demangler does not pass all these tests with the system dylibs on macOS.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
// https://llvm.org/PR51407 was not fixed in some previously-released
// demanglers, which causes them to run into the infinite loop.
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
-// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx11.0
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
+// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx11.0
#include "support/timer.h"
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
#include <cxxabi.h>
#include <string>
@@ -30051,7 +30052,7 @@
{"_Zcv1BIRT_EIS1_E", "operator B<><>"},
{"_ZN2FnIXgs4BaseEX4BaseEEEvv","void Fn<::Base, Base>()"},
-
+
{"_ZN2FnIXgsnw_iEEXna_ipiLi4EEEEEvv", "void Fn<::new int, new[] int(4)>()"},
{"_ZN2FnIXnwLj4E_iEEXgsnaLj4E_ipiLi4EEEEEvv", "void Fn<new(4u) int, ::new[](4u) int(4)>()"},
{"_ZN2FnIXgsdlLi4EEXdaLi4EEEEvv", "void Fn<::delete 4, delete[] 4>()"},
@@ -30111,6 +30112,8 @@
"::basic_ostream()"},
{"_ZNSsC1Ev", "std::basic_string<char, std::char_traits<char>,"
" std::allocator<char>>::basic_string()"},
+ {"_ZN1SB8ctor_tagC2Ev", "S[abi:ctor_tag]::S()"},
+ {"_ZN1SB8ctor_tagD2Ev", "S[abi:ctor_tag]::~S()"},
};
const unsigned N = sizeof(cases) / sizeof(cases[0]);
diff --git a/third_party/llvm-project/libcxxabi/test/test_exception_address_alignment.pass.cpp b/third_party/llvm-project/libcxxabi/test/test_exception_address_alignment.pass.cpp
index edfa789..6299913 100644
--- a/third_party/llvm-project/libcxxabi/test/test_exception_address_alignment.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/test_exception_address_alignment.pass.cpp
@@ -13,7 +13,7 @@
// an incorrectly aligned _Unwind_Exception type on non-ARM. That causes these
// tests to fail when running against a system libc++abi and libunwind that was
// compiled with an incorrect definition of _Unwind_Exception.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// Test that the address of the exception object is properly aligned as required
// by the relevant ABI
diff --git a/third_party/llvm-project/libcxxabi/test/test_fallback_malloc.pass.cpp b/third_party/llvm-project/libcxxabi/test/test_fallback_malloc.pass.cpp
index d7decd9..e7d22a5 100644
--- a/third_party/llvm-project/libcxxabi/test/test_fallback_malloc.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/test_fallback_malloc.pass.cpp
@@ -24,9 +24,12 @@
typedef std::deque<void *> container;
+TEST_DIAGNOSTIC_PUSH
+TEST_CLANG_DIAGNOSTIC_IGNORED("-Wprivate-header")
// #define DEBUG_FALLBACK_MALLOC
#define INSTRUMENT_FALLBACK_MALLOC
#include "../src/fallback_malloc.cpp"
+TEST_DIAGNOSTIC_POP
void assertAlignment(void* ptr) { assert(reinterpret_cast<size_t>(ptr) % alignof(FallbackMaxAlignType) == 0); }
diff --git a/third_party/llvm-project/libcxxabi/test/thread_local_destruction_order.pass.cpp b/third_party/llvm-project/libcxxabi/test/thread_local_destruction_order.pass.cpp
index 9daf966..c7e7717 100644
--- a/third_party/llvm-project/libcxxabi/test/thread_local_destruction_order.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/thread_local_destruction_order.pass.cpp
@@ -11,6 +11,13 @@
// XFAIL: LIBCXX-FREEBSD-FIXME
+// TODO: This test does start working with newer updates of the mingw-w64
+// toolchain, when it includes the following commit:
+// https://github.com/mingw-w64/mingw-w64/commit/71eddccd746c56d9cde28bb5620d027d49259de9
+// Thus, remove this UNSUPPORTED marking after the next update of the CI
+// toolchain.
+// UNSUPPORTED: target={{.*-windows-gnu}}
+
#include <cassert>
#include <thread>
diff --git a/third_party/llvm-project/libcxxabi/test/uncaught_exceptions.pass.cpp b/third_party/llvm-project/libcxxabi/test/uncaught_exceptions.pass.cpp
index 4286ab5..bd679e7 100644
--- a/third_party/llvm-project/libcxxabi/test/uncaught_exceptions.pass.cpp
+++ b/third_party/llvm-project/libcxxabi/test/uncaught_exceptions.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: no-exceptions
// __cxa_uncaught_exceptions is not re-exported from libc++ until macOS 10.15.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
+// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
#include <cxxabi.h>
#include <cassert>
diff --git a/third_party/llvm-project/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S b/third_party/llvm-project/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
new file mode 100644
index 0000000..d8a3ae0
--- /dev/null
+++ b/third_party/llvm-project/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_32.pass.sh.S
@@ -0,0 +1,690 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// Test that the exception object is passed correctly from the personality
+// to the landing pad even when there are wrappers around runtime function
+// __xlc_exception_handle. This test is only for the legacy AIX xlclang
+// compiler generated code. The test source consists of two C++ source files
+// t1.cpp and t2.cpp which are compiled into assembly code by the legacy AIX
+// xlclang++ compiler included in this file. This file tests for the 32-bit
+// mode.
+
+# REQUIRES: target=powerpc-ibm-aix
+# UNSUPPORTED: no-exceptions
+
+// RUN: %{cxx} -c %s -o %t1_32.o -DT1_CPP_CODE %{flags} %{compile_flags}
+// RUN: %{cxx} -c %s -o %t2_32.o -DT2_CPP_CODE %{flags} %{compile_flags}
+// RUN: %{cxx} -o %t_32.exe %t1_32.o %t2_32.o %{flags} %{link_flags}
+// RUN: %{exec} %t_32.exe
+
+#if defined(T1_CPP_CODE)
+#
+# This portion of assembly code is generated by IBM legacy xlclang++ compiler
+# from the following C++ source file for 32-bit mode.
+#
+# t1.cpp:
+#
+#extern "C" int printf(const char *, ...);
+#
+#extern "C" unsigned int * __xlc_exception_handle() __attribute__((weak, alias("wrap__xlc_exception_handle")));
+#
+#void barf() __attribute__((noinline));
+#
+#int main(void) {
+# try {
+# barf();
+# } catch(int) {
+# printf("caught int\n");
+# }
+# return 0;
+#}
+#
+#void barf() { throw 42; }
+
+.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4
+.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
+.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
+.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
+.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
+.set r30,30; .set r31,31
+.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4
+.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9
+.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14
+.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19
+.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24
+.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29
+.set fp30,30; .set fp31,31
+.set v0,0; .set v1,1; .set v2,2; .set v3,3; .set v4,4
+.set v5,5; .set v6,6; .set v7,7; .set v8,8; .set v9,9
+.set v10,10; .set v11,11; .set v12,12; .set v13,13; .set v14,14
+.set v15,15; .set v16,16; .set v17,17; .set v18,18; .set v19,19
+.set v20,20; .set v21,21; .set v22,22; .set v23,23; .set v24,24
+.set v25,25; .set v26,26; .set v27,27; .set v28,28; .set v29,29
+.set v30,30; .set v31,31
+.set x0,0; .set x1,1; .set x2,2; .set x3,3; .set x4,4
+.set x5,5; .set x6,6; .set x7,7; .set x8,8; .set x9,9
+.set x10,10; .set x11,11; .set x12,12; .set x13,13; .set x14,14
+.set x15,15; .set x16,16; .set x17,17; .set x18,18; .set x19,19
+.set x20,20; .set x21,21; .set x22,22; .set x23,23; .set x24,24
+.set x25,25; .set x26,26; .set x27,27; .set x28,28; .set x29,29
+.set x30,30; .set x31,31; .set x32,32; .set x33,33; .set x34,34
+.set x35,35; .set x36,36; .set x37,37; .set x38,38; .set x39,39
+.set x40,40; .set x41,41; .set x42,42; .set x43,43; .set x44,44
+.set x45,45; .set x46,46; .set x47,47; .set x48,48; .set x49,49
+.set x50,50; .set x51,51; .set x52,52; .set x53,53; .set x54,54
+.set x55,55; .set x56,56; .set x57,57; .set x58,58; .set x59,59
+.set x60,60; .set x61,61; .set x62,62; .set x63,63
+.set q0,0; .set q1,1; .set q2,2; .set q3,3; .set q4,4
+.set q5,5; .set q6,6; .set q7,7; .set q8,8; .set q9,9
+.set q10,10; .set q11,11; .set q12,12; .set q13,13; .set q14,14
+.set q15,15; .set q16,16; .set q17,17; .set q18,18; .set q19,19
+.set q20,20; .set q21,21; .set q22,22; .set q23,23; .set q24,24
+.set q25,25; .set q26,26; .set q27,27; .set q28,28; .set q29,29
+.set q30,30; .set q31,31
+.set MQ,0; .set XER,1; .set DSCR,3; .set FROM_RTCU,4; .set FROM_RTCL,5
+.set FROM_DEC,6; .set LR,8; .set CTR,9; .set AMR,13; .set TID,17; .set DSISR,18
+.set DAR,19; .set TO_RTCU,20; .set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24
+.set SDR_1,25; .set SRR_0,26; .set SRR_1,27
+.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1
+.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3
+.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6
+.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9
+.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12
+.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16
+.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19
+.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22
+.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25
+.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28
+.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31
+.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3
+.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7
+.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11
+.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15
+.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19
+.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23
+.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27
+.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31
+.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1
+
+ .rename H.10.NO_SYMBOL{PR},""
+ .rename H.16..__4,".__4"
+ .rename H.18..__8,".__8"
+ .rename H.20..__3,".__3"
+ .rename H.24.NO_SYMBOL{TC},""
+ .rename H.26.NO_SYMBOL{RO},""
+ .rename E.28.__STATIC{RW},"_$STATIC"
+ .rename H.30.__STATIC{TC},"_$STATIC"
+ .rename H.34.__4{TC},"__4"
+ .rename H.38.__8{TC},"__8"
+ .rename H.42.__3{TC},"__3"
+ .rename H.46._Z4barfv{TC},"_Z4barfv"
+ .rename H.50._ZTIi{TC},"_ZTIi"
+ .rename H.54.main{TC},"main"
+
+ .lglobl H.10.NO_SYMBOL{PR}
+ .globl ._Z4barfv
+ .globl .main
+ .lglobl H.16..__4
+ .lglobl H.18..__8
+ .lglobl H.20..__3
+ .lglobl H.26.NO_SYMBOL{RO}
+ .lglobl E.28.__STATIC{RW}
+ .lglobl __4{DS}
+ .lglobl __8{DS}
+ .lglobl __3{DS}
+ .globl _Z4barfv{DS}
+ .extern _ZTIi{UA}
+ .globl main{DS}
+ .extern .__cxa_allocate_exception{PR}
+ .extern .__cxa_throw{PR}
+ .extern .wrap__xlc_exception_handle{PR}
+ .extern .__xlc_catch_matchv2{PR}
+ .extern .__cxa_begin_catch{PR}
+ .extern .printf{PR}
+ .extern .__cxa_end_catch{PR}
+ .extern ._Unwind_Resume{PR}
+ .extern .__cxa_rethrow{PR}
+ .extern ._ZSt9terminatev{PR}
+
+
+# .text section
+ .file "t.cpp","Mon Jan 30 12:53:50 2023 ","IBM XL C/C++ for AIX, Version 16.1.0.13"
+
+
+
+ .csect H.10.NO_SYMBOL{PR}, 7
+._Z4barfv: # 0x00000000 (H.10.NO_SYMBOL)
+ mfspr r0,LR
+ stu SP,-80(SP)
+ st r0,88(SP)
+ cal r3,4(r0)
+ bl .__cxa_allocate_exception{PR}
+ oril r0,r0,0x0000
+ oril r4,r3,0x0000
+ st r4,64(SP)
+ cal r3,42(r0)
+ st r3,0(r4)
+ l r3,64(SP)
+ l r4,T.50._ZTIi(RTOC)
+ cal r5,0(r0)
+ bl .__cxa_throw{PR}
+ oril r0,r0,0x0000
+ l r0,88(SP)
+ mtspr LR,r0
+ cal SP,80(SP)
+ bcr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=1
+ .byte 0x80 # STORES_BC=1,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x0000004c # TB_OFFSET
+ .short 8 # NAME_LEN
+ .byte "_Z4barfv" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+.main: # 0x00000080 (H.10.NO_SYMBOL+0x80)
+ mfspr r0,LR
+ st r31,-4(SP)
+ st r30,-8(SP)
+ st r29,-12(SP)
+ st r0,8(SP)
+ stu SP,-112(SP)
+ oril r30,SP,0x0000
+ l r31,T.30.__STATIC(RTOC)
+ l r29,T.24.NO_SYMBOL(RTOC)
+ cal r3,0(r0)
+ st r3,64(r30)
+ oril r4,r31,0x0000
+ st r4,68(r30)
+ st r3,72(r30)
+ st r3,76(r30)
+ cal r3,1(r0)
+ stb r3,67(r30)
+ bl ._Z4barfv
+ cal r3,0(r0)
+ stb r3,67(r30)
+ b __L188
+__Ld4: # 0x000000d4 (H.10.NO_SYMBOL+0xd4)
+ l r31,T.30.__STATIC(RTOC)
+ l r29,T.24.NO_SYMBOL(RTOC)
+ cal r3,2(r0)
+ stb r3,67(r30)
+ bl .wrap__xlc_exception_handle{PR}
+ oril r0,r0,0x0000
+ st r3,80(r30)
+ l r4,T.50._ZTIi(RTOC)
+ cal r5,84(r30)
+ bl .__xlc_catch_matchv2{PR}
+ oril r0,r0,0x0000
+ cmpli 0,r3,0x0000
+ bc BO_IF_NOT,CR0_EQ,__L10c
+ b __L164
+__L10c: # 0x0000010c (H.10.NO_SYMBOL+0x10c)
+ l r3,80(r30)
+ bl .__cxa_begin_catch{PR}
+ oril r0,r0,0x0000
+ oril r3,r29,0x0000
+ bl .printf{PR}
+ oril r0,r0,0x0000
+ bl .__cxa_end_catch{PR}
+ oril r0,r0,0x0000
+ cal r3,0(r0)
+ stb r3,67(r30)
+ b __L188
+__L138: # 0x00000138 (H.10.NO_SYMBOL+0x138)
+ l r31,T.30.__STATIC(RTOC)
+ l r29,T.24.NO_SYMBOL(RTOC)
+ bl .__cxa_end_catch{PR}
+ oril r0,r0,0x0000
+ cal r3,0(r0)
+ stb r3,67(r30)
+ bl .wrap__xlc_exception_handle{PR}
+ oril r0,r0,0x0000
+ st r3,88(r30)
+ bl ._Unwind_Resume{PR}
+ oril r0,r0,0x0000
+__L164: # 0x00000164 (H.10.NO_SYMBOL+0x164)
+ cal r3,2(r0)
+ stb r3,67(r30)
+ bl .wrap__xlc_exception_handle{PR}
+ oril r0,r0,0x0000
+ st r3,92(r30)
+ bl .__cxa_begin_catch{PR}
+ oril r0,r0,0x0000
+ bl .__cxa_rethrow{PR}
+ oril r0,r0,0x0000
+__L188: # 0x00000188 (H.10.NO_SYMBOL+0x188)
+ cal r3,0(r0)
+ b __L1b8
+__L190: # 0x00000190 (H.10.NO_SYMBOL+0x190)
+ bl .wrap__xlc_exception_handle{PR}
+ oril r0,r0,0x0000
+ st r3,96(r30)
+ bl ._Unwind_Resume{PR}
+ oril r0,r0,0x0000
+__L1a4: # 0x000001a4 (H.10.NO_SYMBOL+0x1a4)
+ l r31,T.30.__STATIC(RTOC)
+ l r29,T.24.NO_SYMBOL(RTOC)
+ bl ._ZSt9terminatev{PR}
+ oril r0,r0,0x0000
+ b __L190
+__L1b8: # 0x000001b8 (H.10.NO_SYMBOL+0x1b8)
+ l SP,0(SP)
+ l r29,-12(SP)
+ l r30,-8(SP)
+ l r31,-4(SP)
+ l r0,8(SP)
+ mtspr LR,r0
+ bcr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x28 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=1,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x61 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=1,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=1
+ .byte 0x80 # STORES_BC=1,FPR_SAVED=0
+ .byte 0x03 # GPR_SAVED=3
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000154 # TB_OFFSET
+ .long 0x00000001 # NUM_CTL_INFO
+ .long 0x00000040 # ctl_info_disp[0]
+ .short 4 # NAME_LEN
+ .byte "main" # NAME
+
+ .byte 30 # ALLOCA_REG
+ .byte 0 # padding
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+H.16..__4: # 0x00000200 (H.10.NO_SYMBOL+0x200)
+ b __L1a4
+ bcr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=0
+ .byte 0x00 # STORES_BC=0,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000008 # TB_OFFSET
+ .short 3 # NAME_LEN
+ .byte "__4" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+H.18..__8: # 0x00000220 (H.10.NO_SYMBOL+0x220)
+ b __L138
+ bcr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=0
+ .byte 0x00 # STORES_BC=0,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000008 # TB_OFFSET
+ .short 3 # NAME_LEN
+ .byte "__8" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+H.20..__3: # 0x00000240 (H.10.NO_SYMBOL+0x240)
+ b __Ld4
+ bcr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=0
+ .byte 0x00 # STORES_BC=0,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000008 # TB_OFFSET
+ .short 3 # NAME_LEN
+ .byte "__3" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect H.10.NO_SYMBOL{PR}
+
+# .data section
+
+
+ .toc # 0x00000280
+T.46._Z4barfv:
+ .tc H.46._Z4barfv{TC},_Z4barfv{DS}
+T.50._ZTIi:
+ .tc H.50._ZTIi{TC},_ZTIi{UA}
+T.54.main:
+ .tc H.54.main{TC},main{DS}
+T.30.__STATIC:
+ .tc H.30.__STATIC{TC},E.28.__STATIC{RW}
+T.24.NO_SYMBOL:
+ .tc H.24.NO_SYMBOL{TC},H.26.NO_SYMBOL{RO}
+T.34.__4:
+ .tc H.34.__4{TC},__4{DS}
+T.38.__8:
+ .tc H.38.__8{TC},__8{DS}
+T.42.__3:
+ .tc H.42.__3{TC},__3{DS}
+
+
+ .csect _Z4barfv{DS}
+ .long ._Z4barfv # "\0\0\0\0"
+ .long TOC{TC0} # "\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect _Z4barfv{DS}
+
+
+ .csect main{DS}
+ .long .main # "\0\0\0\200"
+ .long TOC{TC0} # "\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect main{DS}
+
+
+ .csect __4{DS}
+ .long H.16..__4 # "\0\0\002\0"
+ .long TOC{TC0} # "\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect __4{DS}
+
+
+ .csect __8{DS}
+ .long H.18..__8 # "\0\0\002 "
+ .long TOC{TC0} # "\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect __8{DS}
+
+
+ .csect __3{DS}
+ .long H.20..__3 # "\0\0\002@"
+ .long TOC{TC0} # "\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect __3{DS}
+
+
+ .csect E.28.__STATIC{RW}, 3
+ .long 0x1cedbeef # "\034\355\276\357"
+ .long 0x00000003 # "\0\0\0\003"
+ .long 0x00000000 # "\0\0\0\0"
+ .long __3{DS} # "\0\0\002\320"
+ .long 0xffffffff # "\377\377\377\377"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long __8{DS} # "\0\0\002\304"
+ .long 0xfffffffe # "\377\377\377\376"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long __4{DS} # "\0\0\002\270"
+ .long 0xfffffffc # "\377\377\377\374"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect E.28.__STATIC{RW}
+
+
+ .csect H.26.NO_SYMBOL{RO}, 3
+ .long 0x63617567 # "caug"
+ .long 0x68742069 # "ht i"
+ .long 0x6e740a00 # "nt\n\0"
+# End csect H.26.NO_SYMBOL{RO}
+
+
+
+# .bss section
+
+
+# dwarf sections
+
+# end dwarf sections
+#endif // defined(T1_CPP_CODE)
+
+#if defined(T2_CPP_CODE)
+#
+# This portion of assembly code is generated by IBM legacy xlclang++ compiler
+# from the following C++ source file for 64-bit mode.
+#
+# t2.cpp
+#
+#extern "C" int printf(const char *, ...);
+#
+#extern "C" unsigned int * __xlc_exception_handle();
+#
+#extern "C" unsigned int * wrap__xlc_exception_handle() {
+# printf("wrap__xlc_exception_handle called\n");
+# return __xlc_exception_handle();
+#}
+#
+
+.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4
+.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
+.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
+.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
+.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
+.set r30,30; .set r31,31
+.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4
+.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9
+.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14
+.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19
+.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24
+.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29
+.set fp30,30; .set fp31,31
+.set v0,0; .set v1,1; .set v2,2; .set v3,3; .set v4,4
+.set v5,5; .set v6,6; .set v7,7; .set v8,8; .set v9,9
+.set v10,10; .set v11,11; .set v12,12; .set v13,13; .set v14,14
+.set v15,15; .set v16,16; .set v17,17; .set v18,18; .set v19,19
+.set v20,20; .set v21,21; .set v22,22; .set v23,23; .set v24,24
+.set v25,25; .set v26,26; .set v27,27; .set v28,28; .set v29,29
+.set v30,30; .set v31,31
+.set x0,0; .set x1,1; .set x2,2; .set x3,3; .set x4,4
+.set x5,5; .set x6,6; .set x7,7; .set x8,8; .set x9,9
+.set x10,10; .set x11,11; .set x12,12; .set x13,13; .set x14,14
+.set x15,15; .set x16,16; .set x17,17; .set x18,18; .set x19,19
+.set x20,20; .set x21,21; .set x22,22; .set x23,23; .set x24,24
+.set x25,25; .set x26,26; .set x27,27; .set x28,28; .set x29,29
+.set x30,30; .set x31,31; .set x32,32; .set x33,33; .set x34,34
+.set x35,35; .set x36,36; .set x37,37; .set x38,38; .set x39,39
+.set x40,40; .set x41,41; .set x42,42; .set x43,43; .set x44,44
+.set x45,45; .set x46,46; .set x47,47; .set x48,48; .set x49,49
+.set x50,50; .set x51,51; .set x52,52; .set x53,53; .set x54,54
+.set x55,55; .set x56,56; .set x57,57; .set x58,58; .set x59,59
+.set x60,60; .set x61,61; .set x62,62; .set x63,63
+.set q0,0; .set q1,1; .set q2,2; .set q3,3; .set q4,4
+.set q5,5; .set q6,6; .set q7,7; .set q8,8; .set q9,9
+.set q10,10; .set q11,11; .set q12,12; .set q13,13; .set q14,14
+.set q15,15; .set q16,16; .set q17,17; .set q18,18; .set q19,19
+.set q20,20; .set q21,21; .set q22,22; .set q23,23; .set q24,24
+.set q25,25; .set q26,26; .set q27,27; .set q28,28; .set q29,29
+.set q30,30; .set q31,31
+.set MQ,0; .set XER,1; .set DSCR,3; .set FROM_RTCU,4; .set FROM_RTCL,5
+.set FROM_DEC,6; .set LR,8; .set CTR,9; .set AMR,13; .set TID,17; .set DSISR,18
+.set DAR,19; .set TO_RTCU,20; .set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24
+.set SDR_1,25; .set SRR_0,26; .set SRR_1,27
+.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1
+.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3
+.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6
+.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9
+.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12
+.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16
+.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19
+.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22
+.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25
+.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28
+.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31
+.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3
+.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7
+.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11
+.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15
+.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19
+.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23
+.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27
+.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31
+.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1
+
+ .rename H.10.NO_SYMBOL{PR},""
+ .rename H.16.NO_SYMBOL{TC},""
+ .rename H.18.NO_SYMBOL{RO},""
+ .rename H.22.wrap__xlc_exception_handle{TC},"wrap__xlc_exception_handle"
+
+ .lglobl H.10.NO_SYMBOL{PR}
+ .globl .wrap__xlc_exception_handle
+ .lglobl H.18.NO_SYMBOL{RO}
+ .globl wrap__xlc_exception_handle{DS}
+ .extern .printf{PR}
+ .extern .__xlc_exception_handle{PR}
+
+
+# .text section
+ .file "t2.cpp","Mon Jan 30 12:53:50 2023 ","IBM XL C/C++ for AIX, Version 16.1.0.13"
+
+
+
+ .csect H.10.NO_SYMBOL{PR}, 7
+.wrap__xlc_exception_handle: # 0x00000000 (H.10.NO_SYMBOL)
+ mfspr r0,LR
+ st r31,-4(SP)
+ st r0,8(SP)
+ stu SP,-64(SP)
+ l r31,T.16.NO_SYMBOL(RTOC)
+ oril r3,r31,0x0000
+ bl .printf{PR}
+ oril r0,r0,0x0000
+ bl .__xlc_exception_handle{PR}
+ oril r0,r0,0x0000
+ l r0,72(SP)
+ mtspr LR,r0
+ cal SP,64(SP)
+ l r31,-4(SP)
+ bcr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=1
+ .byte 0x80 # STORES_BC=1,FPR_SAVED=0
+ .byte 0x01 # GPR_SAVED=1
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x0000003c # TB_OFFSET
+ .short 26 # NAME_LEN
+ .byte "wrap__xlc_exception_handle" # NAME
+
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect H.10.NO_SYMBOL{PR}
+
+# .data section
+
+
+ .toc # 0x00000080
+T.22.wrap__xlc_exception_handle:
+ .tc H.22.wrap__xlc_exception_handle{TC},wrap__xlc_exception_handle{DS}
+T.16.NO_SYMBOL:
+ .tc H.16.NO_SYMBOL{TC},H.18.NO_SYMBOL{RO}
+
+
+ .csect wrap__xlc_exception_handle{DS}
+ .long .wrap__xlc_exception_handle# "\0\0\0\0"
+ .long TOC{TC0} # "\0\0\0\200"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect wrap__xlc_exception_handle{DS}
+
+
+ .csect H.18.NO_SYMBOL{RO}, 3
+ .long 0x77726170 # "wrap"
+ .long 0x5f5f786c # "__xl"
+ .long 0x635f6578 # "c_ex"
+ .long 0x63657074 # "cept"
+ .long 0x696f6e5f # "ion_"
+ .long 0x68616e64 # "hand"
+ .long 0x6c652063 # "le c"
+ .long 0x616c6c65 # "alle"
+# End csect H.18.NO_SYMBOL{RO}
+ .long 0x640a0000 # "d\n\0\0"
+
+
+
+# .bss section
+
+
+# dwarf sections
+
+# end dwarf sections
+#endif // defined(T2_CPP_CODE)
diff --git a/third_party/llvm-project/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_64.pass.sh.S b/third_party/llvm-project/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_64.pass.sh.S
new file mode 100644
index 0000000..011f5ff
--- /dev/null
+++ b/third_party/llvm-project/libcxxabi/test/vendor/ibm/aix_xlclang_passing_excp_obj_64.pass.sh.S
@@ -0,0 +1,710 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// Test that the exception object is passed correctly from the personality
+// to the landing pad even when there are wrappers around runtime function
+// __xlc_exception_handle. This test is only for the legacy AIX xlclang
+// compiler generated code. The test source consists of two C++ source files
+// t1.cpp and t2.cpp which are compiled into assembly code by the legacy AIX
+// xlclang++ compiler included in this file. This file tests for the 64-bit
+// mode.
+
+# REQUIRES: target=powerpc64-ibm-aix
+# UNSUPPORTED: no-exceptions
+
+// RUN: %{cxx} -c %s -o %t1_64.o -DT1_CPP_CODE %{flags} %{compile_flags}
+// RUN: %{cxx} -c %s -o %t2_64.o -DT2_CPP_CODE %{flags} %{compile_flags}
+// RUN: %{cxx} -o %t_64.exe %t1_64.o %t2_64.o %{flags} %{link_flags}
+// RUN: %{exec} %t_64.exe
+
+#if defined(T1_CPP_CODE)
+#
+# This portion of assembly code is generated by IBM legacy xlclang++ compiler
+# from the following C++ source file for 64-bit mode.
+#
+# t.cpp:
+#
+#extern "C" int printf(const char *, ...);
+#
+#extern "C" unsigned int * __xlc_exception_handle() __attribute__((weak, alias("wrap__xlc_exception_handle")));
+#
+#void barf() __attribute__((noinline));
+#
+#int main(void) {
+# try {
+# barf();
+# } catch(int) {
+# printf("caught int\n");
+# }
+# return 0;
+#}
+#
+#void barf() { throw 42; }
+
+.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4
+.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
+.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
+.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
+.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
+.set r30,30; .set r31,31
+.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4
+.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9
+.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14
+.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19
+.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24
+.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29
+.set fp30,30; .set fp31,31
+.set v0,0; .set v1,1; .set v2,2; .set v3,3; .set v4,4
+.set v5,5; .set v6,6; .set v7,7; .set v8,8; .set v9,9
+.set v10,10; .set v11,11; .set v12,12; .set v13,13; .set v14,14
+.set v15,15; .set v16,16; .set v17,17; .set v18,18; .set v19,19
+.set v20,20; .set v21,21; .set v22,22; .set v23,23; .set v24,24
+.set v25,25; .set v26,26; .set v27,27; .set v28,28; .set v29,29
+.set v30,30; .set v31,31
+.set x0,0; .set x1,1; .set x2,2; .set x3,3; .set x4,4
+.set x5,5; .set x6,6; .set x7,7; .set x8,8; .set x9,9
+.set x10,10; .set x11,11; .set x12,12; .set x13,13; .set x14,14
+.set x15,15; .set x16,16; .set x17,17; .set x18,18; .set x19,19
+.set x20,20; .set x21,21; .set x22,22; .set x23,23; .set x24,24
+.set x25,25; .set x26,26; .set x27,27; .set x28,28; .set x29,29
+.set x30,30; .set x31,31; .set x32,32; .set x33,33; .set x34,34
+.set x35,35; .set x36,36; .set x37,37; .set x38,38; .set x39,39
+.set x40,40; .set x41,41; .set x42,42; .set x43,43; .set x44,44
+.set x45,45; .set x46,46; .set x47,47; .set x48,48; .set x49,49
+.set x50,50; .set x51,51; .set x52,52; .set x53,53; .set x54,54
+.set x55,55; .set x56,56; .set x57,57; .set x58,58; .set x59,59
+.set x60,60; .set x61,61; .set x62,62; .set x63,63
+.set q0,0; .set q1,1; .set q2,2; .set q3,3; .set q4,4
+.set q5,5; .set q6,6; .set q7,7; .set q8,8; .set q9,9
+.set q10,10; .set q11,11; .set q12,12; .set q13,13; .set q14,14
+.set q15,15; .set q16,16; .set q17,17; .set q18,18; .set q19,19
+.set q20,20; .set q21,21; .set q22,22; .set q23,23; .set q24,24
+.set q25,25; .set q26,26; .set q27,27; .set q28,28; .set q29,29
+.set q30,30; .set q31,31
+.set MQ,0; .set XER,1; .set DSCR,3; .set FROM_RTCU,4; .set FROM_RTCL,5
+.set FROM_DEC,6; .set LR,8; .set CTR,9; .set AMR,13; .set TID,17; .set DSISR,18
+.set DAR,19; .set TO_RTCU,20; .set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24
+.set SDR_1,25; .set SRR_0,26; .set SRR_1,27
+.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1
+.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3
+.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6
+.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9
+.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12
+.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16
+.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19
+.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22
+.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25
+.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28
+.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31
+.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3
+.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7
+.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11
+.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15
+.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19
+.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23
+.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27
+.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31
+.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1
+
+ .rename H.4.NO_SYMBOL{PR},""
+ .rename H.10..__4,".__4"
+ .rename H.12..__8,".__8"
+ .rename H.14..__3,".__3"
+ .rename H.18.NO_SYMBOL{TC},""
+ .rename H.20.NO_SYMBOL{RO},""
+ .rename E.22.__STATIC{RW},"_$STATIC"
+ .rename H.24.__STATIC{TC},"_$STATIC"
+ .rename H.28.__4{TC},"__4"
+ .rename H.32.__8{TC},"__8"
+ .rename H.36.__3{TC},"__3"
+ .rename H.40._Z4barfv{TC},"_Z4barfv"
+ .rename H.44._ZTIi{TC},"_ZTIi"
+ .rename H.48.main{TC},"main"
+
+ .lglobl H.4.NO_SYMBOL{PR}
+ .globl ._Z4barfv
+ .globl .main
+ .lglobl H.10..__4
+ .lglobl H.12..__8
+ .lglobl H.14..__3
+ .lglobl H.20.NO_SYMBOL{RO}
+ .lglobl E.22.__STATIC{RW}
+ .lglobl __4{DS}
+ .lglobl __8{DS}
+ .lglobl __3{DS}
+ .globl _Z4barfv{DS}
+ .extern _ZTIi{UA}
+ .globl main{DS}
+ .extern .__cxa_allocate_exception{PR}
+ .extern .__cxa_throw{PR}
+ .extern .wrap__xlc_exception_handle{PR}
+ .extern .__xlc_catch_matchv2{PR}
+ .extern .__cxa_begin_catch{PR}
+ .extern .printf{PR}
+ .extern .__cxa_end_catch{PR}
+ .extern ._Unwind_Resume{PR}
+ .extern .__cxa_rethrow{PR}
+ .extern ._ZSt9terminatev{PR}
+
+
+# .text section
+ .file "t.cpp","Mon Jan 30 13:42:03 2023 ","IBM XL C/C++ for AIX, Version 16.1.0.13"
+ .machine "ppc64"
+
+
+ .csect H.4.NO_SYMBOL{PR}, 7
+._Z4barfv: # 0x0000000000000000 (H.4.NO_SYMBOL)
+ mfspr r0,LR
+ stdu SP,-128(SP)
+ std r0,144(SP)
+ addi r3,r0,4
+ bl .__cxa_allocate_exception{PR}
+ ori r0,r0,0x0000
+ ori r4,r3,0x0000
+ std r4,112(SP)
+ addi r3,r0,42
+ stw r3,0(r4)
+ ld r3,112(SP)
+ ld r4,T.44._ZTIi(RTOC)
+ addi r5,r0,0
+ bl .__cxa_throw{PR}
+ ori r0,r0,0x0000
+ ld r0,144(SP)
+ mtspr LR,r0
+ addi SP,SP,128
+ bclr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=1
+ .byte 0x80 # STORES_BC=1,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x0000004c # TB_OFFSET
+ .short 8 # NAME_LEN
+ .byte "_Z4barfv" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+.main: # 0x0000000000000080 (H.4.NO_SYMBOL+0x080)
+ mfspr r0,LR
+ std r31,-8(SP)
+ std r30,-16(SP)
+ std r29,-24(SP)
+ std r0,16(SP)
+ stdu SP,-208(SP)
+ ori r30,SP,0x0000
+ ld r31,T.24.__STATIC(RTOC)
+ ld r29,T.18.NO_SYMBOL(RTOC)
+ addi r3,r0,0
+ stw r3,112(r30)
+ ori r4,r31,0x0000
+ std r4,120(r30)
+ std r3,128(r30)
+ stw r3,136(r30)
+ addi r3,r0,1
+ stb r3,115(r30)
+ bl ._Z4barfv
+ addi r3,r0,0
+ stb r3,115(r30)
+ b __L188
+__Ld4: # 0x00000000000000d4 (H.4.NO_SYMBOL+0x0d4)
+ ld r31,T.24.__STATIC(RTOC)
+ ld r29,T.18.NO_SYMBOL(RTOC)
+ addi r3,r0,2
+ stb r3,115(r30)
+ bl .wrap__xlc_exception_handle{PR}
+ ori r0,r0,0x0000
+ std r3,144(r30)
+ ld r4,T.44._ZTIi(RTOC)
+ addi r5,r30,152
+ bl .__xlc_catch_matchv2{PR}
+ ori r0,r0,0x0000
+ cmpli 0,0,r3,0x0000
+ bc BO_IF_NOT,CR0_EQ,__L10c
+ b __L164
+__L10c: # 0x000000000000010c (H.4.NO_SYMBOL+0x010c)
+ ld r3,144(r30)
+ bl .__cxa_begin_catch{PR}
+ ori r0,r0,0x0000
+ ori r3,r29,0x0000
+ bl .printf{PR}
+ ori r0,r0,0x0000
+ bl .__cxa_end_catch{PR}
+ ori r0,r0,0x0000
+ addi r3,r0,0
+ stb r3,115(r30)
+ b __L188
+__L138: # 0x0000000000000138 (H.4.NO_SYMBOL+0x0138)
+ ld r31,T.24.__STATIC(RTOC)
+ ld r29,T.18.NO_SYMBOL(RTOC)
+ bl .__cxa_end_catch{PR}
+ ori r0,r0,0x0000
+ addi r3,r0,0
+ stb r3,115(r30)
+ bl .wrap__xlc_exception_handle{PR}
+ ori r0,r0,0x0000
+ std r3,160(r30)
+ bl ._Unwind_Resume{PR}
+ ori r0,r0,0x0000
+__L164: # 0x0000000000000164 (H.4.NO_SYMBOL+0x0164)
+ addi r3,r0,2
+ stb r3,115(r30)
+ bl .wrap__xlc_exception_handle{PR}
+ ori r0,r0,0x0000
+ std r3,168(r30)
+ bl .__cxa_begin_catch{PR}
+ ori r0,r0,0x0000
+ bl .__cxa_rethrow{PR}
+ ori r0,r0,0x0000
+__L188: # 0x0000000000000188 (H.4.NO_SYMBOL+0x0188)
+ addi r3,r0,0
+ b __L1b8
+__L190: # 0x0000000000000190 (H.4.NO_SYMBOL+0x0190)
+ bl .wrap__xlc_exception_handle{PR}
+ ori r0,r0,0x0000
+ std r3,176(r30)
+ bl ._Unwind_Resume{PR}
+ ori r0,r0,0x0000
+__L1a4: # 0x00000000000001a4 (H.4.NO_SYMBOL+0x01a4)
+ ld r31,T.24.__STATIC(RTOC)
+ ld r29,T.18.NO_SYMBOL(RTOC)
+ bl ._ZSt9terminatev{PR}
+ ori r0,r0,0x0000
+ b __L190
+__L1b8: # 0x00000000000001b8 (H.4.NO_SYMBOL+0x01b8)
+ ld SP,0(SP)
+ ld r29,-24(SP)
+ ld r30,-16(SP)
+ ld r31,-8(SP)
+ ld r0,16(SP)
+ mtspr LR,r0
+ bclr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x28 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=1,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x61 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=1,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=1
+ .byte 0x80 # STORES_BC=1,FPR_SAVED=0
+ .byte 0x03 # GPR_SAVED=3
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000154 # TB_OFFSET
+ .long 0x00000001 # NUM_CTL_INFO
+ .long 0x00000070 # ctl_info_disp[0]
+ .short 4 # NAME_LEN
+ .byte "main" # NAME
+
+ .byte 30 # ALLOCA_REG
+ .byte 0 # padding
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+H.10..__4: # 0x0000000000000200 (H.4.NO_SYMBOL+0x0200)
+ b __L1a4
+ bclr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=0
+ .byte 0x00 # STORES_BC=0,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000008 # TB_OFFSET
+ .short 3 # NAME_LEN
+ .byte "__4" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+H.12..__8: # 0x0000000000000220 (H.4.NO_SYMBOL+0x0220)
+ b __L138
+ bclr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=0
+ .byte 0x00 # STORES_BC=0,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000008 # TB_OFFSET
+ .short 3 # NAME_LEN
+ .byte "__8" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+H.14..__3: # 0x0000000000000240 (H.4.NO_SYMBOL+0x0240)
+ b __Ld4
+ bclr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=0
+ .byte 0x00 # STORES_BC=0,FPR_SAVED=0
+ .byte 0x00 # GPR_SAVED=0
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x00000008 # TB_OFFSET
+ .short 3 # NAME_LEN
+ .byte "__3" # NAME
+
+ .byte 0 # padding
+ .byte 0 # padding
+ .byte 0 # padding
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect H.4.NO_SYMBOL{PR}
+
+# .data section
+
+
+ .toc # 0x0000000000000280
+T.40._Z4barfv:
+ .tc H.40._Z4barfv{TC},_Z4barfv{DS}
+T.44._ZTIi:
+ .tc H.44._ZTIi{TC},_ZTIi{UA}
+T.48.main:
+ .tc H.48.main{TC},main{DS}
+T.24.__STATIC:
+ .tc H.24.__STATIC{TC},E.22.__STATIC{RW}
+T.18.NO_SYMBOL:
+ .tc H.18.NO_SYMBOL{TC},H.20.NO_SYMBOL{RO}
+T.28.__4:
+ .tc H.28.__4{TC},__4{DS}
+T.32.__8:
+ .tc H.32.__8{TC},__8{DS}
+T.36.__3:
+ .tc H.36.__3{TC},__3{DS}
+
+
+ .csect _Z4barfv{DS}, 3
+ .llong ._Z4barfv # "\0\0\0\0\0\0\0\0"
+ .llong TOC{TC0} # "\0\0\0\0\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect _Z4barfv{DS}
+
+
+ .csect main{DS}, 3
+ .llong .main # "\0\0\0\0\0\0\0\200"
+ .llong TOC{TC0} # "\0\0\0\0\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect main{DS}
+
+
+ .csect __4{DS}, 3
+ .llong H.10..__4 # "\0\0\0\0\0\0\002\0"
+ .llong TOC{TC0} # "\0\0\0\0\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect __4{DS}
+
+
+ .csect __8{DS}, 3
+ .llong H.12..__8 # "\0\0\0\0\0\0\002 "
+ .llong TOC{TC0} # "\0\0\0\0\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect __8{DS}
+
+
+ .csect __3{DS}, 3
+ .llong H.14..__3 # "\0\0\0\0\0\0\002@"
+ .llong TOC{TC0} # "\0\0\0\0\0\0\002\200"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect __3{DS}
+
+
+ .csect E.22.__STATIC{RW}, 3
+ .long 0x1cedbeef # "\034\355\276\357"
+ .long 0x00000003 # "\0\0\0\003"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .llong __3{DS} # "\0\0\0\0\0\0\003 "
+ .long 0xffffffff # "\377\377\377\377"
+ .long 0xffffffff # "\377\377\377\377"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .llong __8{DS} # "\0\0\0\0\0\0\003\b"
+ .long 0xffffffff # "\377\377\377\377"
+ .long 0xfffffffe # "\377\377\377\376"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .llong __4{DS} # "\0\0\0\0\0\0\002\360"
+ .long 0xffffffff # "\377\377\377\377"
+ .long 0xfffffffc # "\377\377\377\374"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect E.22.__STATIC{RW}
+
+
+ .csect H.20.NO_SYMBOL{RO}, 3
+ .long 0x63617567 # "caug"
+ .long 0x68742069 # "ht i"
+ .long 0x6e740a00 # "nt\n\0"
+# End csect H.20.NO_SYMBOL{RO}
+ .long 0x00000000 # "\0\0\0\0"
+
+
+
+# .bss section
+
+
+# dwarf sections
+
+# end dwarf sections
+#endif // defined(T1_CPP_CODE)
+
+#if defined(T2_CPP_CODE)
+#
+# This portion of assembly code is generated by IBM legacy xlclang++ compiler
+# from the following C++ source file for 64-bit mode.
+#
+# t2.cpp
+#
+#extern "C" int printf(const char *, ...);
+#
+#extern "C" unsigned int * __xlc_exception_handle();
+#
+#extern "C" unsigned int * wrap__xlc_exception_handle() {
+# printf("wrap__xlc_exception_handle called\n");
+# return __xlc_exception_handle();
+#}
+#
+.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4
+.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
+.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
+.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
+.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
+.set r30,30; .set r31,31
+.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4
+.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9
+.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14
+.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19
+.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24
+.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29
+.set fp30,30; .set fp31,31
+.set v0,0; .set v1,1; .set v2,2; .set v3,3; .set v4,4
+.set v5,5; .set v6,6; .set v7,7; .set v8,8; .set v9,9
+.set v10,10; .set v11,11; .set v12,12; .set v13,13; .set v14,14
+.set v15,15; .set v16,16; .set v17,17; .set v18,18; .set v19,19
+.set v20,20; .set v21,21; .set v22,22; .set v23,23; .set v24,24
+.set v25,25; .set v26,26; .set v27,27; .set v28,28; .set v29,29
+.set v30,30; .set v31,31
+.set x0,0; .set x1,1; .set x2,2; .set x3,3; .set x4,4
+.set x5,5; .set x6,6; .set x7,7; .set x8,8; .set x9,9
+.set x10,10; .set x11,11; .set x12,12; .set x13,13; .set x14,14
+.set x15,15; .set x16,16; .set x17,17; .set x18,18; .set x19,19
+.set x20,20; .set x21,21; .set x22,22; .set x23,23; .set x24,24
+.set x25,25; .set x26,26; .set x27,27; .set x28,28; .set x29,29
+.set x30,30; .set x31,31; .set x32,32; .set x33,33; .set x34,34
+.set x35,35; .set x36,36; .set x37,37; .set x38,38; .set x39,39
+.set x40,40; .set x41,41; .set x42,42; .set x43,43; .set x44,44
+.set x45,45; .set x46,46; .set x47,47; .set x48,48; .set x49,49
+.set x50,50; .set x51,51; .set x52,52; .set x53,53; .set x54,54
+.set x55,55; .set x56,56; .set x57,57; .set x58,58; .set x59,59
+.set x60,60; .set x61,61; .set x62,62; .set x63,63
+.set q0,0; .set q1,1; .set q2,2; .set q3,3; .set q4,4
+.set q5,5; .set q6,6; .set q7,7; .set q8,8; .set q9,9
+.set q10,10; .set q11,11; .set q12,12; .set q13,13; .set q14,14
+.set q15,15; .set q16,16; .set q17,17; .set q18,18; .set q19,19
+.set q20,20; .set q21,21; .set q22,22; .set q23,23; .set q24,24
+.set q25,25; .set q26,26; .set q27,27; .set q28,28; .set q29,29
+.set q30,30; .set q31,31
+.set MQ,0; .set XER,1; .set DSCR,3; .set FROM_RTCU,4; .set FROM_RTCL,5
+.set FROM_DEC,6; .set LR,8; .set CTR,9; .set AMR,13; .set TID,17; .set DSISR,18
+.set DAR,19; .set TO_RTCU,20; .set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24
+.set SDR_1,25; .set SRR_0,26; .set SRR_1,27
+.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1
+.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3
+.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6
+.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9
+.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12
+.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16
+.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19
+.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22
+.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25
+.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28
+.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31
+.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3
+.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7
+.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11
+.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15
+.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19
+.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23
+.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27
+.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31
+.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1
+
+ .rename H.4.NO_SYMBOL{PR},""
+ .rename H.10.NO_SYMBOL{TC},""
+ .rename H.12.NO_SYMBOL{RO},""
+ .rename H.16.wrap__xlc_exception_handle{TC},"wrap__xlc_exception_handle"
+
+ .lglobl H.4.NO_SYMBOL{PR}
+ .globl .wrap__xlc_exception_handle
+ .lglobl H.12.NO_SYMBOL{RO}
+ .globl wrap__xlc_exception_handle{DS}
+ .extern .printf{PR}
+ .extern .__xlc_exception_handle{PR}
+
+
+# .text section
+ .file "t2.cpp","Mon Jan 30 13:41:54 2023 ","IBM XL C/C++ for AIX, Version 16.1.0.13"
+ .machine "ppc64"
+
+
+ .csect H.4.NO_SYMBOL{PR}, 7
+.wrap__xlc_exception_handle: # 0x0000000000000000 (H.4.NO_SYMBOL)
+ mfspr r0,LR
+ std r31,-8(SP)
+ std r0,16(SP)
+ stdu SP,-128(SP)
+ ld r31,T.10.NO_SYMBOL(RTOC)
+ ori r3,r31,0x0000
+ bl .printf{PR}
+ ori r0,r0,0x0000
+ bl .__xlc_exception_handle{PR}
+ ori r0,r0,0x0000
+ ld r0,144(SP)
+ mtspr LR,r0
+ addi SP,SP,128
+ ld r31,-8(SP)
+ bclr BO_ALWAYS,CR0_LT
+ .long 0x00000000
+# traceback table
+ .byte 0x00 # VERSION=0
+ .byte 0x09 # LANG=TB_CPLUSPLUS
+ .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1
+ # INT_PROC=0,HAS_CTL=0,TOCLESS=0
+ # FP_PRESENT=0,LOG_ABORT=0
+ .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1
+ # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND
+ # SAVES_CR=0,SAVES_LR=1
+ .byte 0x80 # STORES_BC=1,FPR_SAVED=0
+ .byte 0x01 # GPR_SAVED=1
+ .byte 0x00 # FIXEDPARMS=0
+ .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1
+ .long 0x0000003c # TB_OFFSET
+ .short 26 # NAME_LEN
+ .byte "wrap__xlc_exception_handle" # NAME
+
+# End of traceback table
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect H.4.NO_SYMBOL{PR}
+
+# .data section
+
+
+ .toc # 0x0000000000000080
+T.16.wrap__xlc_exception_handle:
+ .tc H.16.wrap__xlc_exception_handle{TC},wrap__xlc_exception_handle{DS}
+T.10.NO_SYMBOL:
+ .tc H.10.NO_SYMBOL{TC},H.12.NO_SYMBOL{RO}
+
+
+ .csect wrap__xlc_exception_handle{DS}, 3
+ .llong .wrap__xlc_exception_handle# "\0\0\0\0\0\0\0\0"
+ .llong TOC{TC0} # "\0\0\0\0\0\0\0\200"
+ .long 0x00000000 # "\0\0\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+# End csect wrap__xlc_exception_handle{DS}
+
+
+ .csect H.12.NO_SYMBOL{RO}, 3
+ .long 0x77726170 # "wrap"
+ .long 0x5f5f786c # "__xl"
+ .long 0x635f6578 # "c_ex"
+ .long 0x63657074 # "cept"
+ .long 0x696f6e5f # "ion_"
+ .long 0x68616e64 # "hand"
+ .long 0x6c652063 # "le c"
+ .long 0x616c6c65 # "alle"
+# End csect H.12.NO_SYMBOL{RO}
+ .long 0x640a0000 # "d\n\0\0"
+ .long 0x00000000 # "\0\0\0\0"
+
+
+
+# .bss section
+
+
+# dwarf sections
+
+# end dwarf sections
+
+#endif // defined(T2_CPP_CODE)
diff --git a/third_party/llvm-project/libcxxabi/test/vendor/ibm/vec_reg_restore-le.pass.cpp b/third_party/llvm-project/libcxxabi/test/vendor/ibm/vec_reg_restore-le.pass.cpp
new file mode 100644
index 0000000..413d248
--- /dev/null
+++ b/third_party/llvm-project/libcxxabi/test/vendor/ibm/vec_reg_restore-le.pass.cpp
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// Check that the PowerPC vector registers are restored properly during
+// unwinding.
+
+// REQUIRES: target=powerpc{{(64)?}}le-unknown-linux-gnu
+// UNSUPPORTED: no-exceptions
+
+// Callee-saved VSR's 62 and 63 (vr30, vr31 respectively) are set to 16 bytes
+// with values 1, 2 respectively in main. In order to ensure the two doublewords
+// in each register are different, they are merged. Then they are reset to 16
+// bytes with values 9 and 12 respectively in a callee and an exception is
+// thrown. When catching an exception in main, the values in the two registers
+// need to be the original ones (including the correct doubleword order).
+
+#include <cassert>
+#include <cstdlib>
+
+int __attribute__((noinline)) test2(int i) {
+ if (i > 3)
+ throw i;
+ srand(i);
+ return rand();
+}
+
+int __attribute__((noinline)) test(int i) {
+ // Clobber VS63 and VS62 in the function body.
+ // Set VS63 to 16 bytes each with value 9
+ asm volatile("vspltisb 31, 9" : : : "v31");
+
+ // Set VS62 to 16 bytes each with value 12
+ asm volatile("vspltisb 30, 12" : : : "v30");
+ return test2(i);
+}
+
+#define cmpVS63(vec, result) \
+ { \
+ vector unsigned char gbg; \
+ asm volatile("vcmpequb. %[gbg], 31, %[veca];" \
+ "mfocrf %[res], 2;" \
+ "rlwinm %[res], %[res], 25, 31, 31" \
+ : [res] "=r"(result), [gbg] "=v"(gbg) \
+ : [veca] "v"(vec) \
+ : "cr6"); \
+ }
+
+#define cmpVS62(vec, result) \
+ { \
+ vector unsigned char gbg; \
+ asm volatile("vcmpequb. %[gbg], 30, %[veca];" \
+ "mfocrf %[res], 2;" \
+ "rlwinm %[res], %[res], 25, 31, 31" \
+ : [res] "=r"(result), [gbg] "=v"(gbg) \
+ : [veca] "v"(vec) \
+ : "cr6"); \
+ }
+
+int main(int, char **) {
+ // Set VS63 to 16 bytes each with value 1.
+ asm volatile("vspltisb 31, 1" : : : "v31");
+
+ // Set VS62 to 16 bytes each with value 2.
+ asm volatile("vspltisb 30, 2" : : : "v30");
+
+ // Mix doublewords for both VS62 and VS63.
+ asm volatile("xxmrghd 63, 63, 62");
+ asm volatile("xxmrghd 62, 63, 62");
+
+ vector unsigned long long expectedVS63Value = {0x202020202020202,
+ 0x101010101010101};
+ vector unsigned long long expectedVS62Value = {0x202020202020202,
+ 0x101010101010101};
+ try {
+ test(4);
+ } catch (int num) {
+ // If the unwinder restores VS63 and VS62 correctly, they should contain
+ // 0x01's and 0x02's respectively instead of 0x09's and 0x12's.
+ bool isEqualVS63, isEqualVS62;
+ cmpVS63(expectedVS63Value, isEqualVS63);
+ cmpVS62(expectedVS62Value, isEqualVS62);
+ assert(isEqualVS63 && isEqualVS62);
+ }
+ return 0;
+}
diff --git a/third_party/llvm-project/libunwind/BUILD.gn b/third_party/llvm-project/libunwind/BUILD.gn
index cedc13b..d3112b9 100644
--- a/third_party/llvm-project/libunwind/BUILD.gn
+++ b/third_party/llvm-project/libunwind/BUILD.gn
@@ -68,7 +68,7 @@
]
cflags_cc = [
- "-std=c++17",
+ "-std=c++20",
"-nostdinc++",
"-fPIC",
"-Werror=return-type",
@@ -103,6 +103,7 @@
"//starboard/common",
"//third_party/musl:c",
]
+ configs -= [ "//starboard/build/config:default_cpp_standard" ]
}
}
@@ -129,7 +130,7 @@
# Build libunwind with concurrency built upon Starboard mutexes and
# condition variables.
"_LIBUNWIND_HAS_STARBOARD_THREADS",
- "NDEBUG"
+ "NDEBUG",
]
}
diff --git a/third_party/llvm-project/libunwind/CMakeLists.txt b/third_party/llvm-project/libunwind/CMakeLists.txt
index 5c54788..6f12a16 100644
--- a/third_party/llvm-project/libunwind/CMakeLists.txt
+++ b/third_party/llvm-project/libunwind/CMakeLists.txt
@@ -10,6 +10,7 @@
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../runtimes/cmake/Modules"
"${LLVM_COMMON_CMAKE_UTILS}"
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
)
@@ -66,7 +67,9 @@
message(WARNING "LIBUNWIND_SYSROOT, LIBUNWIND_TARGET_TRIPLE and LIBUNWIND_GCC_TOOLCHAIN are not supported anymore, please use the native CMake equivalents instead")
endif()
-if (LIBUNWIND_ENABLE_SHARED)
+if(MINGW)
+ set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-mingw.cfg.in")
+elseif (LIBUNWIND_ENABLE_SHARED)
set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-shared.cfg.in")
else()
set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-static.cfg.in")
@@ -168,28 +171,6 @@
endif()
endif()
-# Get warning flags
-add_compile_flags_if_supported(-W)
-add_compile_flags_if_supported(-Wall)
-add_compile_flags_if_supported(-Wchar-subscripts)
-add_compile_flags_if_supported(-Wconversion)
-add_compile_flags_if_supported(-Wmismatched-tags)
-add_compile_flags_if_supported(-Wmissing-braces)
-add_compile_flags_if_supported(-Wnewline-eof)
-add_compile_flags_if_supported(-Wno-unused-function)
-add_compile_flags_if_supported(-Wshadow)
-add_compile_flags_if_supported(-Wshorten-64-to-32)
-add_compile_flags_if_supported(-Wsign-compare)
-add_compile_flags_if_supported(-Wsign-conversion)
-add_compile_flags_if_supported(-Wstrict-aliasing=2)
-add_compile_flags_if_supported(-Wstrict-overflow=4)
-add_compile_flags_if_supported(-Wunused-parameter)
-add_compile_flags_if_supported(-Wunused-variable)
-add_compile_flags_if_supported(-Wwrite-strings)
-add_compile_flags_if_supported(-Wundef)
-
-add_compile_flags_if_supported(-Wno-suggest-override)
-
if (WIN32)
# The headers lack matching dllexport attributes (_LIBUNWIND_EXPORT);
# silence the warning instead of cluttering the headers (which aren't
@@ -198,18 +179,6 @@
add_compile_flags_if_supported(-Wno-dll-attribute-on-redeclaration)
endif()
-if (LIBUNWIND_ENABLE_WERROR)
- add_compile_flags_if_supported(-Werror)
- add_compile_flags_if_supported(-WX)
-else()
- add_compile_flags_if_supported(-Wno-error)
- add_compile_flags_if_supported(-WX-)
-endif()
-
-if (LIBUNWIND_ENABLE_PEDANTIC)
- add_compile_flags_if_supported(-pedantic)
-endif()
-
# Get feature flags.
# Exceptions
# Catches C++ exceptions only and tells the compiler to assume that extern C
diff --git a/third_party/llvm-project/libunwind/METADATA b/third_party/llvm-project/libunwind/METADATA
index a6257bc..a3faa54 100644
--- a/third_party/llvm-project/libunwind/METADATA
+++ b/third_party/llvm-project/libunwind/METADATA
@@ -1,21 +1,26 @@
name: "libunwind"
description:
- "Filtered subtree at third_party/llvm-project/libunwind."
+ "Subdirectory subtree of llvm-project."
third_party {
identifier {
type: "ChromiumVersion"
- value: "111.0.5563.150" # from https://chromereleases.googleblog.com/2023/03/stable-channel-update-for-chromeos_29.html
+ value: "114.0.5735.351"
}
identifier {
type: "Git"
- value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git"
- version: "e95b94b74d26f8387d4fb03a687a2fab0ed8e91c"
- # from https://chromium.googlesource.com/chromium/src/+/111.0.5563.150/DEPS#470
+ value: "https://chromium.googlesource.com/external/github.com/llvm/llvm-project"
+ version: "27f27d15f6c90b026eca23b8ee238fdbf772fd80"
+ # from https://chromium.googlesource.com/chromium/src/+/refs/tags/114.0.5735.351/tools/clang/scripts/update.py#38
+ closest_version: "llvmorg-17-init-8029-g27f27d15"
+ }
+ identifier {
+ type: "UpstreamSubdir"
+ value: "libunwind"
}
last_upgrade_date {
- year: 2023
- month: 1
- day: 17
+ year: 2024
+ month: 2
+ day: 21
}
}
diff --git a/third_party/llvm-project/libunwind/cmake/Modules/HandleLibunwindFlags.cmake b/third_party/llvm-project/libunwind/cmake/Modules/HandleLibunwindFlags.cmake
index c5d7603..94c6763 100644
--- a/third_party/llvm-project/libunwind/cmake/Modules/HandleLibunwindFlags.cmake
+++ b/third_party/llvm-project/libunwind/cmake/Modules/HandleLibunwindFlags.cmake
@@ -6,162 +6,10 @@
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
+include(HandleFlags)
unset(add_flag_if_supported)
-# Mangle the name of a compiler flag into a valid CMake identifier.
-# Ex: --std=c++11 -> STD_EQ_CXX11
-macro(mangle_name str output)
- string(STRIP "${str}" strippedStr)
- string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")
- string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}")
- string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}")
- string(REPLACE "-" "_" strippedStr "${strippedStr}")
- string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}")
- string(REPLACE "+" "X" strippedStr "${strippedStr}")
- string(TOUPPER "${strippedStr}" ${output})
-endmacro()
-
-# Remove a list of flags from all CMake variables that affect compile flags.
-# This can be used to remove unwanted flags specified on the command line
-# or added in other parts of LLVM's cmake configuration.
-macro(remove_flags)
- foreach(var ${ARGN})
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
- string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
- string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS "${CMAKE_SHARED_MODULE_FLAGS}")
- remove_definitions(${var})
- endforeach()
-endmacro(remove_flags)
-
-macro(check_flag_supported flag)
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
-endmacro()
-
-macro(append_flags DEST)
- foreach(value ${ARGN})
- list(APPEND ${DEST} ${value})
- list(APPEND ${DEST} ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then append the specified list of flags to DEST
-macro(append_flags_if condition DEST)
- if (${condition})
- list(APPEND ${DEST} ${ARGN})
- endif()
-endmacro()
-
-# Add each flag in the list specified by DEST if that flag is supported by the current compiler.
-macro(append_flags_if_supported DEST)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag})
- endforeach()
-endmacro()
-
-# Add a macro definition if condition is true.
-macro(define_if condition def)
- if (${condition})
- add_definitions(${def})
- endif()
-endmacro()
-
-# Add a macro definition if condition is not true.
-macro(define_if_not condition def)
- if (NOT ${condition})
- add_definitions(${def})
- endif()
-endmacro()
-
-# Add a macro definition to the __config_site file if the specified condition
-# is 'true'. Note that '-D${def}' is not added. Instead it is expected that
-# the build include the '__config_site' header.
-macro(config_define_if condition def)
- if (${condition})
- set(${def} ON)
- set(LIBUNWIND_NEEDS_SITE_CONFIG ON)
- endif()
-endmacro()
-
-macro(config_define_if_not condition def)
- if (NOT ${condition})
- set(${def} ON)
- set(LIBUNWIND_NEEDS_SITE_CONFIG ON)
- endif()
-endmacro()
-
-macro(config_define value def)
- set(${def} ${value})
- set(LIBUNWIND_NEEDS_SITE_CONFIG ON)
-endmacro()
-
-# Add a list of flags to all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS',
-# 'LIBUNWIND_COMPILE_FLAGS' and 'LIBUNWIND_LINK_FLAGS'.
-macro(add_target_flags)
- foreach(value ${ARGN})
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${value}")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${value}")
- list(APPEND LIBUNWIND_COMPILE_FLAGS ${value})
- list(APPEND LIBUNWIND_LINK_FLAGS ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then add a list of flags to
-# all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBUNWIND_COMPILE_FLAGS'
-# and 'LIBUNWIND_LINK_FLAGS'.
-macro(add_target_flags_if condition)
- if (${condition})
- add_target_flags(${ARGN})
- endif()
-endmacro()
-
-# Add all the flags supported by the compiler to all of
-# 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBUNWIND_COMPILE_FLAGS'
-# and 'LIBUNWIND_LINK_FLAGS'.
-macro(add_target_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- add_target_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
-# Add a specified list of flags to both 'LIBUNWIND_COMPILE_FLAGS' and
-# 'LIBUNWIND_LINK_FLAGS'.
-macro(add_flags)
- foreach(value ${ARGN})
- list(APPEND LIBUNWIND_COMPILE_FLAGS ${value})
- list(APPEND LIBUNWIND_LINK_FLAGS ${value})
- endforeach()
-endmacro()
-
-# If the specified 'condition' is true then add a list of flags to both
-# 'LIBUNWIND_COMPILE_FLAGS' and 'LIBUNWIND_LINK_FLAGS'.
-macro(add_flags_if condition)
- if (${condition})
- add_flags(${ARGN})
- endif()
-endmacro()
-
-# Add each flag in the list to LIBUNWIND_COMPILE_FLAGS and LIBUNWIND_LINK_FLAGS
-# if that flag is supported by the current compiler.
-macro(add_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- add_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
# Add a list of flags to 'LIBUNWIND_COMPILE_FLAGS'.
macro(add_compile_flags)
foreach(f ${ARGN})
@@ -202,16 +50,6 @@
endif()
endmacro()
-# For each specified flag, add that flag to 'LIBUNWIND_C_FLAGS' if the
-# flag is supported by the C compiler.
-macro(add_c_compile_flags_if_supported)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_c_compiler_flag("${flag}" "C_SUPPORTS_${flagname}_FLAG")
- add_c_flags_if(C_SUPPORTS_${flagname}_FLAG ${flag})
- endforeach()
-endmacro()
-
# Add a list of flags to 'LIBUNWIND_CXX_FLAGS'.
macro(add_cxx_flags)
foreach(f ${ARGN})
@@ -276,20 +114,3 @@
add_library_flags(${ARGN})
endif()
endmacro()
-
-# Turn a comma separated CMake list into a space separated string.
-macro(split_list listname)
- string(REPLACE ";" " " ${listname} "${${listname}}")
-endmacro()
-
-# For each specified flag, add that compile flag to the provided target.
-# The flags are added with the given visibility, i.e. PUBLIC|PRIVATE|INTERFACE.
-function(target_add_compile_flags_if_supported target visibility)
- foreach(flag ${ARGN})
- mangle_name("${flag}" flagname)
- check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG")
- if (CXX_SUPPORTS_${flagname}_FLAG)
- target_compile_options(${target} ${visibility} ${flag})
- endif()
- endforeach()
-endfunction()
diff --git a/third_party/llvm-project/libunwind/include/__libunwind_config.h b/third_party/llvm-project/libunwind/include/__libunwind_config.h
index f69fe89..a317a36 100644
--- a/third_party/llvm-project/libunwind/include/__libunwind_config.h
+++ b/third_party/llvm-project/libunwind/include/__libunwind_config.h
@@ -196,9 +196,9 @@
# define _LIBUNWIND_TARGET_RISCV 1
# define _LIBUNWIND_TARGET_VE 1
# define _LIBUNWIND_TARGET_S390X 1
-#define _LIBUNWIND_TARGET_LOONGARCH 1
+ #define _LIBUNWIND_TARGET_LOONGARCH 1
# define _LIBUNWIND_CONTEXT_SIZE 167
-# define _LIBUNWIND_CURSOR_SIZE 179
+# define _LIBUNWIND_CURSOR_SIZE 204
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
#endif // _LIBUNWIND_IS_NATIVE_ONLY
diff --git a/third_party/llvm-project/libunwind/include/libunwind.modulemap b/third_party/llvm-project/libunwind/include/libunwind.modulemap
index 162fe1d..775841e 100644
--- a/third_party/llvm-project/libunwind/include/libunwind.modulemap
+++ b/third_party/llvm-project/libunwind/include/libunwind.modulemap
@@ -6,5 +6,8 @@
module unwind [system] {
header "__libunwind_config.h"
header "unwind.h"
+ private textual header "unwind_arm_ehabi.h"
+ private textual header "unwind_itanium.h"
+
export *
}
diff --git a/third_party/llvm-project/libunwind/include/unwind.h b/third_party/llvm-project/libunwind/include/unwind.h
index 26cdef2..b1775d3 100644
--- a/third_party/llvm-project/libunwind/include/unwind.h
+++ b/third_party/llvm-project/libunwind/include/unwind.h
@@ -56,9 +56,9 @@
typedef struct _Unwind_Context _Unwind_Context; // opaque
#if defined(_LIBUNWIND_ARM_EHABI)
-#include "unwind_arm_ehabi.h"
+#include <unwind_arm_ehabi.h>
#else
-#include "unwind_itanium.h"
+#include <unwind_itanium.h>
#endif
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
diff --git a/third_party/llvm-project/libunwind/src/AddressSpace.hpp b/third_party/llvm-project/libunwind/src/AddressSpace.hpp
index 77e4ef8..8101cdd 100644
--- a/third_party/llvm-project/libunwind/src/AddressSpace.hpp
+++ b/third_party/llvm-project/libunwind/src/AddressSpace.hpp
@@ -71,6 +71,10 @@
// In 10.7.0 or later, libSystem.dylib implements this function.
extern "C" bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *);
+namespace libunwind {
+ bool findDynamicUnwindSections(void *, unw_dynamic_unwind_sections *);
+}
+
#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
// When statically linked on bare-metal, the symbols for the EH table are looked
@@ -526,6 +530,22 @@
info.compact_unwind_section_length = (size_t)dyldInfo.compact_unwind_section_length;
return true;
}
+
+ unw_dynamic_unwind_sections dynamicUnwindSectionInfo;
+ if (findDynamicUnwindSections((void *)targetAddr,
+ &dynamicUnwindSectionInfo)) {
+ info.dso_base = dynamicUnwindSectionInfo.dso_base;
+#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
+ info.dwarf_section = (uintptr_t)dynamicUnwindSectionInfo.dwarf_section;
+ info.dwarf_section_length = dynamicUnwindSectionInfo.dwarf_section_length;
+#endif
+ info.compact_unwind_section =
+ (uintptr_t)dynamicUnwindSectionInfo.compact_unwind_section;
+ info.compact_unwind_section_length =
+ dynamicUnwindSectionInfo.compact_unwind_section_length;
+ return true;
+ }
+
#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
info.dso_base = 0;
// Bare metal is statically linked, so no need to ask the dynamic loader
diff --git a/third_party/llvm-project/libunwind/src/CMakeLists.txt b/third_party/llvm-project/libunwind/src/CMakeLists.txt
index df32e53..cced6b4 100644
--- a/third_party/llvm-project/libunwind/src/CMakeLists.txt
+++ b/third_party/llvm-project/libunwind/src/CMakeLists.txt
@@ -135,8 +135,11 @@
# ease, but does not rely on C++ at runtime.
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
+include(WarningFlags)
+
# Build the shared library.
add_library(unwind_shared_objects OBJECT EXCLUDE_FROM_ALL ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+cxx_add_warning_flags(unwind_shared_objects ${LIBUNWIND_ENABLE_WERROR} ${LIBUNWIND_ENABLE_PEDANTIC})
if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
target_compile_options(unwind_shared_objects PRIVATE /GR-)
else()
@@ -174,6 +177,7 @@
# Build the static library.
add_library(unwind_static_objects OBJECT EXCLUDE_FROM_ALL ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+cxx_add_warning_flags(unwind_static_objects ${LIBUNWIND_ENABLE_WERROR} ${LIBUNWIND_ENABLE_PEDANTIC})
if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
target_compile_options(unwind_static_objects PRIVATE /GR-)
else()
diff --git a/third_party/llvm-project/libunwind/src/DwarfInstructions.hpp b/third_party/llvm-project/libunwind/src/DwarfInstructions.hpp
index 27432be..9962c2f 100644
--- a/third_party/llvm-project/libunwind/src/DwarfInstructions.hpp
+++ b/third_party/llvm-project/libunwind/src/DwarfInstructions.hpp
@@ -224,7 +224,8 @@
p &= ~0xfULL;
// CFA is the bottom of the current stack frame.
for (; p < cfa; p += 16) {
- __asm__ __volatile__(".arch_extension memtag\n"
+ __asm__ __volatile__(".arch armv8.5-a\n"
+ ".arch_extension memtag\n"
"stg %[Ptr], [%[Ptr]]\n"
:
: [Ptr] "r"(p)
diff --git a/third_party/llvm-project/libunwind/src/Unwind-EHABI.cpp b/third_party/llvm-project/libunwind/src/Unwind-EHABI.cpp
index 9570182..f387c5d 100644
--- a/third_party/llvm-project/libunwind/src/Unwind-EHABI.cpp
+++ b/third_party/llvm-project/libunwind/src/Unwind-EHABI.cpp
@@ -709,7 +709,7 @@
// Update info about this frame.
unw_proc_info_t frameInfo;
if (__unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
- _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): __unw_step "
+ _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): __unw_get_proc_info "
"failed => _URC_END_OF_STACK",
(void *)exception_object);
return _URC_FATAL_PHASE2_ERROR;
diff --git a/third_party/llvm-project/libunwind/src/Unwind-seh.cpp b/third_party/llvm-project/libunwind/src/Unwind-seh.cpp
index d08c29c..150ba64 100644
--- a/third_party/llvm-project/libunwind/src/Unwind-seh.cpp
+++ b/third_party/llvm-project/libunwind/src/Unwind-seh.cpp
@@ -217,6 +217,7 @@
disp_ctx->ContextRecord,
disp_ctx);
switch (ms_act) {
+ case ExceptionContinueExecution: return _URC_END_OF_STACK;
case ExceptionContinueSearch: return _URC_CONTINUE_UNWIND;
case 4 /*ExceptionExecuteHandler*/:
return phase2 ? _URC_INSTALL_CONTEXT : _URC_HANDLER_FOUND;
@@ -238,7 +239,7 @@
// Update info about this frame.
unw_proc_info_t frameInfo;
if (__unw_get_proc_info(&cursor2, &frameInfo) != UNW_ESUCCESS) {
- _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): __unw_step "
+ _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): __unw_get_proc_info "
"failed => _URC_END_OF_STACK",
(void *)exception_object);
return _URC_FATAL_PHASE2_ERROR;
@@ -304,6 +305,12 @@
// We may get control back if landing pad calls _Unwind_Resume().
__unw_resume(&cursor2);
break;
+ case _URC_END_OF_STACK:
+ _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
+ "personality returned "
+ "_URC_END_OF_STACK",
+ (void *)exception_object);
+ break;
default:
// Personality routine returned an unknown result code.
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
@@ -312,6 +319,8 @@
(void *)exception_object, personalityResult);
return _URC_FATAL_PHASE2_ERROR;
}
+ if (personalityResult == _URC_END_OF_STACK)
+ break;
}
}
diff --git a/third_party/llvm-project/libunwind/src/UnwindCursor.hpp b/third_party/llvm-project/libunwind/src/UnwindCursor.hpp
index 0c6cda3..8b6451c 100644
--- a/third_party/llvm-project/libunwind/src/UnwindCursor.hpp
+++ b/third_party/llvm-project/libunwind/src/UnwindCursor.hpp
@@ -506,7 +506,14 @@
#endif
DISPATCHER_CONTEXT *getDispatcherContext() { return &_dispContext; }
- void setDispatcherContext(DISPATCHER_CONTEXT *disp) { _dispContext = *disp; }
+ void setDispatcherContext(DISPATCHER_CONTEXT *disp) {
+ _dispContext = *disp;
+ _info.lsda = reinterpret_cast<unw_word_t>(_dispContext.HandlerData);
+ if (_dispContext.LanguageHandler) {
+ _info.handler = reinterpret_cast<unw_word_t>(__libunwind_seh_personality);
+ } else
+ _info.handler = 0;
+ }
// libunwind does not and should not depend on C++ library which means that we
// need our own definition of inline placement new.
@@ -572,6 +579,7 @@
_dispContext.HistoryTable = &_histTable;
// Initialize MS context from ours.
R r(context);
+ RtlCaptureContext(&_msContext);
_msContext.ContextFlags = CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_FLOATING_POINT;
#if defined(_LIBUNWIND_TARGET_X86_64)
_msContext.Rax = r.getRegister(UNW_X86_64_RAX);
@@ -679,7 +687,7 @@
bool UnwindCursor<A, R>::validReg(int regNum) {
if (regNum == UNW_REG_IP || regNum == UNW_REG_SP) return true;
#if defined(_LIBUNWIND_TARGET_X86_64)
- if (regNum >= UNW_X86_64_RAX && regNum <= UNW_X86_64_R15) return true;
+ if (regNum >= UNW_X86_64_RAX && regNum <= UNW_X86_64_RIP) return true;
#elif defined(_LIBUNWIND_TARGET_ARM)
if ((regNum >= UNW_ARM_R0 && regNum <= UNW_ARM_R15) ||
regNum == UNW_ARM_RA_AUTH_CODE)
@@ -694,6 +702,7 @@
unw_word_t UnwindCursor<A, R>::getReg(int regNum) {
switch (regNum) {
#if defined(_LIBUNWIND_TARGET_X86_64)
+ case UNW_X86_64_RIP:
case UNW_REG_IP: return _msContext.Rip;
case UNW_X86_64_RAX: return _msContext.Rax;
case UNW_X86_64_RDX: return _msContext.Rdx;
@@ -744,6 +753,7 @@
void UnwindCursor<A, R>::setReg(int regNum, unw_word_t value) {
switch (regNum) {
#if defined(_LIBUNWIND_TARGET_X86_64)
+ case UNW_X86_64_RIP:
case UNW_REG_IP: _msContext.Rip = value; break;
case UNW_X86_64_RAX: _msContext.Rax = value; break;
case UNW_X86_64_RDX: _msContext.Rdx = value; break;
@@ -1978,6 +1988,9 @@
uint32_t lastcode = (xdata->CountOfCodes + 1) & ~1;
const uint32_t *handler = reinterpret_cast<uint32_t *>(&xdata->UnwindCodes[lastcode]);
_info.lsda = reinterpret_cast<unw_word_t>(handler+1);
+ _dispContext.HandlerData = reinterpret_cast<void *>(_info.lsda);
+ _dispContext.LanguageHandler =
+ reinterpret_cast<EXCEPTION_ROUTINE *>(base + *handler);
if (*handler) {
_info.handler = reinterpret_cast<unw_word_t>(__libunwind_seh_personality);
} else
diff --git a/third_party/llvm-project/libunwind/src/UnwindLevel1.c b/third_party/llvm-project/libunwind/src/UnwindLevel1.c
index 7e9adf6..05d0f2c 100644
--- a/third_party/llvm-project/libunwind/src/UnwindLevel1.c
+++ b/third_party/llvm-project/libunwind/src/UnwindLevel1.c
@@ -321,7 +321,7 @@
unw_proc_info_t frameInfo;
if (__unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
_LIBUNWIND_TRACE_UNWINDING(
- "unwind_phase2_forced(ex_obj=%p): __unw_step_stage2 "
+ "unwind_phase2_forced(ex_obj=%p): __unw_get_proc_info "
"failed => _URC_END_OF_STACK",
(void *)exception_object);
return _URC_FATAL_PHASE2_ERROR;
diff --git a/third_party/llvm-project/libunwind/src/UnwindRegistersRestore.S b/third_party/llvm-project/libunwind/src/UnwindRegistersRestore.S
index 2a472be..951189e 100644
--- a/third_party/llvm-project/libunwind/src/UnwindRegistersRestore.S
+++ b/third_party/llvm-project/libunwind/src/UnwindRegistersRestore.S
@@ -194,9 +194,20 @@
addi 4, 3, PPC64_OFFS_FP
// load VS register
+#ifdef __LITTLE_ENDIAN__
+// For little-endian targets, we need a swap since lxvd2x will load the register
+// in the incorrect doubleword order.
+// FIXME: when supporting targets older than Power9 on LE is no longer required,
+// this can be changed to simply `lxv n, (16 * n)(4)`.
+#define PPC64_LVS(n) \
+ lxvd2x n, 0, 4 ;\
+ xxswapd n, n ;\
+ addi 4, 4, 16
+#else
#define PPC64_LVS(n) \
lxvd2x n, 0, 4 ;\
addi 4, 4, 16
+#endif
// restore the first 32 VS regs (and also all floating point regs)
PPC64_LVS(0)
@@ -232,9 +243,16 @@
PPC64_LVS(30)
PPC64_LVS(31)
+#ifdef __LITTLE_ENDIAN__
+#define PPC64_CLVS_RESTORE(n) \
+ addi 4, 3, PPC64_OFFS_FP + n * 16 ;\
+ lxvd2x n, 0, 4 ;\
+ xxswapd n, n
+#else
#define PPC64_CLVS_RESTORE(n) \
addi 4, 3, PPC64_OFFS_FP + n * 16 ;\
lxvd2x n, 0, 4
+#endif
#if !defined(_AIX)
// use VRSAVE to conditionally restore the remaining VS regs, that are
@@ -1203,8 +1221,8 @@
ld.d $r\i, $a0, (8 * \i)
.endr
- ld.d $r4, $a0, (8 * 4) // restore $a0 last
- ld.d $r1, $a0, (8 * 32) // load new pc into $ra
+ ld.d $ra, $a0, (8 * 32) // load new pc into $ra
+ ld.d $a0, $a0, (8 * 4) // restore $a0 last
jr $ra
diff --git a/third_party/llvm-project/libunwind/src/UnwindRegistersSave.S b/third_party/llvm-project/libunwind/src/UnwindRegistersSave.S
index 6c26b79..79f5696 100644
--- a/third_party/llvm-project/libunwind/src/UnwindRegistersSave.S
+++ b/third_party/llvm-project/libunwind/src/UnwindRegistersSave.S
@@ -351,9 +351,20 @@
addi 4, 3, PPC64_OFFS_FP
// store VS register
+#ifdef __LITTLE_ENDIAN__
+// For little-endian targets, we need a swap since stxvd2x will store the
+// register in the incorrect doubleword order.
+// FIXME: when supporting targets older than Power9 on LE is no longer required
+// this can be changed to simply `stxv n, 16 * n(4)`.
+#define PPC64_STVS(n) \
+ xxswapd n, n ;\
+ stxvd2x n, 0, 4 ;\
+ addi 4, 4, 16
+#else
#define PPC64_STVS(n) \
stxvd2x n, 0, 4 ;\
addi 4, 4, 16
+#endif
PPC64_STVS(0)
PPC64_STVS(1)
diff --git a/third_party/llvm-project/libunwind/src/config.h b/third_party/llvm-project/libunwind/src/config.h
index 4bbac95..6707d59 100644
--- a/third_party/llvm-project/libunwind/src/config.h
+++ b/third_party/llvm-project/libunwind/src/config.h
@@ -162,10 +162,14 @@
#define _LIBUNWIND_LOG0(msg)
#define _LIBUNWIND_LOG(msg, ...)
#else
-#define _LIBUNWIND_LOG0(msg) \
- fprintf(stderr, "libunwind: " msg "\n")
-#define _LIBUNWIND_LOG(msg, ...) \
- fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__)
+#define _LIBUNWIND_LOG0(msg) do { \
+ fprintf(stderr, "libunwind: " msg "\n"); \
+ fflush(stderr); \
+ } while (0)
+#define _LIBUNWIND_LOG(msg, ...) do { \
+ fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__); \
+ fflush(stderr); \
+ } while (0)
#endif
#if defined(NDEBUG)
diff --git a/third_party/llvm-project/libunwind/src/libunwind.cpp b/third_party/llvm-project/libunwind/src/libunwind.cpp
index db76126..c1565be 100644
--- a/third_party/llvm-project/libunwind/src/libunwind.cpp
+++ b/third_party/llvm-project/libunwind/src/libunwind.cpp
@@ -349,7 +349,87 @@
#endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
#endif // !defined(__USING_SJLJ_EXCEPTIONS__)
+#ifdef __APPLE__
+namespace libunwind {
+
+static constexpr size_t MAX_DYNAMIC_UNWIND_SECTIONS_FINDERS = 8;
+
+static RWMutex findDynamicUnwindSectionsLock;
+static size_t numDynamicUnwindSectionsFinders = 0;
+static unw_find_dynamic_unwind_sections
+ dynamicUnwindSectionsFinders[MAX_DYNAMIC_UNWIND_SECTIONS_FINDERS] = {0};
+
+bool findDynamicUnwindSections(void *addr, unw_dynamic_unwind_sections *info) {
+ bool found = false;
+ findDynamicUnwindSectionsLock.lock_shared();
+ for (size_t i = 0; i != numDynamicUnwindSectionsFinders; ++i) {
+ if (dynamicUnwindSectionsFinders[i]((unw_word_t)addr, info)) {
+ found = true;
+ break;
+ }
+ }
+ findDynamicUnwindSectionsLock.unlock_shared();
+ return found;
+}
+
+} // namespace libunwind
+
+int __unw_add_find_dynamic_unwind_sections(
+ unw_find_dynamic_unwind_sections find_dynamic_unwind_sections) {
+ findDynamicUnwindSectionsLock.lock();
+
+ // Check that we have enough space...
+ if (numDynamicUnwindSectionsFinders == MAX_DYNAMIC_UNWIND_SECTIONS_FINDERS) {
+ findDynamicUnwindSectionsLock.unlock();
+ return UNW_ENOMEM;
+ }
+
+ // Check for value already present...
+ for (size_t i = 0; i != numDynamicUnwindSectionsFinders; ++i) {
+ if (dynamicUnwindSectionsFinders[i] == find_dynamic_unwind_sections) {
+ findDynamicUnwindSectionsLock.unlock();
+ return UNW_EINVAL;
+ }
+ }
+
+ // Success -- add callback entry.
+ dynamicUnwindSectionsFinders[numDynamicUnwindSectionsFinders++] =
+ find_dynamic_unwind_sections;
+ findDynamicUnwindSectionsLock.unlock();
+
+ return UNW_ESUCCESS;
+}
+
+int __unw_remove_find_dynamic_unwind_sections(
+ unw_find_dynamic_unwind_sections find_dynamic_unwind_sections) {
+ findDynamicUnwindSectionsLock.lock();
+
+ // Find index to remove.
+ size_t finderIdx = numDynamicUnwindSectionsFinders;
+ for (size_t i = 0; i != numDynamicUnwindSectionsFinders; ++i) {
+ if (dynamicUnwindSectionsFinders[i] == find_dynamic_unwind_sections) {
+ finderIdx = i;
+ break;
+ }
+ }
+
+ // If no such registration is present then error out.
+ if (finderIdx == numDynamicUnwindSectionsFinders) {
+ findDynamicUnwindSectionsLock.unlock();
+ return UNW_EINVAL;
+ }
+
+ // Remove entry.
+ for (size_t i = finderIdx; i != numDynamicUnwindSectionsFinders - 1; ++i)
+ dynamicUnwindSectionsFinders[i] = dynamicUnwindSectionsFinders[i + 1];
+ dynamicUnwindSectionsFinders[--numDynamicUnwindSectionsFinders] = nullptr;
+
+ findDynamicUnwindSectionsLock.unlock();
+ return UNW_ESUCCESS;
+}
+
+#endif // __APPLE__
// Add logging hooks in Debug builds only
#ifndef NDEBUG
diff --git a/third_party/llvm-project/libunwind/src/libunwind_ext.h b/third_party/llvm-project/libunwind/src/libunwind_ext.h
index fdc533c..28db43a 100644
--- a/third_party/llvm-project/libunwind/src/libunwind_ext.h
+++ b/third_party/llvm-project/libunwind/src/libunwind_ext.h
@@ -58,6 +58,71 @@
extern void __unw_add_dynamic_eh_frame_section(unw_word_t eh_frame_start);
extern void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start);
+#ifdef __APPLE__
+
+// Holds a description of the object-format-header (if any) and unwind info
+// sections for a given address:
+//
+// * dso_base should point to a header for the JIT'd object containing the
+// given address. The header's type should match the format type that
+// libunwind was compiled for (so a mach_header or mach_header_64 on Darwin).
+// A value of zero indicates that no such header exists.
+//
+// * dwarf_section and dwarf_section_length hold the address range of a DWARF
+// eh-frame section associated with the given address, if any. If the
+// dwarf_section_length field is zero it indicates that no such section
+// exists (and in this case dwarf_section should also be set to zero).
+//
+// * compact_unwind_section and compact_unwind_section_length hold the address
+// range of a compact-unwind info section associated with the given address,
+// if any. If the compact_unwind_section_length field is zero it indicates
+// that no such section exists (and in this case compact_unwind_section
+// should also be set to zero).
+//
+// See the unw_find_dynamic_unwind_sections type below for more details.
+struct unw_dynamic_unwind_sections {
+ unw_word_t dso_base;
+ unw_word_t dwarf_section;
+ size_t dwarf_section_length;
+ unw_word_t compact_unwind_section;
+ size_t compact_unwind_section_length;
+};
+
+// Typedef for unwind-info lookup callbacks. Functions of this type can be
+// registered and deregistered using __unw_add_find_dynamic_unwind_sections
+// and __unw_remove_find_dynamic_unwind_sections respectively.
+//
+// An unwind-info lookup callback should return 1 to indicate that it found
+// unwind-info for the given address, or 0 to indicate that it did not find
+// unwind-info for the given address. If found, the callback should populate
+// some or all of the fields of the info argument (which is guaranteed to be
+// non-null with all fields zero-initialized):
+typedef int (*unw_find_dynamic_unwind_sections)(
+ unw_word_t addr, struct unw_dynamic_unwind_sections *info);
+
+// Register a dynamic unwind-info lookup callback. If libunwind does not find
+// unwind info for a given frame in the executable program or normal dynamic
+// shared objects then it will call all registered dynamic lookup functions
+// in registration order until either one of them returns true, or the end
+// of the list is reached. This lookup will happen before libunwind searches
+// any eh-frames registered via __register_frame or
+// __unw_add_dynamic_eh_frame_section.
+//
+// Returns UNW_ESUCCESS for successful registrations. If the given callback
+// has already been registered then UNW_EINVAL will be returned. If all
+// available callback entries are in use then UNW_ENOMEM will be returned.
+extern int __unw_add_find_dynamic_unwind_sections(
+ unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
+
+// Deregister a dynacim unwind-info lookup callback.
+//
+// Returns UNW_ESUCCESS for successful deregistrations. If the given callback
+// has already been registered then UNW_EINVAL will be returned.
+extern int __unw_remove_find_dynamic_unwind_sections(
+ unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
+
+#endif
+
#if defined(_LIBUNWIND_ARM_EHABI)
extern const uint32_t* decode_eht_entry(const uint32_t*, size_t*, size_t*);
extern _Unwind_Reason_Code _Unwind_VRS_Interpret(_Unwind_Context *context,
diff --git a/third_party/llvm-project/libunwind/test/CMakeLists.txt b/third_party/llvm-project/libunwind/test/CMakeLists.txt
index 0a09553..e6bd526 100644
--- a/third_party/llvm-project/libunwind/test/CMakeLists.txt
+++ b/third_party/llvm-project/libunwind/test/CMakeLists.txt
@@ -10,7 +10,7 @@
pythonize_bool(LIBUNWIND_ENABLE_CET)
pythonize_bool(LIBUNWIND_ENABLE_THREADS)
pythonize_bool(LIBUNWIND_USES_ARM_EHABI)
-set(LIBUNWIND_EXECUTOR "${Python3_EXECUTABLE} ${LIBUNWIND_LIBCXX_PATH}/utils/run.py" CACHE STRING
+set(LIBUNWIND_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${LIBUNWIND_LIBCXX_PATH}/utils/run.py" CACHE STRING
"Executor to use when running tests.")
set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not edit!")
diff --git a/third_party/llvm-project/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in b/third_party/llvm-project/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
index d4777e2..4484573 100644
--- a/third_party/llvm-project/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
+++ b/third_party/llvm-project/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
@@ -7,7 +7,7 @@
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl
+import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
@@ -54,9 +54,11 @@
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
))
+config.stdlib = 'apple-libc++'
+
import os, site
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libunwind/test/configs/cmake-bridge.cfg.in b/third_party/llvm-project/libunwind/test/configs/cmake-bridge.cfg.in
index 109602d..7860301 100644
--- a/third_party/llvm-project/libunwind/test/configs/cmake-bridge.cfg.in
+++ b/third_party/llvm-project/libunwind/test/configs/cmake-bridge.cfg.in
@@ -20,7 +20,7 @@
config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
-config.test_exec_root = '@CMAKE_BINARY_DIR@'
+config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
# Add a few features that are common to all the configurations
if @LIBUNWIND_USES_ARM_EHABI@:
diff --git a/third_party/llvm-project/libunwind/test/configs/ibm-libunwind-shared.cfg.in b/third_party/llvm-project/libunwind/test/configs/ibm-libunwind-shared.cfg.in
index 599de72..c38d278 100644
--- a/third_party/llvm-project/libunwind/test/configs/ibm-libunwind-shared.cfg.in
+++ b/third_party/llvm-project/libunwind/test/configs/ibm-libunwind-shared.cfg.in
@@ -16,8 +16,8 @@
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-merged.cfg.in b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-merged.cfg.in
index d01ee74..2181260 100644
--- a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-merged.cfg.in
+++ b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-merged.cfg.in
@@ -33,8 +33,8 @@
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-mingw.cfg.in b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-mingw.cfg.in
new file mode 100644
index 0000000..99d0aac
--- /dev/null
+++ b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-mingw.cfg.in
@@ -0,0 +1,25 @@
+# This testing configuration handles running the test suite against LLVM's libunwind
+# using either a DLL or a static library, with MinGW/Clang on Windows.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -I %{include} -funwind-tables'
+))
+config.substitutions.append(('%{link_flags}',
+ '-L %{lib} -lunwind'
+))
+config.substitutions.append(('%{exec}',
+ '%{executor} --execdir %T --env PATH=%{lib} -- '
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
diff --git a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-shared.cfg.in b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-shared.cfg.in
index b82eec7..c779df9 100644
--- a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-shared.cfg.in
+++ b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-shared.cfg.in
@@ -32,8 +32,8 @@
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-static.cfg.in b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-static.cfg.in
index a947a5d..739efd2 100644
--- a/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-static.cfg.in
+++ b/third_party/llvm-project/libunwind/test/configs/llvm-libunwind-static.cfg.in
@@ -35,8 +35,8 @@
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
-libcxx.test.newconfig.configure(
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
diff --git a/third_party/llvm-project/libunwind/test/libunwind_01.pass.cpp b/third_party/llvm-project/libunwind/test/libunwind_01.pass.cpp
index 4661ac9..96f12d1 100644
--- a/third_party/llvm-project/libunwind/test/libunwind_01.pass.cpp
+++ b/third_party/llvm-project/libunwind/test/libunwind_01.pass.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
// TODO: Investigate this failure on x86_64 macOS back deployment
-// XFAIL: use_system_cxx_lib && target=x86_64-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
+// XFAIL: stdlib=apple-libc++ && target=x86_64-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan
diff --git a/third_party/llvm-project/libunwind/test/signal_frame.pass.cpp b/third_party/llvm-project/libunwind/test/signal_frame.pass.cpp
index 482481d..e5409f6 100644
--- a/third_party/llvm-project/libunwind/test/signal_frame.pass.cpp
+++ b/third_party/llvm-project/libunwind/test/signal_frame.pass.cpp
@@ -21,6 +21,10 @@
// are necessary to run this test.
// UNSUPPORTED: target=powerpc{{(64)?}}-ibm-aix
+// Windows doesn't generally use CFI directives. However, i686
+// mingw targets do use DWARF (where CFI directives are supported).
+// UNSUPPORTED: target={{x86_64|arm.*|aarch64}}-{{.*}}-windows-{{.*}}
+
#undef NDEBUG
#include <assert.h>
#include <stdlib.h>
diff --git a/third_party/llvm-project/libunwind/test/unw_resume.pass.cpp b/third_party/llvm-project/libunwind/test/unw_resume.pass.cpp
new file mode 100644
index 0000000..76273e4
--- /dev/null
+++ b/third_party/llvm-project/libunwind/test/unw_resume.pass.cpp
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// Ensure that unw_resume() resumes execution at the stack frame identified by
+// cursor.
+
+// TODO: Investigate this failure on AIX system.
+// XFAIL: target={{.*}}-aix{{.*}}
+
+// TODO: Figure out why this fails with Memory Sanitizer.
+// XFAIL: msan
+
+#include <libunwind.h>
+
+void test_unw_resume() {
+ unw_context_t context;
+ unw_cursor_t cursor;
+
+ unw_getcontext(&context);
+ unw_init_local(&cursor, &context);
+ unw_step(&cursor);
+ unw_resume(&cursor);
+}
+
+int main() {
+ test_unw_resume();
+ return 0;
+}
diff --git a/third_party/llvm-project/libunwind/test/unwind_scalable_vectors.pass.cpp b/third_party/llvm-project/libunwind/test/unwind_scalable_vectors.pass.cpp
index 250e2c8..a5c5947 100644
--- a/third_party/llvm-project/libunwind/test/unwind_scalable_vectors.pass.cpp
+++ b/third_party/llvm-project/libunwind/test/unwind_scalable_vectors.pass.cpp
@@ -13,30 +13,8 @@
#include <assert.h>
#include <libunwind.h>
-// Check correct unwinding of frame with VLENB-sized objects (vector registers):
-// 1. Save return address (ra) in temporary register.
-// 2. Load VLENB (vector length in bytes) and substract it from current stack
-// pointer (sp) - equivalent to one vector register on stack frame.
-// 3. Set DWARF cannonical frame address (CFA) to "sp + vlenb" expresssion so it
-// can be correctly unwinded.
-// 4. Call stepper() function and check that 2 unwind steps are successful -
-// from stepper() into foo() and from foo() into main().
-// 5. Restore stack pointer and return address.
-__attribute__((naked)) static void foo() {
- __asm__(".cfi_startproc\n"
- "mv s0, ra\n"
- "csrr s1, vlenb\n"
- "sub sp, sp, s1\n"
- "# .cfi_def_cfa_expression sp + vlenb\n"
- ".cfi_escape 0x0f, 0x07, 0x72, 0x00, 0x92, 0xa2, 0x38, 0x00, 0x22\n"
- "call stepper\n"
- "add sp, sp, s1\n"
- "mv ra, s0\n"
- "ret\n"
- ".cfi_endproc\n");
-}
-
-extern "C" void stepper() {
+#ifdef __riscv_vector
+__attribute__((noinline)) extern "C" void stepper() {
unw_cursor_t cursor;
unw_context_t uc;
unw_getcontext(&uc);
@@ -47,4 +25,16 @@
assert(unw_step(&cursor) > 0);
}
+// Check correct unwinding of frame with VLENB-sized objects (vector registers).
+__attribute__((noinline)) static void foo() {
+ __rvv_int32m1_t v;
+ asm volatile("" : "=vr"(v)); // Dummy inline asm to def v.
+ stepper(); // def-use of v has cross the function, so that
+ // will triger spill/reload to/from the stack.
+ asm volatile("" ::"vr"(v)); // Dummy inline asm to use v.
+}
+
int main() { foo(); }
+#else
+int main() { return 0; }
+#endif